aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYogesh Ashok Powar <yogeshp@marvell.com>2014-02-25 07:12:09 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-02-28 14:33:10 -0500
commit4c924f42c9c9f60ca861a8c4a52825778e9e09a0 (patch)
treeb6a39b725383f7ebe54549a8d7dfe60d92bba89d
parentc3015313aea0f765dbe743f95087a5994db082f2 (diff)
mwl8k: Implement sw_scan start/stop cbs
Implement sw_scan start and stop callbacks. Reset BBP registers for channel, RX busy and average noise stats which clear on read. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Nishant Sarmukadam <nishants@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/mwl8k.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 6c002f3d91cd..61d5bea9a9d7 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -81,6 +81,9 @@ MODULE_PARM_DESC(ap_mode_default,
81 */ 81 */
82 82
83#define MWL8K_HW_TIMER_REGISTER 0x0000a600 83#define MWL8K_HW_TIMER_REGISTER 0x0000a600
84#define BBU_RXRDY_CNT_REG 0x0000a860
85#define NOK_CCA_CNT_REG 0x0000a6a0
86#define BBU_AVG_NOISE_VAL 0x67
84 87
85#define MWL8K_A2H_EVENTS (MWL8K_A2H_INT_DUMMY | \ 88#define MWL8K_A2H_EVENTS (MWL8K_A2H_INT_DUMMY | \
86 MWL8K_A2H_INT_CHNL_SWITCHED | \ 89 MWL8K_A2H_INT_CHNL_SWITCHED | \
@@ -289,6 +292,9 @@ struct mwl8k_priv {
289 292
290 /* bitmap of running BSSes */ 293 /* bitmap of running BSSes */
291 u32 running_bsses; 294 u32 running_bsses;
295
296 /* ACS related */
297 bool sw_scan_start;
292}; 298};
293 299
294#define MAX_WEP_KEY_LEN 13 300#define MAX_WEP_KEY_LEN 13
@@ -5448,6 +5454,38 @@ mwl8k_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
5448 return rc; 5454 return rc;
5449} 5455}
5450 5456
5457static void mwl8k_sw_scan_start(struct ieee80211_hw *hw)
5458{
5459 struct mwl8k_priv *priv = hw->priv;
5460 u8 tmp;
5461
5462 if (!priv->ap_fw)
5463 return;
5464
5465 /* clear all stats */
5466 ioread32(priv->regs + BBU_RXRDY_CNT_REG);
5467 ioread32(priv->regs + NOK_CCA_CNT_REG);
5468 mwl8k_cmd_bbp_reg_access(priv->hw, 0, BBU_AVG_NOISE_VAL, &tmp);
5469
5470 priv->sw_scan_start = true;
5471}
5472
5473static void mwl8k_sw_scan_complete(struct ieee80211_hw *hw)
5474{
5475 struct mwl8k_priv *priv = hw->priv;
5476 u8 tmp;
5477
5478 if (!priv->ap_fw)
5479 return;
5480
5481 priv->sw_scan_start = false;
5482
5483 /* clear all stats */
5484 ioread32(priv->regs + BBU_RXRDY_CNT_REG);
5485 ioread32(priv->regs + NOK_CCA_CNT_REG);
5486 mwl8k_cmd_bbp_reg_access(priv->hw, 0, BBU_AVG_NOISE_VAL, &tmp);
5487}
5488
5451static const struct ieee80211_ops mwl8k_ops = { 5489static const struct ieee80211_ops mwl8k_ops = {
5452 .tx = mwl8k_tx, 5490 .tx = mwl8k_tx,
5453 .start = mwl8k_start, 5491 .start = mwl8k_start,
@@ -5466,6 +5504,8 @@ static const struct ieee80211_ops mwl8k_ops = {
5466 .get_stats = mwl8k_get_stats, 5504 .get_stats = mwl8k_get_stats,
5467 .get_survey = mwl8k_get_survey, 5505 .get_survey = mwl8k_get_survey,
5468 .ampdu_action = mwl8k_ampdu_action, 5506 .ampdu_action = mwl8k_ampdu_action,
5507 .sw_scan_start = mwl8k_sw_scan_start,
5508 .sw_scan_complete = mwl8k_sw_scan_complete,
5469}; 5509};
5470 5510
5471static void mwl8k_finalize_join_worker(struct work_struct *work) 5511static void mwl8k_finalize_join_worker(struct work_struct *work)