[PATCH 1/1] Enable different bd_rates for different packet types

Olof Johansson dev at skyshaper.net
Tue Jun 4 02:06:22 EDT 2013


With this it goes up to eleven.. I mean 54.

I'll take a look at enabling n-rates next.

Pull request https://github.com/KrasnikovEugene/wcn36xx/pull/45

On Tue, Jun 4, 2013 at 8:04 AM, Olof Johansson <dev at skyshaper.net> wrote:
> This commit enable Auto TX Rate adaption for standard ofdm/dsss rates.
>
> Signed-off-by: Olof Johansson <dev at skyshaper.net>
> ---
>  dxe.c  | 6 ++++--
>  txrx.c | 9 +++++++--
>  txrx.h | 7 ++++++-
>  3 files changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/dxe.c b/dxe.c
> index b5940f0..ec3cff3 100644
> --- a/dxe.c
> +++ b/dxe.c
> @@ -483,6 +483,7 @@ int wcn36xx_dxe_tx(struct wcn36xx *wcn,
>         struct wcn36xx_dxe_ctl *ctl = NULL;
>         struct wcn36xx_dxe_desc *desc = NULL;
>         struct wcn36xx_dxe_ch *ch = NULL;
> +       u16 fc;
>
>         ch = is_high ? &wcn->dxe_tx_h_ch : &wcn->dxe_tx_l_ch;
>
> @@ -500,12 +501,13 @@ int wcn36xx_dxe_tx(struct wcn36xx *wcn,
>                 return -EINVAL;
>         }
>
> +       fc = ((u16*)skb->data)[0];
>         wcn36xx_prepare_tx_bd(ctl->bd_cpu_addr, skb->len, header_len);
>         if (!is_high && WCN36XX_BSS_KEY == wcn->en_state) {
>                 wcn36xx_dbg(WCN36XX_DBG_DXE, "DXE Encription enabled");
> -               wcn36xx_fill_tx_bd(wcn, ctl->bd_cpu_addr, broadcast, 0);
> +               wcn36xx_fill_tx_bd(wcn, ctl->bd_cpu_addr, broadcast, 0, fc);
>         } else {
> -               wcn36xx_fill_tx_bd(wcn, ctl->bd_cpu_addr, broadcast, 1);
> +               wcn36xx_fill_tx_bd(wcn, ctl->bd_cpu_addr, broadcast, 1, fc);
>         }
>
>         ctl = ch->head_blk_ctl;
> diff --git a/txrx.c b/txrx.c
> index c52cc22..ca90b0f 100644
> --- a/txrx.c
> +++ b/txrx.c
> @@ -84,7 +84,7 @@ void wcn36xx_prepare_tx_bd(struct wcn36xx_tx_bd *bd,
> u32 len, u32 header_len)
>         bd->pdu.mpdu_len = len;
>  }
>  void wcn36xx_fill_tx_bd(struct wcn36xx *wcn, struct wcn36xx_tx_bd *bd,
> -                       u8 broadcast, u8 encrypt)
> +                       u8 broadcast, u8 encrypt, u16 fc)
>  {
>         bd->dpu_rf = WCN36XX_BMU_WQ_TX;
>         bd->pdu.tid   = WCN36XX_TID;
> @@ -103,8 +103,13 @@ void wcn36xx_fill_tx_bd(struct wcn36xx *wcn,
> struct wcn36xx_tx_bd *bd,
>         } else {
>                 bd->queue_id = WCN36XX_TX_U_WQ_ID;
>                 /* default rate for unicast */
> -               bd->bd_rate = 2;
>                 bd->ack_policy = 0;
> +               if (!ieee80211_is_data(fc)) {
> +                       if (ieee80211_is_mgmt(fc))
> +                               bd->bd_rate = WCN36XX_BD_RATE_MGMT;
> +                       if (ieee80211_is_ctl(fc))
> +                               bd->bd_rate = WCN36XX_BD_RATE_CTRL;
> +               }
>         }
>
>         bd->sta_index = wcn->current_vif->sta_index;
> diff --git a/txrx.h b/txrx.h
> index c2b9a0f..d4199a8 100644
> --- a/txrx.h
> +++ b/txrx.h
> @@ -27,6 +27,11 @@
>  /* broadcast wq ID */
>  #define WCN36XX_TX_B_WQ_ID             0xA
>  #define WCN36XX_TX_U_WQ_ID             0x9
> +/* bd_rate */
> +#define WCN36XX_BD_RATE_DATA 0
> +#define WCN36XX_BD_RATE_MGMT 2
> +#define WCN36XX_BD_RATE_CTRL 3
> +
>  struct wcn36xx_pdu {
>         u32     dpu_fb:8;
>         u32     adu_fb:8;
> @@ -146,5 +151,5 @@ struct wcn36xx_tx_bd {
>  int  wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb);
>  void wcn36xx_prepare_tx_bd(struct wcn36xx_tx_bd *bd, u32 len, u32 header_len);
>  void wcn36xx_fill_tx_bd(struct wcn36xx *wcn, struct wcn36xx_tx_bd *bd,
> -                       u8 broadcast, u8 encrypt);
> +                       u8 broadcast, u8 encrypt, u16 fc);
>  #endif /* _TXRX_H_ */
> --
> 1.8.2.2



More information about the wcn36xx mailing list