diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2009-11-30 12:33:09 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-28 16:31:28 -0500 |
commit | 7dc6a7a7635365b140af969e972900866d0bf34b (patch) | |
tree | d95f34b86b15c5a63fee8e77d74beb8aaab50432 /drivers/net/wireless/mwl8k.c | |
parent | 97474782959af87f5dc8049fca3bd3b25eb68308 (diff) |
mwl8k: remove duplicate local per-vif copy of ieee80211_bss_conf
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 6fa2bde5b618..97a95decf9a8 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -204,12 +204,11 @@ struct mwl8k_priv { | |||
204 | 204 | ||
205 | /* Per interface specific private data */ | 205 | /* Per interface specific private data */ |
206 | struct mwl8k_vif { | 206 | struct mwl8k_vif { |
207 | /* BSS config of AP or IBSS from mac80211*/ | 207 | /* Local MAC address. */ |
208 | struct ieee80211_bss_conf bss_info; | 208 | u8 mac_addr[ETH_ALEN]; |
209 | 209 | ||
210 | /* BSSID of AP or IBSS */ | 210 | /* BSSID of AP. */ |
211 | u8 bssid[ETH_ALEN]; | 211 | u8 bssid[ETH_ALEN]; |
212 | u8 mac_addr[ETH_ALEN]; | ||
213 | 212 | ||
214 | /* Index into station database. Returned by UPDATE_STADB. */ | 213 | /* Index into station database. Returned by UPDATE_STADB. */ |
215 | u8 peer_id; | 214 | u8 peer_id; |
@@ -2123,7 +2122,6 @@ static int | |||
2123 | mwl8k_cmd_set_aid(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | 2122 | mwl8k_cmd_set_aid(struct ieee80211_hw *hw, struct ieee80211_vif *vif) |
2124 | { | 2123 | { |
2125 | struct mwl8k_vif *mv_vif = MWL8K_VIF(vif); | 2124 | struct mwl8k_vif *mv_vif = MWL8K_VIF(vif); |
2126 | struct ieee80211_bss_conf *info = &mv_vif->bss_info; | ||
2127 | struct mwl8k_cmd_update_set_aid *cmd; | 2125 | struct mwl8k_cmd_update_set_aid *cmd; |
2128 | u16 prot_mode; | 2126 | u16 prot_mode; |
2129 | int rc; | 2127 | int rc; |
@@ -2134,14 +2132,14 @@ mwl8k_cmd_set_aid(struct ieee80211_hw *hw, struct ieee80211_vif *vif) | |||
2134 | 2132 | ||
2135 | cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_AID); | 2133 | cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_AID); |
2136 | cmd->header.length = cpu_to_le16(sizeof(*cmd)); | 2134 | cmd->header.length = cpu_to_le16(sizeof(*cmd)); |
2137 | cmd->aid = cpu_to_le16(info->aid); | 2135 | cmd->aid = cpu_to_le16(vif->bss_conf.aid); |
2138 | 2136 | ||
2139 | memcpy(cmd->bssid, mv_vif->bssid, ETH_ALEN); | 2137 | memcpy(cmd->bssid, mv_vif->bssid, ETH_ALEN); |
2140 | 2138 | ||
2141 | if (info->use_cts_prot) { | 2139 | if (vif->bss_conf.use_cts_prot) { |
2142 | prot_mode = MWL8K_FRAME_PROT_11G; | 2140 | prot_mode = MWL8K_FRAME_PROT_11G; |
2143 | } else { | 2141 | } else { |
2144 | switch (info->ht_operation_mode & | 2142 | switch (vif->bss_conf.ht_operation_mode & |
2145 | IEEE80211_HT_OP_MODE_PROTECTION) { | 2143 | IEEE80211_HT_OP_MODE_PROTECTION) { |
2146 | case IEEE80211_HT_OP_MODE_PROTECTION_20MHZ: | 2144 | case IEEE80211_HT_OP_MODE_PROTECTION_20MHZ: |
2147 | prot_mode = MWL8K_FRAME_PROT_11N_HT_40MHZ_ONLY; | 2145 | prot_mode = MWL8K_FRAME_PROT_11N_HT_40MHZ_ONLY; |
@@ -2651,7 +2649,6 @@ static int mwl8k_cmd_update_stadb(struct ieee80211_hw *hw, | |||
2651 | struct ieee80211_vif *vif, __u32 action) | 2649 | struct ieee80211_vif *vif, __u32 action) |
2652 | { | 2650 | { |
2653 | struct mwl8k_vif *mv_vif = MWL8K_VIF(vif); | 2651 | struct mwl8k_vif *mv_vif = MWL8K_VIF(vif); |
2654 | struct ieee80211_bss_conf *info = &mv_vif->bss_info; | ||
2655 | struct mwl8k_cmd_update_stadb *cmd; | 2652 | struct mwl8k_cmd_update_stadb *cmd; |
2656 | struct peer_capability_info *peer_info; | 2653 | struct peer_capability_info *peer_info; |
2657 | int rc; | 2654 | int rc; |
@@ -2672,7 +2669,8 @@ static int mwl8k_cmd_update_stadb(struct ieee80211_hw *hw, | |||
2672 | case MWL8K_STA_DB_MODIFY_ENTRY: | 2669 | case MWL8K_STA_DB_MODIFY_ENTRY: |
2673 | /* Build peer_info block */ | 2670 | /* Build peer_info block */ |
2674 | peer_info->peer_type = MWL8K_PEER_TYPE_ACCESSPOINT; | 2671 | peer_info->peer_type = MWL8K_PEER_TYPE_ACCESSPOINT; |
2675 | peer_info->basic_caps = cpu_to_le16(info->assoc_capability); | 2672 | peer_info->basic_caps = |
2673 | cpu_to_le16(vif->bss_conf.assoc_capability); | ||
2676 | memcpy(peer_info->legacy_rates, mwl8k_rateids, | 2674 | memcpy(peer_info->legacy_rates, mwl8k_rateids, |
2677 | sizeof(mwl8k_rateids)); | 2675 | sizeof(mwl8k_rateids)); |
2678 | peer_info->interop = 1; | 2676 | peer_info->interop = 1; |
@@ -2960,11 +2958,8 @@ static void mwl8k_bss_info_changed(struct ieee80211_hw *hw, | |||
2960 | if (rc) | 2958 | if (rc) |
2961 | return; | 2959 | return; |
2962 | 2960 | ||
2963 | if (info->assoc) { | 2961 | if (vif->bss_conf.assoc) { |
2964 | memcpy(&mwl8k_vif->bss_info, info, | 2962 | memcpy(mwl8k_vif->bssid, vif->bss_conf.bssid, ETH_ALEN); |
2965 | sizeof(struct ieee80211_bss_conf)); | ||
2966 | |||
2967 | memcpy(mwl8k_vif->bssid, info->bssid, ETH_ALEN); | ||
2968 | 2963 | ||
2969 | /* Install rates */ | 2964 | /* Install rates */ |
2970 | rc = mwl8k_cmd_set_rate(hw, vif); | 2965 | rc = mwl8k_cmd_set_rate(hw, vif); |
@@ -2978,12 +2973,13 @@ static void mwl8k_bss_info_changed(struct ieee80211_hw *hw, | |||
2978 | goto out; | 2973 | goto out; |
2979 | 2974 | ||
2980 | /* Set radio preamble */ | 2975 | /* Set radio preamble */ |
2981 | rc = mwl8k_set_radio_preamble(hw, info->use_short_preamble); | 2976 | rc = mwl8k_set_radio_preamble(hw, |
2977 | vif->bss_conf.use_short_preamble); | ||
2982 | if (rc) | 2978 | if (rc) |
2983 | goto out; | 2979 | goto out; |
2984 | 2980 | ||
2985 | /* Set slot time */ | 2981 | /* Set slot time */ |
2986 | rc = mwl8k_cmd_set_slot(hw, info->use_short_slot); | 2982 | rc = mwl8k_cmd_set_slot(hw, vif->bss_conf.use_short_slot); |
2987 | if (rc) | 2983 | if (rc) |
2988 | goto out; | 2984 | goto out; |
2989 | 2985 | ||
@@ -3006,8 +3002,6 @@ static void mwl8k_bss_info_changed(struct ieee80211_hw *hw, | |||
3006 | priv->capture_beacon = true; | 3002 | priv->capture_beacon = true; |
3007 | } else { | 3003 | } else { |
3008 | rc = mwl8k_cmd_update_stadb(hw, vif, MWL8K_STA_DB_DEL_ENTRY); | 3004 | rc = mwl8k_cmd_update_stadb(hw, vif, MWL8K_STA_DB_DEL_ENTRY); |
3009 | memset(&mwl8k_vif->bss_info, 0, | ||
3010 | sizeof(struct ieee80211_bss_conf)); | ||
3011 | memset(mwl8k_vif->bssid, 0, ETH_ALEN); | 3005 | memset(mwl8k_vif->bssid, 0, ETH_ALEN); |
3012 | } | 3006 | } |
3013 | 3007 | ||
@@ -3239,9 +3233,9 @@ static void mwl8k_finalize_join_worker(struct work_struct *work) | |||
3239 | struct mwl8k_priv *priv = | 3233 | struct mwl8k_priv *priv = |
3240 | container_of(work, struct mwl8k_priv, finalize_join_worker); | 3234 | container_of(work, struct mwl8k_priv, finalize_join_worker); |
3241 | struct sk_buff *skb = priv->beacon_skb; | 3235 | struct sk_buff *skb = priv->beacon_skb; |
3242 | u8 dtim = MWL8K_VIF(priv->vif)->bss_info.dtim_period; | ||
3243 | 3236 | ||
3244 | mwl8k_cmd_finalize_join(priv->hw, skb->data, skb->len, dtim); | 3237 | mwl8k_cmd_finalize_join(priv->hw, skb->data, skb->len, |
3238 | priv->vif->bss_conf.dtim_period); | ||
3245 | dev_kfree_skb(skb); | 3239 | dev_kfree_skb(skb); |
3246 | 3240 | ||
3247 | priv->beacon_skb = NULL; | 3241 | priv->beacon_skb = NULL; |