diff options
| -rw-r--r-- | drivers/net/wireless/mwl8k.c | 16 | 
1 files changed, 14 insertions, 2 deletions
| diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 1c4114f8d317..4ee68f7d20f4 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
| @@ -2135,11 +2135,18 @@ static int mwl8k_enable_sniffer(struct ieee80211_hw *hw, bool enable) | |||
| 2135 | */ | 2135 | */ | 
| 2136 | struct mwl8k_cmd_set_mac_addr { | 2136 | struct mwl8k_cmd_set_mac_addr { | 
| 2137 | struct mwl8k_cmd_pkt header; | 2137 | struct mwl8k_cmd_pkt header; | 
| 2138 | __u8 mac_addr[ETH_ALEN]; | 2138 | union { | 
| 2139 | struct { | ||
| 2140 | __le16 mac_type; | ||
| 2141 | __u8 mac_addr[ETH_ALEN]; | ||
| 2142 | } mbss; | ||
| 2143 | __u8 mac_addr[ETH_ALEN]; | ||
| 2144 | }; | ||
| 2139 | } __attribute__((packed)); | 2145 | } __attribute__((packed)); | 
| 2140 | 2146 | ||
| 2141 | static int mwl8k_set_mac_addr(struct ieee80211_hw *hw, u8 *mac) | 2147 | static int mwl8k_set_mac_addr(struct ieee80211_hw *hw, u8 *mac) | 
| 2142 | { | 2148 | { | 
| 2149 | struct mwl8k_priv *priv = hw->priv; | ||
| 2143 | struct mwl8k_cmd_set_mac_addr *cmd; | 2150 | struct mwl8k_cmd_set_mac_addr *cmd; | 
| 2144 | int rc; | 2151 | int rc; | 
| 2145 | 2152 | ||
| @@ -2149,7 +2156,12 @@ static int mwl8k_set_mac_addr(struct ieee80211_hw *hw, u8 *mac) | |||
| 2149 | 2156 | ||
| 2150 | cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_MAC_ADDR); | 2157 | cmd->header.code = cpu_to_le16(MWL8K_CMD_SET_MAC_ADDR); | 
| 2151 | cmd->header.length = cpu_to_le16(sizeof(*cmd)); | 2158 | cmd->header.length = cpu_to_le16(sizeof(*cmd)); | 
| 2152 | memcpy(cmd->mac_addr, mac, ETH_ALEN); | 2159 | if (priv->ap_fw) { | 
| 2160 | cmd->mbss.mac_type = 0; | ||
| 2161 | memcpy(cmd->mbss.mac_addr, mac, ETH_ALEN); | ||
| 2162 | } else { | ||
| 2163 | memcpy(cmd->mac_addr, mac, ETH_ALEN); | ||
| 2164 | } | ||
| 2153 | 2165 | ||
| 2154 | rc = mwl8k_post_cmd(hw, &cmd->header); | 2166 | rc = mwl8k_post_cmd(hw, &cmd->header); | 
| 2155 | kfree(cmd); | 2167 | kfree(cmd); | 
