wok view ndiswrapper-driver/stuff/kernel-2.6.35.patch @ rev 13976

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