Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb remove unused code and use common ethernet media...
details: https://anonhg.NetBSD.org/src/rev/a62e5e094175
branches: trunk
changeset: 844048:a62e5e094175
user: mrg <mrg%NetBSD.org@localhost>
date: Thu Aug 01 00:10:22 2019 +0000
description:
remove unused code and use common ethernet media code where equivalent.
diffstat:
sys/dev/usb/if_aue.c | 14 +++-----------
sys/dev/usb/if_auereg.h | 3 +--
sys/dev/usb/if_kue.c | 6 ++----
sys/dev/usb/if_kuereg.h | 3 +--
sys/dev/usb/if_mue.c | 25 +++++--------------------
sys/dev/usb/if_smsc.c | 28 ++++------------------------
sys/dev/usb/if_smscvar.h | 4 +---
sys/dev/usb/if_udav.c | 30 ++++--------------------------
sys/dev/usb/if_udavreg.h | 3 +--
sys/dev/usb/if_url.c | 26 ++++----------------------
sys/dev/usb/if_urndis.c | 7 ++-----
11 files changed, 28 insertions(+), 121 deletions(-)
diffs (truncated from 505 to 300 lines):
diff -r fd26aac58099 -r a62e5e094175 sys/dev/usb/if_aue.c
--- a/sys/dev/usb/if_aue.c Wed Jul 31 23:53:25 2019 +0000
+++ b/sys/dev/usb/if_aue.c Thu Aug 01 00:10:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_aue.c,v 1.154 2019/05/28 07:41:50 msaitoh Exp $ */
+/* $NetBSD: if_aue.c,v 1.155 2019/08/01 00:10:22 mrg Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.154 2019/05/28 07:41:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.155 2019/08/01 00:10:22 mrg Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -1028,7 +1028,6 @@
for (i = 0; i < AUE_RX_LIST_CNT; i++) {
c = &cd->aue_rx_chain[i];
c->aue_sc = sc;
- c->aue_idx = i;
if (aue_newbuf(sc, c, NULL) == ENOBUFS)
return ENOBUFS;
if (c->aue_xfer == NULL) {
@@ -1057,7 +1056,6 @@
for (i = 0; i < AUE_TX_LIST_CNT; i++) {
c = &cd->aue_tx_chain[i];
c->aue_sc = sc;
- c->aue_idx = i;
c->aue_mbuf = NULL;
if (c->aue_xfer == NULL) {
int err = usbd_create_xfer(sc->aue_ep[AUE_ENDPT_TX],
@@ -1520,19 +1518,13 @@
aue_ifmedia_upd(struct ifnet *ifp)
{
struct aue_softc *sc = ifp->if_softc;
- struct mii_data *mii = GET_MII(sc);
- int rc;
DPRINTFN(5,("%s: %s: enter\n", device_xname(sc->aue_dev), __func__));
if (sc->aue_dying)
return 0;
- sc->aue_link = 0;
-
- if ((rc = mii_mediachg(mii)) == ENXIO)
- return 0;
- return rc;
+ return ether_mediachange(ifp);
}
Static int
diff -r fd26aac58099 -r a62e5e094175 sys/dev/usb/if_auereg.h
--- a/sys/dev/usb/if_auereg.h Wed Jul 31 23:53:25 2019 +0000
+++ b/sys/dev/usb/if_auereg.h Thu Aug 01 00:10:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_auereg.h,v 1.29 2019/07/21 10:27:56 mrg Exp $ */
+/* $NetBSD: if_auereg.h,v 1.30 2019/08/01 00:10:22 mrg Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul%ee.columbia.edu@localhost>. All rights reserved.
@@ -212,7 +212,6 @@
struct usbd_xfer *aue_xfer;
char *aue_buf;
struct mbuf *aue_mbuf;
- int aue_idx;
};
struct aue_cdata {
diff -r fd26aac58099 -r a62e5e094175 sys/dev/usb/if_kue.c
--- a/sys/dev/usb/if_kue.c Wed Jul 31 23:53:25 2019 +0000
+++ b/sys/dev/usb/if_kue.c Thu Aug 01 00:10:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_kue.c,v 1.96 2019/05/28 07:41:50 msaitoh Exp $ */
+/* $NetBSD: if_kue.c,v 1.97 2019/08/01 00:10:22 mrg Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.96 2019/05/28 07:41:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kue.c,v 1.97 2019/08/01 00:10:22 mrg Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -591,7 +591,6 @@
for (i = 0; i < KUE_RX_LIST_CNT; i++) {
c = &cd->kue_rx_chain[i];
c->kue_sc = sc;
- c->kue_idx = i;
if (c->kue_xfer == NULL) {
int error = usbd_create_xfer(sc->kue_ep[KUE_ENDPT_RX],
KUE_BUFSZ, 0, 0, &c->kue_xfer);
@@ -617,7 +616,6 @@
for (i = 0; i < KUE_TX_LIST_CNT; i++) {
c = &cd->kue_tx_chain[i];
c->kue_sc = sc;
- c->kue_idx = i;
if (c->kue_xfer == NULL) {
int error = usbd_create_xfer(sc->kue_ep[KUE_ENDPT_TX],
KUE_BUFSZ, 0, 0, &c->kue_xfer);
diff -r fd26aac58099 -r a62e5e094175 sys/dev/usb/if_kuereg.h
--- a/sys/dev/usb/if_kuereg.h Wed Jul 31 23:53:25 2019 +0000
+++ b/sys/dev/usb/if_kuereg.h Thu Aug 01 00:10:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_kuereg.h,v 1.22 2019/07/21 10:27:56 mrg Exp $ */
+/* $NetBSD: if_kuereg.h,v 1.23 2019/08/01 00:10:22 mrg Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
* Bill Paul <wpaul%ee.columbia.edu@localhost>. All rights reserved.
@@ -147,7 +147,6 @@
struct kue_softc *kue_sc;
struct usbd_xfer *kue_xfer;
uint8_t *kue_buf;
- int kue_idx;
};
struct kue_cdata {
diff -r fd26aac58099 -r a62e5e094175 sys/dev/usb/if_mue.c
--- a/sys/dev/usb/if_mue.c Wed Jul 31 23:53:25 2019 +0000
+++ b/sys/dev/usb/if_mue.c Thu Aug 01 00:10:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mue.c,v 1.50 2019/05/29 09:04:01 mlelstv Exp $ */
+/* $NetBSD: if_mue.c,v 1.51 2019/08/01 00:10:22 mrg 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.50 2019/05/29 09:04:01 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.51 2019/08/01 00:10:22 mrg Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -121,7 +121,6 @@
static int mue_miibus_writereg(device_t, int, int, uint16_t);
static void mue_miibus_statchg(struct ifnet *);
static int mue_ifmedia_upd(struct ifnet *);
-static void mue_ifmedia_sts(struct ifnet *, struct ifmediareq *);
static uint8_t mue_eeprom_getbyte(struct mue_softc *, int, uint8_t *);
static int mue_read_eeprom(struct mue_softc *, uint8_t *, int, int);
@@ -458,28 +457,14 @@
struct mue_softc *sc = ifp->if_softc;
struct mii_data *mii = GET_MII(sc);
- sc->mue_link = 0; /* XXX */
+ sc->mue_link = 0;
if (mii->mii_instance) {
struct mii_softc *miisc;
LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
mii_phy_reset(miisc);
}
- return mii_mediachg(mii);
-}
-
-/*
- * Report current media status.
- */
-static void
-mue_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
-{
- struct mue_softc *sc = ifp->if_softc;
- struct mii_data *mii = GET_MII(sc);
-
- mii_pollstat(mii);
- ifmr->ifm_active = mii->mii_media_active;
- ifmr->ifm_status = mii->mii_media_status;
+ return ether_mediachange(ifp);
}
static uint8_t
@@ -1044,7 +1029,7 @@
mii->mii_flags = MIIF_AUTOTSLEEP;
sc->mue_ec.ec_mii = mii;
- ifmedia_init(&mii->mii_media, 0, mue_ifmedia_upd, mue_ifmedia_sts);
+ ifmedia_init(&mii->mii_media, 0, mue_ifmedia_upd, ether_mediastatus);
mii_attach(self, mii, 0xffffffff, MII_PHY_ANY, MII_OFFSET_ANY, 0);
if (LIST_FIRST(&mii->mii_phys) == NULL) {
diff -r fd26aac58099 -r a62e5e094175 sys/dev/usb/if_smsc.c
--- a/sys/dev/usb/if_smsc.c Wed Jul 31 23:53:25 2019 +0000
+++ b/sys/dev/usb/if_smsc.c Thu Aug 01 00:10:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_smsc.c,v 1.45 2019/05/23 13:10:52 msaitoh Exp $ */
+/* $NetBSD: if_smsc.c,v 1.46 2019/08/01 00:10:22 mrg 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.45 2019/05/23 13:10:52 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.46 2019/08/01 00:10:22 mrg Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -178,7 +178,6 @@
int smsc_miibus_readreg(device_t, int, int, uint16_t *);
int smsc_miibus_writereg(device_t, int, int, uint16_t);
int smsc_ifmedia_upd(struct ifnet *);
-void smsc_ifmedia_sts(struct ifnet *, struct ifmediareq *);
void smsc_lock_mii(struct smsc_softc *);
void smsc_unlock_mii(struct smsc_softc *);
@@ -422,7 +421,6 @@
{
struct smsc_softc * const sc = ifp->if_softc;
struct mii_data * const mii = &sc->sc_mii;
- int err;
if (mii->mii_instance) {
struct mii_softc *miisc;
@@ -430,24 +428,8 @@
LIST_FOREACH(miisc, &mii->mii_phys, mii_list)
mii_phy_reset(miisc);
}
- err = mii_mediachg(mii);
- return err;
-}
-void
-smsc_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
-{
- struct smsc_softc * const sc = ifp->if_softc;
- struct mii_data * const mii = &sc->sc_mii;
-
- /* SMSC_LOCK */
-
- mii_pollstat(mii);
-
- ifmr->ifm_active = mii->mii_media_active;
- ifmr->ifm_status = mii->mii_media_status;
-
- /* SMSC_UNLOCK */
+ return ether_mediachange(ifp);
}
static inline uint32_t
@@ -1215,7 +1197,7 @@
mii->mii_statchg = smsc_miibus_statchg;
mii->mii_flags = MIIF_AUTOTSLEEP;
sc->sc_ec.ec_mii = mii;
- ifmedia_init(&mii->mii_media, 0, smsc_ifmedia_upd, smsc_ifmedia_sts);
+ ifmedia_init(&mii->mii_media, 0, smsc_ifmedia_upd, ether_mediastatus);
mii_attach(self, mii, 0xffffffff, MII_PHY_ANY, MII_OFFSET_ANY, 0);
if (LIST_FIRST(&mii->mii_phys) == NULL) {
@@ -1625,7 +1607,6 @@
for (i = 0; i < SMSC_TX_LIST_CNT; i++) {
c = &cd->tx_chain[i];
c->sc_sc = sc;
- c->sc_idx = i;
c->sc_mbuf = NULL;
if (c->sc_xfer == NULL) {
int error = usbd_create_xfer(sc->sc_ep[SMSC_ENDPT_TX],
@@ -1669,7 +1650,6 @@
for (i = 0; i < SMSC_RX_LIST_CNT; i++) {
c = &cd->rx_chain[i];
c->sc_sc = sc;
- c->sc_idx = i;
c->sc_mbuf = NULL;
if (c->sc_xfer == NULL) {
int error = usbd_create_xfer(sc->sc_ep[SMSC_ENDPT_RX],
diff -r fd26aac58099 -r a62e5e094175 sys/dev/usb/if_smscvar.h
--- a/sys/dev/usb/if_smscvar.h Wed Jul 31 23:53:25 2019 +0000
+++ b/sys/dev/usb/if_smscvar.h Thu Aug 01 00:10:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_smscvar.h,v 1.7 2019/07/30 06:35:03 skrll Exp $ */
+/* $NetBSD: if_smscvar.h,v 1.8 2019/08/01 00:10:22 mrg Exp $ */
/* $OpenBSD: if_smscreg.h,v 1.2 2012/09/27 12:38:11 jsg Exp $ */
/*-
@@ -39,8 +39,6 @@
struct usbd_xfer *sc_xfer;
char *sc_buf;
struct mbuf *sc_mbuf;
- int sc_accum;
- int sc_idx;
};
struct smsc_cdata {
diff -r fd26aac58099 -r a62e5e094175 sys/dev/usb/if_udav.c
--- a/sys/dev/usb/if_udav.c Wed Jul 31 23:53:25 2019 +0000
+++ b/sys/dev/usb/if_udav.c Thu Aug 01 00:10:22 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_udav.c,v 1.59 2019/05/28 07:41:50 msaitoh Exp $ */
+/* $NetBSD: if_udav.c,v 1.60 2019/08/01 00:10:22 mrg Exp $ */
/* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */
Home |
Main Index |
Thread Index |
Old Index