updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / rt73-k2wrlz / rtmp_main.diff
blobf3757dba1d225d9ce9e397fe739d7cc0fc6c32e2
1 *** rtmp_main.c 2009-05-19 21:23:26.000000000 +0200
2 --- rtmp_main.c.orig 2011-03-19 11:06:46.260002232 +0100
3 ***************
4 *** 34,40 ****
5 ***************************************************************************/
7 #include "rt_config.h"
8 !
10 ULONG RTDebugLevel = RT_DEBUG_OFF;
11 static ULONG debug = RT_DEBUG_OFF;
12 --- 34,43 ----
13 ***************************************************************************/
15 #include "rt_config.h"
16 ! /* genuine hack - no longer defined in 2.6.31 */
17 ! #ifndef FIRMWARE_NAME_MAX
18 ! #define FIRMWARE_NAME_MAX 30
19 ! #endif
21 ULONG RTDebugLevel = RT_DEBUG_OFF;
22 static ULONG debug = RT_DEBUG_OFF;
23 ***************
24 *** 58,64 ****
25 MODULE_LICENSE("GPL");
27 MODULE_PARM_DESC(debug, "Debug mask: n selects filter, 0 for none");
28 ! MODULE_PARM_DESC(ifname, "Network device name (default rausb%d)");
29 MODULE_PARM_DESC(firmName, "Permit to load a different firmware: (default: rt73.bin) ");
30 MODULE_PARM_DESC(txPowerTuning, "Adds the given value to the card's default Transmit Power. CAN DAMAGE YOUR HARDWARE!");
32 --- 61,67 ----
33 MODULE_LICENSE("GPL");
35 MODULE_PARM_DESC(debug, "Debug mask: n selects filter, 0 for none");
36 ! MODULE_PARM_DESC(ifname, "Network device name (default ralan%d)");
37 MODULE_PARM_DESC(firmName, "Permit to load a different firmware: (default: rt73.bin) ");
38 MODULE_PARM_DESC(txPowerTuning, "Adds the given value to the card's default Transmit Power. CAN DAMAGE YOUR HARDWARE!");
40 ***************
41 *** 177,182 ****
42 --- 180,206 ----
43 return &pAd->stats;
46 + /* for support of netdev_ops */
47 + /*
48 + * since COMPAT_NET_DEV_OPS has been removed from the kernel, we're kinda stuck with using the new
49 + * net_device_ops API. This change occured at 2.6.31. This supports the new
50 + * interface
51 + */
52 + static int usb_rtusb_open(struct net_device *net_dev);
53 + static int usb_rtusb_close(struct net_device *net_dev);
54 + struct net_device_stats *rt73_get_ether_stats(
55 + IN struct net_device *net_dev);
56 + static const struct net_device_ops rt73_netdev_ops = {
57 + .ndo_open = usb_rtusb_open,
58 + .ndo_stop = usb_rtusb_close,
59 + .ndo_start_xmit = RTMPSendPackets,
60 + .ndo_tx_timeout = 0,
61 + .ndo_set_multicast_list = 0,
62 + .ndo_do_ioctl = rt73_ioctl,
63 + .ndo_get_stats = rt73_get_ether_stats,
64 + .ndo_set_mac_address = 0,
65 + .ndo_change_mtu = 0,
66 + };
67 #if WIRELESS_EXT >= 12
69 ========================================================================
70 ***************
71 *** 1899,1904 ****
72 --- 1923,1930 ----
75 pAd = get_netdev_priv(netdev);
76 + /* added for new kernel api */
77 + netdev->netdev_ops = &rt73_netdev_ops;
78 //netdev->priv = pAd; //Not needed, because of using alloc_etherdev() now.
79 pAd->net_dev = netdev;
80 netif_stop_queue(netdev);
81 ***************
82 *** 1941,1947 ****
83 struct usb_endpoint_descriptor *ep;
85 if (ifname == NULL)
86 ! strcpy(netdev->name, "rausb%d");
87 else
88 strncpy(netdev->name, ifname, IFNAMSIZ);
90 --- 1967,1973 ----
91 struct usb_endpoint_descriptor *ep;
93 if (ifname == NULL)
94 ! strcpy(netdev->name, "ralan%d");
95 else
96 strncpy(netdev->name, ifname, IFNAMSIZ);
98 ***************
99 *** 2113,2120 ****
100 KPRINT(KERN_CRIT, "alloc_etherdev failed\n");
101 goto out_nonetdev;
104 pAd = get_netdev_priv(netdev);
105 //netdev->priv = pAd; //Not needed, because of using alloc_etherdev() now.
106 pAd->net_dev = netdev;
107 netif_stop_queue(netdev);
108 --- 2139,2147 ----
109 KPRINT(KERN_CRIT, "alloc_etherdev failed\n");
110 goto out_nonetdev;
112 pAd = get_netdev_priv(netdev);
113 + /* added to support new kernel API 04-nov-2009 */
114 + netdev->netdev_ops = &rt73_netdev_ops;
115 //netdev->priv = pAd; //Not needed, because of using alloc_etherdev() now.
116 pAd->net_dev = netdev;
117 netif_stop_queue(netdev);
118 ***************
119 *** 2122,2140 ****
120 pAd->pUsb_Dev = dev;
121 SET_MODULE_OWNER(netdev);
122 ether_setup(netdev);
124 netdev->open = usb_rtusb_open;
125 netdev->stop = usb_rtusb_close;
126 netdev->hard_start_xmit = RTMPSendPackets;
127 netdev->get_stats = rt73_get_ether_stats;
129 #if WIRELESS_EXT >= 12
130 #if WIRELESS_EXT < 17
131 netdev->get_wireless_stats = rt73_get_wireless_stats;
132 #endif
133 netdev->wireless_handlers = (struct iw_handler_def *) &rt73_iw_handler_def;
134 #endif
135 ! netdev->do_ioctl = rt73_ioctl;
137 netdev->hard_header_len = 14;
138 netdev->mtu = 1500;
139 --- 2149,2171 ----
140 pAd->pUsb_Dev = dev;
141 SET_MODULE_OWNER(netdev);
142 ether_setup(netdev);
143 ! /* is this right? */
144 ! netdev->watchdog_timeo = 5 * HZ;
145 ! /* 03-nov-2009 - removed because no more CONFIG_COMPAT_NET_DEV_OPS */
146 ! /*
147 netdev->open = usb_rtusb_open;
148 netdev->stop = usb_rtusb_close;
149 netdev->hard_start_xmit = RTMPSendPackets;
150 netdev->get_stats = rt73_get_ether_stats;
151 ! */
152 #if WIRELESS_EXT >= 12
153 #if WIRELESS_EXT < 17
154 netdev->get_wireless_stats = rt73_get_wireless_stats;
155 #endif
156 netdev->wireless_handlers = (struct iw_handler_def *) &rt73_iw_handler_def;
157 #endif
158 ! /* 03-nov-2009 - removed because no more CONFIG_COMPAT_NET_DEV_OPS */
159 ! /* netdev->do_ioctl = rt73_ioctl; */
161 netdev->hard_header_len = 14;
162 netdev->mtu = 1500;