Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: <linville@tuxdriver.com>, <linville@tuxdriver.com>
Cc: <linux-wireless@vger.kernel.org>, <ath9k-devel@lists.ath9k.org>,
	<jouni.malinen@atheros.com>,
	Sujith Manoharan <smanoharan@atheros.com>,
	<linux-wireless@vger.kernel.org>, <ath9k-devel@lists.ath9k.org>,
	Sujith <Sujith.Manoharan@atheros.com>,
	Vasanthakumar Thiagarajan <vasanth@atheros.com>,
	"Luis R. Rodriguez" <lrodriguez@atheros.com>
Subject: [PATCH 02/12] ath9k: Update rate control after association
Date: Sat, 2 Aug 2008 16:48:54 -0700	[thread overview]
Message-ID: <1217720944-23234-3-git-send-email-lrodriguez@atheros.com> (raw)
In-Reply-To: <1217720944-23234-2-git-send-email-lrodriguez@atheros.com>

From: Sujith Manoharan <smanoharan@atheros.com>

Rate control node has to be updated after setting the channel.
And remove an unused variable in ath_rate_newstate(). Be sure
to have a proper rate table for 11a mode before updating the
rate control based on the new mode.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath9k/core.c |    2 +-
 drivers/net/wireless/ath9k/core.h |    1 +
 drivers/net/wireless/ath9k/main.c |   11 ++++++-----
 drivers/net/wireless/ath9k/rc.c   |    7 ++++---
 drivers/net/wireless/ath9k/rc.h   |    3 ++-
 5 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c
index 587f307..6a61064 100644
--- a/drivers/net/wireless/ath9k/core.c
+++ b/drivers/net/wireless/ath9k/core.c
@@ -595,7 +595,7 @@ int ath_vap_listen(struct ath_softc *sc, int if_id)
 #endif
 
 	/* update ratectrl about the new state */
-	ath_rate_newstate(sc, avp, 0);
+	ath_rate_newstate(sc, avp);
 
 	rfilt = ath_calcrxfilter(sc);
 	ath9k_hw_setrxfilter(ah, rfilt);
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h
index fdd0f87..e2b42f2 100644
--- a/drivers/net/wireless/ath9k/core.h
+++ b/drivers/net/wireless/ath9k/core.h
@@ -792,6 +792,7 @@ struct ath_vap {
 						transmit queue */
 	struct ath_vap_config           av_config;  /* vap configuration
 					parameters from 802.11 protocol layer*/
+	struct ath_rate_node            *rc_node;
 };
 
 int ath_vap_attach(struct ath_softc *sc,
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index 7ef0d58..c47ef50 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -447,7 +447,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
 #endif
 
 	/* Update ratectrl */
-	ath_rate_newstate(sc, avp, 0);
+	ath_rate_newstate(sc, avp);
 
 	/* Reclaim beacon resources */
 	if (sc->sc_opmode == HAL_M_HOSTAP || sc->sc_opmode == HAL_M_IBSS) {
@@ -513,7 +513,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
 		case IEEE80211_IF_TYPE_STA:
 		case IEEE80211_IF_TYPE_IBSS:
 			/* Update ratectrl about the new state */
-			ath_rate_newstate(sc, avp, 0);
+			ath_rate_newstate(sc, avp);
 
 			/* Set rx filter */
 			rfilt = ath_calcrxfilter(sc);
@@ -788,9 +788,6 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
 			return;
 		}
 
-		/* Update ratectrl about the new state */
-		ath_rate_newstate(sc, avp, 1);
-
 		/* New association, store aid */
 		if (avp->av_opmode == HAL_M_STA) {
 			sc->sc_curaid = bss_conf->aid;
@@ -828,6 +825,10 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
 			DPRINTF(sc, ATH_DBG_FATAL,
 				"%s: Unable to set channel\n",
 				__func__);
+
+		ath_rate_newstate(sc, avp);
+		/* Update ratectrl about the new state */
+		ath_rc_node_update(hw, avp->rc_node);
 	} else {
 		DPRINTF(sc, ATH_DBG_CONFIG,
 		"%s: Bss Info DISSOC\n", __func__);
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c
index 83b8f2d..ecab05f 100644
--- a/drivers/net/wireless/ath9k/rc.c
+++ b/drivers/net/wireless/ath9k/rc.c
@@ -797,6 +797,8 @@ static struct ath_rate_node *ath_rate_node_alloc(struct ath_vap *avp,
 
 	anode->avp = avp;
 	anode->asc = rsc;
+	avp->rc_node = anode;
+
 	return anode;
 }
 
@@ -838,7 +840,7 @@ u_int8_t ath_rate_findrateix(struct ath_softc *sc,
  * with an AP.  Otherwise this gets called, for example, when
  * the we transition to run state when operating as an AP.
  */
-void ath_rate_newstate(struct ath_softc *sc, struct ath_vap *avp, int up)
+void ath_rate_newstate(struct ath_softc *sc, struct ath_vap *avp)
 {
 	struct ath_rate_softc *asc = sc->sc_rc;
 
@@ -1833,8 +1835,7 @@ static void ath_setup_rates(struct ieee80211_local *local, struct sta_info *sta)
 	rc_priv->neg_rates.rs_nrates = j;
 }
 
-static void ath_rc_node_update(struct ieee80211_hw *hw,
-				struct ath_rate_node *rc_priv)
+void ath_rc_node_update(struct ieee80211_hw *hw, struct ath_rate_node *rc_priv)
 {
 	struct ath_softc *sc = hw->priv;
 	u_int32_t capflag = 0;
diff --git a/drivers/net/wireless/ath9k/rc.h b/drivers/net/wireless/ath9k/rc.h
index 3ed04b2..1c54924 100644
--- a/drivers/net/wireless/ath9k/rc.h
+++ b/drivers/net/wireless/ath9k/rc.h
@@ -294,7 +294,8 @@ void ath_rate_detach(struct ath_rate_softc *asc);
  * Important mostly as the analog to ath_rate_newassoc when operating
  * in station mode.
  */
-void ath_rate_newstate(struct ath_softc *sc, struct ath_vap *avp, int up);
+void ath_rc_node_update(struct ieee80211_hw *hw, struct ath_rate_node *rc_priv);
+void ath_rate_newstate(struct ath_softc *sc, struct ath_vap *avp);
 
 /*
  * Return the tx rate series.
-- 
1.5.6.rc2.15.g457bb.dirty


  parent reply	other threads:[~2008-08-02 23:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-02 23:48 [PATCH 00/12] ath9k: more cleanups for 2.6.27 Luis R. Rodriguez
     [not found] ` <1217720944-23234-2-git-send-email-lrodriguez@atheros.com>
2008-08-02 23:48   ` Luis R. Rodriguez [this message]
2008-08-02 23:48     ` [PATCH 03/12] ath9k: Channel cleanup Luis R. Rodriguez
2008-08-02 23:48       ` [PATCH 04/12] ath9k: Fix channel registration Luis R. Rodriguez
2008-08-02 23:48         ` [PATCH 05/12] ath9k: Consolidate channel list Luis R. Rodriguez
2008-08-02 23:48           ` [PATCH 06/12] ath9k: Pass channel mode when setting a channel Luis R. Rodriguez
2008-08-02 23:48             ` [PATCH 07/12] ath9k: Channel structure cleanup Luis R. Rodriguez
2008-08-02 23:49               ` [PATCH 08/12] ath9k: We don't have a HAL anymore :) Luis R. Rodriguez
     [not found]                 ` <1217720944-23234-10-git-send-email-lrodriguez@atheros.com>
2008-08-02 23:49                   ` [PATCH 10/12] ath9k: Port to new skb->cb mac80211 changes Luis R. Rodriguez
2008-08-02 23:49                     ` [PATCH 11/12] ath9k: Add initial link quality reporting Luis R. Rodriguez
2008-08-02 23:49                       ` [PATCH 12/12] ath9k: Use u8/u16/u32 Luis R. Rodriguez
2008-08-03  0:18 ` [PATCH 00/12] ath9k: more cleanups for 2.6.27 Luis R. Rodriguez
2008-08-03  9:18   ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1217720944-23234-3-git-send-email-lrodriguez@atheros.com \
    --to=lrodriguez@atheros.com \
    --cc=Sujith.Manoharan@atheros.com \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=jouni.malinen@atheros.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=smanoharan@atheros.com \
    --cc=vasanth@atheros.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox