All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@gmail.com>
To: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 3/3] ath9k: Implement an algorithm for Antenna diversity and combining
Date: Thu, 29 Jul 2010 07:39:35 -0700	[thread overview]
Message-ID: <AANLkTimiQZj7Gh5g+W0pcuWYFejt4EGQVCEQQ1aNvsk5@mail.gmail.com> (raw)
In-Reply-To: <1280408219-5293-3-git-send-email-vasanth@atheros.com>

On Thu, Jul 29, 2010 at 5:56 AM, Vasanthakumar Thiagarajan
<vasanth@atheros.com> wrote:
> This algorithm chooses the best main and alt lna out of
> LNA1, LNA2, LNA1+LNA2 and LNA1-LNA2 to improve rx for single
> chain chips(AR9285). This would greatly improve rx when there
> is only one antenna is connected with AR9285.
>
> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>

> diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
> index 243c177..8b4e4a6 100644
> --- a/drivers/net/wireless/ath/ath9k/init.c
> +++ b/drivers/net/wireless/ath/ath9k/init.c
> @@ -531,6 +531,11 @@ static void ath9k_init_misc(struct ath_softc *sc)
>                sc->beacon.bslot[i] = NULL;
>                sc->beacon.bslot_aphy[i] = NULL;
>        }
> +
> +       if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB) {
> +               memset(&sc->ant_comb, 0, sizeof(struct ath_ant_comb));

I do not believe this memset is required since we kzalloc()'d the ah struct.

> +               sc->ant_comb.count = ATH_ANT_DIV_COMB_INIT_COUNT;
> +       }
>  }
>
>  static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
> diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
> index da0cfe9..711e8d2 100644
> --- a/drivers/net/wireless/ath/ath9k/recv.c
> +++ b/drivers/net/wireless/ath/ath9k/recv.c
> @@ -1073,6 +1073,534 @@ static void ath9k_rx_skb_postprocess(struct ath_common *common,
>                rxs->flag &= ~RX_FLAG_DECRYPTED;
>  }
>
> +/* Antenna diversity and combining */
> +static void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs)
> +{

   <-- snip -->

> +       ath9k_hw_antdiv_comb_conf_get(sc->sc_ah, &div_ant_conf);

  <-- snip -->

> +       ath9k_hw_antdiv_comb_conf_set(sc->sc_ah, &div_ant_conf);

  <-- snip -->

> +}

Wow this routine is pretty large. Could you split this up into a few
helpers which describe what they do ?
Also notice how this ended up calling ath9k_hw_antdiv_comb_conf_get()
and ath9k_hw_antdiv_comb_conf_set(), the only callers of those
routines, and this itself is done when:

> +
>  int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
>  {
>        struct ath_buf *bf;
> @@ -1210,6 +1738,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
>                                              PS_WAIT_FOR_PSPOLL_DATA))))
>                        ath_rx_ps(sc, skb);
>
> +               if (ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)
> +                       ath_ant_comb_scan(sc, &rs);
> +
>                ath_rx_send_to_mac80211(hw, sc, skb, rxs);
>
>  requeue:

So the call currently really does not require to be abstracted away
unless we expect another 1x1 device where it will have its own set of
calls, eventually.

  Luis

  reply	other threads:[~2010-07-29 14:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29 12:56 [PATCH 1/3] ath9k_hw: Add capability flag for Antenna diversity and combining feature Vasanthakumar Thiagarajan
2010-07-29 12:56 ` [PATCH 2/3] ath9k_hw: Add functions to get/set antenna diversity configuration Vasanthakumar Thiagarajan
2010-07-29 12:56 ` [PATCH 3/3] ath9k: Implement an algorithm for Antenna diversity and combining Vasanthakumar Thiagarajan
2010-07-29 14:39   ` Luis R. Rodriguez [this message]
2010-07-30  5:36     ` Vasanthakumar Thiagarajan
2010-09-02  8:34 [PATCH 1/3] ath9k_hw: Add capability flag for Antenna diversity and combining feature Vasanthakumar Thiagarajan
2010-09-02  8:34 ` [PATCH 3/3] ath9k: Implement an algorithm for Antenna diversity and combining Vasanthakumar Thiagarajan
2010-09-02  8:37   ` Vasanthakumar Thiagarajan

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=AANLkTimiQZj7Gh5g+W0pcuWYFejt4EGQVCEQQ1aNvsk5@mail.gmail.com \
    --to=mcgrof@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.