2010-12-15 14:29:41

by Luciano Coelho

[permalink] [raw]
Subject: [PATCH v2] wl12xx_sdio_test: rename files to match current style

From: Luciano Coelho <[email protected]>

Change some file names and Kconfig settings so that this new module matches
the new way of using wl12xx instead of wl1271.

Also fix SDIO power enabling and disabling to match the latest way of doing
it.

Cc: Roger Quadros <[email protected]>
Signed-off-by: Luciano Coelho <[email protected]>
---
drivers/net/wireless/wl12xx/Kconfig | 12 +++++---
drivers/net/wireless/wl12xx/Makefile | 3 +-
.../wl12xx/{wl1271_sdio_test.c => sdio_test.c} | 28 +++++++++++++------
3 files changed, 28 insertions(+), 15 deletions(-)
rename drivers/net/wireless/wl12xx/{wl1271_sdio_test.c => sdio_test.c} (96%)

diff --git a/drivers/net/wireless/wl12xx/Kconfig b/drivers/net/wireless/wl12xx/Kconfig
index 085bc44..0e65bce 100644
--- a/drivers/net/wireless/wl12xx/Kconfig
+++ b/drivers/net/wireless/wl12xx/Kconfig
@@ -52,13 +52,15 @@ config WL12XX_SDIO
If you choose to build a module, it'll be called wl12xx_sdio.
Say N if unsure.

-config WL1271_SDIO_TEST
- tristate "TI wl1271 SDIO testing support"
- depends on WL1271 && MMC
+config WL12XX_SDIO_TEST
+ tristate "TI wl12xx SDIO testing support"
+ depends on WL12XX && MMC
+ default n
---help---
This module adds support for the SDIO bus testing with the
- TI wl1271 chipset. Select this if your platform is using
- the SDIO bus.
+ TI wl12xx chipsets. You probably don't want this unless you are
+ testing a new hardware platform. Select this if you want to test the
+ SDIO bus which is connected to the wl12xx chip.

config WL12XX_PLATFORM_DATA
bool
diff --git a/drivers/net/wireless/wl12xx/Makefile b/drivers/net/wireless/wl12xx/Makefile
index 1876785..521c041 100644
--- a/drivers/net/wireless/wl12xx/Makefile
+++ b/drivers/net/wireless/wl12xx/Makefile
@@ -3,13 +3,14 @@ wl12xx-objs = main.o cmd.o io.o event.o tx.o rx.o ps.o acx.o \

wl12xx_spi-objs = spi.o
wl12xx_sdio-objs = sdio.o
+wl12xx_sdio_test-objs = sdio_test.o

wl12xx-$(CONFIG_NL80211_TESTMODE) += testmode.o
obj-$(CONFIG_WL12XX) += wl12xx.o
obj-$(CONFIG_WL12XX_SPI) += wl12xx_spi.o
obj-$(CONFIG_WL12XX_SDIO) += wl12xx_sdio.o

-obj-$(CONFIG_WL1271_SDIO_TEST) += wl1271_sdio_test.o
+obj-$(CONFIG_WL12XX_SDIO_TEST) += wl12xx_sdio_test.o

# small builtin driver bit
obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx_platform_data.o
diff --git a/drivers/net/wireless/wl12xx/wl1271_sdio_test.c b/drivers/net/wireless/wl12xx/sdio_test.c
similarity index 96%
rename from drivers/net/wireless/wl12xx/wl1271_sdio_test.c
rename to drivers/net/wireless/wl12xx/sdio_test.c
index 42d1314..9fcbd3d 100644
--- a/drivers/net/wireless/wl12xx/wl1271_sdio_test.c
+++ b/drivers/net/wireless/wl12xx/sdio_test.c
@@ -1,11 +1,11 @@
/*
- * wl1271_sdio_test.c - SDIO testing driver for wl1271
+ * SDIO testing driver for wl12xx
*
* Copyright (C) 2010 Nokia Corporation
*
* Contact: Roger Quadros <[email protected]>
*
- * wl1271 read/write routines taken from wl1271_sdio.c
+ * wl12xx read/write routines taken from the main module
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -34,10 +34,11 @@
#include <linux/wl12xx.h>
#include <linux/kthread.h>
#include <linux/firmware.h>
+#include <linux/pm_runtime.h>

-#include "wl1271.h"
-#include "wl1271_io.h"
-#include "wl1271_boot.h"
+#include "wl12xx.h"
+#include "io.h"
+#include "boot.h"

#ifndef SDIO_VENDOR_ID_TI
#define SDIO_VENDOR_ID_TI 0x0097
@@ -130,22 +131,31 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,
static int wl1271_sdio_set_power(struct wl1271 *wl, bool enable)
{
struct sdio_func *func = wl_to_func(wl);
+ int ret;

/* Let the SDIO stack handle wlan_enable control, so we
* keep host claimed while wlan is in use to keep wl1271
* alive.
*/
if (enable) {
- sdio_claim_power(func);
+ /* Power up the card */
+ ret = pm_runtime_get_sync(&func->dev);
+ if (ret < 0)
+ goto out;
sdio_claim_host(func);
sdio_enable_func(func);
+ sdio_release_host(func);
} else {
+ sdio_claim_host(func);
sdio_disable_func(func);
sdio_release_host(func);
- sdio_release_power(func);
+
+ /* Power down the card */
+ ret = pm_runtime_put_sync(&func->dev);
}

- return 0;
+out:
+ return ret;
}

static void wl1271_sdio_disable_interrupts(struct wl1271 *wl)
@@ -481,7 +491,7 @@ static void __devexit wl1271_remove(struct sdio_func *func)
}

static struct sdio_driver wl1271_sdio_driver = {
- .name = "wl1271_sdio_test",
+ .name = "wl12xx_sdio_test",
.id_table = wl1271_devices,
.probe = wl1271_probe,
.remove = __devexit_p(wl1271_remove),
--
1.7.0.4



2010-12-16 09:02:04

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style

Hi Roger,

On Wed, 2010-12-15 at 17:16 +0200, Roger Quadros wrote:
> On 12/15/2010 04:48 PM, Luciano Coelho wrote:
> > On Wed, 2010-12-15 at 16:33 +0200, ext Luciano Coelho wrote:
> >> On Wed, 2010-12-15 at 16:31 +0200, [email protected] wrote:
> >>> From: Luciano Coelho<[email protected]>
> >>>
> >>> Change some file names and Kconfig settings so that this new module matches
> >>> the new way of using wl12xx instead of wl1271.
> >>>
> >>> Also fix SDIO power enabling and disabling to match the latest way of doing
> >>> it.
> >>>
> >>> Cc: Roger Quadros<[email protected]>
> >>> Signed-off-by: Luciano Coelho<[email protected]>
> >>> ---
> >>
> >> In v2 I used the -M flag (to detect renames, which I stupidly forgot
> >> before) and removed the file names from the header of the sdio_test.c
> >> file, since it's a bad idea to have it there (thanks Johannes for the
> >> comments).
> >
> > Roger, I have just compile-tested this module in upstream. Could you
> > run at least some basic tests with it to make sure it works?
> >
> >
>
> Luca,
>
> I don't have a ready setup with me which boots mainline kernel and has wl1271 on
> sdio.

I have a tree prepared with the latest wl12xx.git plus some patches that
add support for our development platform (RX-71).


> The only way to verify it is to load the module with the parameters rx=1 and
> tx=1 and see if the "testing started" message appears.

I tried it now, but I'm always getting this when loading the module:

[ 114.883514] wl12xx_sdio_test mmc2:0001:2: could not wake up chip
[ 114.889587] wl12xx_sdio_test: probe of mmc2:0001:2 failed with error 1

Any clue what this is about?


> what platform do you use to verify with mainline kernel & sdio wl1271 ?

I use both our RX-71 and a Beagleboard. I have trees which work on
both, let me know if you want to clone them from my local git.

--
Cheers,
Luca.


2010-12-15 14:46:24

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style

On Wed, 2010-12-15 at 16:33 +0200, ext Luciano Coelho wrote:
> On Wed, 2010-12-15 at 16:31 +0200, [email protected] wrote:
> > From: Luciano Coelho <[email protected]>
> >
> > Change some file names and Kconfig settings so that this new module matches
> > the new way of using wl12xx instead of wl1271.
> >
> > Also fix SDIO power enabling and disabling to match the latest way of doing
> > it.
> >
> > Cc: Roger Quadros <[email protected]>
> > Signed-off-by: Luciano Coelho <[email protected]>
> > ---
>
> In v2 I used the -M flag (to detect renames, which I stupidly forgot
> before) and removed the file names from the header of the sdio_test.c
> file, since it's a bad idea to have it there (thanks Johannes for the
> comments).

Roger, I have just compile-tested this module in upstream. Could you
run at least some basic tests with it to make sure it works?


--
Cheers,
Luca.


2010-12-15 15:15:03

by Roger Quadros

[permalink] [raw]
Subject: Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style

On 12/15/2010 04:48 PM, Luciano Coelho wrote:
> On Wed, 2010-12-15 at 16:33 +0200, ext Luciano Coelho wrote:
>> On Wed, 2010-12-15 at 16:31 +0200, [email protected] wrote:
>>> From: Luciano Coelho<[email protected]>
>>>
>>> Change some file names and Kconfig settings so that this new module matches
>>> the new way of using wl12xx instead of wl1271.
>>>
>>> Also fix SDIO power enabling and disabling to match the latest way of doing
>>> it.
>>>
>>> Cc: Roger Quadros<[email protected]>
>>> Signed-off-by: Luciano Coelho<[email protected]>
>>> ---
>>
>> In v2 I used the -M flag (to detect renames, which I stupidly forgot
>> before) and removed the file names from the header of the sdio_test.c
>> file, since it's a bad idea to have it there (thanks Johannes for the
>> comments).
>
> Roger, I have just compile-tested this module in upstream. Could you
> run at least some basic tests with it to make sure it works?
>
>

Luca,

I don't have a ready setup with me which boots mainline kernel and has wl1271 on
sdio.

The only way to verify it is to load the module with the parameters rx=1 and
tx=1 and see if the "testing started" message appears.

what platform do you use to verify with mainline kernel & sdio wl1271 ?

--
regards,
-roger

2010-12-16 09:24:08

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style

On Thu, 2010-12-16 at 11:12 +0200, Roger Quadros wrote:
> >> what platform do you use to verify with mainline kernel& sdio
> wl1271 ?
> >
> > I use both our RX-71 and a Beagleboard. I have trees which work on
> > both, let me know if you want to clone them from my local git.
> >
>
> Yes that will be helpful. Please provide me a link to your tree that
> works with RX-71.

Ok, I'll send it to you privately. This is on our intranet, so nobody
else can access it from outside anyway (hopefully! ;).


--
Cheers,
Luca.


2010-12-15 14:32:03

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style

On Wed, 2010-12-15 at 16:31 +0200, [email protected] wrote:
> From: Luciano Coelho <[email protected]>
>
> Change some file names and Kconfig settings so that this new module matches
> the new way of using wl12xx instead of wl1271.
>
> Also fix SDIO power enabling and disabling to match the latest way of doing
> it.
>
> Cc: Roger Quadros <[email protected]>
> Signed-off-by: Luciano Coelho <[email protected]>
> ---

In v2 I used the -M flag (to detect renames, which I stupidly forgot
before) and removed the file names from the header of the sdio_test.c
file, since it's a bad idea to have it there (thanks Johannes for the
comments).

--
Cheers,
Luca.


2010-12-16 09:17:17

by Roger Quadros

[permalink] [raw]
Subject: Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style

On 12/16/2010 11:04 AM, Luciano Coelho wrote:
> Hi Roger,
>
>
> I have a tree prepared with the latest wl12xx.git plus some patches that
> add support for our development platform (RX-71).
>
>
>> The only way to verify it is to load the module with the parameters rx=1 and
>> tx=1 and see if the "testing started" message appears.
>
> I tried it now, but I'm always getting this when loading the module:
>
> [ 114.883514] wl12xx_sdio_test mmc2:0001:2: could not wake up chip
> [ 114.889587] wl12xx_sdio_test: probe of mmc2:0001:2 failed with error 1
>
> Any clue what this is about?

Not sure. need to check.

>
>
>> what platform do you use to verify with mainline kernel& sdio wl1271 ?
>
> I use both our RX-71 and a Beagleboard. I have trees which work on
> both, let me know if you want to clone them from my local git.
>

Yes that will be helpful. Please provide me a link to your tree that works with
RX-71.

--
regards,
-roger

2010-12-15 15:08:44

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH v2] wl12xx_sdio_test: rename files to match current style

On Wed, 2010-12-15 at 16:31 +0200, [email protected] wrote:
> From: Luciano Coelho <[email protected]>
>
> Change some file names and Kconfig settings so that this new module matches
> the new way of using wl12xx instead of wl1271.
>
> Also fix SDIO power enabling and disabling to match the latest way of doing
> it.
>
> Cc: Roger Quadros <[email protected]>
> Signed-off-by: Luciano Coelho <[email protected]>
> ---

Applied.


--
Cheers,
Luca.