aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYogesh Ashok Powar <yogeshp@marvell.com>2012-02-01 05:49:54 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-06 14:55:42 -0500
commit197a4e4e1f7ef11458f09b4dd74397baf6758133 (patch)
treeced7a06edfae95fc80fc04a579dcd47a0ff5db5c
parent291689fcfbf0046d17c83c36fc983400f499dec3 (diff)
mwl8k: Remove BSSID from the firmware when the BSS is stopped
Using command DEL_MAC_ADDR, remove the mac address of the BSS when it is stopped i.e the corresponding vif is removed. Without this, the stale bss entry will still be maintained in the firmware which causes issues when the BSS's are recreated. Signed-off-by: Nishant Sarmukadam <nishants@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/mwl8k.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index fd125473be7a..ac7c983f1638 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -402,6 +402,7 @@ static const struct ieee80211_rate mwl8k_rates_50[] = {
402#define MWL8K_CMD_SET_MAC_ADDR 0x0202 /* per-vif */ 402#define MWL8K_CMD_SET_MAC_ADDR 0x0202 /* per-vif */
403#define MWL8K_CMD_SET_RATEADAPT_MODE 0x0203 403#define MWL8K_CMD_SET_RATEADAPT_MODE 0x0203
404#define MWL8K_CMD_GET_WATCHDOG_BITMAP 0x0205 404#define MWL8K_CMD_GET_WATCHDOG_BITMAP 0x0205
405#define MWL8K_CMD_DEL_MAC_ADDR 0x0206 /* per-vif */
405#define MWL8K_CMD_BSS_START 0x1100 /* per-vif */ 406#define MWL8K_CMD_BSS_START 0x1100 /* per-vif */
406#define MWL8K_CMD_SET_NEW_STN 0x1111 /* per-vif */ 407#define MWL8K_CMD_SET_NEW_STN 0x1111 /* per-vif */
407#define MWL8K_CMD_UPDATE_ENCRYPTION 0x1122 /* per-vif */ 408#define MWL8K_CMD_UPDATE_ENCRYPTION 0x1122 /* per-vif */
@@ -3430,10 +3431,7 @@ static int mwl8k_cmd_enable_sniffer(struct ieee80211_hw *hw, bool enable)
3430 return rc; 3431 return rc;
3431} 3432}
3432 3433
3433/* 3434struct mwl8k_cmd_update_mac_addr {
3434 * CMD_SET_MAC_ADDR.
3435 */
3436struct mwl8k_cmd_set_mac_addr {
3437 struct mwl8k_cmd_pkt header; 3435 struct mwl8k_cmd_pkt header;
3438 union { 3436 union {
3439 struct { 3437 struct {
@@ -3449,12 +3447,12 @@ struct mwl8k_cmd_set_mac_addr {
3449#define MWL8K_MAC_TYPE_PRIMARY_AP 2 3447#define MWL8K_MAC_TYPE_PRIMARY_AP 2
3450#define MWL8K_MAC_TYPE_SECONDARY_AP 3 3448#define MWL8K_MAC_TYPE_SECONDARY_AP 3
3451 3449
3452static int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw, 3450static int mwl8k_cmd_update_mac_addr(struct ieee80211_hw *hw,
3453 struct ieee80211_vif *vif, u8 *mac) 3451 struct ieee80211_vif *vif, u8 *mac, bool set)
3454{ 3452{
3455 struct mwl8k_priv *priv = hw->priv; 3453 struct mwl8k_priv *priv = hw->priv;
3456 struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif); 3454 struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif);
3457 struct mwl8k_cmd_set_mac_addr *cmd; 3455 struct mwl8k_cmd_update_mac_addr *cmd;
3458 int mac_type; 3456 int mac_type;
3459 int rc; 3457 int rc;
3460 3458
@@ -3475,7 +3473,11 @@ static int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw,
3475 if (cmd == NULL) 3473 if (cmd == NULL)
3476 return -ENOMEM; 3474 return -ENOMEM;
3477 3475
3478 cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_MAC_ADDR); 3476 if (set)
3477 cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_MAC_ADDR);
3478 else
3479 cmd->header.code = cpu_to_le16(MWL8K_CMD_DEL_MAC_ADDR);
3480
3479 cmd->header.length = cpu_to_le16(sizeof(*cmd)); 3481 cmd->header.length = cpu_to_le16(sizeof(*cmd));
3480 if (priv->ap_fw) { 3482 if (priv->ap_fw) {
3481 cmd->mbss.mac_type = cpu_to_le16(mac_type); 3483 cmd->mbss.mac_type = cpu_to_le16(mac_type);
@@ -3491,6 +3493,24 @@ static int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw,
3491} 3493}
3492 3494
3493/* 3495/*
3496 * MWL8K_CMD_SET_MAC_ADDR.
3497 */
3498static inline int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw,
3499 struct ieee80211_vif *vif, u8 *mac)
3500{
3501 return mwl8k_cmd_update_mac_addr(hw, vif, mac, true);
3502}
3503
3504/*
3505 * MWL8K_CMD_DEL_MAC_ADDR.
3506 */
3507static inline int mwl8k_cmd_del_mac_addr(struct ieee80211_hw *hw,
3508 struct ieee80211_vif *vif, u8 *mac)
3509{
3510 return mwl8k_cmd_update_mac_addr(hw, vif, mac, false);
3511}
3512
3513/*
3494 * CMD_SET_RATEADAPT_MODE. 3514 * CMD_SET_RATEADAPT_MODE.
3495 */ 3515 */
3496struct mwl8k_cmd_set_rate_adapt_mode { 3516struct mwl8k_cmd_set_rate_adapt_mode {
@@ -4542,7 +4562,7 @@ static void mwl8k_remove_interface(struct ieee80211_hw *hw,
4542 if (priv->ap_fw) 4562 if (priv->ap_fw)
4543 mwl8k_cmd_set_new_stn_del(hw, vif, vif->addr); 4563 mwl8k_cmd_set_new_stn_del(hw, vif, vif->addr);
4544 4564
4545 mwl8k_cmd_set_mac_addr(hw, vif, "\x00\x00\x00\x00\x00\x00"); 4565 mwl8k_cmd_del_mac_addr(hw, vif, vif->addr);
4546 4566
4547 mwl8k_remove_vif(priv, mwl8k_vif); 4567 mwl8k_remove_vif(priv, mwl8k_vif);
4548} 4568}