All of lore.kernel.org
 help / color / mirror / Atom feed
* rtlwifi/rtl8188ee baseband config explanation request
@ 2017-09-15  5:08 Farhan Khan
  2017-09-15  6:01 ` Larry Finger
  0 siblings, 1 reply; 4+ messages in thread
From: Farhan Khan @ 2017-09-15  5:08 UTC (permalink / raw)
  To: linux-wireless

Hi all,

I am trying to get a high-level understanding of what occurs in
rtl88e_phy_bb_config() in
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c. I understand the
code up until it runs _rtl88e_phy_bb8188e_config_parafile() .

>From there, I see that phy_config_bb_with_headerfile() will write the
values in RTL8188EEPHY_REG_1TARRAY, runs phy_config_bb_with_pghdr(),
then write the values in RTL8188EEAGCTAB_1TARRAY.

Please provide a high-level explanation of
phy_config_bb_with_headerfile(), and more particularly, of
phy_config_bb_pghdr(). What are their objectives? Also, is there a
reason for this specific order or can it be in any otherwise?

Thanks!

--
Farhan Khan
PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: rtlwifi/rtl8188ee baseband config explanation request
  2017-09-15  5:08 rtlwifi/rtl8188ee baseband config explanation request Farhan Khan
@ 2017-09-15  6:01 ` Larry Finger
  2017-09-15  6:26   ` Farhan Khan
  0 siblings, 1 reply; 4+ messages in thread
From: Larry Finger @ 2017-09-15  6:01 UTC (permalink / raw)
  To: Farhan Khan, linux-wireless

On 09/15/2017 12:08 AM, Farhan Khan wrote:
> Hi all,
> 
> I am trying to get a high-level understanding of what occurs in
> rtl88e_phy_bb_config() in
> drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c. I understand the
> code up until it runs _rtl88e_phy_bb8188e_config_parafile() .
> 
>>From there, I see that phy_config_bb_with_headerfile() will write the
> values in RTL8188EEPHY_REG_1TARRAY, runs phy_config_bb_with_pghdr(),
> then write the values in RTL8188EEAGCTAB_1TARRAY.
> 
> Please provide a high-level explanation of
> phy_config_bb_with_headerfile(), and more particularly, of
> phy_config_bb_pghdr(). What are their objectives? Also, is there a
> reason for this specific order or can it be in any otherwise?

Why do you want to know this information? Are you trying to reverse-engineer the 
Realtek wifi devices. Note that I do not know much about the internals of any of 
the Realtek devices, but I can read the code. The data in 
RTL8188EEPHY_REG_1TARRAY consists of two parts per entry. The first is an 
address, and the second is the data to be loaded into that address. These data 
are used by the firmware to calibrate radios, etc., and have been determined by 
the Realtek engineers. There is a similar interpretation for 
RTL8188EEAGCTAB_1TARRAY. I do not know for sure, but as the data values here are 
ALL written to the same address, I fully expect that these must be written AFTER 
the PHY_REG information. Something needs to be controlling where the data are 
being stored.

The "high-level" interpretation of this code is this is what must be done for 
the device to work. If you want more information, you will need to investigate 
getting an NDA with Realtek. I do not have one, and I do not want such an agreement.

Larry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: rtlwifi/rtl8188ee baseband config explanation request
  2017-09-15  6:01 ` Larry Finger
@ 2017-09-15  6:26   ` Farhan Khan
  2017-09-15 14:33     ` Larry Finger
  0 siblings, 1 reply; 4+ messages in thread
From: Farhan Khan @ 2017-09-15  6:26 UTC (permalink / raw)
  To: Larry Finger, linux-wireless

Thank you for your prompt response.

I am trying to write a FreeBSD port of this driver. The structures of
the two drivers are significantly different, so it is not a trivial
exercise.

The FreeBSD driver also has a similar block of code that writes over an
array of data using an array of registers, and this should be easy to
re-create. But I do not see the equivalent of phy_config_bb_with_pghdr()
anywhere. I do not know if I need to maintain the order for any reason.

I attempted to reach out to Realtek through multiple mediums but did not
receive any replies. Ultimately, I may end up re-playing the same bits
without understanding what is happening.

On 09/15/2017 02:01 AM, Larry Finger wrote:
> On 09/15/2017 12:08 AM, Farhan Khan wrote:
>> Hi all,
>>
>> I am trying to get a high-level understanding of what occurs in
>> rtl88e_phy_bb_config() in
>> drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c. I understand the
>> code up until it runs _rtl88e_phy_bb8188e_config_parafile() .
>>
>>> From there, I see that phy_config_bb_with_headerfile() will write the
>> values in RTL8188EEPHY_REG_1TARRAY, runs phy_config_bb_with_pghdr(),
>> then write the values in RTL8188EEAGCTAB_1TARRAY.
>>
>> Please provide a high-level explanation of
>> phy_config_bb_with_headerfile(), and more particularly, of
>> phy_config_bb_pghdr(). What are their objectives? Also, is there a
>> reason for this specific order or can it be in any otherwise?
> 
> Why do you want to know this information? Are you trying to
> reverse-engineer the Realtek wifi devices. Note that I do not know much
> about the internals of any of the Realtek devices, but I can read the
> code. The data in RTL8188EEPHY_REG_1TARRAY consists of two parts per
> entry. The first is an address, and the second is the data to be loaded
> into that address. These data are used by the firmware to calibrate
> radios, etc., and have been determined by the Realtek engineers. There
> is a similar interpretation for RTL8188EEAGCTAB_1TARRAY. I do not know
> for sure, but as the data values here are ALL written to the same
> address, I fully expect that these must be written AFTER the PHY_REG
> information. Something needs to be controlling where the data are being
> stored.
> 
> The "high-level" interpretation of this code is this is what must be
> done for the device to work. If you want more information, you will need
> to investigate getting an NDA with Realtek. I do not have one, and I do
> not want such an agreement.
> 
> Larry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: rtlwifi/rtl8188ee baseband config explanation request
  2017-09-15  6:26   ` Farhan Khan
@ 2017-09-15 14:33     ` Larry Finger
  0 siblings, 0 replies; 4+ messages in thread
From: Larry Finger @ 2017-09-15 14:33 UTC (permalink / raw)
  To: Farhan Khan, linux-wireless

On 09/15/2017 01:26 AM, Farhan Khan wrote:
> Thank you for your prompt response.
> 
> I am trying to write a FreeBSD port of this driver. The structures of
> the two drivers are significantly different, so it is not a trivial
> exercise.
> 
> The FreeBSD driver also has a similar block of code that writes over an
> array of data using an array of registers, and this should be easy to
> re-create. But I do not see the equivalent of phy_config_bb_with_pghdr()
> anywhere. I do not know if I need to maintain the order for any reason.
> 
> I attempted to reach out to Realtek through multiple mediums but did not
> receive any replies. Ultimately, I may end up re-playing the same bits
> without understanding what is happening.

You should have stated your purpose at the start.

Those sections are loading data for the firmware to use. As you probably are not 
writing your own firmware, and not doing your own calibration, then you should 
just copy all the code that touches the data in the file table.c. The firmware 
does not care whether the host is Linux or FreeBSD. It still has to do that same 
operations on the radio, and this is the data it needs.

As I said in my initial response, I think the PHY register data needs to be 
written before the AGC data as the latter is being written into a buffer that is 
not directly accessible from the host, which means some previous step has set up 
that transfer. As we do not know what that was, you likely need to do everything 
in the same order.

Larry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-15 14:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-15  5:08 rtlwifi/rtl8188ee baseband config explanation request Farhan Khan
2017-09-15  6:01 ` Larry Finger
2017-09-15  6:26   ` Farhan Khan
2017-09-15 14:33     ` Larry Finger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.