summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2007-06-17 18:46:26 +0000
committerimp <imp@FreeBSD.org>2007-06-17 18:46:26 +0000
commitf89fd3b7ea95f6456e62c4be236abbf43ab3e5b8 (patch)
tree7db80c3d8c2a8c3bb2adf96db4859516c09d99d5
parent333d04678de0f758b3332c024f321aa2f9b801b2 (diff)
downloadFreeBSD-src-f89fd3b7ea95f6456e62c4be236abbf43ab3e5b8.zip
FreeBSD-src-f89fd3b7ea95f6456e62c4be236abbf43ab3e5b8.tar.gz
Remove USBGETSOFTC, USB_ATTACH_START, USB_DETACH_START and
USB_DECLARE_DRIVER_INIT from the usb network drivers.
-rw-r--r--sys/dev/usb/if_aue.c9
-rw-r--r--sys/dev/usb/if_axe.c9
-rw-r--r--sys/dev/usb/if_cdce.c34
-rw-r--r--sys/dev/usb/if_cue.c3
-rw-r--r--sys/dev/usb/if_kue.c3
-rw-r--r--sys/dev/usb/if_rue.c9
-rw-r--r--sys/dev/usb/if_ural.c29
7 files changed, 69 insertions, 27 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index 772eea6..b472b8f 100644
--- a/sys/dev/usb/if_aue.c
+++ b/sys/dev/usb/if_aue.c
@@ -410,7 +410,7 @@ aue_read_eeprom(struct aue_softc *sc, caddr_t dest, int off, int cnt, int swap)
static int
aue_miibus_readreg(device_t dev, int phy, int reg)
{
- struct aue_softc *sc = USBGETSOFTC(dev);
+ struct aue_softc *sc = device_get_softc(dev);
int i;
u_int16_t val = 0;
@@ -454,7 +454,7 @@ aue_miibus_readreg(device_t dev, int phy, int reg)
static int
aue_miibus_writereg(device_t dev, int phy, int reg, int data)
{
- struct aue_softc *sc = USBGETSOFTC(dev);
+ struct aue_softc *sc = device_get_softc(dev);
int i;
if (phy == 3)
@@ -480,7 +480,7 @@ aue_miibus_writereg(device_t dev, int phy, int reg, int data)
static void
aue_miibus_statchg(device_t dev)
{
- struct aue_softc *sc = USBGETSOFTC(dev);
+ struct aue_softc *sc = device_get_softc(dev);
struct mii_data *mii = GET_MII(sc);
AUE_CLRBIT(sc, AUE_CTL0, AUE_CTL0_RX_ENB | AUE_CTL0_TX_ENB);
@@ -631,7 +631,8 @@ aue_match(device_t self)
static int
aue_attach(device_t self)
{
- USB_ATTACH_START(aue, sc, uaa);
+ struct aue_softc *sc = device_get_softc(self);
+ struct usb_attach_arg *uaa = device_get_ivars(self);
u_char eaddr[ETHER_ADDR_LEN];
struct ifnet *ifp;
usbd_interface_handle iface;
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c
index 4c2c1b9..6341ef7 100644
--- a/sys/dev/usb/if_axe.c
+++ b/sys/dev/usb/if_axe.c
@@ -207,7 +207,7 @@ axe_cmd(struct axe_softc *sc, int cmd, int index, int val, void *buf)
static int
axe_miibus_readreg(device_t dev, int phy, int reg)
{
- struct axe_softc *sc = USBGETSOFTC(dev);
+ struct axe_softc *sc = device_get_softc(dev);
usbd_status err;
u_int16_t val;
@@ -250,7 +250,7 @@ axe_miibus_readreg(device_t dev, int phy, int reg)
static int
axe_miibus_writereg(device_t dev, int phy, int reg, int val)
{
- struct axe_softc *sc = USBGETSOFTC(dev);
+ struct axe_softc *sc = device_get_softc(dev);
usbd_status err;
if (sc->axe_dying)
@@ -275,7 +275,7 @@ static void
axe_miibus_statchg(device_t dev)
{
#ifdef notdef
- struct axe_softc *sc = USBGETSOFTC(dev);
+ struct axe_softc *sc = device_get_softc(dev);
struct mii_data *mii = GET_MII(sc);
#endif
/* doesn't seem to be necessary */
@@ -407,7 +407,8 @@ axe_match(device_t self)
static int
axe_attach(device_t self)
{
- USB_ATTACH_START(axe, sc, uaa);
+ struct axe_softc *sc = device_get_softc(self);
+ struct usb_attach_arg *uaa = device_get_ivars(self);
u_char eaddr[ETHER_ADDR_LEN];
struct ifnet *ifp;
usb_interface_descriptor_t *id;
diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c
index 156b2db..c4e8b16 100644
--- a/sys/dev/usb/if_cdce.c
+++ b/sys/dev/usb/if_cdce.c
@@ -73,15 +73,32 @@ __FBSDID("$FreeBSD$");
#include "usbdevs.h"
#include <dev/usb/if_cdcereg.h>
+static device_probe_t cdce_match;
+static device_attach_t cdce_attach;
+static device_detach_t cdce_detach;
static device_shutdown_t cdce_shutdown;
-USB_DECLARE_DRIVER_INIT(cdce,
- DEVMETHOD(device_probe, cdce_match),
- DEVMETHOD(device_attach, cdce_attach),
- DEVMETHOD(device_detach, cdce_detach),
- DEVMETHOD(device_shutdown, cdce_shutdown)
- );
+
+static device_method_t cdce_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, cdce_match),
+ DEVMETHOD(device_attach, cdce_attach),
+ DEVMETHOD(device_detach, cdce_detach),
+ DEVMETHOD(device_shutdown, cdce_shutdown),
+
+ { 0, 0 }
+};
+
+static driver_t cdce_driver = {
+ "cdce",
+ cdce_methods,
+ sizeof(struct cdce_softc)
+};
+
+static devclass_t cdce_devclass;
+
DRIVER_MODULE(cdce, uhub, cdce_driver, cdce_devclass, usbd_driver_load, 0);
MODULE_VERSION(cdce, 0);
+MODULE_DEPEND(cdce, usb, 1, 1, 1);
static int cdce_encap(struct cdce_softc *, struct mbuf *, int);
static void cdce_rxeof(usbd_xfer_handle, usbd_private_handle, usbd_status);
@@ -134,7 +151,8 @@ cdce_match(device_t self)
static int
cdce_attach(device_t self)
{
- USB_ATTACH_START(cdce, sc, uaa);
+ struct cdce_softc *sc = device_get_softc(self);
+ struct usb_attach_arg *uaa = device_get_ivars(self);
struct ifnet *ifp;
usbd_device_handle dev = uaa->device;
const struct cdce_type *t;
@@ -322,7 +340,7 @@ cdce_attach(device_t self)
static int
cdce_detach(device_t self)
{
- USB_DETACH_START(cdce, sc);
+ struct cdce_softc *sc = device_get_softc(self);
struct ifnet *ifp;
CDCE_LOCK(sc);
diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c
index af62072..b862b47 100644
--- a/sys/dev/usb/if_cue.c
+++ b/sys/dev/usb/if_cue.c
@@ -432,7 +432,8 @@ cue_match(device_t self)
static int
cue_attach(device_t self)
{
- USB_ATTACH_START(cue, sc, uaa);
+ struct cue_softc *sc = device_get_softc(self);
+ struct usb_attach_arg *uaa = device_get_ivars(self);
u_char eaddr[ETHER_ADDR_LEN];
struct ifnet *ifp;
usb_interface_descriptor_t *id;
diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c
index 7710225..9985015 100644
--- a/sys/dev/usb/if_kue.c
+++ b/sys/dev/usb/if_kue.c
@@ -405,7 +405,8 @@ kue_match(device_t self)
static int
kue_attach(device_t self)
{
- USB_ATTACH_START(kue, sc, uaa);
+ struct kue_softc *sc = device_get_softc(self);
+ struct usb_attach_arg *uaa = device_get_ivars(self);
struct ifnet *ifp;
usbd_status err;
usb_interface_descriptor_t *id;
diff --git a/sys/dev/usb/if_rue.c b/sys/dev/usb/if_rue.c
index d9f54c5..268a873 100644
--- a/sys/dev/usb/if_rue.c
+++ b/sys/dev/usb/if_rue.c
@@ -345,7 +345,7 @@ rue_csr_write_4(struct rue_softc *sc, int reg, u_int32_t val)
static int
rue_miibus_readreg(device_t dev, int phy, int reg)
{
- struct rue_softc *sc = USBGETSOFTC(dev);
+ struct rue_softc *sc = device_get_softc(dev);
int rval;
int ruereg;
@@ -389,7 +389,7 @@ rue_miibus_readreg(device_t dev, int phy, int reg)
static int
rue_miibus_writereg(device_t dev, int phy, int reg, int data)
{
- struct rue_softc *sc = USBGETSOFTC(dev);
+ struct rue_softc *sc = device_get_softc(dev);
int ruereg;
if (phy != 0) /* RTL8150 supports PHY == 0, only */
@@ -442,7 +442,7 @@ rue_miibus_statchg(device_t dev)
* out, so that disable it for good.
*/
#if 0
- struct rue_softc *sc = USBGETSOFTC(dev);
+ struct rue_softc *sc = device_get_softc(dev);
struct mii_data *mii = GET_MII(sc);
int bmcr;
@@ -576,7 +576,8 @@ rue_match(device_t self)
static int
rue_attach(device_t self)
{
- USB_ATTACH_START(rue, sc, uaa);
+ struct rue_softc *sc = device_get_softc(self);
+ struct usb_attach_arg *uaa = device_get_ivars(self);
u_char eaddr[ETHER_ADDR_LEN];
struct ifnet *ifp;
usbd_interface_handle iface;
diff --git a/sys/dev/usb/if_ural.c b/sys/dev/usb/if_ural.c
index 61bf44b..ba8c15a 100644
--- a/sys/dev/usb/if_ural.c
+++ b/sys/dev/usb/if_ural.c
@@ -344,7 +344,27 @@ static const struct {
{ 161, 0x08808, 0x0242f, 0x00281 }
};
-USB_DECLARE_DRIVER(ural);
+static int ural_match(device_t);
+static int ural_attach(device_t);
+static int ural_detach(device_t);
+static device_method_t ural_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, ural_match),
+ DEVMETHOD(device_attach, ural_attach),
+ DEVMETHOD(device_detach, ural_detach),
+
+ { 0, 0 }
+};
+
+static driver_t ural_driver = {
+ "ural",
+ ural_methods,
+ sizeof(struct ural_softc)
+};
+
+static devclass_t ural_devclass;
+
+DRIVER_MODULE(ural, uhub, ural_driver, ural_devclass, usbd_driver_load, 0);
static int
ural_match(device_t self)
@@ -361,7 +381,8 @@ ural_match(device_t self)
static int
ural_attach(device_t self)
{
- USB_ATTACH_START(ural, sc, uaa);
+ struct ural_softc *sc = device_get_softc(self);
+ struct usb_attach_arg *uaa = device_get_ivars(self);
struct ifnet *ifp;
struct ieee80211com *ic = &sc->sc_ic;
usb_interface_descriptor_t *id;
@@ -512,7 +533,7 @@ ural_attach(device_t self)
static int
ural_detach(device_t self)
{
- USB_DETACH_START(ural, sc);
+ struct ural_softc *sc = device_get_softc(self);
struct ieee80211com *ic = &sc->sc_ic;
struct ifnet *ifp = ic->ic_ifp;
@@ -2479,5 +2500,3 @@ ural_amrr_update(usbd_xfer_handle xfer, usbd_private_handle priv,
callout_reset(&sc->amrr_ch, hz, ural_amrr_timeout, sc);
}
-
-DRIVER_MODULE(ural, uhub, ural_driver, ural_devclass, usbd_driver_load, 0);
OpenPOWER on IntegriCloud