Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290365
b: refs/heads/master
c: 197a4e4
h: refs/heads/master
i:
  290363: 62a2dd0
v: v3
  • Loading branch information
Yogesh Ashok Powar authored and John W. Linville committed Feb 6, 2012
1 parent 21b26b7 commit 84b2917
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 291689fcfbf0046d17c83c36fc983400f499dec3
refs/heads/master: 197a4e4e1f7ef11458f09b4dd74397baf6758133
38 changes: 29 additions & 9 deletions trunk/drivers/net/wireless/mwl8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ static const struct ieee80211_rate mwl8k_rates_50[] = {
#define MWL8K_CMD_SET_MAC_ADDR 0x0202 /* per-vif */
#define MWL8K_CMD_SET_RATEADAPT_MODE 0x0203
#define MWL8K_CMD_GET_WATCHDOG_BITMAP 0x0205
#define MWL8K_CMD_DEL_MAC_ADDR 0x0206 /* per-vif */
#define MWL8K_CMD_BSS_START 0x1100 /* per-vif */
#define MWL8K_CMD_SET_NEW_STN 0x1111 /* per-vif */
#define MWL8K_CMD_UPDATE_ENCRYPTION 0x1122 /* per-vif */
Expand Down Expand Up @@ -3430,10 +3431,7 @@ static int mwl8k_cmd_enable_sniffer(struct ieee80211_hw *hw, bool enable)
return rc;
}

/*
* CMD_SET_MAC_ADDR.
*/
struct mwl8k_cmd_set_mac_addr {
struct mwl8k_cmd_update_mac_addr {
struct mwl8k_cmd_pkt header;
union {
struct {
Expand All @@ -3449,12 +3447,12 @@ struct mwl8k_cmd_set_mac_addr {
#define MWL8K_MAC_TYPE_PRIMARY_AP 2
#define MWL8K_MAC_TYPE_SECONDARY_AP 3

static int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, u8 *mac)
static int mwl8k_cmd_update_mac_addr(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, u8 *mac, bool set)
{
struct mwl8k_priv *priv = hw->priv;
struct mwl8k_vif *mwl8k_vif = MWL8K_VIF(vif);
struct mwl8k_cmd_set_mac_addr *cmd;
struct mwl8k_cmd_update_mac_addr *cmd;
int mac_type;
int rc;

Expand All @@ -3475,7 +3473,11 @@ static int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw,
if (cmd == NULL)
return -ENOMEM;

cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_MAC_ADDR);
if (set)
cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_MAC_ADDR);
else
cmd->header.code = cpu_to_le16(MWL8K_CMD_DEL_MAC_ADDR);

cmd->header.length = cpu_to_le16(sizeof(*cmd));
if (priv->ap_fw) {
cmd->mbss.mac_type = cpu_to_le16(mac_type);
Expand All @@ -3490,6 +3492,24 @@ static int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw,
return rc;
}

/*
* MWL8K_CMD_SET_MAC_ADDR.
*/
static inline int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, u8 *mac)
{
return mwl8k_cmd_update_mac_addr(hw, vif, mac, true);
}

/*
* MWL8K_CMD_DEL_MAC_ADDR.
*/
static inline int mwl8k_cmd_del_mac_addr(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, u8 *mac)
{
return mwl8k_cmd_update_mac_addr(hw, vif, mac, false);
}

/*
* CMD_SET_RATEADAPT_MODE.
*/
Expand Down Expand Up @@ -4542,7 +4562,7 @@ static void mwl8k_remove_interface(struct ieee80211_hw *hw,
if (priv->ap_fw)
mwl8k_cmd_set_new_stn_del(hw, vif, vif->addr);

mwl8k_cmd_set_mac_addr(hw, vif, "\x00\x00\x00\x00\x00\x00");
mwl8k_cmd_del_mac_addr(hw, vif, vif->addr);

mwl8k_remove_vif(priv, mwl8k_vif);
}
Expand Down

0 comments on commit 84b2917

Please sign in to comment.