diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2010-08-06 14:49:27 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-16 15:26:43 -0400 |
commit | e5ef5bad345f97f1fef7ccdc01a88c298629a5d9 (patch) | |
tree | c8bd82d0d4eabf9d71d765992b970df67486d857 | |
parent | 0856d9c04a1655612abd96793c1e8b1c1792457e (diff) |
rt2x00: Remove ieee80211_rx_status from rt2x00_dev
rt2x00 was keeping a copy of ieee80211_rx_status embedded
into the rt2x00_dev structure. For each RX frame, this structure
was copied into the skb->cb where mac80211 would handle it further.
However at the moment only the fields current band, and frequency
were updated. Whereas the band was already provided directly within
the rt2x00_dev structure. Save a memcpy action, and reduce memory
a bit, by adding a curr_freq field to rt2x00_dev, and completely
remove the ieee80211_rx_status structure from rt2x00_dev.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00config.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 4 |
6 files changed, 16 insertions, 20 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 827a2580893b..3a150d3a9d9f 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -494,7 +494,7 @@ static int rt2800_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxwi_w2) | |||
494 | u8 offset1; | 494 | u8 offset1; |
495 | u8 offset2; | 495 | u8 offset2; |
496 | 496 | ||
497 | if (rt2x00dev->rx_status.band == IEEE80211_BAND_2GHZ) { | 497 | if (rt2x00dev->curr_band == IEEE80211_BAND_2GHZ) { |
498 | rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_BG, &eeprom); | 498 | rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_BG, &eeprom); |
499 | offset0 = rt2x00_get_field16(eeprom, EEPROM_RSSI_BG_OFFSET0); | 499 | offset0 = rt2x00_get_field16(eeprom, EEPROM_RSSI_BG_OFFSET0); |
500 | offset1 = rt2x00_get_field16(eeprom, EEPROM_RSSI_BG_OFFSET1); | 500 | offset1 = rt2x00_get_field16(eeprom, EEPROM_RSSI_BG_OFFSET1); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index edfc2b759282..8c65244a847a 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -699,6 +699,7 @@ struct rt2x00_dev { | |||
699 | struct ieee80211_hw *hw; | 699 | struct ieee80211_hw *hw; |
700 | struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; | 700 | struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; |
701 | enum ieee80211_band curr_band; | 701 | enum ieee80211_band curr_band; |
702 | int curr_freq; | ||
702 | 703 | ||
703 | /* | 704 | /* |
704 | * If enabled, the debugfs interface structures | 705 | * If enabled, the debugfs interface structures |
@@ -851,11 +852,6 @@ struct rt2x00_dev { | |||
851 | struct ieee80211_low_level_stats low_level_stats; | 852 | struct ieee80211_low_level_stats low_level_stats; |
852 | 853 | ||
853 | /* | 854 | /* |
854 | * RX configuration information. | ||
855 | */ | ||
856 | struct ieee80211_rx_status rx_status; | ||
857 | |||
858 | /* | ||
859 | * Scheduled work. | 855 | * Scheduled work. |
860 | * NOTE: intf_work will use ieee80211_iterate_active_interfaces() | 856 | * NOTE: intf_work will use ieee80211_iterate_active_interfaces() |
861 | * which means it cannot be placed on the hw->workqueue | 857 | * which means it cannot be placed on the hw->workqueue |
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c index fb23af40008b..34f34fa7f53a 100644 --- a/drivers/net/wireless/rt2x00/rt2x00config.c +++ b/drivers/net/wireless/rt2x00/rt2x00config.c | |||
@@ -201,10 +201,8 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, | |||
201 | rt2x00link_reset_tuner(rt2x00dev, false); | 201 | rt2x00link_reset_tuner(rt2x00dev, false); |
202 | 202 | ||
203 | rt2x00dev->curr_band = conf->channel->band; | 203 | rt2x00dev->curr_band = conf->channel->band; |
204 | rt2x00dev->curr_freq = conf->channel->center_freq; | ||
204 | rt2x00dev->tx_power = conf->power_level; | 205 | rt2x00dev->tx_power = conf->power_level; |
205 | rt2x00dev->short_retry = conf->short_frame_max_tx_count; | 206 | rt2x00dev->short_retry = conf->short_frame_max_tx_count; |
206 | rt2x00dev->long_retry = conf->long_frame_max_tx_count; | 207 | rt2x00dev->long_retry = conf->long_frame_max_tx_count; |
207 | |||
208 | rt2x00dev->rx_status.band = conf->channel->band; | ||
209 | rt2x00dev->rx_status.freq = conf->channel->center_freq; | ||
210 | } | 208 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 6499cc416ca3..e692608bee8b 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -464,7 +464,7 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev, | |||
464 | { | 464 | { |
465 | struct rxdone_entry_desc rxdesc; | 465 | struct rxdone_entry_desc rxdesc; |
466 | struct sk_buff *skb; | 466 | struct sk_buff *skb; |
467 | struct ieee80211_rx_status *rx_status = &rt2x00dev->rx_status; | 467 | struct ieee80211_rx_status *rx_status; |
468 | unsigned int header_length; | 468 | unsigned int header_length; |
469 | int rate_idx; | 469 | int rate_idx; |
470 | 470 | ||
@@ -535,19 +535,21 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev, | |||
535 | */ | 535 | */ |
536 | rt2x00link_update_stats(rt2x00dev, entry->skb, &rxdesc); | 536 | rt2x00link_update_stats(rt2x00dev, entry->skb, &rxdesc); |
537 | rt2x00debug_update_crypto(rt2x00dev, &rxdesc); | 537 | rt2x00debug_update_crypto(rt2x00dev, &rxdesc); |
538 | rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_RXDONE, entry->skb); | ||
538 | 539 | ||
540 | /* | ||
541 | * Initialize RX status information, and send frame | ||
542 | * to mac80211. | ||
543 | */ | ||
544 | rx_status = IEEE80211_SKB_RXCB(entry->skb); | ||
539 | rx_status->mactime = rxdesc.timestamp; | 545 | rx_status->mactime = rxdesc.timestamp; |
546 | rx_status->band = rt2x00dev->curr_band; | ||
547 | rx_status->freq = rt2x00dev->curr_freq; | ||
540 | rx_status->rate_idx = rate_idx; | 548 | rx_status->rate_idx = rate_idx; |
541 | rx_status->signal = rxdesc.rssi; | 549 | rx_status->signal = rxdesc.rssi; |
542 | rx_status->flag = rxdesc.flags; | 550 | rx_status->flag = rxdesc.flags; |
543 | rx_status->antenna = rt2x00dev->link.ant.active.rx; | 551 | rx_status->antenna = rt2x00dev->link.ant.active.rx; |
544 | 552 | ||
545 | /* | ||
546 | * Send frame to mac80211 & debugfs. | ||
547 | * mac80211 will clean up the skb structure. | ||
548 | */ | ||
549 | rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_RXDONE, entry->skb); | ||
550 | memcpy(IEEE80211_SKB_RXCB(entry->skb), rx_status, sizeof(*rx_status)); | ||
551 | ieee80211_rx_ni(rt2x00dev->hw, entry->skb); | 553 | ieee80211_rx_ni(rt2x00dev->hw, entry->skb); |
552 | 554 | ||
553 | /* | 555 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index dc6f3ebb8376..cff503faac65 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -1050,7 +1050,7 @@ static void rt61pci_link_tuner(struct rt2x00_dev *rt2x00dev, | |||
1050 | /* | 1050 | /* |
1051 | * Determine r17 bounds. | 1051 | * Determine r17 bounds. |
1052 | */ | 1052 | */ |
1053 | if (rt2x00dev->rx_status.band == IEEE80211_BAND_5GHZ) { | 1053 | if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { |
1054 | low_bound = 0x28; | 1054 | low_bound = 0x28; |
1055 | up_bound = 0x48; | 1055 | up_bound = 0x48; |
1056 | if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) { | 1056 | if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) { |
@@ -1972,7 +1972,7 @@ static int rt61pci_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxd_w1) | |||
1972 | return 0; | 1972 | return 0; |
1973 | } | 1973 | } |
1974 | 1974 | ||
1975 | if (rt2x00dev->rx_status.band == IEEE80211_BAND_5GHZ) { | 1975 | if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { |
1976 | if (lna == 3 || lna == 2) | 1976 | if (lna == 3 || lna == 2) |
1977 | offset += 10; | 1977 | offset += 10; |
1978 | } | 1978 | } |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index aa9de18fd410..c65529678fbd 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -929,7 +929,7 @@ static void rt73usb_link_tuner(struct rt2x00_dev *rt2x00dev, | |||
929 | /* | 929 | /* |
930 | * Determine r17 bounds. | 930 | * Determine r17 bounds. |
931 | */ | 931 | */ |
932 | if (rt2x00dev->rx_status.band == IEEE80211_BAND_5GHZ) { | 932 | if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { |
933 | low_bound = 0x28; | 933 | low_bound = 0x28; |
934 | up_bound = 0x48; | 934 | up_bound = 0x48; |
935 | 935 | ||
@@ -1597,7 +1597,7 @@ static int rt73usb_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxd_w1) | |||
1597 | return 0; | 1597 | return 0; |
1598 | } | 1598 | } |
1599 | 1599 | ||
1600 | if (rt2x00dev->rx_status.band == IEEE80211_BAND_5GHZ) { | 1600 | if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { |
1601 | if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) { | 1601 | if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) { |
1602 | if (lna == 3 || lna == 2) | 1602 | if (lna == 3 || lna == 2) |
1603 | offset += 10; | 1603 | offset += 10; |