2011-01-21 03:02:11

by Sujith

[permalink] [raw]
Subject: [RFC/WIP 15/33] ath9k_htc: Add ANI for AP mode

From: Sujith Manoharan <[email protected]>

The time granularity for the ANI task is different for AP and
station mode.

Signed-off-by: Sujith Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/htc.h | 1 +
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index 378aba3..83deb94 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -32,6 +32,7 @@
#include "wmi.h"

#define ATH_STA_SHORT_CALINTERVAL 1000 /* 1 second */
+#define ATH_AP_SHORT_CALINTERVAL 100 /* 100 ms */
#define ATH_ANI_POLLINTERVAL 100 /* 100 ms */
#define ATH_LONG_CALINTERVAL 30000 /* 30 seconds */
#define ATH_RESTART_CALINTERVAL 1200000 /* 20 minutes */
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index ce11b96..f986d93 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -952,7 +952,8 @@ void ath9k_ani_work(struct work_struct *work)
unsigned int timestamp = jiffies_to_msecs(jiffies);
u32 cal_interval, short_cal_interval;

- short_cal_interval = ATH_STA_SHORT_CALINTERVAL;
+ short_cal_interval = (ah->opmode == NL80211_IFTYPE_AP) ?
+ ATH_AP_SHORT_CALINTERVAL : ATH_STA_SHORT_CALINTERVAL;

/* Only calibrate if awake */
if (ah->power_mode != ATH9K_PM_AWAKE)
@@ -1269,6 +1270,9 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
INC_VIF(priv, vif->type);
ath9k_htc_set_opmode(priv);

+ if (priv->ah->opmode == NL80211_IFTYPE_AP)
+ ath_start_ani(priv);
+
ath_dbg(common, ATH_DBG_CONFIG,
"Attach a VIF of type: %d at idx: %d\n", vif->type, avp->index);

@@ -1302,6 +1306,9 @@ static void ath9k_htc_remove_interface(struct ieee80211_hw *hw,
ath9k_htc_remove_station(priv, vif, NULL);
priv->vif = NULL;

+ if (priv->ah->opmode == NL80211_IFTYPE_AP)
+ cancel_delayed_work_sync(&priv->ath9k_ani_work);
+
DEC_VIF(priv, vif->type);
ath9k_htc_set_opmode(priv);

--
1.7.3.5



2011-01-21 06:45:47

by Sujith

[permalink] [raw]
Subject: Re: [RFC/WIP 15/33] ath9k_htc: Add ANI for AP mode

Vasanthakumar Thiagarajan wrote:
> On Fri, Jan 21, 2011 at 08:31:24AM +0530, Sujith wrote:
> > From: Sujith Manoharan <[email protected]>
> >
> > + if (priv->ah->opmode == NL80211_IFTYPE_AP)
> > + cancel_delayed_work_sync(&priv->ath9k_ani_work);
> > +
>
> What about ANI for other vifs?

I have a half-finished patch handling ANI in multi-VIF scenario, will
fold it into this.

Sujith

Subject: Re: [RFC/WIP 15/33] ath9k_htc: Add ANI for AP mode

On Fri, Jan 21, 2011 at 08:31:24AM +0530, Sujith wrote:
> From: Sujith Manoharan <[email protected]>
>
> + if (priv->ah->opmode == NL80211_IFTYPE_AP)
> + cancel_delayed_work_sync(&priv->ath9k_ani_work);
> +

What about ANI for other vifs?

Vasanth