Subject: [PATCH] rt2x00: Compile fix and kernel version cleanup

From: Ivo van Doorn <[email-masked]>
Date: Fri, 28 Apr 2006 20:52:41 +0200

From: Ivo van Doorn <[email-masked]>

During CVS merge I noticed several compilation errors have sneaked
into the git version of rt2x00.
- PRIO_ENTRIES define has been removed, TX_ENTRIES should be used
- poll_delay module argument is of the type short
- Remove LINUX_VERSION_CODE checks.
- Fix missing byteordering type
- Fix typo in usb_device

Signed-off-by: Ivo van Doorn <[email-masked]>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c wireless-dev-rt2x00-cvs/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 20:49:32.000000000 +0200
+++ wireless-dev-rt2x00-cvs/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 20:50:40.000000000 +0200
@@ -1239,7 +1239,7 @@ rt2400pci_allocate_rings(struct rt2x00_p
 		ATIM_ENTRIES, DATA_FRAME_SIZE, sizeof(struct txd))
 	|| rt2400pci_alloc_ring(
 		rt2x00pci, &rt2x00pci->ring[RING_PRIO], rt2400pci_txdone,
-		PRIO_ENTRIES, DATA_FRAME_SIZE, sizeof(struct txd))
+		TX_ENTRIES, DATA_FRAME_SIZE, sizeof(struct txd))
 	|| rt2400pci_alloc_ring(
 		rt2x00pci, &rt2x00pci->ring[RING_BEACON], rt2400pci_beacondone,
 		BEACON_ENTRIES, MGMT_FRAME_SIZE, sizeof(struct txd))) {
@@ -2729,14 +2729,12 @@ MODULE_PARM_DESC(debug, "Set this parame
 #endif /* CONFIG_RT2400PCI_DEBUG */
 
 #ifdef CONFIG_RT2400PCI_BUTTON
-module_param_named(poll_delay, rt2x00_poll_delay, int, S_IRUGO);
+module_param_named(poll_delay, rt2x00_poll_delay, short, S_IRUGO);
 MODULE_PARM_DESC(debug, "Delay between WiFi button pollings (in 100ms).");
 #endif /* CONFIG_RT2400PCI_BUTTON */
 
 static struct pci_driver rt2400pci_driver = {
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 14)
 	.owner		= THIS_MODULE,
-#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 14) */
 	.name		= DRV_NAME,
 	.id_table	= rt2400pci_device_table,
 	.probe		= rt2400pci_probe,
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-rt2x00-cvs/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 20:49:45.000000000 +0200
+++ wireless-dev-rt2x00-cvs/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 20:50:39.000000000 +0200
@@ -1328,7 +1328,7 @@ rt2500pci_allocate_rings(struct rt2x00_p
 		ATIM_ENTRIES, DATA_FRAME_SIZE, sizeof(struct txd))
 	|| rt2500pci_alloc_ring(
 		rt2x00pci, &rt2x00pci->ring[RING_PRIO], rt2500pci_txdone,
-		PRIO_ENTRIES, DATA_FRAME_SIZE, sizeof(struct txd))
+		TX_ENTRIES, DATA_FRAME_SIZE, sizeof(struct txd))
 	|| rt2500pci_alloc_ring(
 		rt2x00pci, &rt2x00pci->ring[RING_BEACON], rt2500pci_beacondone,
 		BEACON_ENTRIES, MGMT_FRAME_SIZE, sizeof(struct txd))) {
@@ -3032,14 +3032,12 @@ MODULE_PARM_DESC(debug, "Set this parame
 #endif /* CONFIG_RT2500PCI_DEBUG */
 
 #ifdef CONFIG_RT2500PCI_BUTTON
-module_param_named(poll_delay, rt2x00_poll_delay, int, S_IRUGO);
+module_param_named(poll_delay, rt2x00_poll_delay, short, S_IRUGO);
 MODULE_PARM_DESC(debug, "Delay between WiFi button pollings (in 100ms).");
 #endif /* CONFIG_RT2500PCI_BUTTON */
 
 static struct pci_driver rt2500pci_driver = {
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 14)
 	.owner		= THIS_MODULE,
-#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 14) */
 	.name		= DRV_NAME,
 	.id_table	= rt2500pci_device_table,
 	.probe		= rt2500pci_probe,
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.h wireless-dev-rt2x00-cvs/drivers/net/wireless/d80211/rt2x00/rt2500pci.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.h	2006-04-28 15:58:29.000000000 +0200
+++ wireless-dev-rt2x00-cvs/drivers/net/wireless/d80211/rt2x00/rt2500pci.h	2006-04-28 20:28:58.000000000 +0200
@@ -1005,7 +1005,7 @@ struct txd{
 	__le32				word1;
 #define TXD_W1_BUFFER_ADDRESS		FIELD32(0xffffffff)
 
-	u32				word2;
+	__le32				word2;
 #define TXD_W2_IV_OFFSET		FIELD32(0x0000003f)
 #define TXD_W2_AIFS			FIELD32(0x000000c0)
 #define TXD_W2_CWMIN			FIELD32(0x00000f00)
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-rt2x00-cvs/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 20:49:59.000000000 +0200
+++ wireless-dev-rt2x00-cvs/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 20:50:39.000000000 +0200
@@ -1362,7 +1362,7 @@ rt2500usb_tx(struct net_device *net_dev,
 	struct sk_buff *skb, struct ieee80211_tx_control *control)
 {
 	struct rt2x00_usb	*rt2x00usb = ieee80211_dev_hw_data(net_dev);
-	struct usb_devive	*usb_dev =
+	struct usb_device	*usb_dev =
 		interface_to_usbdev(rt2x00usb->usb_intf);
 	struct data_ring	*ring;
 	struct data_entry	*entry;
@@ -1844,7 +1844,7 @@ rt2500usb_beacon_update(struct net_devic
 	struct sk_buff *skb, struct ieee80211_tx_control *control)
 {
 	struct rt2x00_usb	*rt2x00usb = ieee80211_dev_hw_data(net_dev);
-	struct usb_devive	*usb_dev =
+	struct usb_device	*usb_dev =
 		interface_to_usbdev(rt2x00usb->usb_intf);
 	struct data_entry	*entry;
 
@@ -2074,7 +2074,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 			channels[counter].val = vals[counter];
 	}
 
-		/*
+	/*
 	 * Set TX power, each EEPROM TXpower entry
 	 * contains the TXpower value for 2 channels.
 	 */
@@ -2628,9 +2628,7 @@ MODULE_PARM_DESC(debug, "Set this parame
 #endif /* CONFIG_RT2500USB_DEBUG */
 
 static struct usb_driver rt2500usb_driver = {
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 15)
 	.owner		= THIS_MODULE,
-#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 15) */
 	.name		= DRV_NAME,
 	.id_table	= rt2500usb_device_table,
 	.probe		= rt2500usb_probe,