linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mwifiex: remove support for old chipsets W0/W1
@ 2011-05-24  1:00 Bing Zhao
  2011-05-24  1:00 ` [PATCH 2/2] mwifiex: correct the error check used for dev_alloc_name() Bing Zhao
  0 siblings, 1 reply; 4+ messages in thread
From: Bing Zhao @ 2011-05-24  1:00 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
	Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao

From: Amitkumar Karwar <akarwar@marvell.com>

For SD8787 A0/A1 chipsets we use the default firmware image
file 'mrvl/sd8787_uapsta.bin'. So the chip rev id variable
is removed.

The global variable fw_name is moved to adapter structure
so that we can support a different interface, such as PCIe,
in future.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/main.c |   18 ++----------------
 drivers/net/wireless/mwifiex/main.h |   11 +----------
 drivers/net/wireless/mwifiex/sdio.c |    8 ++------
 drivers/net/wireless/mwifiex/sdio.h |    2 ++
 4 files changed, 7 insertions(+), 32 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 44957ca..f6db51c 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -35,8 +35,6 @@ static struct mwifiex_bss_attr mwifiex_bss_sta[] = {
 
 static int drv_mode = DRV_MODE_STA;
 
-static char fw_name[32] = DEFAULT_FW_NAME;
-
 /* Supported drv_mode table */
 static struct mwifiex_drv_mode mwifiex_drv_mode_tbl[] = {
 	{
@@ -384,20 +382,8 @@ static int mwifiex_init_hw_fw(struct mwifiex_adapter *adapter)
 
 	memset(&fw, 0, sizeof(struct mwifiex_fw_image));
 
-	switch (adapter->revision_id) {
-	case SD8787_W0:
-	case SD8787_W1:
-		strcpy(fw_name, SD8787_W1_FW_NAME);
-		break;
-	case SD8787_A0:
-	case SD8787_A1:
-		strcpy(fw_name, SD8787_AX_FW_NAME);
-		break;
-	default:
-		break;
-	}
-
-	err = request_firmware(&adapter->firmware, fw_name, adapter->dev);
+	err = request_firmware(&adapter->firmware, adapter->fw_name,
+			       adapter->dev);
 	if (err < 0) {
 		dev_err(adapter->dev, "request_firmware() returned"
 				" error code %#x\n", err);
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 8316b3c..89f9870 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -48,15 +48,6 @@ enum {
 
 #define DRV_MODE_STA       0x1
 
-#define SD8787_W0   0x30
-#define SD8787_W1   0x31
-#define SD8787_A0   0x40
-#define SD8787_A1   0x41
-
-#define DEFAULT_FW_NAME "mrvl/sd8787_uapsta.bin"
-#define SD8787_W1_FW_NAME "mrvl/sd8787_uapsta_w1.bin"
-#define SD8787_AX_FW_NAME "mrvl/sd8787_uapsta.bin"
-
 struct mwifiex_drv_mode {
 	u16 drv_mode;
 	u16 intf_num;
@@ -576,10 +567,10 @@ struct mwifiex_adapter {
 	u8 priv_num;
 	struct mwifiex_drv_mode *drv_mode;
 	const struct firmware *firmware;
+	char fw_name[32];
 	struct device *dev;
 	bool surprise_removed;
 	u32 fw_release_number;
-	u32 revision_id;
 	u16 init_wait_q_woken;
 	wait_queue_head_t init_wait_q;
 	void *card;
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index d425dbd..4327b6d 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -1531,6 +1531,7 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter)
 	sdio_set_drvdata(func, card);
 
 	adapter->dev = &func->dev;
+	strcpy(adapter->fw_name, SD8787_DEFAULT_FW_NAME);
 
 	return 0;
 
@@ -1552,7 +1553,6 @@ disable_func:
  *        the first interrupt got from bootloader
  *      - Disable host interrupt mask register
  *      - Get SDIO port
- *      - Get revision ID
  *      - Initialize SDIO variables in card
  *      - Allocate MP registers
  *      - Allocate MPA Tx and Rx buffers
@@ -1576,10 +1576,6 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter)
 	/* Get SDIO ioport */
 	mwifiex_init_sdio_ioport(adapter);
 
-	/* Get revision ID */
-#define REV_ID_REG	0x5c
-	mwifiex_read_reg(adapter, REV_ID_REG, &adapter->revision_id);
-
 	/* Initialize SDIO variables in card */
 	card->mp_rd_bitmap = 0;
 	card->mp_wr_bitmap = 0;
@@ -1751,4 +1747,4 @@ MODULE_AUTHOR("Marvell International Ltd.");
 MODULE_DESCRIPTION("Marvell WiFi-Ex SDIO Driver version " SDIO_VERSION);
 MODULE_VERSION(SDIO_VERSION);
 MODULE_LICENSE("GPL v2");
-MODULE_FIRMWARE("sd8787.bin");
+MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin");
diff --git a/drivers/net/wireless/mwifiex/sdio.h b/drivers/net/wireless/mwifiex/sdio.h
index 4e97e90..c925376 100644
--- a/drivers/net/wireless/mwifiex/sdio.h
+++ b/drivers/net/wireless/mwifiex/sdio.h
@@ -28,6 +28,8 @@
 
 #include "main.h"
 
+#define SD8787_DEFAULT_FW_NAME "mrvl/sd8787_uapsta.bin"
+
 #define BLOCK_MODE	1
 #define BYTE_MODE	0
 
-- 
1.7.0.2


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

* [PATCH 2/2] mwifiex: correct the error check used for dev_alloc_name()
  2011-05-24  1:00 [PATCH 1/2] mwifiex: remove support for old chipsets W0/W1 Bing Zhao
@ 2011-05-24  1:00 ` Bing Zhao
  2011-06-01 19:18   ` John W. Linville
  0 siblings, 1 reply; 4+ messages in thread
From: Bing Zhao @ 2011-05-24  1:00 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
	Yogesh Powar, Marc Yang, Frank Huang, Bing Zhao

From: Amitkumar Karwar <akarwar@marvell.com>

In failure case dev_alloc_name() returns negative errno code.
This patch corrects the check used for handling error path.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/main.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index f6db51c..77c104b 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -684,6 +684,7 @@ static struct mwifiex_private *mwifiex_add_interface(
 	struct net_device *dev;
 	struct mwifiex_private *priv;
 	void *mdev_priv;
+	int ret;
 
 	dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), "mlan%d",
 			      ether_setup, 1);
@@ -691,8 +692,11 @@ static struct mwifiex_private *mwifiex_add_interface(
 		dev_err(adapter->dev, "no memory available for netdevice\n");
 		goto error;
 	}
-	if (dev_alloc_name(dev, dev->name)) {
-		dev_err(adapter->dev, "unable to alloc name for netdevice\n");
+
+	ret = dev_alloc_name(dev, dev->name);
+	if (ret < 0) {
+		dev_err(adapter->dev, "unable to alloc dev name '%s': %d\n",
+					dev->name, ret);
 		goto error;
 	}
 
-- 
1.7.0.2


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

* Re: [PATCH 2/2] mwifiex: correct the error check used for dev_alloc_name()
  2011-05-24  1:00 ` [PATCH 2/2] mwifiex: correct the error check used for dev_alloc_name() Bing Zhao
@ 2011-06-01 19:18   ` John W. Linville
  2011-06-02  8:57     ` Bing Zhao
  0 siblings, 1 reply; 4+ messages in thread
From: John W. Linville @ 2011-06-01 19:18 UTC (permalink / raw)
  To: Bing Zhao
  Cc: linux-wireless, Johannes Berg, Amitkumar Karwar, Kiran Divekar,
	Yogesh Powar, Marc Yang, Frank Huang

commit 1c5cae815d19ffe02bdfda1260949ef2b1806171
Author: Jiri Pirko <jpirko@redhat.com>
Date:   Sat Apr 30 01:21:32 2011 +0000

    net: call dev_alloc_name from register_netdevice
    
    Force dev_alloc_name() to be called from register_netdevice() by
    dev_get_valid_name(). That allows to remove multiple explicit
    dev_alloc_name() calls.
    
    The possibility to call dev_alloc_name in advance remains.
    
    This also fixes veth creation regresion caused by
    84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743
    
    Signed-off-by: Jiri Pirko <jpirko@redhat.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

This patch is now obsolete...

On Mon, May 23, 2011 at 06:00:18PM -0700, Bing Zhao wrote:
> From: Amitkumar Karwar <akarwar@marvell.com>
> 
> In failure case dev_alloc_name() returns negative errno code.
> This patch corrects the check used for handling error path.
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
> Signed-off-by: Bing Zhao <bzhao@marvell.com>
> ---
>  drivers/net/wireless/mwifiex/main.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
> index f6db51c..77c104b 100644
> --- a/drivers/net/wireless/mwifiex/main.c
> +++ b/drivers/net/wireless/mwifiex/main.c
> @@ -684,6 +684,7 @@ static struct mwifiex_private *mwifiex_add_interface(
>  	struct net_device *dev;
>  	struct mwifiex_private *priv;
>  	void *mdev_priv;
> +	int ret;
>  
>  	dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), "mlan%d",
>  			      ether_setup, 1);
> @@ -691,8 +692,11 @@ static struct mwifiex_private *mwifiex_add_interface(
>  		dev_err(adapter->dev, "no memory available for netdevice\n");
>  		goto error;
>  	}
> -	if (dev_alloc_name(dev, dev->name)) {
> -		dev_err(adapter->dev, "unable to alloc name for netdevice\n");
> +
> +	ret = dev_alloc_name(dev, dev->name);
> +	if (ret < 0) {
> +		dev_err(adapter->dev, "unable to alloc dev name '%s': %d\n",
> +					dev->name, ret);
>  		goto error;
>  	}
>  
> -- 
> 1.7.0.2
> 
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

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

* RE: [PATCH 2/2] mwifiex: correct the error check used for dev_alloc_name()
  2011-06-01 19:18   ` John W. Linville
@ 2011-06-02  8:57     ` Bing Zhao
  0 siblings, 0 replies; 4+ messages in thread
From: Bing Zhao @ 2011-06-02  8:57 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-wireless@vger.kernel.org, Johannes Berg, Amitkumar Karwar,
	Kiran Divekar, Yogesh Powar, Marc Yang, Frank Huang

> commit 1c5cae815d19ffe02bdfda1260949ef2b1806171
> Author: Jiri Pirko <jpirko@redhat.com>
> Date:   Sat Apr 30 01:21:32 2011 +0000
> 
>     net: call dev_alloc_name from register_netdevice
> 
>     Force dev_alloc_name() to be called from register_netdevice() by
>     dev_get_valid_name(). That allows to remove multiple explicit
>     dev_alloc_name() calls.
> 
>     The possibility to call dev_alloc_name in advance remains.
> 
>     This also fixes veth creation regresion caused by
>     84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743
> 
>     Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
> 
> This patch is now obsolete...

Hi John,

Thanks for the info. Please revert this patch then.

Regards,
Bing

> On Mon, May 23, 2011 at 06:00:18PM -0700, Bing Zhao wrote:
>> From: Amitkumar Karwar <akarwar@marvell.com>
>>
>> In failure case dev_alloc_name() returns negative errno code.
>> This patch corrects the check used for handling error path.

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

end of thread, other threads:[~2011-06-02  9:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-24  1:00 [PATCH 1/2] mwifiex: remove support for old chipsets W0/W1 Bing Zhao
2011-05-24  1:00 ` [PATCH 2/2] mwifiex: correct the error check used for dev_alloc_name() Bing Zhao
2011-06-01 19:18   ` John W. Linville
2011-06-02  8:57     ` Bing Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).