diff options
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 91c5f74350b7..b48674b577e6 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 */ |
@@ -3429,10 +3430,7 @@ static int mwl8k_cmd_enable_sniffer(struct ieee80211_hw *hw, bool enable) | |||
3429 | return rc; | 3430 | return rc; |
3430 | } | 3431 | } |
3431 | 3432 | ||
3432 | /* | 3433 | struct mwl8k_cmd_update_mac_addr { |
3433 | * CMD_SET_MAC_ADDR. | ||
3434 | */ | ||
3435 | struct mwl8k_cmd_set_mac_addr { | ||
3436 | struct mwl8k_cmd_pkt header; | 3434 | struct mwl8k_cmd_pkt header; |
3437 | union { | 3435 | union { |
3438 | struct { | 3436 | struct { |
@@ -3448,12 +3446,12 @@ struct mwl8k_cmd_set_mac_addr { | |||
3448 | #define MWL8K_MAC_TYPE_PRIMARY_AP 2 | 3446 | #define MWL8K_MAC_TYPE_PRIMARY_AP 2 |
3449 | #define MWL8K_MAC_TYPE_SECONDARY_AP 3 | 3447 | #define MWL8K_MAC_TYPE_SECONDARY_AP 3 |
3450 | 3448 | ||
3451 | static int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw, | 3449 | static int mwl8k_cmd_update_mac_addr(struct ieee80211_hw *hw, |
3452 | struct ieee80211_vif *vif, u8 *mac) | 3450 | struct ieee80211_vif *vif, u8 *mac, bool set) |
3453 | { | 3451 | { |
3454 | struct mwl8k_priv *priv = hw->priv; | 3452 | struct mwl8k_priv *priv = hw->priv; |
3455 | struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif); | 3453 | struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif); |
3456 | struct mwl8k_cmd_set_mac_addr *cmd; | 3454 | struct mwl8k_cmd_update_mac_addr *cmd; |
3457 | int mac_type; | 3455 | int mac_type; |
3458 | int rc; | 3456 | int rc; |
3459 | 3457 | ||
@@ -3474,7 +3472,11 @@ static int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw, | |||
3474 | if (cmd == NULL) | 3472 | if (cmd == NULL) |
3475 | return -ENOMEM; | 3473 | return -ENOMEM; |
3476 | 3474 | ||
3477 | cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_MAC_ADDR); | 3475 | if (set) |
3476 | cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_MAC_ADDR); | ||
3477 | else | ||
3478 | cmd->header.code = cpu_to_le16(MWL8K_CMD_DEL_MAC_ADDR); | ||
3479 | |||
3478 | cmd->header.length = cpu_to_le16(sizeof(*cmd)); | 3480 | cmd->header.length = cpu_to_le16(sizeof(*cmd)); |
3479 | if (priv->ap_fw) { | 3481 | if (priv->ap_fw) { |
3480 | cmd->mbss.mac_type = cpu_to_le16(mac_type); | 3482 | cmd->mbss.mac_type = cpu_to_le16(mac_type); |
@@ -3490,6 +3492,24 @@ static int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw, | |||
3490 | } | 3492 | } |
3491 | 3493 | ||
3492 | /* | 3494 | /* |
3495 | * MWL8K_CMD_SET_MAC_ADDR. | ||
3496 | */ | ||
3497 | static inline int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw, | ||
3498 | struct ieee80211_vif *vif, u8 *mac) | ||
3499 | { | ||
3500 | return mwl8k_cmd_update_mac_addr(hw, vif, mac, true); | ||
3501 | } | ||
3502 | |||
3503 | /* | ||
3504 | * MWL8K_CMD_DEL_MAC_ADDR. | ||
3505 | */ | ||
3506 | static inline int mwl8k_cmd_del_mac_addr(struct ieee80211_hw *hw, | ||
3507 | struct ieee80211_vif *vif, u8 *mac) | ||
3508 | { | ||
3509 | return mwl8k_cmd_update_mac_addr(hw, vif, mac, false); | ||
3510 | } | ||
3511 | |||
3512 | /* | ||
3493 | * CMD_SET_RATEADAPT_MODE. | 3513 | * CMD_SET_RATEADAPT_MODE. |
3494 | */ | 3514 | */ |
3495 | struct mwl8k_cmd_set_rate_adapt_mode { | 3515 | struct mwl8k_cmd_set_rate_adapt_mode { |
@@ -4541,7 +4561,7 @@ static void mwl8k_remove_interface(struct ieee80211_hw *hw, | |||
4541 | if (priv->ap_fw) | 4561 | if (priv->ap_fw) |
4542 | mwl8k_cmd_set_new_stn_del(hw, vif, vif->addr); | 4562 | mwl8k_cmd_set_new_stn_del(hw, vif, vif->addr); |
4543 | 4563 | ||
4544 | mwl8k_cmd_set_mac_addr(hw, vif, "\x00\x00\x00\x00\x00\x00"); | 4564 | mwl8k_cmd_del_mac_addr(hw, vif, vif->addr); |
4545 | 4565 | ||
4546 | mwl8k_remove_vif(priv, mwl8k_vif); | 4566 | mwl8k_remove_vif(priv, mwl8k_vif); |
4547 | } | 4567 | } |