public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: sean.wang@mediatek.com
Cc: nbd@nbd.name, Soul.Huang@mediatek.com, YN.Chen@mediatek.com,
	Leon.Yen@mediatek.com, Eric-SY.Chang@mediatek.com,
	Deren.Wu@mediatek.com, km.lin@mediatek.com,
	robin.chiu@mediatek.com, Eddie.Chen@mediatek.com,
	ch.yeh@mediatek.com, posh.sun@mediatek.com,
	ted.huang@mediatek.com, Eric.Liang@mediatek.com,
	Stella.Chang@mediatek.com, Tom.Chou@mediatek.com,
	steve.lee@mediatek.com, jsiuda@google.com, frankgor@google.com,
	jemele@google.com, shawnku@google.com,
	linux-wireless@vger.kernel.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] mt76: mt7921: add MU EDCA cmd support
Date: Thu, 7 Oct 2021 22:26:11 +0200	[thread overview]
Message-ID: <YV9X43y1pQCDApd5@localhost.localdomain> (raw)
In-Reply-To: <181a8f619a55c5a509c838d2ea5ec64641d4aa19.1633632336.git.objelf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3658 bytes --]

> From: Sean Wang <sean.wang@mediatek.com>
> 
> Add MU EDCA MCU command support to update MU AC parameter record field
> from the access point.
> 
> Co-developed-by: Eric-SY Chang <Eric-SY.Chang@mediatek.com>
> Signed-off-by: Eric-SY Chang <Eric-SY.Chang@mediatek.com>
> Tested-by: Eric-SY Chang <Eric-SY.Chang@mediatek.com>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> ---
>  .../wireless/mediatek/mt76/mt76_connac_mcu.h  |  1 +
>  .../net/wireless/mediatek/mt76/mt7921/mcu.c   | 56 ++++++++++++++++++-
>  2 files changed, 54 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
> index cb36dd39221c..0ce670d65673 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
> @@ -563,6 +563,7 @@ enum {
>  	MCU_CMD_SCHED_SCAN_ENABLE = MCU_CE_PREFIX | 0x61,
>  	MCU_CMD_SCHED_SCAN_REQ = MCU_CE_PREFIX | 0x62,
>  	MCU_CMD_GET_NIC_CAPAB = MCU_CE_PREFIX | 0x8a,
> +	MCU_CMD_SET_MU_EDCA_PARMS = MCU_CE_PREFIX | 0xb0,
>  	MCU_CMD_REG_WRITE = MCU_CE_PREFIX | 0xc0,
>  	MCU_CMD_REG_READ = MCU_CE_PREFIX | MCU_QUERY_MASK | 0xc0,
>  	MCU_CMD_CHIP_CONFIG = MCU_CE_PREFIX | 0xca,
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> index 56fb7e54e283..53b2eaad2af7 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
> @@ -974,7 +974,31 @@ int mt7921_mcu_set_tx(struct mt7921_dev *dev, struct ieee80211_vif *vif)
>  		.total = IEEE80211_NUM_ACS,
>  	};
>  	struct mt7921_vif *mvif = (struct mt7921_vif *)vif->drv_priv;
> -	int ac;
> +

can you please remove blank line here?

> +	struct mu_edca {
> +		u8 cw_min;
> +		u8 cw_max;
> +		u8 aifsn;
> +		u8 acm;
> +		u8 timer;
> +		u8 padding[3];
> +	};
> +	struct mt7921_mcu_mu_tx {
> +		u8 ver;
> +		u8 pad0;
> +		u16 len;

I guess __le16 here (even if it is not actually used)

Regards,
Lorenzo

> +		u8 bss_idx;
> +		u8 qos;
> +		u8 wmm_idx;
> +		u8 pad1;
> +		struct mu_edca edca[IEEE80211_NUM_ACS];
> +		u8 pad3[32];
> +	} __packed req_mu = {
> +		.bss_idx = mvif->mt76.idx,
> +		.qos = vif->bss_conf.qos,
> +		.wmm_idx = mvif->mt76.wmm_idx,
> +	};
> +	int ac, ret;
>  
>  	for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
>  		struct ieee80211_tx_queue_params *q = &mvif->queue_params[ac];
> @@ -995,8 +1019,34 @@ int mt7921_mcu_set_tx(struct mt7921_dev *dev, struct ieee80211_vif *vif)
>  		else
>  			e->cw_max = cpu_to_le16(10);
>  	}
> -	return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_EDCA_UPDATE, &req,
> -				 sizeof(req), true);
> +
> +	ret = mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_EDCA_UPDATE, &req,
> +				sizeof(req), true);
> +	if (ret)
> +		return ret;
> +
> +	if (!vif->bss_conf.he_support)
> +		return 0;
> +
> +	for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
> +		struct ieee80211_he_mu_edca_param_ac_rec *q;
> +		struct mu_edca *e;
> +		int to_aci[] = {1, 0, 2, 3};
> +
> +		if (!mvif->queue_params[ac].mu_edca)
> +			break;
> +
> +		q = &mvif->queue_params[ac].mu_edca_param_rec;
> +		e = &(req_mu.edca[to_aci[ac]]);
> +
> +		e->cw_min = q->ecw_min_max & 0xf;
> +		e->cw_max = (q->ecw_min_max & 0xf0) >> 4;
> +		e->aifsn = q->aifsn;
> +		e->timer = q->mu_edca_timer;
> +	}
> +
> +	return mt76_mcu_send_msg(&dev->mt76, MCU_CMD_SET_MU_EDCA_PARMS, &req_mu,
> +				 sizeof(req_mu), false);
>  }
>  
>  int mt7921_mcu_set_chan_info(struct mt7921_phy *phy, int cmd)
> -- 
> 2.25.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2021-10-07 20:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07 18:57 [PATCH] mt76: mt7921: add MU EDCA cmd support sean.wang
2021-10-07 20:26 ` Lorenzo Bianconi [this message]

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=YV9X43y1pQCDApd5@localhost.localdomain \
    --to=lorenzo.bianconi@redhat.com \
    --cc=Deren.Wu@mediatek.com \
    --cc=Eddie.Chen@mediatek.com \
    --cc=Eric-SY.Chang@mediatek.com \
    --cc=Eric.Liang@mediatek.com \
    --cc=Leon.Yen@mediatek.com \
    --cc=Soul.Huang@mediatek.com \
    --cc=Stella.Chang@mediatek.com \
    --cc=Tom.Chou@mediatek.com \
    --cc=YN.Chen@mediatek.com \
    --cc=ch.yeh@mediatek.com \
    --cc=frankgor@google.com \
    --cc=jemele@google.com \
    --cc=jsiuda@google.com \
    --cc=km.lin@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=posh.sun@mediatek.com \
    --cc=robin.chiu@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=shawnku@google.com \
    --cc=steve.lee@mediatek.com \
    --cc=ted.huang@mediatek.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