diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/recv.c')
-rw-r--r-- | drivers/net/wireless/ath9k/recv.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c index 23b6f54cde5c..ec535834f961 100644 --- a/drivers/net/wireless/ath9k/recv.c +++ b/drivers/net/wireless/ath9k/recv.c | |||
@@ -16,6 +16,12 @@ | |||
16 | 16 | ||
17 | #include "ath9k.h" | 17 | #include "ath9k.h" |
18 | 18 | ||
19 | static struct ieee80211_hw * ath_get_virt_hw(struct ath_softc *sc, | ||
20 | struct ieee80211_hdr *hdr) | ||
21 | { | ||
22 | return sc->pri_wiphy->hw; | ||
23 | } | ||
24 | |||
19 | /* | 25 | /* |
20 | * Setup and link descriptors. | 26 | * Setup and link descriptors. |
21 | * | 27 | * |
@@ -123,10 +129,12 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds, | |||
123 | struct ieee80211_hdr *hdr; | 129 | struct ieee80211_hdr *hdr; |
124 | u8 ratecode; | 130 | u8 ratecode; |
125 | __le16 fc; | 131 | __le16 fc; |
132 | struct ieee80211_hw *hw; | ||
126 | 133 | ||
127 | hdr = (struct ieee80211_hdr *)skb->data; | 134 | hdr = (struct ieee80211_hdr *)skb->data; |
128 | fc = hdr->frame_control; | 135 | fc = hdr->frame_control; |
129 | memset(rx_status, 0, sizeof(struct ieee80211_rx_status)); | 136 | memset(rx_status, 0, sizeof(struct ieee80211_rx_status)); |
137 | hw = ath_get_virt_hw(sc, hdr); | ||
130 | 138 | ||
131 | if (ds->ds_rxstat.rs_more) { | 139 | if (ds->ds_rxstat.rs_more) { |
132 | /* | 140 | /* |
@@ -186,7 +194,6 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds, | |||
186 | rx_status->rate_idx = ratecode & 0x7f; | 194 | rx_status->rate_idx = ratecode & 0x7f; |
187 | } else { | 195 | } else { |
188 | int i = 0, cur_band, n_rates; | 196 | int i = 0, cur_band, n_rates; |
189 | struct ieee80211_hw *hw = sc->hw; | ||
190 | 197 | ||
191 | cur_band = hw->conf.channel->band; | 198 | cur_band = hw->conf.channel->band; |
192 | n_rates = sc->sbands[cur_band].n_bitrates; | 199 | n_rates = sc->sbands[cur_band].n_bitrates; |
@@ -208,8 +215,8 @@ static int ath_rx_prepare(struct sk_buff *skb, struct ath_desc *ds, | |||
208 | } | 215 | } |
209 | 216 | ||
210 | rx_status->mactime = ath_extend_tsf(sc, ds->ds_rxstat.rs_tstamp); | 217 | rx_status->mactime = ath_extend_tsf(sc, ds->ds_rxstat.rs_tstamp); |
211 | rx_status->band = sc->hw->conf.channel->band; | 218 | rx_status->band = hw->conf.channel->band; |
212 | rx_status->freq = sc->hw->conf.channel->center_freq; | 219 | rx_status->freq = hw->conf.channel->center_freq; |
213 | rx_status->noise = sc->ani.noise_floor; | 220 | rx_status->noise = sc->ani.noise_floor; |
214 | rx_status->signal = rx_status->noise + ds->ds_rxstat.rs_rssi; | 221 | rx_status->signal = rx_status->noise + ds->ds_rxstat.rs_rssi; |
215 | rx_status->antenna = ds->ds_rxstat.rs_antenna; | 222 | rx_status->antenna = ds->ds_rxstat.rs_antenna; |
@@ -604,7 +611,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
604 | } | 611 | } |
605 | 612 | ||
606 | /* Send the frame to mac80211 */ | 613 | /* Send the frame to mac80211 */ |
607 | __ieee80211_rx(sc->hw, skb, &rx_status); | 614 | __ieee80211_rx(ath_get_virt_hw(sc, hdr), skb, &rx_status); |
608 | 615 | ||
609 | /* We will now give hardware our shiny new allocated skb */ | 616 | /* We will now give hardware our shiny new allocated skb */ |
610 | bf->bf_mpdu = requeue_skb; | 617 | bf->bf_mpdu = requeue_skb; |