Re: ndiswrapper and NetworkManager, and sysfs/HAL



Dan Williams scribbled:
> Great!!  I've seen about 10 people using ndiswrapper so far that are
> having problems, both on this list and Fedora lists.  Could you post the
> patch to this list (or email it to me, I'm interested in it)?  How hard
> will it be to get upstream?

I'm attaching it and CC:ing this list as well as the
ndiswrapper-general list.  I don't know how difficult this will
be to get included upstream.  It was a farily trivial patch to
get working.  This patch is against wrapper.c from ndiswrapper-0.11.

Caveats: this is my first delving into kernel code.  The USB patches
are untested, as I don't have any USB/ndiswrapper devices.  The
kludge of passing NULL as the device if the kernel rev is <2.6 is
icky, but it works.

> What the ndiswrapper developers have to understand is that their stuff
> is fundamentally broken until they support sysfs.  They don't really
> need a 'driver' link (though it would be really, really nice), but a
> 'device' link is almost mandatory.  It has to get done in ndiswrapper
> because the Windows drivers, of course, aren't going to set a NETDEV on
> themselves :)

Can't imagine why.  :)

> Dan

ja.
-- 
Joe Ammond                                                  joe ammond org
              My new toy: http://www.ammond.org/Spitfire
--- wrapper.c.orig	2004-11-04 18:31:51.000000000 -0600
+++ wrapper.c	2004-11-05 12:01:38.719783112 -0600
@@ -1385,7 +1385,8 @@
 
 static struct net_device *ndis_init_netdev(struct ndis_handle **phandle,
                                            struct ndis_device *device,
-                                           struct ndis_driver *driver)
+                                           struct ndis_driver *driver,
+					   struct device *netdev)
 {
 	int i, *ip;
 	struct net_device *dev;
@@ -1398,7 +1399,8 @@
 	}
 
 	SET_MODULE_OWNER(dev);
-//	SET_NETDEV_DEV(dev, &pdev->dev);
+	if (netdev != NULL)
+		SET_NETDEV_DEV(dev, netdev);
 
 	handle = dev->priv;
 	/* Poision the fileds as they may contain function pointers
@@ -1502,7 +1504,7 @@
 		       "mind if you have problem.\n", device->driver->name);
 	}
 
-	dev = ndis_init_netdev(&handle, device, driver);
+	dev = ndis_init_netdev(&handle, device, driver, &pdev->dev);
 	if(!dev)
 	{
 		printk(KERN_ERR "Unable to alloc etherdev\n");
@@ -1610,7 +1612,11 @@
 
 	TRACEENTER1("%04x:%04x\n", usb_id->idVendor, usb_id->idProduct);
 
-	dev = ndis_init_netdev(&handle, device, driver);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+	dev = ndis_init_netdev(&handle, device, driver, &intf->dev);
+#else
+	dev = ndis_init_netdev(&handle, device, driver, NULL);
+#endif
 	if(!dev) {
 		ERROR("%s", "Unable to alloc etherdev\n");
 		res = -ENOMEM;

Attachment: pgptN4FRm6yHA.pgp
Description: PGP signature



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