Commit dc460127 authored by Roland Vossen's avatar Roland Vossen Committed by John W. Linville

brcm80211: smac: mute transmit on ops_start

Monitor mode functionality (not functional yet) requires transmit to be
muted after ops_start() is called, transmit is unmuted when the first
interface is added.
Reviewed-by: default avatarAlwin Beukers <alwin@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2646c46d
...@@ -294,6 +294,9 @@ static int brcms_ops_start(struct ieee80211_hw *hw) ...@@ -294,6 +294,9 @@ static int brcms_ops_start(struct ieee80211_hw *hw)
wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy); wiphy_rfkill_stop_polling(wl->pub->ieee_hw->wiphy);
spin_lock_bh(&wl->lock); spin_lock_bh(&wl->lock);
/* avoid acknowledging frames before a non-monitor device is added */
wl->mute_tx = true;
if (!wl->pub->up) if (!wl->pub->up)
err = brcms_up(wl); err = brcms_up(wl);
else else
...@@ -335,6 +338,8 @@ static void brcms_ops_stop(struct ieee80211_hw *hw) ...@@ -335,6 +338,8 @@ static void brcms_ops_stop(struct ieee80211_hw *hw)
static int static int
brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{ {
struct brcms_info *wl = hw->priv;
/* Just STA for now */ /* Just STA for now */
if (vif->type != NL80211_IFTYPE_AP && if (vif->type != NL80211_IFTYPE_AP &&
vif->type != NL80211_IFTYPE_MESH_POINT && vif->type != NL80211_IFTYPE_MESH_POINT &&
...@@ -346,6 +351,9 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -346,6 +351,9 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
wl->mute_tx = false;
brcms_c_mute(wl->wlc, false);
return 0; return 0;
} }
...@@ -1303,8 +1311,7 @@ void brcms_init(struct brcms_info *wl) ...@@ -1303,8 +1311,7 @@ void brcms_init(struct brcms_info *wl)
{ {
BCMMSG(wl->pub->ieee_hw->wiphy, "wl%d\n", wl->pub->unit); BCMMSG(wl->pub->ieee_hw->wiphy, "wl%d\n", wl->pub->unit);
brcms_reset(wl); brcms_reset(wl);
brcms_c_init(wl->wlc, wl->mute_tx);
brcms_c_init(wl->wlc);
} }
/* /*
......
...@@ -80,6 +80,7 @@ struct brcms_info { ...@@ -80,6 +80,7 @@ struct brcms_info {
struct brcms_firmware fw; struct brcms_firmware fw;
struct wiphy *wiphy; struct wiphy *wiphy;
struct brcms_ucode ucode; struct brcms_ucode ucode;
bool mute_tx;
}; };
/* misc callbacks */ /* misc callbacks */
......
...@@ -2396,6 +2396,7 @@ void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask) ...@@ -2396,6 +2396,7 @@ void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask)
W_REG(&wlc_hw->regs->macintmask, wlc->macintmask); W_REG(&wlc_hw->regs->macintmask, wlc->macintmask);
} }
/* assumes that the d11 MAC is enabled */
static void brcms_b_tx_fifo_suspend(struct brcms_hardware *wlc_hw, static void brcms_b_tx_fifo_suspend(struct brcms_hardware *wlc_hw,
uint tx_fifo) uint tx_fifo)
{ {
...@@ -2487,6 +2488,12 @@ static void brcms_b_mute(struct brcms_hardware *wlc_hw, bool mute_tx) ...@@ -2487,6 +2488,12 @@ static void brcms_b_mute(struct brcms_hardware *wlc_hw, bool mute_tx)
brcms_c_ucode_mute_override_clear(wlc_hw); brcms_c_ucode_mute_override_clear(wlc_hw);
} }
void
brcms_c_mute(struct brcms_c_info *wlc, bool mute_tx)
{
brcms_b_mute(wlc->hw, mute_tx);
}
/* /*
* Read and clear macintmask and macintstatus and intstatus registers. * Read and clear macintmask and macintstatus and intstatus registers.
* This routine should be called with interrupts off * This routine should be called with interrupts off
...@@ -8253,11 +8260,10 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded) ...@@ -8253,11 +8260,10 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
return wlc->macintstatus != 0; return wlc->macintstatus != 0;
} }
void brcms_c_init(struct brcms_c_info *wlc) void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx)
{ {
struct d11regs __iomem *regs; struct d11regs __iomem *regs;
u16 chanspec; u16 chanspec;
bool mute_tx = false;
BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit); BCMMSG(wlc->wiphy, "wl%d\n", wlc->pub->unit);
......
...@@ -540,7 +540,7 @@ extern int brcms_c_up(struct brcms_c_info *wlc); ...@@ -540,7 +540,7 @@ extern int brcms_c_up(struct brcms_c_info *wlc);
extern uint brcms_c_down(struct brcms_c_info *wlc); extern uint brcms_c_down(struct brcms_c_info *wlc);
extern bool brcms_c_chipmatch(u16 vendor, u16 device); extern bool brcms_c_chipmatch(u16 vendor, u16 device);
extern void brcms_c_init(struct brcms_c_info *wlc); extern void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx);
extern void brcms_c_reset(struct brcms_c_info *wlc); extern void brcms_c_reset(struct brcms_c_info *wlc);
extern void brcms_c_intrson(struct brcms_c_info *wlc); extern void brcms_c_intrson(struct brcms_c_info *wlc);
...@@ -597,5 +597,6 @@ extern void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, ...@@ -597,5 +597,6 @@ extern void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc,
extern int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr); extern int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr);
extern int brcms_c_get_tx_power(struct brcms_c_info *wlc); extern int brcms_c_get_tx_power(struct brcms_c_info *wlc);
extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc); extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc);
extern void brcms_c_mute(struct brcms_c_info *wlc, bool on);
#endif /* _BRCM_PUB_H_ */ #endif /* _BRCM_PUB_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment