linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Jakub Sitnicki <jsitnicki@gmail.com>
Cc: Larry.Finger@lwfinger.net, linux-wireless@vger.kernel.org
Subject: Re: [RFC 16/16] rtl8xxxu: rtl8188eu: Implement parse_efuse()
Date: Mon, 26 Oct 2015 13:45:23 -0400	[thread overview]
Message-ID: <wrfjh9ld34ng.fsf@redhat.com> (raw)
In-Reply-To: <87lhatdzhn.fsf@frog.home> (Jakub Sitnicki's message of "Fri, 23 Oct 2015 23:52:20 +0200")

Jakub Sitnicki <jsitnicki@gmail.com> writes:
> On Wed, Oct 21, 2015 at 04:15 AM CEST, Jes Sorensen
> <Jes.Sorensen@redhat.com> wrote:
>> Jakub Sitnicki <jsitnicki@gmail.com> writes:
>>> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
>>> index 79f47e3..ec49504 100644
>>> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
>>> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
>>> @@ -507,6 +507,22 @@ struct rtl8192cu_efuse {
>>>  	u8 customer_id;
>>>  };
>>>  
>>> +struct rtl8188eu_efuse {
>>> +	__le16 rtl_id;
>>> +	u8 res0[0x0e];
>>> +	struct {						/* 0x10 */
>>> +		u8 cck_index_A[6];
>>> +		u8 ht40_1s_index_A[5];
>>> +		struct nibble_pair ht20_ofdm_index_diff[1];
>>> +	} tx_power;
>>> +	u8 res1[0xbb];
>>> +	u8 mac_addr[ETH_ALEN];					/* 0xd7 */
>>> +	u8 res2[0x02];
>>> +	u8 vendor_name[7];					/* 0xdf */
>>> +	u8 res3[0x02];
>>> +	u8 device_name[11];					/* 0xe8 */
>>> +};
>>
>> This is incomplete - I think it should look more like this:
>>
>> struct rtl8188eu_efuse {
>> 	__le16 rtl_id;
>> 	u8 res0[0x0e];
>> 	u8 cck_tx_power_index_A[3];	/* 0x10 */
>> 	u8 cck_tx_power_index_B[3];
>> 	u8 ht40_1s_tx_power_index_A[3];	/* 0x16 */
>> 	u8 ht40_1s_tx_power_index_B[3];
>> 	u8 res1[0x9c];
>> 	u8 channel_plan;		/* 0xb8 */
>> 	u8 xtal_k;
>> 	u8 thermal_meter;
>> 	u8 iqk_lck;
>> 	u8 res2[5];
>> 	u8 rf_board_option;
>> 	u8 rf_feature_option;
>> 	u8 rf_bt_setting;
>> 	u8 eeprom_version;
>> 	u8 eeprom_customer_id;
>> 	u8 res3[3];
>> 	u8 rf_antenna_option;		/* 0xc9 */
>> 	u8 res4[6];
>> 	u8 vid;				/* 0xd0 */
>> 	u8 res5[1];
>> 	u8 pid;				/* 0xd2 */
>> 	u8 res6[1];
>> 	u8 usb_optional_function;
>> 	u8 res7[2];
>> 	u8 mac_addr[ETH_ALEN];		/* 0xd7 */
>> 	u8 res8[2];
>> 	u8 vendor_name[7];
>> 	u8 res9[2];
>> 	u8 device_name[0x0b];		/* 0xe8 */
>> 	u8 res10[2];
>> 	u8 serial[0x0b];		/* 0xf5 */
>> 	u8 res11[0x30];
>> 	u8 unknown[0x0d];		/* 0x130 */
>> 	u8 res12[0xc3];
>> };
>
> The approach I took here was to add only the fields that I needed so
> far.  But you're right, in full, it should like that, apart from the
> tx_power fields.  My understanding of the vendor driver is that these
> should look like so:
>
>         /* RF path A */
> 	u8 cck_tx_power_index_A[6];
> 	u8 ht40_1s_tx_power_index_A[5];
> 	struct rtl8723au_idx ht20_ofdm_tx_power_index_diff_A;
>         struct {
>         	struct rtl8723au_idx ht40_ht20;
>                 struct rtl8723au_idx ofdm_cck;
>         } tx_power_index_diff_A[3];
>         /* RF path B */
> 	u8 cck_tx_power_index_B[6];
> 	u8 ht40_1s_tx_power_index_B[5];
> 	struct rtl8723au_idx ht20_ofdm_tx_power_index_diff_B;
>         struct {
>         	struct rtl8723au_idx ht40_ht20;
>                 struct rtl8723au_idx ofdm_cck;
>         } tx_power_index_diff_B[3];
>         /* RF path C */
>         [...]
>         /* RF path D */
>         [...]
>
> ... but RTL8188EU has only RF path A, so I stopped at that.
>
> It's not pretty how these 4-bit signed values (nibbles?) are laid out,
> so I hope that I'm just getting it wrong :-)

It's pretty gross, I agree. I prefer to try to build a complete image of
the image. Down the line we tend to need the additional fields. The
EFUSE tends to map to a given power of 2 size.

My array was not complete either, I didn't get far enough to have to
deal with the power values. If you want to complete the struct and send
me a patch, that would be cool.

Cheers,
Jes

  reply	other threads:[~2015-10-26 17:45 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-20  6:45 [RFC 00/16] rtl8xxxu: eFUSE parsing for RTL8188EU chips Jakub Sitnicki
2015-10-20  6:45 ` [RFC 01/16] rtl8xxxu: Treat REG_9346CR as an 8-bit wide register Jakub Sitnicki
2015-10-21  0:29   ` Jes Sorensen
2015-10-23  5:38     ` Jakub Sitnicki
2015-10-20  6:45 ` [RFC 02/16] rtl8xxxu: Use REG_EFUSE_TEST register only on multifunctional devices Jakub Sitnicki
2015-10-21  0:57   ` Jes Sorensen
2015-10-23  5:45     ` Jakub Sitnicki
2015-10-20  6:45 ` [RFC 03/16] rtl8xxxu: Don't check for illegal offset when reading from efuse Jakub Sitnicki
2015-10-21  1:07   ` Jes Sorensen
2015-10-20  6:45 ` [RFC 04/16] rtl8xxxu: Skip disabled efuse words early Jakub Sitnicki
2015-10-21  1:09   ` Jes Sorensen
2015-10-20  6:45 ` [RFC 05/16] rtl8xxxu: Unbreak a user-visible string Jakub Sitnicki
2015-10-21  1:46   ` Jes Sorensen
2015-10-23  5:54     ` Jakub Sitnicki
2015-10-23 15:38       ` Jes Sorensen
2015-10-20  6:45 ` [RFC 06/16] rtl8xxxu: rtl8723au: Introduce a pointer to efuse Jakub Sitnicki
2015-10-21  1:52   ` Jes Sorensen
2015-10-20  6:45 ` [RFC 07/16] rtl8xxxu: rtl8192cu: " Jakub Sitnicki
2015-10-20  6:45 ` [RFC 08/16] rtl8xxxu: Extract TX power fields from struct rtl8xxu_priv Jakub Sitnicki
2015-10-21  1:58   ` Jes Sorensen
2015-10-23 21:16     ` Jakub Sitnicki
2015-10-26 17:40       ` Jes Sorensen
2015-10-20  6:45 ` [RFC 09/16] rtl8xxxu: Rename struct struct rtl8723au_tx_power fields Jakub Sitnicki
2015-10-20  6:45 ` [RFC 10/16] rtl8xxxu: Rename struct rtl8723au_idx Jakub Sitnicki
2015-10-21  2:00   ` Jes Sorensen
2015-10-20  6:45 ` [RFC 11/16] rtl8xxxu: Make efuse content length a parameter Jakub Sitnicki
2015-10-21  2:01   ` Jes Sorensen
2015-10-20  6:45 ` [RFC 12/16] rtl8xxxu: Prepare to have more than one kind of struct *_tx_power Jakub Sitnicki
2015-10-20  6:45 ` [RFC 13/16] rtl8xxxu: Make set_tx_power a chip-type-dependent operation Jakub Sitnicki
2015-10-21  2:07   ` Jes Sorensen
2015-10-23 21:17     ` Jakub Sitnicki
2015-10-20  6:45 ` [RFC 14/16] rtl8xxxu: Introduce a device agnostic constant for efuse map length Jakub Sitnicki
2015-10-21  2:03   ` Jes Sorensen
2015-10-20  6:45 ` [RFC 15/16] rtl8xxxu: rtl8188eu: Add stubbed fileops and chip-specific constants Jakub Sitnicki
2015-10-20  6:45 ` [RFC 16/16] rtl8xxxu: rtl8188eu: Implement parse_efuse() Jakub Sitnicki
2015-10-21  2:15   ` Jes Sorensen
2015-10-23 21:52     ` Jakub Sitnicki
2015-10-26 17:45       ` Jes Sorensen [this message]
2015-11-02  8:21         ` [PATCH] rtl8xxxu: rtl8192eu: Map out EFUSE TX power area Jakub Sitnicki
2015-11-10 21:57           ` Jes Sorensen
2015-10-21  0:29 ` [RFC 00/16] rtl8xxxu: eFUSE parsing for RTL8188EU chips Jes Sorensen
2015-10-23  5:24   ` Jakub Sitnicki

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=wrfjh9ld34ng.fsf@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=jsitnicki@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /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).