From eadf519a78ae697bafce763cc292be1fba6aab4d Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Sun, 23 May 2004 12:35:25 +0000 Subject: Replace the static "qdat" structure with a per-instance softc field in all USB ethernet drivers. The qdat structure contains a pointer to the interface's struct ifnet and is used to process incoming packets, so simultaneous use of two similar devices caused crashes and confusion. The if_udav driver appeared in the tree since Daan's PR, so I made similar changes to that driver too. PR: kern/59290 Submitted by: Daan Vreeken --- sys/dev/usb/if_axe.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sys/dev/usb/if_axe.c') diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index c5dd47b972d2..d80cb6aa4613 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -113,8 +113,6 @@ Static struct axe_type axe_devs[] = { { 0, 0 } }; -Static struct usb_qdat axe_qdat; - Static int axe_match(device_ptr_t); Static int axe_attach(device_ptr_t); Static int axe_detach(device_ptr_t); @@ -508,8 +506,8 @@ USB_ATTACH(axe) ifp->if_baudrate = 10000000; ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; - axe_qdat.ifp = ifp; - axe_qdat.if_rxstart = axe_rxstart; + sc->axe_qdat.ifp = ifp; + sc->axe_qdat.if_rxstart = axe_rxstart; if (mii_phy_probe(self, &sc->axe_miibus, axe_ifmedia_upd, axe_ifmedia_sts)) { @@ -711,7 +709,7 @@ axe_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) } ifp->if_ipackets++; - m->m_pkthdr.rcvif = (struct ifnet *)&axe_qdat; + m->m_pkthdr.rcvif = (struct ifnet *)&sc->axe_qdat; m->m_pkthdr.len = m->m_len = total_len; /* Put the packet on the special USB input queue. */ -- cgit v1.2.3