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
5 ***************************************************************************/
10 ULONG RTDebugLevel = RT_DEBUG_OFF;
11 static ULONG debug = RT_DEBUG_OFF;
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
21 ULONG RTDebugLevel = RT_DEBUG_OFF;
22 static ULONG debug = RT_DEBUG_OFF;
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!");
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!");
46 + /* for support of netdev_ops */
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
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,
67 #if WIRELESS_EXT >= 12
69 ========================================================================
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);
83 struct usb_endpoint_descriptor *ep;
86 ! strcpy(netdev->name, "rausb%d");
88 strncpy(netdev->name, ifname, IFNAMSIZ);
91 struct usb_endpoint_descriptor *ep;
94 ! strcpy(netdev->name, "ralan%d");
96 strncpy(netdev->name, ifname, IFNAMSIZ);
100 KPRINT(KERN_CRIT, "alloc_etherdev failed\n");
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);
109 KPRINT(KERN_CRIT, "alloc_etherdev failed\n");
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);
121 SET_MODULE_OWNER(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;
133 netdev->wireless_handlers = (struct iw_handler_def *) &rt73_iw_handler_def;
135 ! netdev->do_ioctl = rt73_ioctl;
137 netdev->hard_header_len = 14;
141 SET_MODULE_OWNER(netdev);
143 ! /* is this right? */
144 ! netdev->watchdog_timeo = 5 * HZ;
145 ! /* 03-nov-2009 - removed because no more CONFIG_COMPAT_NET_DEV_OPS */
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;
152 #if WIRELESS_EXT >= 12
153 #if WIRELESS_EXT < 17
154 netdev->get_wireless_stats = rt73_get_wireless_stats;
156 netdev->wireless_handlers = (struct iw_handler_def *) &rt73_iw_handler_def;
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;