Module Name:    src
Committed By:   mrg
Date:           Tue Jun 18 09:34:57 UTC 2019

Modified Files:
        src/sys/dev/usb: if_axen.c if_axenreg.h

Log Message:
move struct axen_chain, struct axen_cdata, struct axen_softc,
struct axen_type, sc_if, GET_MII(), and GET_IFP() -- all the
software defined components from if_axenreg.h into if_axen.c.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/usb/if_axenreg.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_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.41 src/sys/dev/usb/if_axen.c:1.42
--- src/sys/dev/usb/if_axen.c:1.41	Tue May 28 07:41:50 2019
+++ src/sys/dev/usb/if_axen.c	Tue Jun 18 09:34:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.41 2019/05/28 07:41:50 msaitoh Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.42 2019/06/18 09:34:57 mrg Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.41 2019/05/28 07:41:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.42 2019/06/18 09:34:57 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -73,6 +73,69 @@ int	axendebug = 0;
 #define DPRINTFN(n, x)
 #endif
 
+struct axen_softc;
+
+struct axen_chain {
+	struct axen_softc	*axen_sc;
+	struct usbd_xfer	*axen_xfer;
+	uint8_t			*axen_buf;
+};
+
+struct axen_cdata {
+	struct axen_chain	axen_tx_chain[AXEN_TX_LIST_CNT];
+	struct axen_chain	axen_rx_chain[AXEN_RX_LIST_CNT];
+	int			axen_tx_prod;
+	int			axen_tx_cnt;
+};
+
+struct axen_softc {
+	device_t		axen_dev;
+	struct ethercom		axen_ec;
+	struct mii_data		axen_mii;
+	krndsource_t		rnd_source;
+	struct usbd_device *	axen_udev;
+	struct usbd_interface *	axen_iface;
+
+	uint16_t		axen_vendor;
+	uint16_t		axen_product;
+	uint16_t		axen_flags;
+
+	int			axen_ed[AXEN_ENDPT_MAX];
+	struct usbd_pipe	*axen_ep[AXEN_ENDPT_MAX];
+	int			axen_if_flags;
+	struct axen_cdata	axen_cdata;
+	struct callout		axen_stat_ch;
+
+	int			axen_refcnt;
+	bool			axen_dying;
+	bool			axen_attached;
+
+	struct usb_task		axen_tick_task;
+
+	krwlock_t		axen_mii_lock;
+
+	int			axen_link;
+
+	int			axen_phyno;
+	struct timeval		axen_rx_notice;
+	struct timeval		axen_tx_notice;
+	u_int			axen_rx_bufsz;
+	u_int			axen_tx_bufsz;
+	int			axen_rev;
+
+#define sc_if	axen_ec.ec_if
+};
+
+#define GET_MII(sc) (&(sc)->axen_mii)
+#define GET_IFP(sc) (&(sc)->sc_if)
+
+struct axen_type {
+	struct usb_devno	axen_dev;
+	uint16_t		axen_flags;
+#define AX178A	0x0001		/* AX88178a */
+#define AX179	0x0002		/* AX88179 */
+};
+
 /*
  * Various supported device vendors/products.
  */

Index: src/sys/dev/usb/if_axenreg.h
diff -u src/sys/dev/usb/if_axenreg.h:1.13 src/sys/dev/usb/if_axenreg.h:1.14
--- src/sys/dev/usb/if_axenreg.h:1.13	Tue May 28 08:59:35 2019
+++ src/sys/dev/usb/if_axenreg.h	Tue Jun 18 09:34:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axenreg.h,v 1.13 2019/05/28 08:59:35 msaitoh Exp $	*/
+/*	$NetBSD: if_axenreg.h,v 1.14 2019/06/18 09:34:57 mrg Exp $	*/
 /*	$OpenBSD: if_axenreg.h,v 1.1 2013/10/07 05:37:41 yuo Exp $	*/
 
 /*
@@ -230,28 +230,6 @@
 #define AXEN_ENDPT_INTR		0x2
 #define AXEN_ENDPT_MAX		0x3
 
-struct axen_type {
-	struct usb_devno	axen_dev;
-	uint16_t		axen_flags;
-#define AX178A	0x0001		/* AX88178a */
-#define AX179	0x0002		/* AX88179 */
-};
-
-struct axen_softc;
-
-struct axen_chain {
-	struct axen_softc	*axen_sc;
-	struct usbd_xfer	*axen_xfer;
-	uint8_t			*axen_buf;
-};
-
-struct axen_cdata {
-	struct axen_chain	axen_tx_chain[AXEN_TX_LIST_CNT];
-	struct axen_chain	axen_rx_chain[AXEN_RX_LIST_CNT];
-	int			axen_tx_prod;
-	int			axen_tx_cnt;
-};
-
 struct axen_qctrl {
 	uint8_t			ctrl;
 	uint8_t			timer_low;
@@ -264,44 +242,3 @@ struct axen_sframe_hdr {
 	uint32_t		plen; /* packet length */
 	uint32_t		gso;
 } __packed;
-
-struct axen_softc {
-	device_t		axen_dev;
-	struct ethercom		axen_ec;
-	struct mii_data		axen_mii;
-	krndsource_t		rnd_source;
-	struct usbd_device *	axen_udev;
-	struct usbd_interface *	axen_iface;
-
-	uint16_t		axen_vendor;
-	uint16_t		axen_product;
-	uint16_t		axen_flags;
-
-	int			axen_ed[AXEN_ENDPT_MAX];
-	struct usbd_pipe	*axen_ep[AXEN_ENDPT_MAX];
-	int			axen_if_flags;
-	struct axen_cdata	axen_cdata;
-	struct callout		axen_stat_ch;
-
-	int			axen_refcnt;
-	bool			axen_dying;
-	bool			axen_attached;
-
-	struct usb_task		axen_tick_task;
-
-	krwlock_t		axen_mii_lock;
-
-	int			axen_link;
-
-	int			axen_phyno;
-	struct timeval		axen_rx_notice;
-	struct timeval		axen_tx_notice;
-	u_int			axen_rx_bufsz;
-	u_int			axen_tx_bufsz;
-	int			axen_rev;
-
-#define sc_if	axen_ec.ec_if
-};
-
-#define GET_MII(sc) (&(sc)->axen_mii)
-#define GET_IFP(sc) (&(sc)->sc_if)

Reply via email to