public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the wireless-next tree with the net-next tree
@ 2013-02-11  2:33 Stephen Rothwell
  2013-02-11  2:58 ` Joe Perches
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Rothwell @ 2013-02-11  2:33 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-next, linux-kernel, David Miller, netdev, Joe Perches,
	Luciano Coelho

[-- Attachment #1: Type: text/plain, Size: 2256 bytes --]

Hi John,

Today's linux-next merge of the wireless-next tree got conflicts in
drivers/net/wireless/ti/wlcore/sdio.c and
drivers/net/wireless/ti/wlcore/spi.c between commit 0d2e7a5c6080
("wireless: Remove unnecessary alloc/OOM messages, alloc cleanups") from
the net-next tree and commit afb43e6d88e5 ("wlcore: remove if_ops from
platform_data") from the wireless-next tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
diff --cc drivers/net/wireless/ti/wlcore/sdio.c
index 75622f6,198028d..0000000
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@@ -228,9 -228,19 +228,17 @@@ static int wl1271_probe(struct sdio_fun
  	if (func->num != 0x02)
  		return -ENODEV;
  
+ 	pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
+ 	if (!pdev_data) {
+ 		dev_err(&func->dev, "can't allocate platdev_data\n");
+ 		goto out;
+ 	}
+ 
+ 	pdev_data->if_ops = &sdio_ops;
+ 
  	glue = kzalloc(sizeof(*glue), GFP_KERNEL);
 -	if (!glue) {
 -		dev_err(&func->dev, "can't allocate glue\n");
 +	if (!glue)
- 		goto out;
+ 		goto out_free_pdev_data;
 -	}
  
  	glue->dev = &func->dev;
  
diff --cc drivers/net/wireless/ti/wlcore/spi.c
index 53790d1,5ad2e10..0000000
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@@ -325,17 -331,26 +325,24 @@@ static int wl1271_probe(struct spi_devi
  	struct resource res[1];
  	int ret = -ENOMEM;
  
- 	pdata = spi->dev.platform_data;
- 	if (!pdata) {
+ 	pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
+ 	if (!pdev_data) {
+ 		dev_err(&spi->dev, "can't allocate platdev_data\n");
+ 		goto out;
+ 	}
+ 
+ 	pdev_data->pdata = spi->dev.platform_data;
+ 	if (!pdev_data->pdata) {
  		dev_err(&spi->dev, "no platform data\n");
- 		return -ENODEV;
+ 		ret = -ENODEV;
+ 		goto out_free_pdev_data;
  	}
  
- 	pdata->ops = &spi_ops;
+ 	pdev_data->if_ops = &spi_ops;
  
  	glue = kzalloc(sizeof(*glue), GFP_KERNEL);
 -	if (!glue) {
 -		dev_err(&spi->dev, "can't allocate glue\n");
 +	if (!glue)
- 		goto out;
+ 		goto out_free_pdev_data;
 -	}
  
  	glue->dev = &spi->dev;
  

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: linux-next: manual merge of the wireless-next tree with the net-next tree
  2013-02-11  2:33 linux-next: manual merge of the wireless-next tree with the net-next tree Stephen Rothwell
@ 2013-02-11  2:58 ` Joe Perches
  2013-02-11  6:47   ` Luciano Coelho
  0 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2013-02-11  2:58 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: John W. Linville, linux-next, linux-kernel, David Miller, netdev,
	Luciano Coelho

On Mon, 2013-02-11 at 13:33 +1100, Stephen Rothwell wrote:
> Hi John,
> 
> Today's linux-next merge of the wireless-next tree got conflicts in
> drivers/net/wireless/ti/wlcore/sdio.c and
> drivers/net/wireless/ti/wlcore/spi.c between commit 0d2e7a5c6080
> ("wireless: Remove unnecessary alloc/OOM messages, alloc cleanups") from
> the net-next tree and commit afb43e6d88e5 ("wlcore: remove if_ops from
> platform_data") from the wireless-next tree.
> 
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).
> 

Thanks Stephen.

Can you remove just the dev_err below too please.

+       pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
+       if (!pdev_data) {
+               dev_err(&func->dev, "can't allocate platdev_data\n");
+               goto out;
+       }

Joe

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

* Re: linux-next: manual merge of the wireless-next tree with the net-next tree
  2013-02-11  2:58 ` Joe Perches
@ 2013-02-11  6:47   ` Luciano Coelho
  2013-02-11  7:40     ` Stephen Rothwell
  0 siblings, 1 reply; 12+ messages in thread
From: Luciano Coelho @ 2013-02-11  6:47 UTC (permalink / raw)
  To: Joe Perches
  Cc: Stephen Rothwell, John W. Linville, linux-next, linux-kernel,
	David Miller, netdev

On Sun, 2013-02-10 at 18:58 -0800, Joe Perches wrote:
> On Mon, 2013-02-11 at 13:33 +1100, Stephen Rothwell wrote:
> > Hi John,
> > 
> > Today's linux-next merge of the wireless-next tree got conflicts in
> > drivers/net/wireless/ti/wlcore/sdio.c and
> > drivers/net/wireless/ti/wlcore/spi.c between commit 0d2e7a5c6080
> > ("wireless: Remove unnecessary alloc/OOM messages, alloc cleanups") from
> > the net-next tree and commit afb43e6d88e5 ("wlcore: remove if_ops from
> > platform_data") from the wireless-next tree.
> > 
> > I fixed it up (see below) and can carry the fix as necessary (no action
> > is required).
> > 

The fix up looks good.  Thanks!


> Thanks Stephen.
> 
> Can you remove just the dev_err below too please.
> 
> +       pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
> +       if (!pdev_data) {
> +               dev_err(&func->dev, "can't allocate platdev_data\n");
> +               goto out;
> +       }

Yes, and there's also another one in
drivers/net/wireless/ti/wlcore/spi.c:

+       pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
+       if (!pdev_data) {
+               dev_err(&spi->dev, "can't allocate platdev_data\n");
+               goto out;
+       }

--
Cheers,
Luca.

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

* Re: linux-next: manual merge of the wireless-next tree with the net-next tree
  2013-02-11  6:47   ` Luciano Coelho
@ 2013-02-11  7:40     ` Stephen Rothwell
  2013-02-11  7:53       ` Luciano Coelho
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Rothwell @ 2013-02-11  7:40 UTC (permalink / raw)
  To: Luciano Coelho
  Cc: Joe Perches, John W. Linville, linux-next, linux-kernel,
	David Miller, netdev

[-- Attachment #1: Type: text/plain, Size: 1589 bytes --]

Hi all,

On Mon, 11 Feb 2013 08:47:54 +0200 Luciano Coelho <coelho@ti.com> wrote:
>
> On Sun, 2013-02-10 at 18:58 -0800, Joe Perches wrote:
> > On Mon, 2013-02-11 at 13:33 +1100, Stephen Rothwell wrote:
> > > 
> > > Today's linux-next merge of the wireless-next tree got conflicts in
> > > drivers/net/wireless/ti/wlcore/sdio.c and
> > > drivers/net/wireless/ti/wlcore/spi.c between commit 0d2e7a5c6080
> > > ("wireless: Remove unnecessary alloc/OOM messages, alloc cleanups") from
> > > the net-next tree and commit afb43e6d88e5 ("wlcore: remove if_ops from
> > > platform_data") from the wireless-next tree.
> > > 
> > > I fixed it up (see below) and can carry the fix as necessary (no action
> > > is required).
> 
> The fix up looks good.  Thanks!
> 
> > Thanks Stephen.
> > 
> > Can you remove just the dev_err below too please.
> > 
> > +       pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
> > +       if (!pdev_data) {
> > +               dev_err(&func->dev, "can't allocate platdev_data\n");
> > +               goto out;
> > +       }
> 
> Yes, and there's also another one in
> drivers/net/wireless/ti/wlcore/spi.c:
> 
> +       pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
> +       if (!pdev_data) {
> +               dev_err(&spi->dev, "can't allocate platdev_data\n");
> +               goto out;
> +       }

I presume that there is no harm in actually fixing these extra ones
directly in the wireless-next tree, right?  (hint, John, hint :-))

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: linux-next: manual merge of the wireless-next tree with the net-next tree
  2013-02-11  7:40     ` Stephen Rothwell
@ 2013-02-11  7:53       ` Luciano Coelho
  2013-02-11  8:02         ` [PATCH] wlcore: remove newly introduced alloc/OOM messages Luciano Coelho
  2013-02-11  8:21         ` [PATCH v2] " Luciano Coelho
  0 siblings, 2 replies; 12+ messages in thread
From: Luciano Coelho @ 2013-02-11  7:53 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Joe Perches, John W. Linville, linux-next, linux-kernel,
	David Miller, netdev

On Mon, 2013-02-11 at 18:40 +1100, Stephen Rothwell wrote:
> Hi all,
> 
> On Mon, 11 Feb 2013 08:47:54 +0200 Luciano Coelho <coelho@ti.com> wrote:
> >
> > On Sun, 2013-02-10 at 18:58 -0800, Joe Perches wrote:
> > > On Mon, 2013-02-11 at 13:33 +1100, Stephen Rothwell wrote:
> > > > 
> > > > Today's linux-next merge of the wireless-next tree got conflicts in
> > > > drivers/net/wireless/ti/wlcore/sdio.c and
> > > > drivers/net/wireless/ti/wlcore/spi.c between commit 0d2e7a5c6080
> > > > ("wireless: Remove unnecessary alloc/OOM messages, alloc cleanups") from
> > > > the net-next tree and commit afb43e6d88e5 ("wlcore: remove if_ops from
> > > > platform_data") from the wireless-next tree.
> > > > 
> > > > I fixed it up (see below) and can carry the fix as necessary (no action
> > > > is required).
> > 
> > The fix up looks good.  Thanks!
> > 
> > > Thanks Stephen.
> > > 
> > > Can you remove just the dev_err below too please.
> > > 
> > > +       pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
> > > +       if (!pdev_data) {
> > > +               dev_err(&func->dev, "can't allocate platdev_data\n");
> > > +               goto out;
> > > +       }
> > 
> > Yes, and there's also another one in
> > drivers/net/wireless/ti/wlcore/spi.c:
> > 
> > +       pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
> > +       if (!pdev_data) {
> > +               dev_err(&spi->dev, "can't allocate platdev_data\n");
> > +               goto out;
> > +       }
> 
> I presume that there is no harm in actually fixing these extra ones
> directly in the wireless-next tree, right?  (hint, John, hint :-))

I'll send a patch fixing this in a minute.

--
Luca.

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

* [PATCH] wlcore: remove newly introduced alloc/OOM messages
  2013-02-11  7:53       ` Luciano Coelho
@ 2013-02-11  8:02         ` Luciano Coelho
  2013-02-11  8:06           ` Luciano Coelho
                             ` (2 more replies)
  2013-02-11  8:21         ` [PATCH v2] " Luciano Coelho
  1 sibling, 3 replies; 12+ messages in thread
From: Luciano Coelho @ 2013-02-11  8:02 UTC (permalink / raw)
  To: linville, sfr; +Cc: joe, linux-next, linux-kernel, davem, netdev

In commit 0d2e7a5c (wireless: Remove unnecessary alloc/OOM messages,
alloc cleanups) OOM messages after alloc were removed from the wlcore
modules.

Commit afb43e6d (wlcore: remove if_ops from platform_data)
reintroduced a couple of those.  This patch removes them.

Signed-off-by: Luciano Coelho <coelho@ti.com>
---

John,

Can you apply this directly on wireless-next after you process my latest pull-request?

Thanks!

 drivers/net/wireless/ti/Kconfig                    |    9 ----
 drivers/net/wireless/ti/Makefile                   |    4 +-
 drivers/net/wireless/ti/wl1251/ps.c                |    3 +-
 drivers/net/wireless/ti/wl12xx/main.c              |    3 +-
 drivers/net/wireless/ti/wl18xx/conf.h              |    7 ++-
 drivers/net/wireless/ti/wl18xx/main.c              |    5 --
 drivers/net/wireless/ti/wlcore/Kconfig             |    5 ++
 drivers/net/wireless/ti/wlcore/Makefile            |    3 ++
 drivers/net/wireless/ti/wlcore/boot.c              |    4 +-
 drivers/net/wireless/ti/wlcore/cmd.c               |    8 ++--
 drivers/net/wireless/ti/wlcore/main.c              |   17 ++++---
 drivers/net/wireless/ti/wlcore/sdio.c              |    4 +-
 drivers/net/wireless/ti/wlcore/spi.c               |    4 +-
 .../net/wireless/ti/wlcore/wl12xx_platform_data.c  |   49 ++++++++++++++++++++
 drivers/net/wireless/ti/wlcore/wlcore.h            |    1 +
 drivers/net/wireless/ti/wlcore/wlcore_i.h          |    9 +---
 16 files changed, 83 insertions(+), 52 deletions(-)
 create mode 100644 drivers/net/wireless/ti/wlcore/wl12xx_platform_data.c

diff --git a/drivers/net/wireless/ti/Kconfig b/drivers/net/wireless/ti/Kconfig
index cbe1e7f..be80011 100644
--- a/drivers/net/wireless/ti/Kconfig
+++ b/drivers/net/wireless/ti/Kconfig
@@ -12,13 +12,4 @@ source "drivers/net/wireless/ti/wl18xx/Kconfig"
 
 # keep last for automatic dependencies
 source "drivers/net/wireless/ti/wlcore/Kconfig"
-
-config WILINK_PLATFORM_DATA
-	bool "TI WiLink platform data"
-	depends on WLCORE_SDIO || WL1251_SDIO
-	default y
-	---help---
-	Small platform data bit needed to pass data to the sdio modules.
-
-
 endif # WL_TI
diff --git a/drivers/net/wireless/ti/Makefile b/drivers/net/wireless/ti/Makefile
index af14231..4d68239 100644
--- a/drivers/net/wireless/ti/Makefile
+++ b/drivers/net/wireless/ti/Makefile
@@ -1,7 +1,5 @@
 obj-$(CONFIG_WLCORE)			+= wlcore/
 obj-$(CONFIG_WL12XX)			+= wl12xx/
+obj-$(CONFIG_WL12XX_PLATFORM_DATA)	+= wlcore/
 obj-$(CONFIG_WL1251)			+= wl1251/
 obj-$(CONFIG_WL18XX)			+= wl18xx/
-
-# small builtin driver bit
-obj-$(CONFIG_WILINK_PLATFORM_DATA)	+= wilink_platform_data.o
diff --git a/drivers/net/wireless/ti/wl1251/ps.c b/drivers/net/wireless/ti/wl1251/ps.c
index db719f7..b9e27b9 100644
--- a/drivers/net/wireless/ti/wl1251/ps.c
+++ b/drivers/net/wireless/ti/wl1251/ps.c
@@ -68,8 +68,7 @@ int wl1251_ps_elp_wakeup(struct wl1251 *wl)
 	unsigned long timeout, start;
 	u32 elp_reg;
 
-	if (delayed_work_pending(&wl->elp_work))
-		cancel_delayed_work(&wl->elp_work);
+	cancel_delayed_work(&wl->elp_work);
 
 	if (!wl->elp)
 		return 0;
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 09694e3..3254bfc 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -1703,8 +1703,7 @@ static struct ieee80211_sta_ht_cap wl12xx_ht_cap = {
 static int wl12xx_setup(struct wl1271 *wl)
 {
 	struct wl12xx_priv *priv = wl->priv;
-	struct wlcore_platdev_data *pdev_data = wl->pdev->dev.platform_data;
-	struct wl12xx_platform_data *pdata = pdev_data->pdata;
+	struct wl12xx_platform_data *pdata = wl->pdev->dev.platform_data;
 
 	wl->rtable = wl12xx_rtable;
 	wl->num_tx_desc = WL12XX_NUM_TX_DESCRIPTORS;
diff --git a/drivers/net/wireless/ti/wl18xx/conf.h b/drivers/net/wireless/ti/wl18xx/conf.h
index e34302e..b5f1148 100644
--- a/drivers/net/wireless/ti/wl18xx/conf.h
+++ b/drivers/net/wireless/ti/wl18xx/conf.h
@@ -23,7 +23,7 @@
 #define __WL18XX_CONF_H__
 
 #define WL18XX_CONF_MAGIC	0x10e100ca
-#define WL18XX_CONF_VERSION	(WLCORE_CONF_VERSION | 0x0006)
+#define WL18XX_CONF_VERSION	(WLCORE_CONF_VERSION | 0x0005)
 #define WL18XX_CONF_MASK	0x0000ffff
 #define WL18XX_CONF_SIZE	(WLCORE_CONF_SIZE + \
 				 sizeof(struct wl18xx_priv_conf))
@@ -70,9 +70,8 @@ struct wl18xx_mac_and_phy_params {
 	u8 pwr_limit_reference_11_abg;
 	u8 per_chan_pwr_limit_arr_11p[NUM_OF_CHANNELS_11_P];
 	u8 pwr_limit_reference_11p;
-	u8 spare1;
-	u8 per_chan_bo_mode_11_abg[13];
-	u8 per_chan_bo_mode_11_p[4];
+	u8 spare1[9];
+	u8 spare2[9];
 	u8 primary_clock_setting_time;
 	u8 clock_valid_on_wake_up;
 	u8 secondary_clock_setting_time;
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index a10b7a7..0be1cfc 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -547,11 +547,6 @@ static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
 			0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
 			0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
 		.pwr_limit_reference_11p	= 0x64,
-		.per_chan_bo_mode_11_abg	= { 0x00, 0x00, 0x00, 0x00,
-						    0x00, 0x00, 0x00, 0x00,
-						    0x00, 0x00, 0x00, 0x00,
-						    0x00 },
-		.per_chan_bo_mode_11_p		= { 0x00, 0x00, 0x00, 0x00 },
 		.per_chan_pwr_limit_arr_11p	= { 0xff, 0xff, 0xff, 0xff,
 						    0xff, 0xff, 0xff },
 		.psat				= 0,
diff --git a/drivers/net/wireless/ti/wlcore/Kconfig b/drivers/net/wireless/ti/wlcore/Kconfig
index 2b83282..d7b907e 100644
--- a/drivers/net/wireless/ti/wlcore/Kconfig
+++ b/drivers/net/wireless/ti/wlcore/Kconfig
@@ -33,3 +33,8 @@ config WLCORE_SDIO
 
 	  If you choose to build a module, it'll be called wlcore_sdio.
 	  Say N if unsure.
+
+config WL12XX_PLATFORM_DATA
+	bool
+	depends on WLCORE_SDIO != n || WL1251_SDIO != n
+	default y
diff --git a/drivers/net/wireless/ti/wlcore/Makefile b/drivers/net/wireless/ti/wlcore/Makefile
index b21398f..d9fba9e 100644
--- a/drivers/net/wireless/ti/wlcore/Makefile
+++ b/drivers/net/wireless/ti/wlcore/Makefile
@@ -9,4 +9,7 @@ obj-$(CONFIG_WLCORE)			+= wlcore.o
 obj-$(CONFIG_WLCORE_SPI)		+= wlcore_spi.o
 obj-$(CONFIG_WLCORE_SDIO)		+= wlcore_sdio.o
 
+# small builtin driver bit
+obj-$(CONFIG_WL12XX_PLATFORM_DATA)	+= wl12xx_platform_data.o
+
 ccflags-y += -D__CHECK_ENDIAN__
diff --git a/drivers/net/wireless/ti/wlcore/boot.c b/drivers/net/wireless/ti/wlcore/boot.c
index 77752b0..b58ae5f 100644
--- a/drivers/net/wireless/ti/wlcore/boot.c
+++ b/drivers/net/wireless/ti/wlcore/boot.c
@@ -84,8 +84,8 @@ out:
 static int wlcore_validate_fw_ver(struct wl1271 *wl)
 {
 	unsigned int *fw_ver = wl->chip.fw_ver;
-	unsigned int *min_ver = (wl->fw_type == WL12XX_FW_TYPE_MULTI) ?
-		wl->min_mr_fw_ver : wl->min_sr_fw_ver;
+	unsigned int *min_ver = (wl->fw_type == WL12XX_FW_TYPE_NORMAL) ?
+		wl->min_sr_fw_ver : wl->min_mr_fw_ver;
 	char min_fw_str[32] = "";
 	int i;
 
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index 6331f9e..1201aca 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.c
+++ b/drivers/net/wireless/ti/wlcore/cmd.c
@@ -510,12 +510,10 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif)
 	cmd->sta.hlid = wlvif->sta.hlid;
 	cmd->sta.session = wl->session_ids[wlvif->sta.hlid];
 	/*
-	 * We don't have the correct remote rates in this stage.  The
-	 * rates will be reconfigured later, after association, if the
-	 * firmware supports ACX_PEER_CAP.  Otherwise, there's nothing
-	 * we can do, so use all supported_rates here.
+	 * We don't have the correct remote rates in this stage. the rates
+	 * will be reconfigured later, after authorization.
 	 */
-	cmd->sta.remote_rates = cpu_to_le32(supported_rates);
+	cmd->sta.remote_rates = cpu_to_le32(wlvif->rate_set);
 
 	wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d "
 		     "basic_rate_set: 0x%x, remote_rates: 0x%x",
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 28a3757..e1dfdf9 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -2162,7 +2162,7 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif)
 	return 0;
 }
 
-static int wl12xx_init_fw(struct wl1271 *wl)
+static bool wl12xx_init_fw(struct wl1271 *wl)
 {
 	int retries = WL1271_BOOT_RETRIES;
 	bool booted = false;
@@ -2228,7 +2228,7 @@ power_off:
 
 	wl->state = WLCORE_STATE_ON;
 out:
-	return ret;
+	return booted;
 }
 
 static bool wl12xx_dev_role_started(struct wl12xx_vif *wlvif)
@@ -2371,6 +2371,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
 	struct vif_counter_data vif_count;
 	int ret = 0;
 	u8 role_type;
+	bool booted = false;
 
 	vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER |
 			     IEEE80211_VIF_SUPPORTS_CQM_RSSI;
@@ -2431,9 +2432,11 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
 		 */
 		memcpy(wl->addresses[0].addr, vif->addr, ETH_ALEN);
 
-		ret = wl12xx_init_fw(wl);
-		if (ret < 0)
+		booted = wl12xx_init_fw(wl);
+		if (!booted) {
+			ret = -EINVAL;
 			goto out;
+		}
 	}
 
 	ret = wl12xx_cmd_role_enable(wl, vif->addr,
@@ -5963,8 +5966,7 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
 {
 	struct wl1271 *wl = context;
 	struct platform_device *pdev = wl->pdev;
-	struct wlcore_platdev_data *pdev_data = pdev->dev.platform_data;
-	struct wl12xx_platform_data *pdata = pdev_data->pdata;
+	struct wl12xx_platform_data *pdata = pdev->dev.platform_data;
 	unsigned long irqflags;
 	int ret;
 
@@ -5993,7 +5995,8 @@ static void wlcore_nvs_cb(const struct firmware *fw, void *context)
 
 	wl->irq = platform_get_irq(pdev, 0);
 	wl->platform_quirks = pdata->platform_quirks;
-	wl->if_ops = pdev_data->if_ops;
+	wl->set_power = pdata->set_power;
+	wl->if_ops = pdata->ops;
 
 	if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ)
 		irqflags = IRQF_TRIGGER_RISING;
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 198028d..29ef249 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -229,10 +229,8 @@ static int wl1271_probe(struct sdio_func *func,
 		return -ENODEV;
 
 	pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
-	if (!pdev_data) {
-		dev_err(&func->dev, "can't allocate platdev_data\n");
+	if (!pdev_data)
 		goto out;
-	}
 
 	pdev_data->if_ops = &sdio_ops;
 
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index 5ad2e10..e264478 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -332,10 +332,8 @@ static int wl1271_probe(struct spi_device *spi)
 	int ret = -ENOMEM;
 
 	pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
-	if (!pdev_data) {
-		dev_err(&spi->dev, "can't allocate platdev_data\n");
+	if (!pdev_data)
 		goto out;
-	}
 
 	pdev_data->pdata = spi->dev.platform_data;
 	if (!pdev_data->pdata) {
diff --git a/drivers/net/wireless/ti/wlcore/wl12xx_platform_data.c b/drivers/net/wireless/ti/wlcore/wl12xx_platform_data.c
new file mode 100644
index 0000000..998e958
--- /dev/null
+++ b/drivers/net/wireless/ti/wlcore/wl12xx_platform_data.c
@@ -0,0 +1,49 @@
+/*
+ * This file is part of wl12xx
+ *
+ * Copyright (C) 2010-2011 Texas Instruments, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/wl12xx.h>
+
+static struct wl12xx_platform_data *platform_data;
+
+int __init wl12xx_set_platform_data(const struct wl12xx_platform_data *data)
+{
+	if (platform_data)
+		return -EBUSY;
+	if (!data)
+		return -EINVAL;
+
+	platform_data = kmemdup(data, sizeof(*data), GFP_KERNEL);
+	if (!platform_data)
+		return -ENOMEM;
+
+	return 0;
+}
+
+struct wl12xx_platform_data *wl12xx_get_platform_data(void)
+{
+	if (!platform_data)
+		return ERR_PTR(-ENODEV);
+
+	return platform_data;
+}
+EXPORT_SYMBOL(wl12xx_get_platform_data);
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index af9feca..ebd8c6f 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -183,6 +183,7 @@ struct wl1271 {
 
 	struct wl1271_if_operations *if_ops;
 
+	void (*set_power)(bool enable);
 	int irq;
 
 	spinlock_t wl_lock;
diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h
index c845b0e..910f8e2 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore_i.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h
@@ -111,9 +111,9 @@ enum {
 
 struct wl1271_chip {
 	u32 id;
-	char fw_ver_str[ETHTOOL_BUSINFO_LEN];
+	char fw_ver_str[ETHTOOL_FWVERS_LEN];
 	unsigned int fw_ver[NUM_FW_VER];
-	char phy_fw_ver_str[ETHTOOL_BUSINFO_LEN];
+	char phy_fw_ver_str[ETHTOOL_FWVERS_LEN];
 };
 
 #define NUM_TX_QUEUES              4
@@ -206,11 +206,6 @@ struct wl1271_if_operations {
 	void (*set_block_size) (struct device *child, unsigned int blksz);
 };
 
-struct wlcore_platdev_data {
-	struct wl12xx_platform_data *pdata;
-	struct wl1271_if_operations *if_ops;
-};
-
 #define MAX_NUM_KEYS 14
 #define MAX_KEY_SIZE 32
 
-- 
1.7.10.4

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

* Re: [PATCH] wlcore: remove newly introduced alloc/OOM messages
  2013-02-11  8:02         ` [PATCH] wlcore: remove newly introduced alloc/OOM messages Luciano Coelho
@ 2013-02-11  8:06           ` Luciano Coelho
  2013-02-11  8:07           ` Joe Perches
  2013-02-11  8:08           ` Felipe Balbi
  2 siblings, 0 replies; 12+ messages in thread
From: Luciano Coelho @ 2013-02-11  8:06 UTC (permalink / raw)
  To: linville; +Cc: sfr, joe, linux-next, linux-kernel, davem, netdev

On Mon, 2013-02-11 at 10:02 +0200, Luciano Coelho wrote:
> In commit 0d2e7a5c (wireless: Remove unnecessary alloc/OOM messages,
> alloc cleanups) OOM messages after alloc were removed from the wlcore
> modules.
> 
> Commit afb43e6d (wlcore: remove if_ops from platform_data)
> reintroduced a couple of those.  This patch removes them.
> 
> Signed-off-by: Luciano Coelho <coelho@ti.com>
> ---
> 
> John,
> 
> Can you apply this directly on wireless-next after you process my latest pull-request?
> 
> Thanks!

Ermm... obviously this is completely wrong.  I'll send v2 in a bit.

--
Luca.

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

* Re: [PATCH] wlcore: remove newly introduced alloc/OOM messages
  2013-02-11  8:02         ` [PATCH] wlcore: remove newly introduced alloc/OOM messages Luciano Coelho
  2013-02-11  8:06           ` Luciano Coelho
@ 2013-02-11  8:07           ` Joe Perches
  2013-02-11  8:07             ` Luciano Coelho
  2013-02-11  8:08           ` Felipe Balbi
  2 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2013-02-11  8:07 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linville, sfr, linux-next, linux-kernel, davem, netdev

On Mon, 2013-02-11 at 10:02 +0200, Luciano Coelho wrote:
> In commit 0d2e7a5c (wireless: Remove unnecessary alloc/OOM messages,
> alloc cleanups) OOM messages after alloc were removed from the wlcore
> modules.
> 
> Commit afb43e6d (wlcore: remove if_ops from platform_data)
> reintroduced a couple of those.  This patch removes them.

You sure?

The largish patch doesn't match the commit message.

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

* Re: [PATCH] wlcore: remove newly introduced alloc/OOM messages
  2013-02-11  8:07           ` Joe Perches
@ 2013-02-11  8:07             ` Luciano Coelho
  0 siblings, 0 replies; 12+ messages in thread
From: Luciano Coelho @ 2013-02-11  8:07 UTC (permalink / raw)
  To: Joe Perches; +Cc: linville, sfr, linux-next, linux-kernel, davem, netdev

On Mon, 2013-02-11 at 00:07 -0800, Joe Perches wrote:
> On Mon, 2013-02-11 at 10:02 +0200, Luciano Coelho wrote:
> > In commit 0d2e7a5c (wireless: Remove unnecessary alloc/OOM messages,
> > alloc cleanups) OOM messages after alloc were removed from the wlcore
> > modules.
> > 
> > Commit afb43e6d (wlcore: remove if_ops from platform_data)
> > reintroduced a couple of those.  This patch removes them.
> 
> You sure?
> 
> The largish patch doesn't match the commit message.

Sorry, I screwed up.  I'll send v2 in a second (should get some more
coffee first ;)

--
Luca.

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

* Re: [PATCH] wlcore: remove newly introduced alloc/OOM messages
  2013-02-11  8:02         ` [PATCH] wlcore: remove newly introduced alloc/OOM messages Luciano Coelho
  2013-02-11  8:06           ` Luciano Coelho
  2013-02-11  8:07           ` Joe Perches
@ 2013-02-11  8:08           ` Felipe Balbi
  2 siblings, 0 replies; 12+ messages in thread
From: Felipe Balbi @ 2013-02-11  8:08 UTC (permalink / raw)
  To: Luciano Coelho
  Cc: linville, sfr, joe, linux-next, linux-kernel, davem, netdev

[-- Attachment #1: Type: text/plain, Size: 593 bytes --]

On Mon, Feb 11, 2013 at 10:02:29AM +0200, Luciano Coelho wrote:
> In commit 0d2e7a5c (wireless: Remove unnecessary alloc/OOM messages,
> alloc cleanups) OOM messages after alloc were removed from the wlcore
> modules.
> 
> Commit afb43e6d (wlcore: remove if_ops from platform_data)
> reintroduced a couple of those.  This patch removes them.
> 
> Signed-off-by: Luciano Coelho <coelho@ti.com>
> ---
> 
> John,
> 
> Can you apply this directly on wireless-next after you process my latest pull-request?

please don't... patch isn't really what commit log says :-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH v2] wlcore: remove newly introduced alloc/OOM messages
  2013-02-11  7:53       ` Luciano Coelho
  2013-02-11  8:02         ` [PATCH] wlcore: remove newly introduced alloc/OOM messages Luciano Coelho
@ 2013-02-11  8:21         ` Luciano Coelho
  2013-02-11  8:24           ` Felipe Balbi
  1 sibling, 1 reply; 12+ messages in thread
From: Luciano Coelho @ 2013-02-11  8:21 UTC (permalink / raw)
  To: linville, sfr; +Cc: joe, linux-next, linux-kernel, davem, netdev

In commit 0d2e7a5c (wireless: Remove unnecessary alloc/OOM messages,
alloc cleanups) OOM messages after alloc were removed from the wlcore
modules.

Commit afb43e6d (wlcore: remove if_ops from platform_data)
reintroduced a couple of those.  This patch removes them.

Signed-off-by: Luciano Coelho <coelho@ti.com>
---

John,

Please ignore my previous patch.  Now this should be right. ;)

Can you apply this directly on wireless-next after you process my
latest pull-request?

Thanks!

Sorry for my monday-morning-with-too-little-caffeinne-in-the-blood
screw up. ;)

 drivers/net/wireless/ti/wlcore/sdio.c |    4 +---
 drivers/net/wireless/ti/wlcore/spi.c  |    4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index 198028d..29ef249 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -229,10 +229,8 @@ static int wl1271_probe(struct sdio_func *func,
 		return -ENODEV;
 
 	pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
-	if (!pdev_data) {
-		dev_err(&func->dev, "can't allocate platdev_data\n");
+	if (!pdev_data)
 		goto out;
-	}
 
 	pdev_data->if_ops = &sdio_ops;
 
diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c
index 5ad2e10..e264478 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -332,10 +332,8 @@ static int wl1271_probe(struct spi_device *spi)
 	int ret = -ENOMEM;
 
 	pdev_data = kzalloc(sizeof(*pdev_data), GFP_KERNEL);
-	if (!pdev_data) {
-		dev_err(&spi->dev, "can't allocate platdev_data\n");
+	if (!pdev_data)
 		goto out;
-	}
 
 	pdev_data->pdata = spi->dev.platform_data;
 	if (!pdev_data->pdata) {
-- 
1.7.10.4

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

* Re: [PATCH v2] wlcore: remove newly introduced alloc/OOM messages
  2013-02-11  8:21         ` [PATCH v2] " Luciano Coelho
@ 2013-02-11  8:24           ` Felipe Balbi
  0 siblings, 0 replies; 12+ messages in thread
From: Felipe Balbi @ 2013-02-11  8:24 UTC (permalink / raw)
  To: Luciano Coelho
  Cc: linville, sfr, joe, linux-next, linux-kernel, davem, netdev

[-- Attachment #1: Type: text/plain, Size: 482 bytes --]

On Mon, Feb 11, 2013 at 10:21:18AM +0200, Luciano Coelho wrote:
> In commit 0d2e7a5c (wireless: Remove unnecessary alloc/OOM messages,
> alloc cleanups) OOM messages after alloc were removed from the wlcore
> modules.
> 
> Commit afb43e6d (wlcore: remove if_ops from platform_data)
> reintroduced a couple of those.  This patch removes them.
> 
> Signed-off-by: Luciano Coelho <coelho@ti.com>

looks good now :-)

Reviewed-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2013-02-11  8:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-11  2:33 linux-next: manual merge of the wireless-next tree with the net-next tree Stephen Rothwell
2013-02-11  2:58 ` Joe Perches
2013-02-11  6:47   ` Luciano Coelho
2013-02-11  7:40     ` Stephen Rothwell
2013-02-11  7:53       ` Luciano Coelho
2013-02-11  8:02         ` [PATCH] wlcore: remove newly introduced alloc/OOM messages Luciano Coelho
2013-02-11  8:06           ` Luciano Coelho
2013-02-11  8:07           ` Joe Perches
2013-02-11  8:07             ` Luciano Coelho
2013-02-11  8:08           ` Felipe Balbi
2013-02-11  8:21         ` [PATCH v2] " Luciano Coelho
2013-02-11  8:24           ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox