看板 DFBSD_submit 關於我們 聯絡資訊
Try this patch. -Matt Index: usb/usb_ethersubr.c =================================================================== RCS file: /cvs/src/sys/bus/usb/usb_ethersubr.c,v retrieving revision 1.10 diff -u -r1.10 usb_ethersubr.c --- usb/usb_ethersubr.c 23 Jul 2004 07:16:24 -0000 1.10 +++ usb/usb_ethersubr.c 15 Feb 2005 22:49:55 -0000 @@ -76,17 +76,24 @@ Static struct ifqueue usbq_tx; Static int mtx_inited = 0; -Static int usbintr(struct netmsg *msg) +/* + * Note: packets are queued with IF_ENQUEUE and not passed in nm_packet at + * the moment. + */ +Static int +usbintr(struct netmsg *msg) { - struct mbuf *m = ((struct netmsg_packet *)msg)->nm_packet; + struct mbuf *m; struct usb_qdat *q; struct ifnet *ifp; int s; s = splimp(); - /* Check the RX queue */ - while(1) { + /* + * Hand off received packets to the system. + */ + for (;;) { IF_DEQUEUE(&usbq_rx, m); if (m == NULL) break; @@ -100,8 +107,10 @@ (*ifp->if_start)(ifp); } - /* Check the TX queue */ - while(1) { + /* + * Throw away packets which have completed transmission. + */ + for (;;) { IF_DEQUEUE(&usbq_tx, m); if (m == NULL) break; @@ -120,11 +129,10 @@ void usb_register_netisr(void) { - if (mtx_inited) - return; - mtx_inited = 1; - netisr_register(NETISR_USB, cpu0_portfn, usbintr); - return; + if (mtx_inited == 0) { + mtx_inited = 1; + netisr_register(NETISR_USB, cpu0_portfn, usbintr); + } } /* @@ -134,11 +142,14 @@ void usb_ether_input(struct mbuf *m) { - netisr_queue(NETISR_USB, m); + IF_ENQUEUE(&usbq_rx, m); + netisr_queue(NETISR_USB, NULL); } void usb_tx_done(struct mbuf *m) { - netisr_queue(NETISR_USB, m); + IF_ENQUEUE(&usbq_tx, m); + netisr_queue(NETISR_USB, NULL); } +