rev |
line source |
pascal@20394
|
1 diff -uNr ndiswrapper-1.56.old/driver/usb.c ndiswrapper-1.56/driver/usb.c
|
pascal@20394
|
2 --- ndiswrapper-1.56.old/driver/usb.c 2010-02-10 18:09:32.000000000 -0800
|
pascal@20394
|
3 +++ ndiswrapper-1.56/driver/usb.c 2010-07-25 02:29:25.442145846 -0700
|
pascal@20394
|
4 @@ -191,9 +191,15 @@
|
pascal@20394
|
5 if (wrap_urb->flags & WRAP_URB_COPY_BUFFER) {
|
pascal@20394
|
6 USBTRACE("freeing DMA buffer for URB: %p %p",
|
pascal@20394
|
7 urb, urb->transfer_buffer);
|
pascal@20394
|
8 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
|
pascal@20394
|
9 usb_buffer_free(IRP_WRAP_DEVICE(irp)->usb.udev,
|
pascal@20394
|
10 + urb->transfer_buffer_length,
|
pascal@20394
|
11 + urb->transfer_buffer, urb->transfer_dma);
|
pascal@20394
|
12 +#else
|
pascal@20394
|
13 + usb_free_coherent(IRP_WRAP_DEVICE(irp)->usb.udev,
|
pascal@20394
|
14 urb->transfer_buffer_length,
|
pascal@20394
|
15 urb->transfer_buffer, urb->transfer_dma);
|
pascal@20394
|
16 +#endif
|
pascal@20394
|
17 }
|
pascal@20394
|
18 if (urb->setup_packet)
|
pascal@20394
|
19 kfree(urb->setup_packet);
|
pascal@20394
|
20 @@ -303,9 +309,16 @@
|
pascal@20394
|
21 || PageHighMem(virt_to_page(buf))
|
pascal@20394
|
22 #endif
|
pascal@20394
|
23 )) {
|
pascal@20394
|
24 +
|
pascal@20394
|
25 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
|
pascal@20394
|
26 urb->transfer_buffer =
|
pascal@20394
|
27 - usb_buffer_alloc(wd->usb.udev, buf_len, alloc_flags,
|
pascal@20394
|
28 + usb_buffer_alloc(wd->usb.udev, buf_len, alloc_flags,
|
pascal@20394
|
29 + &urb->transfer_dma);
|
pascal@20394
|
30 +#else
|
pascal@20394
|
31 + urb->transfer_buffer =
|
pascal@20394
|
32 + usb_alloc_coherent(wd->usb.udev, buf_len, alloc_flags,
|
pascal@20394
|
33 &urb->transfer_dma);
|
pascal@20394
|
34 +#endif
|
pascal@20394
|
35 if (!urb->transfer_buffer) {
|
pascal@20394
|
36 WARNING("couldn't allocate dma buf");
|
pascal@20394
|
37 IoAcquireCancelSpinLock(&irp->cancel_irql);
|
pascal@20394
|
38 diff -uNr ndiswrapper-1.56.old/driver/wrapndis.c ndiswrapper-1.56/driver/wrapndis.c
|
pascal@20394
|
39 --- ndiswrapper-1.56.old/driver/wrapndis.c 2010-02-10 18:09:32.000000000 -0800
|
pascal@20394
|
40 +++ ndiswrapper-1.56/driver/wrapndis.c 2010-07-25 02:06:13.184631757 -0700
|
pascal@20394
|
41 @@ -936,6 +936,10 @@
|
pascal@20394
|
42 EXIT2(return);
|
pascal@20394
|
43 }
|
pascal@20394
|
44
|
pascal@20394
|
45 +#ifndef netdev_mc_count
|
pascal@20394
|
46 +#define netdev_mc_count(net_dev) net_dev->mc_count
|
pascal@20394
|
47 +#endif
|
pascal@20394
|
48 +
|
pascal@20394
|
49 static void set_multicast_list(struct ndis_device *wnd)
|
pascal@20394
|
50 {
|
pascal@20394
|
51 struct net_device *net_dev;
|
pascal@20394
|
52 @@ -950,20 +954,26 @@
|
pascal@20394
|
53 packet_filter |= NDIS_PACKET_TYPE_PROMISCUOUS |
|
pascal@20394
|
54 NDIS_PACKET_TYPE_ALL_LOCAL;
|
pascal@20394
|
55 } else if (net_dev->flags & IFF_ALLMULTI ||
|
pascal@20394
|
56 - net_dev->mc_count > wnd->multicast_size) {
|
pascal@20394
|
57 + netdev_mc_count(net_dev) > wnd->multicast_size) {
|
pascal@20394
|
58 packet_filter |= NDIS_PACKET_TYPE_ALL_MULTICAST;
|
pascal@20394
|
59 TRACE2("0x%08x", packet_filter);
|
pascal@20394
|
60 - } else if (net_dev->mc_count > 0) {
|
pascal@20394
|
61 + } else if (netdev_mc_count(net_dev) > 0) {
|
pascal@20394
|
62 int i, size;
|
pascal@20394
|
63 char *buf;
|
pascal@20394
|
64 +#ifndef netdev_for_each_mc_addr
|
pascal@20394
|
65 struct dev_mc_list *mclist;
|
pascal@20394
|
66 - size = min(wnd->multicast_size, net_dev->mc_count);
|
pascal@20394
|
67 - TRACE2("%d, %d", wnd->multicast_size, net_dev->mc_count);
|
pascal@20394
|
68 +#else
|
pascal@20394
|
69 + struct netdev_hw_addr *mclist;
|
pascal@20394
|
70 +#endif
|
pascal@20394
|
71 +
|
pascal@20394
|
72 + size = min(wnd->multicast_size, netdev_mc_count(net_dev));
|
pascal@20394
|
73 + TRACE2("%d, %d", wnd->multicast_size, netdev_mc_count(net_dev));
|
pascal@20394
|
74 buf = kmalloc(size * ETH_ALEN, GFP_KERNEL);
|
pascal@20394
|
75 if (!buf) {
|
pascal@20394
|
76 WARNING("couldn't allocate memory");
|
pascal@20394
|
77 EXIT2(return);
|
pascal@20394
|
78 }
|
pascal@20394
|
79 +#ifndef netdev_for_each_mc_addr
|
pascal@20394
|
80 mclist = net_dev->mc_list;
|
pascal@20394
|
81 for (i = 0; i < size && mclist; mclist = mclist->next) {
|
pascal@20394
|
82 if (mclist->dmi_addrlen != ETH_ALEN)
|
pascal@20394
|
83 @@ -972,6 +982,15 @@
|
pascal@20394
|
84 TRACE2(MACSTRSEP, MAC2STR(mclist->dmi_addr));
|
pascal@20394
|
85 i++;
|
pascal@20394
|
86 }
|
pascal@20394
|
87 +#else
|
pascal@20394
|
88 + i = 0;
|
pascal@20394
|
89 + netdev_for_each_mc_addr(mclist, net_dev){
|
pascal@20394
|
90 + memcpy(buf + i++ * ETH_ALEN,
|
pascal@20394
|
91 + mclist->addr, ETH_ALEN);
|
pascal@20394
|
92 + TRACE2(MACSTRSEP, MAC2STR(mclist->addr));
|
pascal@20394
|
93 +
|
pascal@20394
|
94 + }
|
pascal@20394
|
95 +#endif
|
pascal@20394
|
96 res = mp_set(wnd, OID_802_3_MULTICAST_LIST, buf, i * ETH_ALEN);
|
pascal@20394
|
97 if (res == NDIS_STATUS_SUCCESS && i > 0)
|
pascal@20394
|
98 packet_filter |= NDIS_PACKET_TYPE_MULTICAST;
|