Re: New, yet unsupported USB-Ethernet adaptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/2/06, Michael Helmling <[email protected]> wrote:

I bought an USB-Ethernet adaptor from delock (www.delock.de) and found it was
not supported by linux from the vendor. So I played a little with lsusb and
found it uses a MCS7830 chip from MosChip semiconductor (moschip.com). On
their homepage I found a driver but it only was a precompiled Fedora4 module.
So I wrote them an email and they sent me the whole source code for the
module . Unfortunately it doesn't compile on my machine with a 2.6.16 kernel,
but in does on a friend's one who uses 2.6.12, so I assume something has
changed in the kernel interface (I get errors with sk_buff_head not
containing "list").
I have no idea of how to correct this but maybe someone else can. I attached
the sourcecode wich is licensed under the GPL.

Great. below is an UNTESTED patch which should get it to build fine
with more recent kernels. (Builds on 2.6.17-rc3). Give it a try if you
can and let us know.

Signed-off-by: Ioan Ionita <[email protected]>
--

--- old/mcs7830.c	2006-05-02 11:01:22.000000000 -0400
+++ new/mcs7830.c	2006-05-02 11:01:12.000000000 -0400
@@ -1309,9 +1309,9 @@
 * completion callbacks.  2.5 should have fixed those bugs...
 */

-static void defer_bh (struct usbnet *dev, struct sk_buff *skb)
+static void defer_bh (struct usbnet *dev, struct sk_buff *skb, struct
sk_buff_head *list)
{
-	struct sk_buff_head	*list = skb->list;
+	
	unsigned long		flags;

	spin_lock_irqsave (&list->lock, flags);
@@ -1370,7 +1370,7 @@

	usb_fill_bulk_urb (urb, dev->udev, dev->in,
		skb->data, size, rx_complete, skb);
-	urb->transfer_flags |= URB_ASYNC_UNLINK;
+	

	spin_lock_irqsave (&dev->rxq.lock, lockflags);

@@ -1503,7 +1503,7 @@
		break;
	}

-	defer_bh (dev, skb);
+	defer_bh (dev, skb, &dev->txq);

	if (urb) {
		if (netif_running (dev->net)
@@ -1935,7 +1935,7 @@

	urb->dev = NULL;
	entry->state = tx_done;
-	defer_bh (dev, skb);
+	defer_bh (dev, skb, &dev->txq);
}

/*-------------------------------------------------------------------------*/
@@ -1997,7 +1997,7 @@

	usb_fill_bulk_urb (urb, dev->udev, dev->out,
			skb->data, skb->len, tx_complete, skb);
-	urb->transfer_flags |= URB_ASYNC_UNLINK;
+

	/* don't assume the hardware handles USB_ZERO_PACKET
	 * NOTE:  strictly conforming cdc-ether devices should expect
@@ -2044,7 +2044,7 @@
		}
		usb_fill_bulk_urb (Zerourb, dev->udev, dev->out,\
				skb->data, 0, Zero_complete, NULL);
-		Zerourb->transfer_flags |= URB_ASYNC_UNLINK;
+		
		retval2 = usb_submit_urb (urb, GFP_ATOMIC);
		if(retval2 !=0)
		printk("Error sending Zero Length packet in transmission\n");
@@ -2404,8 +2404,10 @@
MODULE_DEVICE_TABLE (usb, products);

static struct usb_driver usbnet_driver = {
-	.owner =	THIS_MODULE,
-	.name =		driver_name,
+	.driver = {
+		.owner =	THIS_MODULE,
+		.name =		driver_name,
+	 },
	.id_table =	products,
	.probe =	usbnet_probe,
	.disconnect =	usbnet_disconnect,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux