2011-01-21 03:04:27

by Sujith

[permalink] [raw]
Subject: [RFC/WIP 30/33] ath9k_htc: Fix host RX initialization

From: Sujith Manoharan <[email protected]>

There is no need to set the BSSID mask or opmode when
initializing RX, they would be set correctly in the HW reset
routine.

Signed-off-by: Sujith Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index 9913ef0..458164f 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -451,20 +451,12 @@ u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv)
static void ath9k_htc_opmode_init(struct ath9k_htc_priv *priv)
{
struct ath_hw *ah = priv->ah;
- struct ath_common *common = ath9k_hw_common(ah);
-
u32 rfilt, mfilt[2];

/* configure rx filter */
rfilt = ath9k_htc_calcrxfilter(priv);
ath9k_hw_setrxfilter(ah, rfilt);

- /* configure bssid mask */
- ath_hw_setbssidmask(common);
-
- /* configure operational mode */
- ath9k_hw_setopmode(ah);
-
/* calculate and install multicast filter */
mfilt[0] = mfilt[1] = ~0;
ath9k_hw_setmcastfilter(ah, mfilt[0], mfilt[1]);
--
1.7.3.5



Subject: Re: [RFC/WIP 30/33] ath9k_htc: Fix host RX initialization

On Fri, Jan 21, 2011 at 08:33:41AM +0530, Sujith wrote:
> From: Sujith Manoharan <[email protected]>
>
> There is no need to set the BSSID mask or opmode when
> initializing RX, they would be set correctly in the HW reset
> routine.
>
> Signed-off-by: Sujith Manoharan <[email protected]>
> ---
> drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 8 --------
> 1 files changed, 0 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
> index 9913ef0..458164f 100644
> --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
> +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
> @@ -451,20 +451,12 @@ u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv)
> static void ath9k_htc_opmode_init(struct ath9k_htc_priv *priv)
> {
> struct ath_hw *ah = priv->ah;
> - struct ath_common *common = ath9k_hw_common(ah);
> -
> u32 rfilt, mfilt[2];
>
> /* configure rx filter */
> rfilt = ath9k_htc_calcrxfilter(priv);
> ath9k_hw_setrxfilter(ah, rfilt);
>
> - /* configure bssid mask */
> - ath_hw_setbssidmask(common);
> -
> - /* configure operational mode */
> - ath9k_hw_setopmode(ah);

I think we need to take care a bug in reg AR_STA_ID1 configuration.
During hw reset, operating mode is set in AR_STA_ID1 but right after
it's overwritten. See the following code segment in
ath9k_hw_reset().

ath9k_hw_set_operating_mode(ah, ah->opmode);

ENABLE_REGWRITE_BUFFER(ah);

REG_WRITE(ah, AR_STA_ID0, get_unaligned_le32(common->macaddr));
REG_WRITE(ah, AR_STA_ID1, get_unaligned_le16(common->macaddr + 4)
| macStaId1
| AR_STA_ID1_RTS_USE_DEF
| (ah->config.
ack_6mb ? AR_STA_ID1_ACKCTS_6MB : 0)
| ah->sta_id1_defaults);


Existing code works because we configure the opmode again through
ath9k_htc_opmode_init() after reset.

Vasanth

2011-01-21 06:44:53

by Sujith

[permalink] [raw]
Subject: Re: [RFC/WIP 30/33] ath9k_htc: Fix host RX initialization

Vasanthakumar Thiagarajan wrote:
> I think we need to take care a bug in reg AR_STA_ID1 configuration.
> During hw reset, operating mode is set in AR_STA_ID1 but right after
> it's overwritten. See the following code segment in
> ath9k_hw_reset().
>
> ath9k_hw_set_operating_mode(ah, ah->opmode);
>
> ENABLE_REGWRITE_BUFFER(ah);
>
> REG_WRITE(ah, AR_STA_ID0, get_unaligned_le32(common->macaddr));
> REG_WRITE(ah, AR_STA_ID1, get_unaligned_le16(common->macaddr + 4)
> | macStaId1
> | AR_STA_ID1_RTS_USE_DEF
> | (ah->config.
> ack_6mb ? AR_STA_ID1_ACKCTS_6MB : 0)
> | ah->sta_id1_defaults);
>
>
> Existing code works because we configure the opmode again through
> ath9k_htc_opmode_init() after reset.

Looks like I changed this, see commit 6819d57f07440a8f9540967d9212a70e9c98eceb
But yes, opmode_init() in both ath9k and ath9k_htc takes care of this.
I'll fix this.

Sujith