File usb-rndis-lite-usbnet.patch of Package usb-rndis-lite

diff -Naur usb-rndis-lite-0.11/rndis_host.c
--- usb-rndis-lite-0.11/rndis_host.c	2008-01-07 07:17:29.000000000 -0500
+++ usb-rndis-lite-0.11-landon/rndis_host.c	2009-11-10 07:55:02.000000000 -0500
@@ -505,7 +505,9 @@
 	dev->rx_urb_size = (dev->udev->speed == USB_SPEED_FULL) ? 16384 : 8192;
 	u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size);
 
-	net->change_mtu = NULL;
+	#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+    net->change_mtu = NULL;
+  #endif
 
 	retval = rndis_command(dev, u.header);
 	if (unlikely(retval < 0)) {
diff -Naur usb-rndis-lite-0.11/usbnet.c
--- usb-rndis-lite-0.11/usbnet.c	2008-01-07 07:17:29.000000000 -0500
+++ usb-rndis-lite-0.11-landon/usbnet.c	2009-11-10 13:02:08.000000000 -0500
@@ -1124,11 +1124,21 @@
 }
 EXPORT_SYMBOL_GPL(usbnet_disconnect);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+static const struct net_device_ops rndisLiteNetDevOps =
+{
+    .ndo_open = usbnet_open,
+    .ndo_stop = usbnet_stop,
+    .ndo_start_xmit = usbnet_start_xmit,
+    .ndo_get_stats = usbnet_get_stats,
+    .ndo_change_mtu = usbnet_change_mtu,
+    .ndo_tx_timeout = usbnet_tx_timeout,
+};
+#endif
 
 /*-------------------------------------------------------------------------*/
 
 // precondition: never called in_interrupt
-
 int
 usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 {
@@ -1196,13 +1206,18 @@
 		net->features |= NETIF_F_HIGHDMA;
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+  net->netdev_ops=&rndisLiteNetDevOps;
+#else
 	net->change_mtu = usbnet_change_mtu;
 	net->get_stats = usbnet_get_stats;
 	net->hard_start_xmit = usbnet_start_xmit;
 	net->open = usbnet_open;
 	net->stop = usbnet_stop;
-	net->watchdog_timeo = TX_TIMEOUT_JIFFIES;
 	net->tx_timeout = usbnet_tx_timeout;
+#endif
+
+	net->watchdog_timeo = TX_TIMEOUT_JIFFIES;
 	net->ethtool_ops = &usbnet_ethtool_ops;
 
 	// allow device-specific bind/init procedures

openSUSE Build Service is sponsored by