linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ath9k patches
@ 2014-08-23 13:42 Sujith Manoharan
  2014-08-23 13:42 ` [PATCH 1/4] ath9k: Fix channel context variables in ath_softc Sujith Manoharan
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sujith Manoharan @ 2014-08-23 13:42 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, ath9k-devel

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Third series cleaning up the channel context code. Most of the code
has been moved inside CONFIG_ATH9K_CHANNEL_CONTEXT. Since the normal
path also makes use of certain channel context specific variables,
they have been left unmodified - like 'cur_chan', 'cur_chandef' etc.

After this series, just 3 functions in channel.c are outside
CONFIG_ATH9K_CHANNEL_CONTEXT.

All the pending patches are in:
http://msujith.org/dir/patches/wl/Aug-23-2014/

Sujith

Sujith Manoharan (4):
  ath9k: Fix channel context variables in ath_softc
  ath9k: Remove redundant ifdef
  ath9k: Move ath9k_beacon_add_noa to channel.c
  ath9k: Fix ath_chanctx_get()

 drivers/net/wireless/ath/ath9k/ath9k.h   | 29 ++++++++++++++----
 drivers/net/wireless/ath/ath9k/beacon.c  | 49 ------------------------------
 drivers/net/wireless/ath/ath9k/channel.c | 51 ++++++++++++++++++++++++++++++--
 3 files changed, 72 insertions(+), 57 deletions(-)

-- 
2.0.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] ath9k: Fix channel context variables in ath_softc
  2014-08-23 13:42 [PATCH 0/4] ath9k patches Sujith Manoharan
@ 2014-08-23 13:42 ` Sujith Manoharan
  2014-08-23 13:42 ` [PATCH 2/4] ath9k: Remove redundant ifdef Sujith Manoharan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Sujith Manoharan @ 2014-08-23 13:42 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, ath9k-devel

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

chanctx_work and next_chan are required only when
CONFIG_ATH9K_CHANNEL_CONTEXT is enabled.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/ath9k.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 02664b3..a2f4fa7 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -324,6 +324,10 @@ struct ath_rx {
 	u32 ampdu_ref;
 };
 
+/*******************/
+/* Channel Context */
+/*******************/
+
 struct ath_chanctx {
 	struct cfg80211_chan_def chandef;
 	struct list_head vifs;
@@ -917,15 +921,16 @@ struct ath_softc {
 	struct mutex mutex;
 	struct work_struct paprd_work;
 	struct work_struct hw_reset_work;
-	struct work_struct chanctx_work;
 	struct completion paprd_complete;
 	wait_queue_head_t tx_wait;
 
 #ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
+	struct work_struct chanctx_work;
 	struct ath_gen_timer *p2p_ps_timer;
 	struct ath_vif *p2p_ps_vif;
 	struct ath_chanctx_sched sched;
 	struct ath_offchannel offchannel;
+	struct ath_chanctx *next_chan;
 #endif
 
 	unsigned long driver_data;
@@ -947,7 +952,6 @@ struct ath_softc {
 	struct cfg80211_chan_def cur_chandef;
 	struct ath_chanctx chanctx[ATH9K_NUM_CHANCTX];
 	struct ath_chanctx *cur_chan;
-	struct ath_chanctx *next_chan;
 	spinlock_t chan_lock;
 
 #ifdef CONFIG_MAC80211_LEDS
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] ath9k: Remove redundant ifdef
  2014-08-23 13:42 [PATCH 0/4] ath9k patches Sujith Manoharan
  2014-08-23 13:42 ` [PATCH 1/4] ath9k: Fix channel context variables in ath_softc Sujith Manoharan
@ 2014-08-23 13:42 ` Sujith Manoharan
  2014-08-23 13:42 ` [PATCH 3/4] ath9k: Move ath9k_beacon_add_noa to channel.c Sujith Manoharan
  2014-08-23 13:42 ` [PATCH 4/4] ath9k: Fix ath_chanctx_get() Sujith Manoharan
  3 siblings, 0 replies; 5+ messages in thread
From: Sujith Manoharan @ 2014-08-23 13:42 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, ath9k-devel

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

This was introduced in an earlier patch to handle
a compilation warning, but since the channel context
code has been mostly isolated, this is not required now.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/channel.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index 08bb14c..7aa9535 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -257,9 +257,7 @@ static void ath_chanctx_setup_timer(struct ath_softc *sc, u32 tsf_time)
 {
 	struct ath_hw *ah = sc->sc_ah;
 
-#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
 	ath9k_hw_gen_timer_start(ah, sc->p2p_ps_timer, tsf_time, 1000000);
-#endif
 	tsf_time -= ath9k_hw_gettsf32(ah);
 	tsf_time = msecs_to_jiffies(tsf_time / 1000) + 1;
 	mod_timer(&sc->sched.timer, tsf_time);
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] ath9k: Move ath9k_beacon_add_noa to channel.c
  2014-08-23 13:42 [PATCH 0/4] ath9k patches Sujith Manoharan
  2014-08-23 13:42 ` [PATCH 1/4] ath9k: Fix channel context variables in ath_softc Sujith Manoharan
  2014-08-23 13:42 ` [PATCH 2/4] ath9k: Remove redundant ifdef Sujith Manoharan
@ 2014-08-23 13:42 ` Sujith Manoharan
  2014-08-23 13:42 ` [PATCH 4/4] ath9k: Fix ath_chanctx_get() Sujith Manoharan
  3 siblings, 0 replies; 5+ messages in thread
From: Sujith Manoharan @ 2014-08-23 13:42 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, ath9k-devel

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/ath9k.h   |  7 +++++
 drivers/net/wireless/ath/ath9k/beacon.c  | 49 --------------------------------
 drivers/net/wireless/ath/ath9k/channel.c | 49 ++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+), 49 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index a2f4fa7..9e61679 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -31,6 +31,7 @@
 #include "spectral.h"
 
 struct ath_node;
+struct ath_vif;
 
 extern struct ieee80211_ops ath9k_ops;
 extern int ath9k_modparam_nohwcrypt;
@@ -434,6 +435,8 @@ void ath9k_p2p_remove_vif(struct ath_softc *sc,
 void ath9k_p2p_beacon_sync(struct ath_softc *sc);
 void ath9k_p2p_bss_info_changed(struct ath_softc *sc,
 				struct ieee80211_vif *vif);
+void ath9k_beacon_add_noa(struct ath_softc *sc, struct ath_vif *avp,
+			  struct sk_buff *skb);
 void ath9k_p2p_ps_timer(void *priv);
 void ath9k_chanctx_wake_queues(struct ath_softc *sc);
 void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx);
@@ -496,6 +499,10 @@ static inline void ath9k_p2p_bss_info_changed(struct ath_softc *sc,
 					      struct ieee80211_vif *vif)
 {
 }
+static inline void ath9k_beacon_add_noa(struct ath_softc *sc, struct ath_vif *avp,
+					struct sk_buff *skb)
+{
+}
 static inline void ath9k_p2p_ps_timer(struct ath_softc *sc)
 {
 }
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index dc68d11..b2f56d8 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -108,55 +108,6 @@ static void ath9k_beacon_setup(struct ath_softc *sc, struct ieee80211_vif *vif,
 	ath9k_hw_set_txdesc(ah, bf->bf_desc, &info);
 }
 
-static void ath9k_beacon_add_noa(struct ath_softc *sc, struct ath_vif *avp,
-				 struct sk_buff *skb)
-{
-	static const u8 noa_ie_hdr[] = {
-		WLAN_EID_VENDOR_SPECIFIC,	/* type */
-		0,				/* length */
-		0x50, 0x6f, 0x9a,		/* WFA OUI */
-		0x09,				/* P2P subtype */
-		0x0c,				/* Notice of Absence */
-		0x00,				/* LSB of little-endian len */
-		0x00,				/* MSB of little-endian len */
-	};
-
-	struct ieee80211_p2p_noa_attr *noa;
-	int noa_len, noa_desc, i = 0;
-	u8 *hdr;
-
-	if (!avp->offchannel_duration && !avp->periodic_noa_duration)
-		return;
-
-	noa_desc = !!avp->offchannel_duration + !!avp->periodic_noa_duration;
-	noa_len = 2 + sizeof(struct ieee80211_p2p_noa_desc) * noa_desc;
-
-	hdr = skb_put(skb, sizeof(noa_ie_hdr));
-	memcpy(hdr, noa_ie_hdr, sizeof(noa_ie_hdr));
-	hdr[1] = sizeof(noa_ie_hdr) + noa_len - 2;
-	hdr[7] = noa_len;
-
-	noa = (void *) skb_put(skb, noa_len);
-	memset(noa, 0, noa_len);
-
-	noa->index = avp->noa_index;
-	if (avp->periodic_noa_duration) {
-		u32 interval = TU_TO_USEC(sc->cur_chan->beacon.beacon_interval);
-
-		noa->desc[i].count = 255;
-		noa->desc[i].start_time = cpu_to_le32(avp->periodic_noa_start);
-		noa->desc[i].duration = cpu_to_le32(avp->periodic_noa_duration);
-		noa->desc[i].interval = cpu_to_le32(interval);
-		i++;
-	}
-
-	if (avp->offchannel_duration) {
-		noa->desc[i].count = 1;
-		noa->desc[i].start_time = cpu_to_le32(avp->offchannel_start);
-		noa->desc[i].duration = cpu_to_le32(avp->offchannel_duration);
-	}
-}
-
 static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw,
 					     struct ieee80211_vif *vif)
 {
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index 7aa9535..0e64b73 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -1042,6 +1042,55 @@ static void ath9k_update_p2p_ps(struct ath_softc *sc, struct ieee80211_vif *vif)
 	ath9k_update_p2p_ps_timer(sc, avp);
 }
 
+void ath9k_beacon_add_noa(struct ath_softc *sc, struct ath_vif *avp,
+			  struct sk_buff *skb)
+{
+	static const u8 noa_ie_hdr[] = {
+		WLAN_EID_VENDOR_SPECIFIC,	/* type */
+		0,				/* length */
+		0x50, 0x6f, 0x9a,		/* WFA OUI */
+		0x09,				/* P2P subtype */
+		0x0c,				/* Notice of Absence */
+		0x00,				/* LSB of little-endian len */
+		0x00,				/* MSB of little-endian len */
+	};
+
+	struct ieee80211_p2p_noa_attr *noa;
+	int noa_len, noa_desc, i = 0;
+	u8 *hdr;
+
+	if (!avp->offchannel_duration && !avp->periodic_noa_duration)
+		return;
+
+	noa_desc = !!avp->offchannel_duration + !!avp->periodic_noa_duration;
+	noa_len = 2 + sizeof(struct ieee80211_p2p_noa_desc) * noa_desc;
+
+	hdr = skb_put(skb, sizeof(noa_ie_hdr));
+	memcpy(hdr, noa_ie_hdr, sizeof(noa_ie_hdr));
+	hdr[1] = sizeof(noa_ie_hdr) + noa_len - 2;
+	hdr[7] = noa_len;
+
+	noa = (void *) skb_put(skb, noa_len);
+	memset(noa, 0, noa_len);
+
+	noa->index = avp->noa_index;
+	if (avp->periodic_noa_duration) {
+		u32 interval = TU_TO_USEC(sc->cur_chan->beacon.beacon_interval);
+
+		noa->desc[i].count = 255;
+		noa->desc[i].start_time = cpu_to_le32(avp->periodic_noa_start);
+		noa->desc[i].duration = cpu_to_le32(avp->periodic_noa_duration);
+		noa->desc[i].interval = cpu_to_le32(interval);
+		i++;
+	}
+
+	if (avp->offchannel_duration) {
+		noa->desc[i].count = 1;
+		noa->desc[i].start_time = cpu_to_le32(avp->offchannel_start);
+		noa->desc[i].duration = cpu_to_le32(avp->offchannel_duration);
+	}
+}
+
 void ath9k_p2p_ps_timer(void *priv)
 {
 	struct ath_softc *sc = priv;
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] ath9k: Fix ath_chanctx_get()
  2014-08-23 13:42 [PATCH 0/4] ath9k patches Sujith Manoharan
                   ` (2 preceding siblings ...)
  2014-08-23 13:42 ` [PATCH 3/4] ath9k: Move ath9k_beacon_add_noa to channel.c Sujith Manoharan
@ 2014-08-23 13:42 ` Sujith Manoharan
  3 siblings, 0 replies; 5+ messages in thread
From: Sujith Manoharan @ 2014-08-23 13:42 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, ath9k-devel

From: Sujith Manoharan <c_manoha@qca.qualcomm.com>

Move it inside a CONFIG_ATH9K_CHANNEL_CONTEXT ifdef
since it is not needed otherwise.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath9k/ath9k.h | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 9e61679..acbe2b7 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -413,16 +413,19 @@ struct ath_offchannel {
 	     ctx <= &sc->chanctx[ARRAY_SIZE(sc->chanctx) - 1];      \
 	     ctx++)
 
+void ath_chanctx_init(struct ath_softc *sc);
+void ath_chanctx_set_channel(struct ath_softc *sc, struct ath_chanctx *ctx,
+			     struct cfg80211_chan_def *chandef);
+
+#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
+
 static inline struct ath_chanctx *
 ath_chanctx_get(struct ieee80211_chanctx_conf *ctx)
 {
 	struct ath_chanctx **ptr = (void *) ctx->drv_priv;
 	return *ptr;
 }
-void ath_chanctx_init(struct ath_softc *sc);
-void ath_chanctx_set_channel(struct ath_softc *sc, struct ath_chanctx *ctx,
-			     struct cfg80211_chan_def *chandef);
-#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
+
 bool ath9k_is_chanctx_enabled(void);
 void ath9k_fill_chanctx_ops(void);
 void ath9k_init_channel_context(struct ath_softc *sc);
@@ -451,7 +454,9 @@ void ath_chanctx_set_next(struct ath_softc *sc, bool force);
 void ath_offchannel_next(struct ath_softc *sc);
 void ath_scan_complete(struct ath_softc *sc, bool abort);
 void ath_roc_complete(struct ath_softc *sc, bool abort);
+
 #else
+
 static inline bool ath9k_is_chanctx_enabled(void)
 {
 	return false;
@@ -513,6 +518,7 @@ static inline void ath_chanctx_check_active(struct ath_softc *sc,
 					    struct ath_chanctx *ctx)
 {
 }
+
 #endif /* CONFIG_ATH9K_CHANNEL_CONTEXT */
 
 int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan);
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-23 13:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-23 13:42 [PATCH 0/4] ath9k patches Sujith Manoharan
2014-08-23 13:42 ` [PATCH 1/4] ath9k: Fix channel context variables in ath_softc Sujith Manoharan
2014-08-23 13:42 ` [PATCH 2/4] ath9k: Remove redundant ifdef Sujith Manoharan
2014-08-23 13:42 ` [PATCH 3/4] ath9k: Move ath9k_beacon_add_noa to channel.c Sujith Manoharan
2014-08-23 13:42 ` [PATCH 4/4] ath9k: Fix ath_chanctx_get() Sujith Manoharan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).