Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb usbnet: Factor usbnet_init_rx_tx out into usbnet...



details:   https://anonhg.NetBSD.org/src/rev/17321cad5c97
branches:  trunk
changeset: 362551:17321cad5c97
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Mar 03 05:56:09 2022 +0000

description:
usbnet: Factor usbnet_init_rx_tx out into usbnet_if_init.

Make it private; no need for drivers to call it any more.

diffstat:

 sys/dev/usb/if_aue.c    |   6 +++---
 sys/dev/usb/if_axe.c    |   6 +++---
 sys/dev/usb/if_axen.c   |   6 +++---
 sys/dev/usb/if_cdce.c   |   7 +++----
 sys/dev/usb/if_cue.c    |   6 +++---
 sys/dev/usb/if_kue.c    |   6 +++---
 sys/dev/usb/if_mos.c    |   6 +++---
 sys/dev/usb/if_mue.c    |   6 +++---
 sys/dev/usb/if_smsc.c   |   6 +++---
 sys/dev/usb/if_udav.c   |   6 +++---
 sys/dev/usb/if_upl.c    |   7 +++----
 sys/dev/usb/if_ure.c    |   6 +++---
 sys/dev/usb/if_url.c    |   6 +++---
 sys/dev/usb/if_urndis.c |   6 +++---
 sys/dev/usb/usbnet.c    |  13 +++++++++----
 sys/dev/usb/usbnet.h    |   5 +----
 16 files changed, 52 insertions(+), 52 deletions(-)

diffs (truncated from 443 to 300 lines):

diff -r 2fa82d5c3679 -r 17321cad5c97 sys/dev/usb/if_aue.c
--- a/sys/dev/usb/if_aue.c      Thu Mar 03 05:56:00 2022 +0000
+++ b/sys/dev/usb/if_aue.c      Thu Mar 03 05:56:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_aue.c,v 1.188 2022/03/03 05:55:19 riastradh Exp $   */
+/*     $NetBSD: if_aue.c,v 1.189 2022/03/03 05:56:09 riastradh Exp $   */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.188 2022/03/03 05:55:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.189 2022/03/03 05:56:09 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -972,7 +972,7 @@
        AUE_SETBIT(sc, AUE_CTL0, AUE_CTL0_TX_ENB);
        AUE_SETBIT(sc, AUE_CTL2, AUE_CTL2_EP3_CLR);
 
-       return usbnet_init_rx_tx(un);
+       return 0;
 }
 
 static void
diff -r 2fa82d5c3679 -r 17321cad5c97 sys/dev/usb/if_axe.c
--- a/sys/dev/usb/if_axe.c      Thu Mar 03 05:56:00 2022 +0000
+++ b/sys/dev/usb/if_axe.c      Thu Mar 03 05:56:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axe.c,v 1.148 2022/03/03 05:55:38 riastradh Exp $   */
+/*     $NetBSD: if_axe.c,v 1.149 2022/03/03 05:56:09 riastradh Exp $   */
 /*     $OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.148 2022/03/03 05:55:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.149 2022/03/03 05:56:09 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1286,7 +1286,7 @@
 
        axe_cmd(sc, AXE_CMD_RXCTL_WRITE, 0, rxmode, NULL);
 
-       return usbnet_init_rx_tx(un);
+       return 0;
 }
 
 static void
diff -r 2fa82d5c3679 -r 17321cad5c97 sys/dev/usb/if_axen.c
--- a/sys/dev/usb/if_axen.c     Thu Mar 03 05:56:00 2022 +0000
+++ b/sys/dev/usb/if_axen.c     Thu Mar 03 05:56:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axen.c,v 1.91 2022/03/03 05:55:29 riastradh Exp $   */
+/*     $NetBSD: if_axen.c,v 1.92 2022/03/03 05:56:09 riastradh 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.91 2022/03/03 05:55:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.92 2022/03/03 05:56:09 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -896,7 +896,7 @@
        wval = htole16(rxmode);
        axen_cmd(un, AXEN_CMD_MAC_WRITE2, 2, AXEN_MAC_RXCTL, &wval);
 
-       return usbnet_init_rx_tx(un);
+       return 0;
 }
 
 static void
diff -r 2fa82d5c3679 -r 17321cad5c97 sys/dev/usb/if_cdce.c
--- a/sys/dev/usb/if_cdce.c     Thu Mar 03 05:56:00 2022 +0000
+++ b/sys/dev/usb/if_cdce.c     Thu Mar 03 05:56:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cdce.c,v 1.78 2022/03/03 05:56:00 riastradh Exp $ */
+/*     $NetBSD: if_cdce.c,v 1.79 2022/03/03 05:56:09 riastradh Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul%windriver.com@localhost>
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.78 2022/03/03 05:56:00 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.79 2022/03/03 05:56:09 riastradh Exp $");
 
 #include <sys/param.h>
 
@@ -258,9 +258,8 @@
 static int
 cdce_uno_init(struct ifnet *ifp)
 {
-       struct usbnet           *un = ifp->if_softc;
 
-       return usbnet_init_rx_tx(un);
+       return 0;
 }
 
 static void
diff -r 2fa82d5c3679 -r 17321cad5c97 sys/dev/usb/if_cue.c
--- a/sys/dev/usb/if_cue.c      Thu Mar 03 05:56:00 2022 +0000
+++ b/sys/dev/usb/if_cue.c      Thu Mar 03 05:56:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cue.c,v 1.104 2022/03/03 05:55:29 riastradh Exp $   */
+/*     $NetBSD: if_cue.c,v 1.105 2022/03/03 05:56:09 riastradh Exp $   */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.104 2022/03/03 05:55:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.105 2022/03/03 05:56:09 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -654,7 +654,7 @@
        /* Program the LED operation. */
        cue_csr_write_1(un, CUE_LEDCTL, CUE_LEDCTL_FOLLOW_LINK);
 
-       return usbnet_init_rx_tx(un);
+       return 0;
 }
 
 /* Stop and reset the adapter.  */
diff -r 2fa82d5c3679 -r 17321cad5c97 sys/dev/usb/if_kue.c
--- a/sys/dev/usb/if_kue.c      Thu Mar 03 05:56:00 2022 +0000
+++ b/sys/dev/usb/if_kue.c      Thu Mar 03 05:56:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_kue.c,v 1.116 2022/03/03 05:55:29 riastradh Exp $   */
+/*     $NetBSD: if_kue.c,v 1.117 2022/03/03 05:56:09 riastradh Exp $   */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.116 2022/03/03 05:55:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.117 2022/03/03 05:56:09 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -615,7 +615,7 @@
 #endif
        kue_setword(un, KUE_CMD_SET_URB_SIZE, 64);
 
-       return usbnet_init_rx_tx(un);
+       return 0;
 }
 
 #ifdef _MODULE
diff -r 2fa82d5c3679 -r 17321cad5c97 sys/dev/usb/if_mos.c
--- a/sys/dev/usb/if_mos.c      Thu Mar 03 05:56:00 2022 +0000
+++ b/sys/dev/usb/if_mos.c      Thu Mar 03 05:56:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mos.c,v 1.20 2022/03/03 05:55:38 riastradh Exp $    */
+/*     $NetBSD: if_mos.c,v 1.21 2022/03/03 05:56:09 riastradh Exp $    */
 /*     $OpenBSD: if_mos.c,v 1.40 2019/07/07 06:40:10 kevlo Exp $       */
 
 /*
@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mos.c,v 1.20 2022/03/03 05:55:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mos.c,v 1.21 2022/03/03 05:56:09 riastradh Exp $");
 
 #include <sys/param.h>
 
@@ -750,7 +750,7 @@
        rxmode &= ~(MOS_CTL_SLEEP);
        mos_reg_write_1(un, MOS_CTL, rxmode);
 
-       return usbnet_init_rx_tx(un);
+       return 0;
 }
 
 void
diff -r 2fa82d5c3679 -r 17321cad5c97 sys/dev/usb/if_mue.c
--- a/sys/dev/usb/if_mue.c      Thu Mar 03 05:56:00 2022 +0000
+++ b/sys/dev/usb/if_mue.c      Thu Mar 03 05:56:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_mue.c,v 1.79 2022/03/03 05:55:19 riastradh Exp $    */
+/*     $NetBSD: if_mue.c,v 1.80 2022/03/03 05:56:09 riastradh Exp $    */
 /*     $OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $  */
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.79 2022/03/03 05:55:19 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.80 2022/03/03 05:56:09 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1244,7 +1244,7 @@
        /* Set MTU. */
        mue_setmtu_locked(un);
 
-       return usbnet_init_rx_tx(un);
+       return 0;
 }
 
 static int
diff -r 2fa82d5c3679 -r 17321cad5c97 sys/dev/usb/if_smsc.c
--- a/sys/dev/usb/if_smsc.c     Thu Mar 03 05:56:00 2022 +0000
+++ b/sys/dev/usb/if_smsc.c     Thu Mar 03 05:56:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_smsc.c,v 1.90 2022/03/03 05:55:38 riastradh Exp $   */
+/*     $NetBSD: if_smsc.c,v 1.91 2022/03/03 05:56:09 riastradh Exp $   */
 
 /*     $OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.90 2022/03/03 05:55:38 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.91 2022/03/03 05:56:09 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -561,7 +561,7 @@
        /* TCP/UDP checksum offload engines. */
        smsc_setoe_locked(un);
 
-       return usbnet_init_rx_tx(un);
+       return 0;
 }
 
 static void
diff -r 2fa82d5c3679 -r 17321cad5c97 sys/dev/usb/if_udav.c
--- a/sys/dev/usb/if_udav.c     Thu Mar 03 05:56:00 2022 +0000
+++ b/sys/dev/usb/if_udav.c     Thu Mar 03 05:56:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_udav.c,v 1.95 2022/03/03 05:56:00 riastradh Exp $   */
+/*     $NetBSD: if_udav.c,v 1.96 2022/03/03 05:56:09 riastradh Exp $   */
 /*     $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $   */
 
 /*
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.95 2022/03/03 05:56:00 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.96 2022/03/03 05:56:09 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -504,7 +504,7 @@
        if (usbnet_isdying(un))
                return EIO;
 
-       return usbnet_init_rx_tx(un);
+       return 0;
 }
 
 static void
diff -r 2fa82d5c3679 -r 17321cad5c97 sys/dev/usb/if_upl.c
--- a/sys/dev/usb/if_upl.c      Thu Mar 03 05:56:00 2022 +0000
+++ b/sys/dev/usb/if_upl.c      Thu Mar 03 05:56:09 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_upl.c,v 1.74 2022/03/03 05:56:00 riastradh Exp $    */
+/*     $NetBSD: if_upl.c,v 1.75 2022/03/03 05:56:09 riastradh Exp $    */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.74 2022/03/03 05:56:00 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.75 2022/03/03 05:56:09 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -254,9 +254,8 @@
 static int
 upl_uno_init(struct ifnet *ifp)
 {
-       struct usbnet * const un = ifp->if_softc;
 
-       return usbnet_init_rx_tx(un);
+       return 0;
 }
 



Home | Main Index | Thread Index | Old Index