aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorStanislaw Gruszka <stf_xl@wp.pl>2013-03-16 14:19:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-03-18 16:38:35 -0400
commit613c75fc4ee854e84f737ea8906a94104879c4c4 (patch)
treeba7d44ecd0326c122eff992d5aa3d3d6e19c4401 /drivers/net/wireless/rt2x00
parent3d81535ea5940446510a8a5cee1c6ad23c90c753 (diff)
rt2800: 5592: TXWI & RXWI descriptors size
Based on: TXWI_STRUC RXWI_STRUC from: DPO_RT5572_LinuxSTA_2.6.1.3_20121022/include/chip/rtmp_mac.h Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c5
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c5
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c53
4 files changed, 58 insertions, 7 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index 6105243f215f..a7630d5ec892 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -2628,6 +2628,8 @@ struct mac_iveiv_entry {
2628#define TXWI_DESC_SIZE (4 * sizeof(__le32)) 2628#define TXWI_DESC_SIZE (4 * sizeof(__le32))
2629#define RXWI_DESC_SIZE (4 * sizeof(__le32)) 2629#define RXWI_DESC_SIZE (4 * sizeof(__le32))
2630 2630
2631#define TXWI_DESC_SIZE_5592 (5 * sizeof(__le32))
2632#define RXWI_DESC_SIZE_5592 (6 * sizeof(__le32))
2631/* 2633/*
2632 * TX WI structure 2634 * TX WI structure
2633 */ 2635 */
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 5adb92b387dc..9b1f293b4833 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -676,11 +676,6 @@ void rt2800_process_rxwi(struct queue_entry *entry,
676 * Convert descriptor AGC value to RSSI value. 676 * Convert descriptor AGC value to RSSI value.
677 */ 677 */
678 rxdesc->rssi = rt2800_agc_to_rssi(entry->queue->rt2x00dev, word); 678 rxdesc->rssi = rt2800_agc_to_rssi(entry->queue->rt2x00dev, word);
679
680 /*
681 * Remove RXWI descriptor from start of buffer.
682 */
683 skb_pull(entry->skb, RXWI_DESC_SIZE);
684} 679}
685EXPORT_SYMBOL_GPL(rt2800_process_rxwi); 680EXPORT_SYMBOL_GPL(rt2800_process_rxwi);
686 681
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 80cf8d745c6f..f732ded8f1ba 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -729,6 +729,11 @@ static void rt2800pci_fill_rxdone(struct queue_entry *entry,
729 * Process the RXWI structure that is at the start of the buffer. 729 * Process the RXWI structure that is at the start of the buffer.
730 */ 730 */
731 rt2800_process_rxwi(entry, rxdesc); 731 rt2800_process_rxwi(entry, rxdesc);
732
733 /*
734 * Remove RXWI descriptor from start of buffer.
735 */
736 skb_pull(entry->skb, RXWI_DESC_SIZE);
732} 737}
733 738
734/* 739/*
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index f9ca79503252..9b1ca672f6ca 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -485,7 +485,7 @@ static void rt2800usb_write_tx_desc(struct queue_entry *entry,
485 */ 485 */
486 skbdesc->flags |= SKBDESC_DESC_IN_SKB; 486 skbdesc->flags |= SKBDESC_DESC_IN_SKB;
487 skbdesc->desc = txi; 487 skbdesc->desc = txi;
488 skbdesc->desc_len = TXINFO_DESC_SIZE + TXWI_DESC_SIZE; 488 skbdesc->desc_len = entry->queue->desc_size;
489} 489}
490 490
491/* 491/*
@@ -730,6 +730,11 @@ static void rt2800usb_fill_rxdone(struct queue_entry *entry,
730 * Process the RXWI structure. 730 * Process the RXWI structure.
731 */ 731 */
732 rt2800_process_rxwi(entry, rxdesc); 732 rt2800_process_rxwi(entry, rxdesc);
733
734 /*
735 * Remove RXWI descriptor from start of buffer.
736 */
737 skb_pull(entry->skb, entry->queue->desc_size - RXINFO_DESC_SIZE);
733} 738}
734 739
735/* 740/*
@@ -890,6 +895,47 @@ static const struct rt2x00_ops rt2800usb_ops = {
890#endif /* CONFIG_RT2X00_LIB_DEBUGFS */ 895#endif /* CONFIG_RT2X00_LIB_DEBUGFS */
891}; 896};
892 897
898static const struct data_queue_desc rt2800usb_queue_rx_5592 = {
899 .entry_num = 128,
900 .data_size = AGGREGATION_SIZE,
901 .desc_size = RXINFO_DESC_SIZE + RXWI_DESC_SIZE_5592,
902 .priv_size = sizeof(struct queue_entry_priv_usb),
903};
904
905static const struct data_queue_desc rt2800usb_queue_tx_5592 = {
906 .entry_num = 16,
907 .data_size = AGGREGATION_SIZE,
908 .desc_size = TXINFO_DESC_SIZE + TXWI_DESC_SIZE_5592,
909 .priv_size = sizeof(struct queue_entry_priv_usb),
910};
911
912static const struct data_queue_desc rt2800usb_queue_bcn_5592 = {
913 .entry_num = 8,
914 .data_size = MGMT_FRAME_SIZE,
915 .desc_size = TXINFO_DESC_SIZE + TXWI_DESC_SIZE_5592,
916 .priv_size = sizeof(struct queue_entry_priv_usb),
917};
918
919
920static const struct rt2x00_ops rt2800usb_ops_5592 = {
921 .name = KBUILD_MODNAME,
922 .drv_data_size = sizeof(struct rt2800_drv_data),
923 .max_ap_intf = 8,
924 .eeprom_size = EEPROM_SIZE,
925 .rf_size = RF_SIZE,
926 .tx_queues = NUM_TX_QUEUES,
927 .extra_tx_headroom = TXINFO_DESC_SIZE + TXWI_DESC_SIZE_5592,
928 .rx = &rt2800usb_queue_rx_5592,
929 .tx = &rt2800usb_queue_tx_5592,
930 .bcn = &rt2800usb_queue_bcn_5592,
931 .lib = &rt2800usb_rt2x00_ops,
932 .drv = &rt2800usb_rt2800_ops,
933 .hw = &rt2800usb_mac80211_ops,
934#ifdef CONFIG_RT2X00_LIB_DEBUGFS
935 .debugfs = &rt2800_rt2x00debug,
936#endif /* CONFIG_RT2X00_LIB_DEBUGFS */
937};
938
893/* 939/*
894 * rt2800usb module information. 940 * rt2800usb module information.
895 */ 941 */
@@ -1201,7 +1247,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
1201 { USB_DEVICE(0x148f, 0x5372) }, 1247 { USB_DEVICE(0x148f, 0x5372) },
1202#endif 1248#endif
1203#ifdef CONFIG_RT2800USB_RT55XX 1249#ifdef CONFIG_RT2800USB_RT55XX
1204 { USB_DEVICE(0x148f, 0x5572) }, 1250 { USB_DEVICE(0x148f, 0x5572), .driver_info = 5592 },
1205#endif 1251#endif
1206#ifdef CONFIG_RT2800USB_UNKNOWN 1252#ifdef CONFIG_RT2800USB_UNKNOWN
1207 /* 1253 /*
@@ -1306,6 +1352,9 @@ MODULE_LICENSE("GPL");
1306static int rt2800usb_probe(struct usb_interface *usb_intf, 1352static int rt2800usb_probe(struct usb_interface *usb_intf,
1307 const struct usb_device_id *id) 1353 const struct usb_device_id *id)
1308{ 1354{
1355 if (id->driver_info == 5592)
1356 return rt2x00usb_probe(usb_intf, &rt2800usb_ops_5592);
1357
1309 return rt2x00usb_probe(usb_intf, &rt2800usb_ops); 1358 return rt2x00usb_probe(usb_intf, &rt2800usb_ops);
1310} 1359}
1311 1360