ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: John Crispin <john@phrozen.org>
Cc: ath11k@lists.infradead.org,
	Shashidhar Lakkavalli <slakkavalli@datto.com>
Subject: Re: [PATCH 1/4] ath11k: add HE support
Date: Wed, 04 Sep 2019 18:21:12 +0300	[thread overview]
Message-ID: <87r24wnl3r.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <20190904091211.26868-2-john@phrozen.org> (John Crispin's message of "Wed, 4 Sep 2019 11:12:08 +0200")

John Crispin <john@phrozen.org> writes:

> Add basic HE support to the driver. The sband_iftype data is generated from
> the capabilities read from the FW.
>
> Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
> Signed-off-by: John Crispin <john@phrozen.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

[...]

> +		for (nss = 0; nss <= arg->peer_ppet.numss_m1; nss++) {
> +			for (ru = 0; ru < 4; ru++) {
> +				u32 val = 0;
> +				int i;
> +
> +				if ((arg->peer_ppet.ru_bit_mask & BIT(ru)) == 0)
> +					continue;
> +				for (i = 0; i < 6; i++) {
> +					val >>= 1;
> +					val |= ((he_cap->ppe_thres[bit / 8] >>
> +						 (bit % 8)) & 0x1) << 5;
> +					bit++;
> +				}
> +				arg->peer_ppet.ppet16_ppet8_ru3_ru0[nss] |=
> +								val << (ru * 6);
> +			}
> +		}
> +	}

I think this loop needs a code comment explaining what's happening here.


[...]

> +static void ath11k_gen_ppe_thresh(struct ath11k_ppe_threshold *fw_ppet,
> +				  u8 *he_ppet)
> +{
> +	int nss, ru;
> +	u8 bit = 7;
> +
> +	he_ppet[0] = fw_ppet->numss_m1 & IEEE80211_PPE_THRES_NSS_MASK;
> +	he_ppet[0] |= (fw_ppet->ru_bit_mask <<
> +		       IEEE80211_PPE_THRES_RU_INDEX_BITMASK_POS) &
> +		      IEEE80211_PPE_THRES_RU_INDEX_BITMASK_MASK;
> +	for (nss = 0; nss <= fw_ppet->numss_m1; nss++) {
> +		for (ru = 0; ru < 4; ru++) {
> +			u8 val;
> +			int i;
> +
> +			if ((fw_ppet->ru_bit_mask & BIT(ru)) == 0)
> +				continue;
> +			val = (fw_ppet->ppet16_ppet8_ru3_ru0[nss] >> (ru * 6)) &
> +			       0x3f;
> +			val = ((val >> 3) & 0x7) | ((val & 0x7) << 3);
> +			for (i = 5; i >= 0; i--) {
> +				he_ppet[bit / 8] |=
> +					((val >> i) & 0x1) << ((bit % 8));
> +				bit++;
> +			}
> +		}
> +	}

And this as well.

> +		he_cap->he_mcs_nss_supp.rx_mcs_80 =
> +			cpu_to_le16(band_cap->he_mcs & 0xffff);
> +		he_cap->he_mcs_nss_supp.tx_mcs_80 =
> +			cpu_to_le16(band_cap->he_mcs & 0xffff);
> +		he_cap->he_mcs_nss_supp.rx_mcs_160 =
> +			cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
> +		he_cap->he_mcs_nss_supp.tx_mcs_160 =
> +			cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
> +		he_cap->he_mcs_nss_supp.rx_mcs_80p80 =
> +			cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
> +		he_cap->he_mcs_nss_supp.tx_mcs_80p80 =
> +			cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);

We try always have proper defines for the magic values and using
FIELD_GET() instead of manually shifting.


-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  parent reply	other threads:[~2019-09-04 15:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04  9:12 [PATCH 0/4] ath11k: add HE support John Crispin
2019-09-04  9:12 ` [PATCH 1/4] " John Crispin
2019-09-04 15:15   ` Kalle Valo
2019-09-04 15:21   ` Kalle Valo [this message]
2019-09-05 14:30   ` Kalle Valo
2019-09-05 20:12     ` John Crispin
2019-09-04  9:12 ` [PATCH 2/4] ath11k: add TWT support John Crispin
2019-09-04  9:12 ` [PATCH 3/4] ath11k: add spatial reuse support John Crispin
2019-09-04 15:21   ` Kalle Valo
2019-09-04  9:12 ` [PATCH 4/4] ath11k: register HE mesh capabilities John Crispin
2019-09-04  9:20   ` Sven Eckelmann

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=87r24wnl3r.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=john@phrozen.org \
    --cc=slakkavalli@datto.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