From: Igal Chernobelsky <igalc@ti.com>
To: Luciano Coelho <coelho@ti.com>
Cc: Arik Nemtsov <arik@wizery.com>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 03/20] wlcore/wl18xx/wl12xx: FW log params per chip arch
Date: Wed, 5 Dec 2012 14:29:26 +0200 [thread overview]
Message-ID: <50BF3E26.1080801@ti.com> (raw)
In-Reply-To: <1354704935.6234.44.camel@cumari.coelho.fi>
Hi Luca,
On 12/05/2012 12:55 PM, Luciano Coelho wrote:
> On Wed, 2012-11-28 at 11:42 +0200, Arik Nemtsov wrote:
>> From: Igal Chernobelsky<igalc@ti.com>
>>
>> FW memory block size and FW log end marker parameters
>> are added to wl structure and are initialized per
>> chip architecture. convert_hwaddr hw operation is added
>> to convert chip dependent FW internal address.
>> Copy from FW log is also simplified to copy the entire
>> memory block as FW logger utility is repsponsible
>> for parsing of FW log content.
>>
>> Signed-off-by: Igal Chernobelsky<igalc@ti.com>
>> Signed-off-by: Arik Nemtsov<arik@wizery.com>
>> ---
> This commit log explains what has been done, which can quite easily be
> see in the patch itself. That's okay, but what I'm missing here is the
> explanation *why* this needs to be done.
I can add to commit that FW logger is supported by wlcore but
has different parameters per chip (actually written in commit header).
>
>> diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
>> index 951b88c..5e3c808 100644
>> --- a/drivers/net/wireless/ti/wl12xx/main.c
>> +++ b/drivers/net/wireless/ti/wl12xx/main.c
>> @@ -706,6 +706,9 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
>> goto out;
>> }
>>
>> + wl->fw_mem_block_size = 256;
>> + wl->fwlog_end = 0x2000000;
> This value used to be in a macro before (WLCORE_FW_LOG_END), why kill
> it? It should just be renamed to WL12XX_FW_LOG_END and a new one be
> created for WL18XX.
These values are used only in one place during initialization and
are assigned to variables with self explanation name.
Do you still prefer defines?
>> @@ -1632,6 +1635,11 @@ static int wl12xx_set_peer_cap(struct wl1271 *wl,
>> hlid);
>> }
>>
>> +static u32 wl12xx_convert_hwaddr(struct wl1271 *wl, u32 hwaddr)
>> +{
>> + return hwaddr<< 5;
>> +}
> There was a good comment about this calculation before, it should be
> moved here instead of deleted.
Sorry, I will restore the comment for wl12xx:
/* Addresses are stored internally as addresses to 32 bytes blocks */
>
>> @@ -1669,6 +1677,7 @@ static struct wlcore_ops wl12xx_ops = {
>> .channel_switch = wl12xx_cmd_channel_switch,
>> .pre_pkt_send = NULL,
>> .set_peer_cap = wl12xx_set_peer_cap,
>> + .convert_hwaddr = wl12xx_convert_hwaddr,
> No need to break the alignment here.
I will fix it.
>
>> static struct ieee80211_sta_ht_cap wl12xx_ht_cap = {
>> diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
>> index df8de71..d806241 100644
>> --- a/drivers/net/wireless/ti/wl18xx/main.c
>> +++ b/drivers/net/wireless/ti/wl18xx/main.c
>> @@ -667,6 +667,9 @@ static int wl18xx_identify_chip(struct wl1271 *wl)
>> goto out;
>> }
>>
>> + wl->fw_mem_block_size = 272;
>> + wl->fwlog_end = 0x40000000;
> Again, the magic number here can be avoided.
The same as for wl12xx.
>> @@ -1423,6 +1426,11 @@ static int wl18xx_set_peer_cap(struct wl1271 *wl,
>> rate_set, hlid);
>> }
>>
>> +static u32 wl18xx_convert_hwaddr(struct wl1271 *wl, u32 hwaddr)
>> +{
>> + return hwaddr& ~0x80000000;
>> +}
> A small explanation here would be nice.
That is formula to convert from HW address ...
> [...]
>
>
>
>> /* Traverse the memory blocks linked list */
>> do {
>> - memset(block, 0, WL12XX_HW_BLOCK_SIZE);
>> - ret = wlcore_read_hwaddr(wl, addr, block, WL12XX_HW_BLOCK_SIZE,
>> - false);
>> + part.mem.start = wlcore_hw_convert_hwaddr(wl, addr);
>> + part.mem.size = PAGE_SIZE;
>> +
>> + ret = wlcore_set_partition(wl,&part);
>> + if (ret< 0) {
>> + wl1271_error("%s: set_partition start=0x%X size=%d",
>> + __func__, part.mem.start, part.mem.size);
> This could probably be a bit more descriptive, like saying that the
> fwlog seems to be corrupt because the address in the linked list can't
> be used for setting the partition.
Ok, will add the comment.
>
>> diff --git a/drivers/net/wireless/ti/wlcore/io.h b/drivers/net/wireless/ti/wlcore/io.h
>> index f48530f..5897747 100644
>> --- a/drivers/net/wireless/ti/wlcore/io.h
>> +++ b/drivers/net/wireless/ti/wlcore/io.h
>> @@ -165,8 +165,8 @@ static inline int __must_check wlcore_read_hwaddr(struct wl1271 *wl, int hwaddr,
>> int physical;
>> int addr;
>>
>> - /* Addresses are stored internally as addresses to 32 bytes blocks */
>> - addr = hwaddr<< 5;
>> + /* Convert from FW internal address which is chip arch dependent */
>> + addr = wl->ops->convert_hwaddr(wl, hwaddr);
> This could be more descriptive. As I understand, this is converting an
> internal representation of pointers in the hardware to an address that
> can be used to set the partitions.
>
Ok, will add more comment: convert to address used for setting partition
and reading over SDIO
>
>> diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h
>> index a664662..a8647bd 100644
>> --- a/drivers/net/wireless/ti/wlcore/wlcore_i.h
>> +++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h
>> @@ -523,6 +523,4 @@ void wl1271_rx_filter_flatten_fields(struct wl12xx_rx_filter *filter,
>> #define HW_HT_RATES_OFFSET 16
>> #define HW_MIMO_RATES_OFFSET 24
>>
>> -#define WL12XX_HW_BLOCK_SIZE 256
> I think this should also be created separately for wl12xx and wl18xx
> instead of deleting the macro and hardcoding the values.
See above comment for defines.
> --
> Luca.
>
--
Best regards
Igal
next prev parent reply other threads:[~2012-12-05 12:24 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-28 9:42 [PATCH 00/20] wlcore fixes for 3.8 (part3) Arik Nemtsov
2012-11-28 9:42 ` [PATCH 01/20] wl12xx/wl18xx: update default fw logger's settings Arik Nemtsov
2012-11-28 14:34 ` Luciano Coelho
2012-11-28 17:46 ` Arik Nemtsov
2012-11-28 18:25 ` Luciano Coelho
2012-11-28 19:12 ` Arik Nemtsov
2012-11-28 19:59 ` Luciano Coelho
2012-11-28 9:42 ` [PATCH 02/20] wlcore: add ACX_PEER_CAP command Arik Nemtsov
2012-12-05 9:35 ` Luciano Coelho
2012-12-05 10:17 ` Eliad Peller
2012-12-05 10:22 ` Luciano Coelho
2012-12-05 10:33 ` Eliad Peller
2012-12-05 10:43 ` Luciano Coelho
2012-11-28 9:42 ` [PATCH 03/20] wlcore/wl18xx/wl12xx: FW log params per chip arch Arik Nemtsov
2012-12-05 10:55 ` Luciano Coelho
2012-12-05 12:29 ` Igal Chernobelsky [this message]
2012-12-05 13:25 ` Luciano Coelho
2012-11-28 9:42 ` [PATCH 04/20] wlcore: remove support for injected Tx Arik Nemtsov
2012-11-28 9:42 ` [PATCH 05/20] wlcore: increase scan dwell times if no activity Arik Nemtsov
2012-12-05 11:21 ` Luciano Coelho
2012-12-05 12:19 ` Eyal Shapira
2012-12-05 20:25 ` Luciano Coelho
2012-12-05 21:02 ` Luciano Coelho
2012-11-28 9:42 ` [PATCH 06/20] wlcore: improve handling for Rx errors Arik Nemtsov
2012-11-28 9:42 ` [PATCH 07/20] wlcore: set 5Ghz probe-req template for DFS channels Arik Nemtsov
2012-11-28 9:42 ` [PATCH 08/20] wlcore: add new plt power-mode: CHIP_AWAKE Arik Nemtsov
2012-12-05 20:48 ` Luciano Coelho
2012-11-28 9:42 ` [PATCH 09/20] wlcore: disable elp sleep while in plt mode Arik Nemtsov
2012-12-05 20:52 ` Luciano Coelho
2012-11-28 9:42 ` [PATCH 10/20] wl18xx: fix a bug in wl->num_rx_desc initialization Arik Nemtsov
2012-11-28 9:42 ` [PATCH 11/20] wlcore/wl18xx: change priority calculations for links Arik Nemtsov
2012-12-07 9:23 ` Luciano Coelho
2012-12-07 18:13 ` Arik Nemtsov
2012-11-28 9:42 ` [PATCH 12/20] wl18xx: limit Tx for the AP single-STA-in-PSM case Arik Nemtsov
2012-12-07 12:08 ` Luciano Coelho
2012-12-07 18:16 ` Arik Nemtsov
2012-11-28 9:42 ` [PATCH 13/20] wlcore: use link count for single-STA-PSM optimization Arik Nemtsov
2012-12-07 12:19 ` Luciano Coelho
2012-12-07 18:17 ` Arik Nemtsov
2012-11-28 9:42 ` [PATCH 14/20] wlcore: use separate HW queue for each AC in each vif Arik Nemtsov
2012-11-28 9:42 ` [PATCH 15/20] wlcore: don't take mutex before stopping queues Arik Nemtsov
2012-11-28 9:42 ` [PATCH 16/20] wlcore: consolidate Rx BA bitmap management to links struct Arik Nemtsov
2012-11-28 9:42 ` [PATCH 17/20] wl18xx: support MIMO only if HT mode is not forced to SISO Arik Nemtsov
2012-11-28 9:42 ` [PATCH 18/20] wlcore: support scan reports during periodic scan Arik Nemtsov
2012-11-28 9:42 ` [PATCH 19/20] wl18xx: count HW block spare based correctly on keys Arik Nemtsov
2012-11-28 9:42 ` [PATCH 20/20] wlcore: Always pass DMA-able buffers to mmc functions Arik Nemtsov
2012-12-10 17:06 ` Luciano Coelho
2012-12-10 17:24 ` Alberto Garau
2012-12-10 17:49 ` wl12xx over spi with no scan results (was: Re: [PATCH 20/20] wlcore: Always pass DMA-able buffers to mmc functions) Luciano Coelho
2012-12-11 9:16 ` Alberto Garau
2012-12-11 9:33 ` wl12xx over spi with no scan results Luciano Coelho
2012-12-11 10:35 ` Alberto Garau
2012-12-11 10:51 ` Luciano Coelho
2012-12-11 12:28 ` Alberto Garau
2012-12-11 12:34 ` Luciano Coelho
[not found] ` <0294E4ABF3EF28409B75AAF7EAC3D41A0C360949@DB3PRD0510MB381.eurprd05.prod.outlook.com>
2012-12-12 8:45 ` Luciano Coelho
2012-12-12 10:13 ` Alberto Garau
2012-12-12 10:16 ` Luciano Coelho
2012-12-12 12:18 ` Alberto Garau
2012-12-17 9:38 ` Alberto Garau
2012-12-17 11:18 ` Luciano Coelho
2012-12-20 14:25 ` Alberto Garau
2012-12-11 12:14 ` [PATCH 00/20] wlcore fixes for 3.8 (part3) Luciano 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=50BF3E26.1080801@ti.com \
--to=igalc@ti.com \
--cc=arik@wizery.com \
--cc=coelho@ti.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 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.