dirk janssen - 2005-02-20

Not sure whether this is the best place to put this, but could somebody please pass it on if it isn't.

I have tried to compile ndiswrappers on an old laptop (pre usb). In the process, I found a few small errors in the source of loader.c, which are corrected in the patch below. They all have to do with usb specific code that is not within a #ifdev CONFIG_USB / #endif pair so you'll get many errors if you compile it on a pre-usb platform.

Ndiswrappers worked but my hardware did not install, then I tried atmel-wlan-drivers and those are working w/o problems. Hardware: Belkin 6020 pcmcia card (realtek chip) on IBM thinkpad 560e.

Cheers,
Dirk


driver/loader.c.orig Sat Feb 5 17:16:01 2005
--- driver/loader.c Sun Feb 20 20:30:55 2005
***
752,757 ****
--- 752,759 ----
(num_pci + 1) * sizeof(struct pci_device_id));
}

  • ifdef CONFIG_USB

    if (num_usb > 0) {
            ndiswrapper_usb_devices =
                    kmalloc((num_usb + 1) * sizeof(struct usb_device_id),
    

763,768 *
--- 765,771 ----
memset(ndiswrapper_usb_devices, 0,
(num_usb + 1) * sizeof(struct usb_device_id));
}
+ #endif

    ndis_devices = vmalloc(num_ndis_devices * sizeof(*ndis_devices));
    if (!ndis_devices) {

851,856
--- 854,861 ----
goto err;
}
}
+ /
dpj /
+ #ifdef CONFIG_USB
if (ndiswrapper_usb_devices) {
memset(&ndiswrapper_usb_driver, 0,
sizeof(ndiswrapper_usb_driver));
**

866,871 *
--- 871,878 ----
goto err;
}
}
+ #endif
+

    vfree(devices);
    TRACEEXIT1(return 0);

966,977 *

    TRACEENTER1("");
    misc_deregister(&wrapper_misc);

!
if (ndiswrapper_usb_devices) {
usb_deregister(&ndiswrapper_usb_driver);
kfree(ndiswrapper_usb_devices);
ndiswrapper_usb_devices = NULL;
}
if (ndiswrapper_pci_devices) {
pci_unregister_driver(&ndiswrapper_pci_driver);
kfree(ndiswrapper_pci_devices);
--- 973,985 ----

    TRACEENTER1("");
    misc_deregister(&wrapper_misc);

! #ifdef CONFIG_USB
if (ndiswrapper_usb_devices) {
usb_deregister(&ndiswrapper_usb_driver);
kfree(ndiswrapper_usb_devices);
ndiswrapper_usb_devices = NULL;
}
+ #endif
if (ndiswrapper_pci_devices) {
pci_unregister_driver(&ndiswrapper_pci_driver);
kfree(ndiswrapper_pci_devices);