On 30/08/17 20:37, Arend van Spriel wrote:
> On 22-08-17 13:25, Ian Molton wrote:
>> +#define __sd_reg(field) \
>> +(offsetof(struct sdpcmd_regs, field))
>
> I really dislike __foo() stuff. Please just stick with uppercase for
> macros, so SD_REG(). I am fine wit
On 30/08/17 20:11, Arend van Spriel wrote:
>> Whilst this if () statement is technically correct, it lacks clarity.
>
> I don't see the unclarity here. In my opinion people reading the code
> should have a good level in C language and a decent level of curiosity
> when they come across a function/
On 30/08/17 19:59, Arend van Spriel wrote:
>> +static int brcmf_sdiod_reg_write(struct brcmf_sdio_dev *sdiodev, u32
>> addr,
>> + u8 regsz, void *data)
>
> Thought I mentioned this before, but the indentation should be aligned
> to opening bracket.
I checked this locally, and its
On 30/08/17 19:51, Arend van Spriel wrote:
> On 22-08-17 13:25, Ian Molton wrote:
>> All the other IO functions are the other way round in this
>> driver. Make this one match.
>
> Sorry for being a nit, but not sure why the commit message starts with a
> tab.
Not
On 23/08/17 13:36, Julian Calaby wrote:
> Hi Ian,
>
> On Wed, Aug 23, 2017 at 10:27 PM, Ian Molton wrote:
>> On 23/08/17 11:09, Julian Calaby wrote:
>>> I don't think I explained my point well.
>>>
>>> The description of this patch implies that thi
On 23/08/17 11:09, Julian Calaby wrote:
> I don't think I explained my point well.
>
> The description of this patch implies that this method
> brcmf_sdiod_ramrw(), now relies on the window being set elsewhere
> before it's called.
I don't think it does.
> I'm asking why we can't move the settin
On 22/08/17 20:44, Arend van Spriel wrote:
> By the way, the driver prefix in the subject is wrong, ie. brcmfamc
> should be brcmfmac. I think it already was wrong in the previous series,
> but I forgot to mention it.
Drat. well spotted :)
-Ian
On 22/08/17 20:41, Arend van Spriel wrote:
> On 22-08-17 13:25, Ian Molton wrote:
>> Hi folks,
>>
>> Arend, as requested - a respin to take account of your comments.
>>
>> Unfortunately, although I've only included the patches you requested
>> from v4,
Replace the array of functions with a pair of pointers to the
relevant functions.
Signed-off-by: Ian Molton
Acked-by: Arend van Spriel
---
.../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 115 +++---
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c| 170
Trivial tidy of register definitions.
Signed-off-by: Ian Molton
---
.../net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 4 ++--
.../net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 19 ++-
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/net
In preparation for removing the function array, remove all code that
refers to function by index and replace with pointers to the function
itself.
Signed-off-by: Ian Molton
Reviewed-by: Arend van Spriel
# Conflicts:
# drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
Trivial cleanup of nasty variable name
Signed-off-by: Ian Molton
Acked-by: Arend van Spriel
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
a few inconsistently named pointers whilst we are at it ie.
sdiod -> sdiodev
Signed-off-by: Ian Molton
Reviewed-by: Arend van Spriel
---
.../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 140 +++
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c| 406 +++--
2 files cha
Avoid confusion with unrelated _buscore labels.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
b/drivers/net/wireless
Its more efficient to test the register we're interested in first,
potentially avoiding two more comparisons, and therefore always avoiding
one comparison per call on all other chips.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 9 ++---
1
This macro is used exactly nowhere in the code. Delete it.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
b/drivers/net/wireless/broadcom
Whilst this if () statement is technically correct, it lacks clarity.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
b
code. We also convert
those that map directly to sdio_{read,write}*() to macros.
Signed-off-by: Ian Molton
Reviewed-by: Arend van Spriel
---
.../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 166 +++
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c| 182
Make it more obvious that this code acually enables interrupts, and
provide nice definitions for the bits in the register.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 3 ++-
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 8 +---
2
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
index 916f75e5e7a1
The IO functions operate within the Chipcommon IO window. Explicitly
set this, rather than relying on the last initialisation IO access to
leave it set to the right value by chance.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 8
drivers/net
Linux doesnt pass you func0 as a function when probing - instead
providing specific access functions to read/write it.
This prepares for a patch to remove the actual array entry itself.
Signed-off-by: Ian Molton
# Conflicts:
# drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
Remove yet another IO function from the code and replace with one
that already exists.
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c| 91 +++---
1 file changed, 45 insertions(+), 46 deletions(-)
diff --git a/drivers/net/wireless/broadcom
Create a macro to make the code a bit more readable, whilst we're stuck
with using struct element offsets as register offsets.
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c| 35 +-
1 file changed, 14 insertions(+), 21 deletions(-)
will allow for easier refcounting in future.
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c| 25 +-
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
b/drivers/net
This function needs to be split up into separate read / write variants
for clarity.
Signed-off-by: Ian Molton
Reviewed-by: Arend van Spriel
---
.../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 67 +++---
1 file changed, 45 insertions(+), 22 deletions(-)
diff --git a
All functions that might require the window address changing call
brcmf_sdiod_set_backplane_window() prior to access. Thus resetting
the window is not required.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 5 -
1 file changed, 5 deletions
This function has become trivial enough that it may as well be pushed into
its callers, which has the side-benefit of clarifying what's going on.
Remove it, and rename brcmf_sdiod_set_sbaddr_window() to
brcmf_sdiod_set_backplane_window() as it's easier to understand.
Signed-off-by:
Rather than workaround the restrictions on func0 addressing in the
driver, set MMC_QUIRK_LENIENT_FN0
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 4
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 4 ++--
2 files changed, 6
This function sets the address of the IO window used for
SDIO accesses onto the backplane of the chip.
It currently uses 3 separate masks despite the full mask being
defined in the code already. Remove the separate masks and clean up.
Signed-off-by: Ian Molton
Reviewed-by: Arend van
Register access code is not the place for band-aid fixes like this.
If this is a genuine problem, it should be fixed further up in the driver
stack.
Signed-off-by: Ian Molton
Reviewed-by: Arend van Spriel
---
.../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 28 +-
1
This function is obfuscating how IO works on this chip. Remove it
and push its logic into brcmf_sdiod_reg_{read,write}().
Handling of -ENOMEDIUM is altered, but as that's pretty much broken anyway
we can ignore that.
Signed-off-by: Ian Molton
Reviewed-by: Arend van Spriel
---
.../wir
If you need debugging this low level, you're doing something wrong.
Remove these noisy debug statements so the code is more readable.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/driver
Unlikely to be a problem, but brcmf_sdiod_regrb() is
not symmetric with brcmf_sdiod_regrl(). Fix.
Signed-off-by: Ian Molton
Reviewed-by: Arend van Spriel
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a
The value passed to brcmf_sdiod_addrprep() is *always* 4
remove this parameter and the unused code to handle it.
Signed-off-by: Ian Molton
Reviewed-by: Arend van Spriel
---
.../net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 18 --
1 file changed, 8 insertions
This large function is concealing a LOT of obscure logic about
how the hardware functions. Time to split it up.
This first patch splits the function into two pieces - read and write,
doing away with the rw flag in the process.
Signed-off-by: Ian Molton
Reviewed-by: Arend van Spriel
Hi folks,
Arend, as requested - a respin to take account of your comments.
Unfortunately, although I've only included the patches you requested from v4,
breaking out some of the simpler changes (whitespace, macos, etc.) has grown
the set back up to 30 patches. I hope this is OK.
I've tried to in
All the other IO functions are the other way round in this
driver. Make this one match.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/broadcom
The 4 IO functions in this patch are incorrect as they use compiler types
to determine how many bytes to send to the hardware.
Signed-off-by: Ian Molton
Reviewed-by: Arend van Spriel
---
.../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 22 +++---
1 file changed, 11
On 07/08/17 18:55, Ian Molton wrote:
> On 07/08/17 12:26, Arend van Spriel wrote:
>> On 7/26/2017 10:25 PM, Ian Molton wrote:
>>> Primarily this patch removes:
>>>
>>> brcmf_sdiod_f0_writeb()
>>> brcmf_sdiod_reg_write()
>>> brcmf_sdiod_reg_
On 07/08/17 12:26, Arend van Spriel wrote:
>> +err = brcmf_sdiod_buff_write(sdiodev, SDIO_FUNC_2, addr, mypkt);
>>
>> brcmu_pkt_buf_free_skb(mypkt);
>> +
>
> You are keen on sprinkling whitespace here and there. Could you please
> use separate patches for that as much as possible. N
On 07/08/17 12:26, Arend van Spriel wrote:
> On 7/26/2017 10:25 PM, Ian Molton wrote:
>> Unlikely to be a problem, but brcmf_sdiod_regrb() is
>> not symmetric with brcmf_sdiod_regrl() in this regard.
>
> You are pretty keen on symmetry, but you could also remove th
On 07/08/17 12:25, Arend van Spriel wrote:
> On 26-07-17 22:25, Ian Molton wrote:
>> Register access code is not the place for band-aid fixes like this.
>> If this is a genuine problem, it should be fixed further up in the driver
>> stack.
>
> So lets make it a SDIO deb
On 08/08/17 13:29, Arend van Spriel wrote:
>> int brcmf_sdio_sleep(struct brcmf_sdio *bus, bool sleep)
>> {
>> +struct brcmf_sdio_dev *sdiodev = bus->sdiodev;
>> +struct sdio_func *func1 = sdiodev->func1;
>
> Actually only wanted to explicitly mention this one. Probably the
> compiler is
On 08/08/17 12:19, Arend van Spriel wrote:
>> -sdio_f0_readb((sdiodev)->func[0], (addr), (r))
>> +sdio_f0_readb((sdiodev)->func[1], (addr), (r))
>
> There is no reason to keep these any longer as these do not provide any
> functionality over the core sdio function unless you consider the
>
On 07/08/17 13:32, Arend van Spriel wrote:
>
> We actually just need the chipcommon base address so why not have that
> here, ie.:
> +u32 cc_base;
I see no advantage to that - the u32 is the same size as (or not much
bigger than the pointer to the struct brcmf_core, and my approach makes
it c
On 07/08/17 12:27, Arend van Spriel wrote:
> On 7/26/2017 10:25 PM, Ian Molton wrote:
>> This function has become trivial enough that it may as well be pushed
>> into
>> its callers, which has the side-benefit of clarifying what's going on.
>>
>> Remove it, an
On 07/08/17 12:26, Arend van Spriel wrote:
>
> Needing this debugging does not necessarily means you are doing
> something wrong. You may be dealing with hardware that is doing
> something wrong and when that happens this debug can be useful. I
> frankly hardly ever enable SDIO debug level unless
On 07/08/17 18:51, Ian Molton wrote:
> On 07/08/17 12:25, Arend van Spriel wrote:
>>> Handling of -ENOMEDIUM is altered, but as that's pretty much broken
>>> anyway
>>> we can ignore that.
>>
>> Please explain why you think it is broken.
>
>
On 07/08/17 12:25, Arend van Spriel wrote:
>> All the other IO functions are the other way round in this
>> driver. Make this one match.
>
> Core SDIO functions are indeed the other way around, but the IO
> functions in this file use (addr, data) pattern. So should we aim to get
> it all consi
On 08/08/17 12:19, Arend van Spriel wrote:
>> #define brcmf_sdiod_func0_rb(sdiodev, addr, r) \
>> -sdio_f0_readb((sdiodev)->func[0], (addr), (r))
>> +sdio_f0_readb((sdiodev)->func[1], (addr), (r))
>
> There is no reason to keep these any longer as these do not provide any
> functionality
On 07/08/17 12:26, Arend van Spriel wrote:
> On 7/26/2017 10:25 PM, Ian Molton wrote:
>> Primarily this patch removes:
>>
>> brcmf_sdiod_f0_writeb()
>> brcmf_sdiod_reg_write()
>> brcmf_sdiod_reg_read()
>
> Having [patch 30/34] "brcmfmac: Correctly
On 07/08/17 12:25, Arend van Spriel wrote:
>> Handling of -ENOMEDIUM is altered, but as that's pretty much broken
>> anyway
>> we can ignore that.
>
> Please explain why you think it is broken.
Not got the code to hand right now, but from memory, theres a trapdoor
case where the state can wind up
On 07/08/17 12:25, Arend van Spriel wrote:
> On 26-07-17 22:25, Ian Molton wrote:
>> This large function is concealing a LOT of obscure logic about
>> how the hardware functions. Time to split it up.
>>
>> This first patch splits the function into two pieces - re
On 27/07/17 11:09, Arend van Spriel wrote:
>>
>> Hi Arend,
>>
>> Noted for future series. I take it I shouldn't re-spin if you're going
>> through them already?
>
> My "guess" is a v5 is likely ;-)
No prob. I've spotted a gem in it myself (FIXME comment that crept
through). I'll split it into two
On 27/07/17 10:52, Arend van Spriel wrote:
>>
>> How many patches would you like at once?
>
> Hi Ian,
>
> ~10-15 patches should be fine although I am simply ploughing through the
> lot right now.
Hi Arend,
Noted for future series. I take it I shouldn't re-spin if you're going
through them alrea
On 27/07/17 07:17, Kalle Valo wrote:
>> Here's a v4 of the cleanup patchset - checkpatch clean(er - I have purposely
>> left some warnings unaddressed).
>>
>> I also dropped an accidental adjustment of a debug macro from v3.
> Like I said already last time, please split the patchset into reasonable
Trivial tidy of register definitions.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
b/drivers/net/wireless/broadcom
Linux doesnt pass you func0 as a function when probing - instead
providing specific access functions to read/write it.
This prepares for a patch to remove the actual array entry itself.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 5 +
drivers
This driver uses the label ctx like its going out of fashion.
Lets rename this usage of it so that its easier to see whats going on.
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/chip.c| 24 +++---
.../wireless/broadcom/brcm80211/brcmfmac/chip.h
code.
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 166 +++
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c| 182 ++---
.../wireless/broadcom/brcm80211/brcmfmac/sdio.h| 28 +++-
3 files changed, 132 insertions(+), 244
Trivial cleanup of nasty variable name
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
b/drivers/net/wireless
These functions are poorly named. for the sake of one character,
correct this.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211
will allow for easier refcounting in future.
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c| 25 +-
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
b/drivers/net
This function needs to be split up into separate read / write variants
for clarity.
Signed-off-by: Ian Molton
# Conflicts:
# drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
---
.../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 69 +++---
1 file changed, 47
This function has become trivial enough that it may as well be pushed into
its callers, which has the side-benefit of clarifying what's going on.
Remove it, and rename brcmf_sdiod_set_sbaddr_window() to
brcmf_sdiod_set_backplane_window() as it's easier to understand.
Signed-off-by:
Avoid confusion with unrelated _buscore labels.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
b/drivers/net/wireless
This macro is used exactly nowhere in the code. Delete it.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
b/drivers/net/wireless/broadcom
Remove yet another IO function from the code and replace with one
that already exists.
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c| 91 +++---
1 file changed, 45 insertions(+), 46 deletions(-)
diff --git a/drivers/net/wireless/broadcom
In preparation for removing the function array, remove all code that
refers to function by index and replace with pointers to the function
itself.
Signed-off-by: Ian Molton
# Conflicts:
# drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
---
.../wireless/broadcom/brcm80211
Rather than workaround the restrictions on func0 addressing in the
driver, set MMC_QUIRK_LENIENT_FN0
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 4
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 4 ++--
2 files changed, 6
All functions that might require the window address changing call
brcmf_sdiod_set_backplane_window() prior to access. Thus resetting
the window is not required.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 5 -
1 file changed, 5 deletions
There is zero need to keep these structures separate, they are *always*
allocated together. All they do is obfuscate the code, whilst offering
zero real gain.
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/chip.c| 383 +
.../wireless/broadcom
This #define is poorly named. Correct it.
At the same time, convert the if..elseif...else it is used in to a switch
for clarity.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 11 +++
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a
Create a macro to make the code a bit more readable, whilst we're stuck
with using struct element offsets as register offsets.
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c| 35 +-
1 file changed, 14 insertions(+), 21 deletions(-)
* Renamed routine in line with kernel convention.
* Improved handling of chips that cannot autoprobe
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/chip.c| 132 +
1 file changed, 84 insertions(+), 48 deletions(-)
diff --git a/drivers/net/wireless
The IO functions operate within the Chipcommon IO window. Explicitly
set this, rather than relying on the last initialisation IO access to
leave it set to the right value by chance.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 8
drivers/net
a few inconsistently named pointers whilst we are at it ie.
sdiod -> sdiodev
Signed-off-by: Ian Molton
# Conflicts:
# drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
# drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
---
.../wireless/broadcom/brcm80211/brcmfmac
Replace the array of functions with a pair of pointers to the
relevant functions.
Signed-off-by: Ian Molton
# Conflicts:
# drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
# drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
---
.../wireless/broadcom/brcm80211
Tidy code, fix whitespace, remove useless debug code.
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/sdio.c| 24 ++
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
b/drivers
Most of the core IO functions are called via a long train of pointers.
Introduce brcmf_readl(), brcmf_writel(), brcmf_writelp(),
brcmf_clear_bits(), and brcmf_set_bits_post() in an attempt to deal with
this.
These brcmf_writelp() and brcmf_set_bits_post() issue posted writes.
Signed-off-by: Ian
Improve legibility / conform to kernel coding style.
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/chip.c| 47 ++
1 file changed, 47 insertions(+)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
b/drivers/net/wireless
Register access code is not the place for band-aid fixes like this.
If this is a genuine problem, it should be fixed further up in the driver
stack.
Signed-off-by: Ian Molton
# Conflicts:
# drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
---
.../wireless/broadcom/brcm80211
This function sets the address of the IO window used for
SDIO accesses onto the backplane of the chip.
It currently uses 3 separate masks despite the full mask being
defined in the code already. Remove the separate masks and clean up.
Signed-off-by: Ian Molton
# Conflicts
This large function is concealing a LOT of obscure logic about
how the hardware functions. Time to split it up.
This first patch splits the function into two pieces - read and write,
doing away with the rw flag in the process.
Signed-off-by: Ian Molton
---
.../wireless/broadcom
This function is obfuscating how IO works on this chip. Remove it
and push its logic into brcmf_sdiod_reg_{read,write}().
Handling of -ENOMEDIUM is altered, but as that's pretty much broken anyway
we can ignore that.
Signed-off-by: Ian Molton
# Conflicts:
# drivers/net/wireless/bro
Unlikely to be a problem, but brcmf_sdiod_regrb() is
not symmetric with brcmf_sdiod_regrl() in this regard.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless
All the other IO functions are the other way round in this
driver. Make this one match.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/broadcom
The value passed to brcmf_sdiod_addrprep() is *always* 4
remove this parameter and the unused code to handle it.
Signed-off-by: Ian Molton
---
.../net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 18 --
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a
If you need debugging this low level, you're doing something wrong.
Remove these noisy debug statements so the code is more readable.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --
The 4 IO functions in this patch are incorrect as they use compiler types
to determine how many bytes to send to the hardware.
Signed-off-by: Ian Molton
---
.../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 22 +++---
1 file changed, 11 insertions(+), 11 deletions(-)
diff
Hi folks,
Here's a v4 of the cleanup patchset - checkpatch clean(er - I have purposely
left some warnings unaddressed).
I also dropped an accidental adjustment of a debug macro from v3.
-Ian
On 24/07/17 20:47, Arend van Spriel wrote:
> On 19-07-17 21:07, Ian Molton wrote:
>> Hi all,
>>
>> Please find the 3rd revision of my cleanup patchset for brcmfmac.
>>
>> I've done some further cleanup and it now handles SDIO the ay the MMC
>> subsyst
On 22/07/17 20:18, Ian Molton wrote:
> On 22/07/17 19:43, Hans de Goede wrote:
>> Hi,
>>
>> When upgrading my devel environment to 4.13-rc1+ I noticed that
>> the brcm43430 sdio wifi on a Chuwi Hi8 plus stopped working:
>
> There is a fix for this:
>
> htt
On 22/07/17 19:43, Hans de Goede wrote:
> Hi,
>
> When upgrading my devel environment to 4.13-rc1+ I noticed that
> the brcm43430 sdio wifi on a Chuwi Hi8 plus stopped working:
There is a fix for this:
https://patchwork.kernel.org/patch/9836383/
IIRC
-Ian
> https://github.com/0day-ci/linux/commits/Ian-Molton/brcmfmac-Fix-parameter-order-in-brcmf_sdiod_f0_writeb/20170718-123057
> base:
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
> master
> config: x86_64-randconfig-a0-07201347 (attached as .co
On 19/07/17 12:47, Arend van Spriel wrote:
> On 19-07-17 00:45, Ian Molton wrote:
>> (as it stands, back to back wpasuplpicant runs make it keel over, as
>> does module unload and reload).
>
> It is good to get such feedback. We should get in details about this.
I'll r
Linux doesnt pass you func0 as a function when probing - instead
providing specific access functions to read/write it.
This prepares for a patch to remove the actual array entry itself.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 5 +
drivers
Avoid confusion with unrelated _buscore labels.
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
b/drivers/net/wireless
Rather than workaround the restrictions on func0 addressing in the
driver, set MMC_QUIRK_LENIENT_FN0
Signed-off-by: Ian Molton
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 4
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 4 ++--
2 files changed, 6
1 - 100 of 203 matches
Mail list logo