diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2009-11-23 16:44:52 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-28 15:04:38 -0500 |
commit | e6218cc47bd54710dc523e8c983ceddba625e3ae (patch) | |
tree | 5ea8f107baab70b268eb0cc8d71b15a57838eb89 /drivers | |
parent | 04d0362e2fa9d5f1ab560d0d59d04a535b4f3973 (diff) |
rt2x00: Centralize setting of extra TX headroom requested by rt2x00.
Set the value of extra_tx_headroom in a central place, rather than in each
of the drivers. This is preparatory for taking alignment space into account
in the TX headroom requested by rt2x00.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800usb.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 2 |
10 files changed, 16 insertions, 16 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 7f900be39e5a..e7f46405a418 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1432,7 +1432,6 @@ static int rt2400pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1432 | IEEE80211_HW_SIGNAL_DBM | | 1432 | IEEE80211_HW_SIGNAL_DBM | |
1433 | IEEE80211_HW_SUPPORTS_PS | | 1433 | IEEE80211_HW_SUPPORTS_PS | |
1434 | IEEE80211_HW_PS_NULLFUNC_STACK; | 1434 | IEEE80211_HW_PS_NULLFUNC_STACK; |
1435 | rt2x00dev->hw->extra_tx_headroom = 0; | ||
1436 | 1435 | ||
1437 | SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); | 1436 | SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); |
1438 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, | 1437 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, |
@@ -1629,6 +1628,7 @@ static const struct rt2x00_ops rt2400pci_ops = { | |||
1629 | .eeprom_size = EEPROM_SIZE, | 1628 | .eeprom_size = EEPROM_SIZE, |
1630 | .rf_size = RF_SIZE, | 1629 | .rf_size = RF_SIZE, |
1631 | .tx_queues = NUM_TX_QUEUES, | 1630 | .tx_queues = NUM_TX_QUEUES, |
1631 | .extra_tx_headroom = 0, | ||
1632 | .rx = &rt2400pci_queue_rx, | 1632 | .rx = &rt2400pci_queue_rx, |
1633 | .tx = &rt2400pci_queue_tx, | 1633 | .tx = &rt2400pci_queue_tx, |
1634 | .bcn = &rt2400pci_queue_bcn, | 1634 | .bcn = &rt2400pci_queue_bcn, |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 30960fd8a449..408fcfc120f5 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1733,8 +1733,6 @@ static int rt2500pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1733 | IEEE80211_HW_SUPPORTS_PS | | 1733 | IEEE80211_HW_SUPPORTS_PS | |
1734 | IEEE80211_HW_PS_NULLFUNC_STACK; | 1734 | IEEE80211_HW_PS_NULLFUNC_STACK; |
1735 | 1735 | ||
1736 | rt2x00dev->hw->extra_tx_headroom = 0; | ||
1737 | |||
1738 | SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); | 1736 | SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); |
1739 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, | 1737 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, |
1740 | rt2x00_eeprom_addr(rt2x00dev, | 1738 | rt2x00_eeprom_addr(rt2x00dev, |
@@ -1928,6 +1926,7 @@ static const struct rt2x00_ops rt2500pci_ops = { | |||
1928 | .eeprom_size = EEPROM_SIZE, | 1926 | .eeprom_size = EEPROM_SIZE, |
1929 | .rf_size = RF_SIZE, | 1927 | .rf_size = RF_SIZE, |
1930 | .tx_queues = NUM_TX_QUEUES, | 1928 | .tx_queues = NUM_TX_QUEUES, |
1929 | .extra_tx_headroom = 0, | ||
1931 | .rx = &rt2500pci_queue_rx, | 1930 | .rx = &rt2500pci_queue_rx, |
1932 | .tx = &rt2500pci_queue_tx, | 1931 | .tx = &rt2500pci_queue_tx, |
1933 | .bcn = &rt2500pci_queue_bcn, | 1932 | .bcn = &rt2500pci_queue_bcn, |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 02290f68113e..83f2592c59de 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1656,8 +1656,6 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1656 | IEEE80211_HW_SUPPORTS_PS | | 1656 | IEEE80211_HW_SUPPORTS_PS | |
1657 | IEEE80211_HW_PS_NULLFUNC_STACK; | 1657 | IEEE80211_HW_PS_NULLFUNC_STACK; |
1658 | 1658 | ||
1659 | rt2x00dev->hw->extra_tx_headroom = TXD_DESC_SIZE; | ||
1660 | |||
1661 | SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); | 1659 | SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); |
1662 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, | 1660 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, |
1663 | rt2x00_eeprom_addr(rt2x00dev, | 1661 | rt2x00_eeprom_addr(rt2x00dev, |
@@ -1829,6 +1827,7 @@ static const struct rt2x00_ops rt2500usb_ops = { | |||
1829 | .eeprom_size = EEPROM_SIZE, | 1827 | .eeprom_size = EEPROM_SIZE, |
1830 | .rf_size = RF_SIZE, | 1828 | .rf_size = RF_SIZE, |
1831 | .tx_queues = NUM_TX_QUEUES, | 1829 | .tx_queues = NUM_TX_QUEUES, |
1830 | .extra_tx_headroom = TXD_DESC_SIZE, | ||
1832 | .rx = &rt2500usb_queue_rx, | 1831 | .rx = &rt2500usb_queue_rx, |
1833 | .tx = &rt2500usb_queue_tx, | 1832 | .tx = &rt2500usb_queue_tx, |
1834 | .bcn = &rt2500usb_queue_bcn, | 1833 | .bcn = &rt2500usb_queue_bcn, |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 02ffcf54bf09..eb1e1d00bec3 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -2030,12 +2030,6 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2030 | IEEE80211_HW_SUPPORTS_PS | | 2030 | IEEE80211_HW_SUPPORTS_PS | |
2031 | IEEE80211_HW_PS_NULLFUNC_STACK; | 2031 | IEEE80211_HW_PS_NULLFUNC_STACK; |
2032 | 2032 | ||
2033 | if (rt2x00_intf_is_usb(rt2x00dev)) | ||
2034 | rt2x00dev->hw->extra_tx_headroom = | ||
2035 | TXINFO_DESC_SIZE + TXWI_DESC_SIZE; | ||
2036 | else if (rt2x00_intf_is_pci(rt2x00dev)) | ||
2037 | rt2x00dev->hw->extra_tx_headroom = TXWI_DESC_SIZE; | ||
2038 | |||
2039 | SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); | 2033 | SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); |
2040 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, | 2034 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, |
2041 | rt2x00_eeprom_addr(rt2x00dev, | 2035 | rt2x00_eeprom_addr(rt2x00dev, |
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 029a45f0cb99..dfc886fcb44d 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -652,7 +652,7 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
652 | { | 652 | { |
653 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 653 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); |
654 | __le32 *txd = skbdesc->desc; | 654 | __le32 *txd = skbdesc->desc; |
655 | __le32 *txwi = (__le32 *)(skb->data - rt2x00dev->hw->extra_tx_headroom); | 655 | __le32 *txwi = (__le32 *)(skb->data - rt2x00dev->ops->extra_tx_headroom); |
656 | u32 word; | 656 | u32 word; |
657 | 657 | ||
658 | /* | 658 | /* |
@@ -725,14 +725,14 @@ static void rt2800pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
725 | rt2x00_set_field32(&word, TXD_W1_BURST, | 725 | rt2x00_set_field32(&word, TXD_W1_BURST, |
726 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); | 726 | test_bit(ENTRY_TXD_BURST, &txdesc->flags)); |
727 | rt2x00_set_field32(&word, TXD_W1_SD_LEN0, | 727 | rt2x00_set_field32(&word, TXD_W1_SD_LEN0, |
728 | rt2x00dev->hw->extra_tx_headroom); | 728 | rt2x00dev->ops->extra_tx_headroom); |
729 | rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0); | 729 | rt2x00_set_field32(&word, TXD_W1_LAST_SEC0, 0); |
730 | rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0); | 730 | rt2x00_set_field32(&word, TXD_W1_DMA_DONE, 0); |
731 | rt2x00_desc_write(txd, 1, word); | 731 | rt2x00_desc_write(txd, 1, word); |
732 | 732 | ||
733 | rt2x00_desc_read(txd, 2, &word); | 733 | rt2x00_desc_read(txd, 2, &word); |
734 | rt2x00_set_field32(&word, TXD_W2_SD_PTR1, | 734 | rt2x00_set_field32(&word, TXD_W2_SD_PTR1, |
735 | skbdesc->skb_dma + rt2x00dev->hw->extra_tx_headroom); | 735 | skbdesc->skb_dma + rt2x00dev->ops->extra_tx_headroom); |
736 | rt2x00_desc_write(txd, 2, word); | 736 | rt2x00_desc_write(txd, 2, word); |
737 | 737 | ||
738 | rt2x00_desc_read(txd, 3, &word); | 738 | rt2x00_desc_read(txd, 3, &word); |
@@ -1207,6 +1207,7 @@ static const struct rt2x00_ops rt2800pci_ops = { | |||
1207 | .eeprom_size = EEPROM_SIZE, | 1207 | .eeprom_size = EEPROM_SIZE, |
1208 | .rf_size = RF_SIZE, | 1208 | .rf_size = RF_SIZE, |
1209 | .tx_queues = NUM_TX_QUEUES, | 1209 | .tx_queues = NUM_TX_QUEUES, |
1210 | .extra_tx_headroom = TXWI_DESC_SIZE, | ||
1210 | .rx = &rt2800pci_queue_rx, | 1211 | .rx = &rt2800pci_queue_rx, |
1211 | .tx = &rt2800pci_queue_tx, | 1212 | .tx = &rt2800pci_queue_tx, |
1212 | .bcn = &rt2800pci_queue_bcn, | 1213 | .bcn = &rt2800pci_queue_bcn, |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 208316af6d99..af85d18cdbe7 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -796,6 +796,7 @@ static const struct rt2x00_ops rt2800usb_ops = { | |||
796 | .eeprom_size = EEPROM_SIZE, | 796 | .eeprom_size = EEPROM_SIZE, |
797 | .rf_size = RF_SIZE, | 797 | .rf_size = RF_SIZE, |
798 | .tx_queues = NUM_TX_QUEUES, | 798 | .tx_queues = NUM_TX_QUEUES, |
799 | .extra_tx_headroom = TXINFO_DESC_SIZE + TXWI_DESC_SIZE, | ||
799 | .rx = &rt2800usb_queue_rx, | 800 | .rx = &rt2800usb_queue_rx, |
800 | .tx = &rt2800usb_queue_tx, | 801 | .tx = &rt2800usb_queue_tx, |
801 | .bcn = &rt2800usb_queue_bcn, | 802 | .bcn = &rt2800usb_queue_bcn, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 1cbb7ac2f32f..4d841c07c970 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -588,6 +588,7 @@ struct rt2x00_ops { | |||
588 | const unsigned int eeprom_size; | 588 | const unsigned int eeprom_size; |
589 | const unsigned int rf_size; | 589 | const unsigned int rf_size; |
590 | const unsigned int tx_queues; | 590 | const unsigned int tx_queues; |
591 | const unsigned int extra_tx_headroom; | ||
591 | const struct data_queue_desc *rx; | 592 | const struct data_queue_desc *rx; |
592 | const struct data_queue_desc *tx; | 593 | const struct data_queue_desc *tx; |
593 | const struct data_queue_desc *bcn; | 594 | const struct data_queue_desc *bcn; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 4a4b7e42fe6e..06c43ca39bf8 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -684,6 +684,11 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
684 | rt2x00dev->hw->queues = rt2x00dev->ops->tx_queues; | 684 | rt2x00dev->hw->queues = rt2x00dev->ops->tx_queues; |
685 | 685 | ||
686 | /* | 686 | /* |
687 | * Initialize extra TX headroom required. | ||
688 | */ | ||
689 | rt2x00dev->hw->extra_tx_headroom = rt2x00dev->ops->extra_tx_headroom; | ||
690 | |||
691 | /* | ||
687 | * Register HW. | 692 | * Register HW. |
688 | */ | 693 | */ |
689 | status = ieee80211_register_hw(rt2x00dev->hw); | 694 | status = ieee80211_register_hw(rt2x00dev->hw); |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 4cb9afeed9d7..687e17dc2e9f 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2546,7 +2546,6 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2546 | IEEE80211_HW_SIGNAL_DBM | | 2546 | IEEE80211_HW_SIGNAL_DBM | |
2547 | IEEE80211_HW_SUPPORTS_PS | | 2547 | IEEE80211_HW_SUPPORTS_PS | |
2548 | IEEE80211_HW_PS_NULLFUNC_STACK; | 2548 | IEEE80211_HW_PS_NULLFUNC_STACK; |
2549 | rt2x00dev->hw->extra_tx_headroom = 0; | ||
2550 | 2549 | ||
2551 | SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); | 2550 | SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); |
2552 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, | 2551 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, |
@@ -2794,6 +2793,7 @@ static const struct rt2x00_ops rt61pci_ops = { | |||
2794 | .eeprom_size = EEPROM_SIZE, | 2793 | .eeprom_size = EEPROM_SIZE, |
2795 | .rf_size = RF_SIZE, | 2794 | .rf_size = RF_SIZE, |
2796 | .tx_queues = NUM_TX_QUEUES, | 2795 | .tx_queues = NUM_TX_QUEUES, |
2796 | .extra_tx_headroom = 0, | ||
2797 | .rx = &rt61pci_queue_rx, | 2797 | .rx = &rt61pci_queue_rx, |
2798 | .tx = &rt61pci_queue_tx, | 2798 | .tx = &rt61pci_queue_tx, |
2799 | .bcn = &rt61pci_queue_bcn, | 2799 | .bcn = &rt61pci_queue_bcn, |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index d13a051b39af..ced3b6ab5e16 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2069,7 +2069,6 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2069 | IEEE80211_HW_SIGNAL_DBM | | 2069 | IEEE80211_HW_SIGNAL_DBM | |
2070 | IEEE80211_HW_SUPPORTS_PS | | 2070 | IEEE80211_HW_SUPPORTS_PS | |
2071 | IEEE80211_HW_PS_NULLFUNC_STACK; | 2071 | IEEE80211_HW_PS_NULLFUNC_STACK; |
2072 | rt2x00dev->hw->extra_tx_headroom = TXD_DESC_SIZE; | ||
2073 | 2072 | ||
2074 | SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); | 2073 | SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); |
2075 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, | 2074 | SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, |
@@ -2312,6 +2311,7 @@ static const struct rt2x00_ops rt73usb_ops = { | |||
2312 | .eeprom_size = EEPROM_SIZE, | 2311 | .eeprom_size = EEPROM_SIZE, |
2313 | .rf_size = RF_SIZE, | 2312 | .rf_size = RF_SIZE, |
2314 | .tx_queues = NUM_TX_QUEUES, | 2313 | .tx_queues = NUM_TX_QUEUES, |
2314 | .extra_tx_headroom = TXD_DESC_SIZE, | ||
2315 | .rx = &rt73usb_queue_rx, | 2315 | .rx = &rt73usb_queue_rx, |
2316 | .tx = &rt73usb_queue_tx, | 2316 | .tx = &rt73usb_queue_tx, |
2317 | .bcn = &rt73usb_queue_bcn, | 2317 | .bcn = &rt73usb_queue_bcn, |