Hi,

Here's a patch against 2.4.17-pre6 that fixes a bug in the USB CDCEther
driver, and cleans up the module reference counting.  The patch is from
Brad Hards.

thanks,

greg k-h



diff -Nru a/drivers/usb/CDCEther.c b/drivers/usb/CDCEther.c
--- a/drivers/usb/CDCEther.c    Fri Dec  7 17:31:55 2001
+++ b/drivers/usb/CDCEther.c    Fri Dec  7 17:31:55 2001
@@ -337,13 +337,9 @@
        ether_dev_t *ether_dev = (ether_dev_t *)net->priv;
        int     res;
 
-       // We are finally getting used!
-       MOD_INC_USE_COUNT;
-
        // Turn on the USB and let the packets flow!!!
        if ( (res = enable_net_traffic( ether_dev )) ) {
                err( __FUNCTION__ "can't enable_net_traffic() - %d", res );
-               MOD_DEC_USE_COUNT;
                return -EIO;
        }
 
@@ -391,9 +387,6 @@
        usb_unlink_urb( &ether_dev->tx_urb );
        usb_unlink_urb( &ether_dev->intr_urb );
        
-       // We are not being used now.
-       MOD_DEC_USE_COUNT;
-
        // That's it.  I'm done.
        return 0;
 }
@@ -480,6 +473,7 @@
                      i++, mclist = mclist->next) {
                        memcpy(&mclist->dmi_addr, &buff[i * 6], 6);
                }
+#if 0
                usb_control_msg(ether_dev->usb,
                                usb_sndctrlpipe(ether_dev->usb, 0),
                                SET_ETHERNET_MULTICAST_FILTER, /* request */
@@ -489,11 +483,13 @@
                                buff,
                                (6* net->mc_count), /* size */
                                HZ); /* timeout */
+#endif
                kfree(buff);
        }
- 
+
+#if 0 
        CDC_SetEthernetPacketFilter(ether_dev);
-       
+#endif 
         // Tell the kernel to start giving frames to us again.
        netif_wake_queue(net);
 }
@@ -1210,6 +1206,7 @@
        // Now that we have an ethernet device, let's set it up
        // (And I don't mean "set [it] up the bomb".)
        net->priv = ether_dev;
+       SET_MODULE_OWNER(net);
        net->open = CDCEther_open;
        net->stop = CDCEther_close;
        net->watchdog_timeo = CDC_ETHER_TX_TIMEOUT;


_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to