Commit 170d0e67 authored by Eliad Peller's avatar Eliad Peller Committed by Luciano Coelho

wl12xx: move recorded_ap_keys into wlvif

move recorded_ap_keys into the per-interface data, rather than
being global.
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent c7ffb902
...@@ -379,7 +379,7 @@ static bool bug_on_recovery; ...@@ -379,7 +379,7 @@ static bool bug_on_recovery;
static void __wl1271_op_remove_interface(struct wl1271 *wl, static void __wl1271_op_remove_interface(struct wl1271 *wl,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
bool reset_tx_queues); bool reset_tx_queues);
static void wl1271_free_ap_keys(struct wl1271 *wl); static void wl1271_free_ap_keys(struct wl1271 *wl, struct wl12xx_vif *wlvif);
static void wl1271_device_release(struct device *dev) static void wl1271_device_release(struct device *dev)
...@@ -2132,7 +2132,7 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl, ...@@ -2132,7 +2132,7 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
wl->bitrate_masks[IEEE80211_BAND_5GHZ] = wl->conf.tx.basic_rate_5; wl->bitrate_masks[IEEE80211_BAND_5GHZ] = wl->conf.tx.basic_rate_5;
wl->vif = NULL; wl->vif = NULL;
wl->tx_spare_blocks = TX_HW_BLOCK_SPARE_DEFAULT; wl->tx_spare_blocks = TX_HW_BLOCK_SPARE_DEFAULT;
wl1271_free_ap_keys(wl); wl1271_free_ap_keys(wl, wlvif);
memset(wlvif->ap.sta_hlid_map, 0, sizeof(wlvif->ap.sta_hlid_map)); memset(wlvif->ap.sta_hlid_map, 0, sizeof(wlvif->ap.sta_hlid_map));
wl->ap_fw_ps_map = 0; wl->ap_fw_ps_map = 0;
wl->ap_ps_map = 0; wl->ap_ps_map = 0;
...@@ -2603,9 +2603,10 @@ static void wl1271_op_configure_filter(struct ieee80211_hw *hw, ...@@ -2603,9 +2603,10 @@ static void wl1271_op_configure_filter(struct ieee80211_hw *hw,
kfree(fp); kfree(fp);
} }
static int wl1271_record_ap_key(struct wl1271 *wl, u8 id, u8 key_type, static int wl1271_record_ap_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
u8 key_size, const u8 *key, u8 hlid, u32 tx_seq_32, u8 id, u8 key_type, u8 key_size,
u16 tx_seq_16) const u8 *key, u8 hlid, u32 tx_seq_32,
u16 tx_seq_16)
{ {
struct wl1271_ap_key *ap_key; struct wl1271_ap_key *ap_key;
int i; int i;
...@@ -2620,10 +2621,10 @@ static int wl1271_record_ap_key(struct wl1271 *wl, u8 id, u8 key_type, ...@@ -2620,10 +2621,10 @@ static int wl1271_record_ap_key(struct wl1271 *wl, u8 id, u8 key_type,
* an existing key. * an existing key.
*/ */
for (i = 0; i < MAX_NUM_KEYS; i++) { for (i = 0; i < MAX_NUM_KEYS; i++) {
if (wl->recorded_ap_keys[i] == NULL) if (wlvif->ap.recorded_keys[i] == NULL)
break; break;
if (wl->recorded_ap_keys[i]->id == id) { if (wlvif->ap.recorded_keys[i]->id == id) {
wl1271_warning("trying to record key replacement"); wl1271_warning("trying to record key replacement");
return -EINVAL; return -EINVAL;
} }
...@@ -2644,17 +2645,17 @@ static int wl1271_record_ap_key(struct wl1271 *wl, u8 id, u8 key_type, ...@@ -2644,17 +2645,17 @@ static int wl1271_record_ap_key(struct wl1271 *wl, u8 id, u8 key_type,
ap_key->tx_seq_32 = tx_seq_32; ap_key->tx_seq_32 = tx_seq_32;
ap_key->tx_seq_16 = tx_seq_16; ap_key->tx_seq_16 = tx_seq_16;
wl->recorded_ap_keys[i] = ap_key; wlvif->ap.recorded_keys[i] = ap_key;
return 0; return 0;
} }
static void wl1271_free_ap_keys(struct wl1271 *wl) static void wl1271_free_ap_keys(struct wl1271 *wl, struct wl12xx_vif *wlvif)
{ {
int i; int i;
for (i = 0; i < MAX_NUM_KEYS; i++) { for (i = 0; i < MAX_NUM_KEYS; i++) {
kfree(wl->recorded_ap_keys[i]); kfree(wlvif->ap.recorded_keys[i]);
wl->recorded_ap_keys[i] = NULL; wlvif->ap.recorded_keys[i] = NULL;
} }
} }
...@@ -2666,10 +2667,10 @@ static int wl1271_ap_init_hwenc(struct wl1271 *wl, struct wl12xx_vif *wlvif) ...@@ -2666,10 +2667,10 @@ static int wl1271_ap_init_hwenc(struct wl1271 *wl, struct wl12xx_vif *wlvif)
for (i = 0; i < MAX_NUM_KEYS; i++) { for (i = 0; i < MAX_NUM_KEYS; i++) {
u8 hlid; u8 hlid;
if (wl->recorded_ap_keys[i] == NULL) if (wlvif->ap.recorded_keys[i] == NULL)
break; break;
key = wl->recorded_ap_keys[i]; key = wlvif->ap.recorded_keys[i];
hlid = key->hlid; hlid = key->hlid;
if (hlid == WL12XX_INVALID_LINK_ID) if (hlid == WL12XX_INVALID_LINK_ID)
hlid = wlvif->ap.bcast_hlid; hlid = wlvif->ap.bcast_hlid;
...@@ -2694,7 +2695,7 @@ static int wl1271_ap_init_hwenc(struct wl1271 *wl, struct wl12xx_vif *wlvif) ...@@ -2694,7 +2695,7 @@ static int wl1271_ap_init_hwenc(struct wl1271 *wl, struct wl12xx_vif *wlvif)
} }
out: out:
wl1271_free_ap_keys(wl); wl1271_free_ap_keys(wl, wlvif);
return ret; return ret;
} }
...@@ -2725,7 +2726,7 @@ static int wl1271_set_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, ...@@ -2725,7 +2726,7 @@ static int wl1271_set_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
if (action != KEY_ADD_OR_REPLACE) if (action != KEY_ADD_OR_REPLACE)
return 0; return 0;
ret = wl1271_record_ap_key(wl, id, ret = wl1271_record_ap_key(wl, wlvif, id,
key_type, key_size, key_type, key_size,
key, hlid, tx_seq_32, key, hlid, tx_seq_32,
tx_seq_16); tx_seq_16);
......
...@@ -524,9 +524,6 @@ struct wl1271 { ...@@ -524,9 +524,6 @@ struct wl1271 {
/* Most recently reported noise in dBm */ /* Most recently reported noise in dBm */
s8 noise; s8 noise;
/* recoreded keys for AP-mode - set here before AP startup */
struct wl1271_ap_key *recorded_ap_keys[MAX_NUM_KEYS];
/* bands supported by this instance of wl12xx */ /* bands supported by this instance of wl12xx */
struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
...@@ -593,6 +590,9 @@ struct wl12xx_vif { ...@@ -593,6 +590,9 @@ struct wl12xx_vif {
/* HLIDs bitmap of associated stations */ /* HLIDs bitmap of associated stations */
unsigned long sta_hlid_map[BITS_TO_LONGS( unsigned long sta_hlid_map[BITS_TO_LONGS(
WL12XX_MAX_LINKS)]; WL12XX_MAX_LINKS)];
/* recoreded keys - set here before AP startup */
struct wl1271_ap_key *recorded_keys[MAX_NUM_KEYS];
} ap; } ap;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment