Module Name: src Committed By: msaitoh Date: Tue Jun 7 05:46:00 UTC 2011
Modified Files: src/share/man/man4: cdce.4 src/sys/dev/usb: if_cdce.c Log Message: - Add some new devices (from OpenBSD rev. 1.11-1.12,1.15 and 1.20). - force usb to send a zero length packet on the end of usb packets which happen to be a multple of 64 bytes, to indicate end of packet. (from OpenBSD rev. 1.23) - style change To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/cdce.4 cvs rdiff -u -r1.32 -r1.33 src/sys/dev/usb/if_cdce.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/man/man4/cdce.4 diff -u src/share/man/man4/cdce.4:1.6 src/share/man/man4/cdce.4:1.7 --- src/share/man/man4/cdce.4:1.6 Fri Jan 15 19:24:49 2010 +++ src/share/man/man4/cdce.4 Tue Jun 7 05:46:00 2011 @@ -25,9 +25,9 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.\" $NetBSD: cdce.4,v 1.6 2010/01/15 19:24:49 joerg Exp $ +.\" $NetBSD: cdce.4,v 1.7 2011/06/07 05:46:00 msaitoh Exp $ .\" -.Dd October 22, 2004 +.Dd June 07, 2011 .Dt CDCE 4 .Os .Sh NAME @@ -44,6 +44,14 @@ .Pp .Bl -bullet -compact .It +Acer Labs USB 2.0 Data Link +.It +G.Mate YP3X00 +.It +Motorola USBNET +.It +NetChip EthernetGadget +.It Prolific PL-2501 .It Sharp Zaurus Index: src/sys/dev/usb/if_cdce.c diff -u src/sys/dev/usb/if_cdce.c:1.32 src/sys/dev/usb/if_cdce.c:1.33 --- src/sys/dev/usb/if_cdce.c:1.32 Tue Dec 21 07:07:44 2010 +++ src/sys/dev/usb/if_cdce.c Tue Jun 7 05:46:00 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_cdce.c,v 1.32 2010/12/21 07:07:44 jnemeth Exp $ */ +/* $NetBSD: if_cdce.c,v 1.33 2011/06/07 05:46:00 msaitoh Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wp...@windriver.com> @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.32 2010/12/21 07:07:44 jnemeth Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.33 2011/06/07 05:46:00 msaitoh Exp $"); #ifdef __NetBSD__ #include "opt_inet.h" #endif @@ -50,7 +50,6 @@ #include <sys/systm.h> #include <sys/sockio.h> #include <sys/mbuf.h> -#include <sys/malloc.h> #include <sys/kernel.h> #include <sys/socket.h> #include <sys/device.h> @@ -96,16 +95,21 @@ Static void cdce_stop(struct cdce_softc *); Static const struct cdce_type cdce_devs[] = { + {{ USB_VENDOR_ACERLABS, USB_PRODUCT_ACERLABS_M5632 }, CDCE_NO_UNION }, + {{ USB_VENDOR_COMPAQ, USB_PRODUCT_COMPAQ_IPAQLINUX }, CDCE_NO_UNION }, + {{ USB_VENDOR_GMATE, USB_PRODUCT_GMATE_YP3X00 }, CDCE_NO_UNION }, + {{ USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_USBLAN }, CDCE_ZAURUS | CDCE_NO_UNION }, + {{ USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_USBLAN2 }, CDCE_ZAURUS | CDCE_NO_UNION }, + {{ USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_ETHERNETGADGET }, CDCE_NO_UNION }, {{ USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2501 }, CDCE_NO_UNION }, {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SL5500 }, CDCE_ZAURUS }, {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_A300 }, CDCE_ZAURUS | CDCE_NO_UNION }, {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SL5600 }, CDCE_ZAURUS | CDCE_NO_UNION }, {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_C700 }, CDCE_ZAURUS | CDCE_NO_UNION }, {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_C750 }, CDCE_ZAURUS | CDCE_NO_UNION }, - {{ USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_USBLAN }, CDCE_ZAURUS | CDCE_NO_UNION }, - {{ USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_USBLAN2 }, CDCE_ZAURUS | CDCE_NO_UNION }, }; -#define cdce_lookup(v, p) ((const struct cdce_type *)usb_lookup(cdce_devs, v, p)) +#define cdce_lookup(v, p) \ + ((const struct cdce_type *)usb_lookup(cdce_devs, v, p)) int cdce_match(device_t, cfdata_t, void *); void cdce_attach(device_t, device_t, void *); @@ -135,7 +139,7 @@ { struct cdce_softc *sc = device_private(self); struct usbif_attach_arg *uaa = aux; - char *devinfop; + char *devinfop; int s; struct ifnet *ifp; usbd_device_handle dev = uaa->device; @@ -378,7 +382,8 @@ c->cdce_mbuf = m; usbd_setup_xfer(c->cdce_xfer, sc->cdce_bulkout_pipe, c, c->cdce_buf, - m->m_pkthdr.len + extra, USBD_NO_COPY, 10000, cdce_txeof); + m->m_pkthdr.len + extra, USBD_FORCE_SHORT_XFER | USBD_NO_COPY, + 10000, cdce_txeof); err = usbd_transfer(c->cdce_xfer); if (err != USBD_IN_PROGRESS) { cdce_stop(sc); @@ -429,7 +434,8 @@ sc->cdce_cdata.cdce_rx_chain[i].cdce_mbuf = NULL; } if (sc->cdce_cdata.cdce_rx_chain[i].cdce_xfer != NULL) { - usbd_free_xfer(sc->cdce_cdata.cdce_rx_chain[i].cdce_xfer); + usbd_free_xfer + (sc->cdce_cdata.cdce_rx_chain[i].cdce_xfer); sc->cdce_cdata.cdce_rx_chain[i].cdce_xfer = NULL; } } @@ -440,7 +446,8 @@ sc->cdce_cdata.cdce_tx_chain[i].cdce_mbuf = NULL; } if (sc->cdce_cdata.cdce_tx_chain[i].cdce_xfer != NULL) { - usbd_free_xfer(sc->cdce_cdata.cdce_tx_chain[i].cdce_xfer); + usbd_free_xfer( + sc->cdce_cdata.cdce_tx_chain[i].cdce_xfer); sc->cdce_cdata.cdce_tx_chain[i].cdce_xfer = NULL; } } @@ -629,7 +636,8 @@ c->cdce_xfer = usbd_alloc_xfer(sc->cdce_udev); if (c->cdce_xfer == NULL) return (ENOBUFS); - c->cdce_buf = usbd_alloc_buffer(c->cdce_xfer, CDCE_BUFSZ); + c->cdce_buf = usbd_alloc_buffer(c->cdce_xfer, + CDCE_BUFSZ); if (c->cdce_buf == NULL) return (ENOBUFS); }