提交 b180b100 编写于 作者: A Arend van Spriel 提交者: John W. Linville

brcmsmac: allow user-space setting of interface address

The interface address of the wireless device is determined by
the permanent address stored in the device. This patch allows
it to be overridden from user-space.
Reported-by: NMaximilian Engelhardt <maxi@daemonizer.de>
Reviewed-by: NPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: NPiotr Haber <phaber@broadcom.com>
Signed-off-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 66578c0a
...@@ -363,6 +363,7 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -363,6 +363,7 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
} }
spin_lock_bh(&wl->lock); spin_lock_bh(&wl->lock);
memcpy(wl->pub->cur_etheraddr, vif->addr, sizeof(vif->addr));
wl->mute_tx = false; wl->mute_tx = false;
brcms_c_mute(wl->wlc, false); brcms_c_mute(wl->wlc, false);
spin_unlock_bh(&wl->lock); spin_unlock_bh(&wl->lock);
......
...@@ -2473,6 +2473,7 @@ static void brcms_b_tx_fifo_resume(struct brcms_hardware *wlc_hw, ...@@ -2473,6 +2473,7 @@ static void brcms_b_tx_fifo_resume(struct brcms_hardware *wlc_hw,
static void brcms_b_mute(struct brcms_hardware *wlc_hw, bool mute_tx) static void brcms_b_mute(struct brcms_hardware *wlc_hw, bool mute_tx)
{ {
static const u8 null_ether_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; static const u8 null_ether_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
u8 *ethaddr = wlc_hw->wlc->pub->cur_etheraddr;
if (mute_tx) { if (mute_tx) {
/* suspend tx fifos */ /* suspend tx fifos */
...@@ -2482,8 +2483,7 @@ static void brcms_b_mute(struct brcms_hardware *wlc_hw, bool mute_tx) ...@@ -2482,8 +2483,7 @@ static void brcms_b_mute(struct brcms_hardware *wlc_hw, bool mute_tx)
brcms_b_tx_fifo_suspend(wlc_hw, TX_AC_VI_FIFO); brcms_b_tx_fifo_suspend(wlc_hw, TX_AC_VI_FIFO);
/* zero the address match register so we do not send ACKs */ /* zero the address match register so we do not send ACKs */
brcms_b_set_addrmatch(wlc_hw, RCM_MAC_OFFSET, brcms_b_set_addrmatch(wlc_hw, RCM_MAC_OFFSET, null_ether_addr);
null_ether_addr);
} else { } else {
/* resume tx fifos */ /* resume tx fifos */
brcms_b_tx_fifo_resume(wlc_hw, TX_DATA_FIFO); brcms_b_tx_fifo_resume(wlc_hw, TX_DATA_FIFO);
...@@ -2492,8 +2492,7 @@ static void brcms_b_mute(struct brcms_hardware *wlc_hw, bool mute_tx) ...@@ -2492,8 +2492,7 @@ static void brcms_b_mute(struct brcms_hardware *wlc_hw, bool mute_tx)
brcms_b_tx_fifo_resume(wlc_hw, TX_AC_VI_FIFO); brcms_b_tx_fifo_resume(wlc_hw, TX_AC_VI_FIFO);
/* Restore address */ /* Restore address */
brcms_b_set_addrmatch(wlc_hw, RCM_MAC_OFFSET, brcms_b_set_addrmatch(wlc_hw, RCM_MAC_OFFSET, ethaddr);
wlc_hw->etheraddr);
} }
wlc_phy_mute_upd(wlc_hw->band->pi, mute_tx, 0); wlc_phy_mute_upd(wlc_hw->band->pi, mute_tx, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册