aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/recv.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-03-03 12:23:28 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-03-05 14:39:44 -0500
commitbce048d77dff3dcfd75d54dc38580c81baa95853 (patch)
tree214b954bae87b52bad66c60f625c925be10b3500 /drivers/net/wireless/ath9k/recv.c
parent8ca21f0185a606c490867f7471196aa29639e638 (diff)
ath9k: Add data structure for supporting virtual radio/wiphy operation
This is the initial step in allowing ath9k to register multiple virtual radios (wiphys). The goal of virtual radios is to allow the same radio to be shared for multiple virtual interfaces that may operate on different channels. The mac80211 virtual interface support is designed only for single channel operation and as such, it is not suitable for this type of use. Anyway, it can be used on top of the virtual radio concept, if desired (e.g., use two virtual radios to handle two channels and then add multiple mac80211 virtual interfaces on top of each virtual radio). The new struct ath_wiphy is now registered as the driver data structure for wiphy. This structure has a pointer to the shared (among virtual wiphys of the same physical radio) struct ath_softc data. The primary wiphy maintains the allocated memory for ath_softc. Secondary (virtual) wiphys will only allocate the new ath_wiphy structure. Registration of secondary wiphys is added in a separate patch. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/recv.c')
-rw-r--r--drivers/net/wireless/ath9k/recv.c15
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
19static 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;