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

Pontus Fuchs pontus.fuchs at gmail.com
Tue Jun 4 04:35:19 EDT 2013


On 2013-06-04 08:04, Olof Johansson wrote:
> This commit enable Auto TX Rate adaption for standard ofdm/dsss rates.

Sweet!

> 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];

Looks ugly to me. Why not:

struct ieee80211_hdr * hdr = (struct iee80211_hdr *) skb->data;



>   	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);

Then pass hdr (or even skb pointer) to fill_tx_bd.


>   	} 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)) {

and then

ieee80211_is_data(hdr->frame_control)


> +			if (ieee80211_is_mgmt(fc))
> +				bd->bd_rate = WCN36XX_BD_RATE_MGMT;
> +			if (ieee80211_is_ctl(fc))
> +				bd->bd_rate = WCN36XX_BD_RATE_CTRL;
> +		}
>   	}

//Pontus




More information about the wcn36xx mailing list