Module Name: src Committed By: mrg Date: Sat Jun 22 04:35:46 UTC 2019
Modified Files: src/sys/dev/usb: if_cdce.c if_cdcereg.h Log Message: move the software-only parts of cdce(4) out of if_cdcereg.h. (if_cdcereg.h probably can go entirely. it's almost empty, but at least these definitions have some relationship with the hardware bits.) To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/dev/usb/if_cdce.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/if_cdcereg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/if_cdce.c diff -u src/sys/dev/usb/if_cdce.c:1.47 src/sys/dev/usb/if_cdce.c:1.48 --- src/sys/dev/usb/if_cdce.c:1.47 Sun May 5 03:17:54 2019 +++ src/sys/dev/usb/if_cdce.c Sat Jun 22 04:35:46 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_cdce.c,v 1.47 2019/05/05 03:17:54 mrg Exp $ */ +/* $NetBSD: if_cdce.c,v 1.48 2019/06/22 04:35:46 mrg 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.47 2019/05/05 03:17:54 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.48 2019/06/22 04:35:46 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v #include <sys/kernel.h> #include <sys/socket.h> #include <sys/device.h> +#include <sys/rndsource.h> #include <net/if.h> #include <net/if_arp.h> @@ -68,8 +69,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v #include <netinet/if_inarp.h> #endif - - #include <dev/usb/usb.h> #include <dev/usb/usbdi.h> #include <dev/usb/usbdi_util.h> @@ -78,6 +77,55 @@ __KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v #include <dev/usb/if_cdcereg.h> +struct cdce_type { + struct usb_devno cdce_dev; + uint16_t cdce_flags; +#define CDCE_ZAURUS 1 +#define CDCE_NO_UNION 2 +}; + +struct cdce_softc; + +struct cdce_chain { + struct cdce_softc *cdce_sc; + struct usbd_xfer *cdce_xfer; + char *cdce_buf; + struct mbuf *cdce_mbuf; + int cdce_accum; + int cdce_idx; +}; + +struct cdce_cdata { + struct cdce_chain cdce_rx_chain[CDCE_RX_LIST_CNT]; + struct cdce_chain cdce_tx_chain[CDCE_TX_LIST_CNT]; + int cdce_tx_prod; + int cdce_tx_cons; + int cdce_tx_cnt; + int cdce_rx_prod; +}; + +struct cdce_softc { + device_t cdce_dev; + struct ethercom cdce_ec; + krndsource_t rnd_source; +#define GET_IFP(sc) (&(sc)->cdce_ec.ec_if) + struct usbd_device * cdce_udev; + struct usbd_interface * cdce_ctl_iface; + struct usbd_interface * cdce_data_iface; + int cdce_bulkin_no; + struct usbd_pipe * cdce_bulkin_pipe; + int cdce_bulkout_no; + struct usbd_pipe * cdce_bulkout_pipe; + char cdce_dying; + int cdce_unit; + struct cdce_cdata cdce_cdata; + int cdce_rxeof_errors; + uint16_t cdce_flags; + char cdce_attached; + + kmutex_t cdce_start_lock; +}; + Static int cdce_tx_list_init(struct cdce_softc *); Static int cdce_rx_list_init(struct cdce_softc *); Static int cdce_newbuf(struct cdce_softc *, struct cdce_chain *, Index: src/sys/dev/usb/if_cdcereg.h diff -u src/sys/dev/usb/if_cdcereg.h:1.9 src/sys/dev/usb/if_cdcereg.h:1.10 --- src/sys/dev/usb/if_cdcereg.h:1.9 Sat Apr 23 10:15:31 2016 +++ src/sys/dev/usb/if_cdcereg.h Sat Jun 22 04:35:46 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_cdcereg.h,v 1.9 2016/04/23 10:15:31 skrll Exp $ */ +/* $NetBSD: if_cdcereg.h,v 1.10 2019/06/22 04:35:46 mrg Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wp...@windriver.com> @@ -34,55 +34,6 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <sys/rndsource.h> - #define CDCE_RX_LIST_CNT 1 #define CDCE_TX_LIST_CNT 1 #define CDCE_BUFSZ 1542 - -struct cdce_type { - struct usb_devno cdce_dev; - uint16_t cdce_flags; -#define CDCE_ZAURUS 1 -#define CDCE_NO_UNION 2 -}; - -struct cdce_softc; - -struct cdce_chain { - struct cdce_softc *cdce_sc; - struct usbd_xfer *cdce_xfer; - char *cdce_buf; - struct mbuf *cdce_mbuf; - int cdce_accum; - int cdce_idx; -}; - -struct cdce_cdata { - struct cdce_chain cdce_rx_chain[CDCE_RX_LIST_CNT]; - struct cdce_chain cdce_tx_chain[CDCE_TX_LIST_CNT]; - int cdce_tx_prod; - int cdce_tx_cons; - int cdce_tx_cnt; - int cdce_rx_prod; -}; - -struct cdce_softc { - device_t cdce_dev; - struct ethercom cdce_ec; - krndsource_t rnd_source; -#define GET_IFP(sc) (&(sc)->cdce_ec.ec_if) - struct usbd_device * cdce_udev; - struct usbd_interface * cdce_ctl_iface; - struct usbd_interface * cdce_data_iface; - int cdce_bulkin_no; - struct usbd_pipe * cdce_bulkin_pipe; - int cdce_bulkout_no; - struct usbd_pipe * cdce_bulkout_pipe; - char cdce_dying; - int cdce_unit; - struct cdce_cdata cdce_cdata; - int cdce_rxeof_errors; - uint16_t cdce_flags; - char cdce_attached; -};