From: Kalle Valo <kvalo@codeaurora.org>
To: Luca Coelho <luca@coelho.fi>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 10/12] iwlwifi: Add support for getting rf id with blank otp
Date: Sun, 29 Aug 2021 14:27:56 +0300 [thread overview]
Message-ID: <87sfys4hj7.fsf@codeaurora.org> (raw)
In-Reply-To: <e9265c03dee77861f5aeb8d94569b51d28bca148.camel@coelho.fi> (Luca Coelho's message of "Thu, 26 Aug 2021 14:45:55 +0300")
Luca Coelho <luca@coelho.fi> writes:
> On Thu, 2021-08-26 at 14:30 +0300, Luca Coelho wrote:
>> On Sat, 2021-08-21 at 17:07 +0300, Kalle Valo wrote:
>> > Luca Coelho <luca@coelho.fi> writes:
>> >
>> > > From: Matti Gottlieb <matti.gottlieb@intel.com>
>> > >
>> > > When having a blank OTP the only way to get the rf id
>> > > and the cdb info is from prph registers.
>> > >
>> > > Currently there is some implementation for this, but it
>> > > is located in the wrong place in the code (should be before
>> > > trying to understand what HW is connected and not after),
>> > > and it has a partial implementation.
>> > >
>> > > Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
>> > > Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
>> >
>> > [...]
>> >
>> > > +/*
>> > > + * struct iwl_crf_chip_id_reg
>> > > + *
>> > > + * type: bits 0-11
>> > > + * reserved: bits 12-18
>> > > + * slave_exist: bit 19
>> > > + * dash: bits 20-23
>> > > + * step: bits 24-26
>> > > + * flavor: bits 27-31
>> > > + */
>> > > +struct iwl_crf_chip_id_reg {
>> > > + u32 type : 12;
>> > > + u32 reserved : 7;
>> > > + u32 slave_exist : 1;
>> > > + u32 dash : 4;
>> > > + u32 step : 4;
>> > > + u32 flavor : 4;
>> > > +};
>> >
>> > This doesn't look endian safe.
>>
>> It's not exactly that this is not endian safe, but we had two issues:
>>
>> 1. AFAIK these bitfields are not guaranteed to be kept in order, so we
>> shouldn't use them. I'll change it to decode this in some other way.
>>
>> 2. We are actually reading the register without caring for endianess.
>> I will fix it.
>
> Oops, as Johannes pointed out offline, this is not an issue, actually.
> I got confused with some places where we do cpu_to_le32() after
> reading, which is the opposite and essentially proves that the read is
> in cpu-endianess. So I won't "fix" it. ;)
Good that endian is handled properly, thanks for checking.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2021-08-29 11:28 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-20 11:03 [PATCH 00/13] iwlwifi: updates intended for v5.15 2021-08-20 Luca Coelho
2021-08-20 11:03 ` [PATCH 01/12] iwlwifi: mvm: add support for range request command version 13 Luca Coelho
2021-08-20 11:03 ` [PATCH 02/12] iwlwifi: mvm: add support for resonder config command version 9 Luca Coelho
2021-08-21 14:01 ` Kalle Valo
2021-08-23 8:51 ` Luca Coelho
2021-08-20 11:03 ` [PATCH 03/12] iwlwifi: move get pnvm file name to a separate function Luca Coelho
2021-08-20 11:03 ` [PATCH 04/12] iwlwifi: mvm: introduce iwl_stored_beacon_notif_v3 Luca Coelho
2021-08-20 11:03 ` [PATCH 05/12] iwlwifi: mvm: support broadcast TWT alone Luca Coelho
2021-08-20 11:03 ` [PATCH 06/12] iwlwifi: mvm: Fix scan channel flags settings Luca Coelho
2021-08-20 11:03 ` [PATCH 07/12] iwlwifi: mvm: don't use FW key ID in beacon protection Luca Coelho
2021-08-20 11:03 ` [PATCH 08/12] iwlwifi: export DHC framework and add first public entry, twt_setup Luca Coelho
2021-08-21 14:04 ` Kalle Valo
2021-08-23 8:57 ` Luca Coelho
2021-08-26 11:26 ` Luca Coelho
2021-10-18 7:51 ` Kalle Valo
2021-10-22 6:28 ` Luca Coelho
2021-08-20 11:03 ` [PATCH 09/12] iwlwifi: mvm: add fixed_rate debugfs entry to public DHC Luca Coelho
2021-08-20 11:03 ` [PATCH 10/12] iwlwifi: Add support for getting rf id with blank otp Luca Coelho
2021-08-21 14:07 ` Kalle Valo
2021-08-26 11:30 ` Luca Coelho
2021-08-26 11:45 ` Luca Coelho
2021-08-29 11:27 ` Kalle Valo [this message]
2021-08-20 11:03 ` [PATCH 11/12] iwlwifi: Add support for more BZ HWs Luca Coelho
2021-08-20 11:03 ` [PATCH 12/12] iwlwifi: Start scratch debug register for Bz family Luca Coelho
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=87sfys4hj7.fsf@codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luca@coelho.fi \
/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;
as well as URLs for NNTP newsgroup(s).