All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] mwifiex: missing break statement
@ 2016-04-11 14:52 Amitkumar Karwar
  2016-04-11 14:52 ` [PATCH 2/5] mwifiex: add pcie usb/uart firmware download support Amitkumar Karwar
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Amitkumar Karwar @ 2016-04-11 14:52 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Nishant Sarmukadam, Amitkumar Karwar

This patch adds missing break statement at the end of
PCIE_DEVICE_ID_MARVELL_88W8897 switch section.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/pcie.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index edf8b07..c28edbb 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -2831,6 +2831,7 @@ static void mwifiex_pcie_get_fw_name(struct mwifiex_adapter *adapter)
 		default:
 			break;
 		}
+		break;
 	case PCIE_DEVICE_ID_MARVELL_88W8997:
 		mwifiex_read_reg(adapter, 0x0c48, &revision_id);
 		switch (revision_id) {
-- 
1.8.1.4


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

* [PATCH 2/5] mwifiex: add pcie usb/uart firmware download support
  2016-04-11 14:52 [PATCH 1/5] mwifiex: missing break statement Amitkumar Karwar
@ 2016-04-11 14:52 ` Amitkumar Karwar
  2016-04-11 14:52 ` [PATCH 3/5] mwifiex: add default setting for pcie firmware download Amitkumar Karwar
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Amitkumar Karwar @ 2016-04-11 14:52 UTC (permalink / raw)
  To: linux-wireless
  Cc: Cathy Luo, Nishant Sarmukadam, Shengzhen Li, Amitkumar Karwar

From: Shengzhen Li <szli@marvell.com>

This patch adds support for downloading usb/uart firmware for
8997 chipset by reading the chip version.

Signed-off-by: Shengzhen Li <szli@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/pcie.c | 17 +++++++++++++++--
 drivers/net/wireless/marvell/mwifiex/pcie.h |  7 +++++--
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index c28edbb..1d888b5 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -2811,6 +2811,7 @@ static int mwifiex_pcie_request_irq(struct mwifiex_adapter *adapter)
 static void mwifiex_pcie_get_fw_name(struct mwifiex_adapter *adapter)
 {
 	int revision_id = 0;
+	int version;
 	struct pcie_service_card *card = adapter->card;
 
 	switch (card->dev->device) {
@@ -2834,12 +2835,24 @@ static void mwifiex_pcie_get_fw_name(struct mwifiex_adapter *adapter)
 		break;
 	case PCIE_DEVICE_ID_MARVELL_88W8997:
 		mwifiex_read_reg(adapter, 0x0c48, &revision_id);
+		mwifiex_read_reg(adapter, 0x0cd0, &version);
+		version &= 0x7;
 		switch (revision_id) {
 		case PCIE8997_V2:
-			strcpy(adapter->fw_name, PCIE8997_FW_NAME_V2);
+			if (version == CHIP_VER_PCIEUSB)
+				strcpy(adapter->fw_name,
+				       PCIEUSB8997_FW_NAME_V2);
+			else
+				strcpy(adapter->fw_name,
+				       PCIEUART8997_FW_NAME_V2);
 			break;
 		case PCIE8997_Z:
-			strcpy(adapter->fw_name, PCIE8997_FW_NAME_Z);
+			if (version == CHIP_VER_PCIEUSB)
+				strcpy(adapter->fw_name,
+				       PCIEUSB8997_FW_NAME_Z);
+			else
+				strcpy(adapter->fw_name,
+				       PCIEUART8997_FW_NAME_Z);
 			break;
 		default:
 			break;
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.h b/drivers/net/wireless/marvell/mwifiex/pcie.h
index cc7a5df..bbabfb0 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.h
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.h
@@ -32,8 +32,10 @@
 #define PCIE8766_DEFAULT_FW_NAME "mrvl/pcie8766_uapsta.bin"
 #define PCIE8897_A0_FW_NAME "mrvl/pcie8897_uapsta_a0.bin"
 #define PCIE8897_B0_FW_NAME "mrvl/pcie8897_uapsta.bin"
-#define PCIE8997_FW_NAME_Z "mrvl/pcieusb8997_combo.bin"
-#define PCIE8997_FW_NAME_V2 "mrvl/pcieusb8997_combo_v2.bin"
+#define PCIEUART8997_FW_NAME_Z "mrvl/pcieuart8997_combo.bin"
+#define PCIEUART8997_FW_NAME_V2 "mrvl/pcieuart8997_combo_v2.bin"
+#define PCIEUSB8997_FW_NAME_Z "mrvl/pcieusb8997_combo.bin"
+#define PCIEUSB8997_FW_NAME_V2 "mrvl/pcieusb8997_combo_v2.bin"
 
 #define PCIE_VENDOR_ID_MARVELL              (0x11ab)
 #define PCIE_VENDOR_ID_V2_MARVELL           (0x1b4b)
@@ -45,6 +47,7 @@
 #define PCIE8897_B0	0x1200
 #define PCIE8997_Z	0x0
 #define PCIE8997_V2	0x471
+#define CHIP_VER_PCIEUSB	0x2
 
 /* Constants for Buffer Descriptor (BD) rings */
 #define MWIFIEX_MAX_TXRX_BD			0x20
-- 
1.8.1.4


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

* [PATCH 3/5] mwifiex: add default setting for pcie firmware download
  2016-04-11 14:52 [PATCH 1/5] mwifiex: missing break statement Amitkumar Karwar
  2016-04-11 14:52 ` [PATCH 2/5] mwifiex: add pcie usb/uart firmware download support Amitkumar Karwar
@ 2016-04-11 14:52 ` Amitkumar Karwar
  2016-04-11 14:52 ` [PATCH 4/5] mwifiex: do not wait on semaphore during card removal Amitkumar Karwar
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Amitkumar Karwar @ 2016-04-11 14:52 UTC (permalink / raw)
  To: linux-wireless
  Cc: Cathy Luo, Nishant Sarmukadam, Shengzhen Li, Amitkumar Karwar

From: Shengzhen Li <szli@marvell.com>

This patch adds default setting for pcie firmware download name in
case that there are newer chipset version.

Signed-off-by: Shengzhen Li <szli@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/pcie.c | 3 +++
 drivers/net/wireless/marvell/mwifiex/pcie.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
index 1d888b5..0c7937e 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
@@ -2830,6 +2830,8 @@ static void mwifiex_pcie_get_fw_name(struct mwifiex_adapter *adapter)
 			strcpy(adapter->fw_name, PCIE8897_B0_FW_NAME);
 			break;
 		default:
+			strcpy(adapter->fw_name, PCIE8897_DEFAULT_FW_NAME);
+
 			break;
 		}
 		break;
@@ -2855,6 +2857,7 @@ static void mwifiex_pcie_get_fw_name(struct mwifiex_adapter *adapter)
 				       PCIEUART8997_FW_NAME_Z);
 			break;
 		default:
+			strcpy(adapter->fw_name, PCIE8997_DEFAULT_FW_NAME);
 			break;
 		}
 	default:
diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.h b/drivers/net/wireless/marvell/mwifiex/pcie.h
index bbabfb0..5770b43 100644
--- a/drivers/net/wireless/marvell/mwifiex/pcie.h
+++ b/drivers/net/wireless/marvell/mwifiex/pcie.h
@@ -30,8 +30,10 @@
 #include    "main.h"
 
 #define PCIE8766_DEFAULT_FW_NAME "mrvl/pcie8766_uapsta.bin"
+#define PCIE8897_DEFAULT_FW_NAME "mrvl/pcie8897_uapsta.bin"
 #define PCIE8897_A0_FW_NAME "mrvl/pcie8897_uapsta_a0.bin"
 #define PCIE8897_B0_FW_NAME "mrvl/pcie8897_uapsta.bin"
+#define PCIE8997_DEFAULT_FW_NAME "mrvl/pcieuart8997_combo_v2.bin"
 #define PCIEUART8997_FW_NAME_Z "mrvl/pcieuart8997_combo.bin"
 #define PCIEUART8997_FW_NAME_V2 "mrvl/pcieuart8997_combo_v2.bin"
 #define PCIEUSB8997_FW_NAME_Z "mrvl/pcieusb8997_combo.bin"
-- 
1.8.1.4


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

* [PATCH 4/5] mwifiex: do not wait on semaphore during card removal
  2016-04-11 14:52 [PATCH 1/5] mwifiex: missing break statement Amitkumar Karwar
  2016-04-11 14:52 ` [PATCH 2/5] mwifiex: add pcie usb/uart firmware download support Amitkumar Karwar
  2016-04-11 14:52 ` [PATCH 3/5] mwifiex: add default setting for pcie firmware download Amitkumar Karwar
@ 2016-04-11 14:52 ` Amitkumar Karwar
  2016-04-11 14:52 ` [PATCH 5/5] mwifiex: fix incorrect ht capability problem Amitkumar Karwar
  2016-04-14 13:03 ` [1/5] mwifiex: missing break statement Kalle Valo
  4 siblings, 0 replies; 6+ messages in thread
From: Amitkumar Karwar @ 2016-04-11 14:52 UTC (permalink / raw)
  To: linux-wireless
  Cc: Cathy Luo, Nishant Sarmukadam, Xinming Hu, Amitkumar Karwar

From: Xinming Hu <huxm@marvell.com>

Host hang is observed if card is removed before firmware download
gets completed. In this case, firmware will be failed to download and
adapter structure gets freed.

In other thread, mwifiex_remove_card() waits on semaphore until the
firmware download fails. This wait is not necessary and may result in
invalid adapter access.

This patch uses down_trylock to return immediately so that hang issue
won't occur.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 04b975c..b459c70 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -1434,7 +1434,7 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
 	struct mwifiex_private *priv = NULL;
 	int i;
 
-	if (down_interruptible(sem))
+	if (down_trylock(sem))
 		goto exit_sem_err;
 
 	if (!adapter)
-- 
1.8.1.4


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

* [PATCH 5/5] mwifiex: fix incorrect ht capability problem
  2016-04-11 14:52 [PATCH 1/5] mwifiex: missing break statement Amitkumar Karwar
                   ` (2 preceding siblings ...)
  2016-04-11 14:52 ` [PATCH 4/5] mwifiex: do not wait on semaphore during card removal Amitkumar Karwar
@ 2016-04-11 14:52 ` Amitkumar Karwar
  2016-04-14 13:03 ` [1/5] mwifiex: missing break statement Kalle Valo
  4 siblings, 0 replies; 6+ messages in thread
From: Amitkumar Karwar @ 2016-04-11 14:52 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Nishant Sarmukadam, Amitkumar Karwar

IEEE80211_CHAN_NO_HT40PLUS and IEEE80211_CHAN_NO_HT40PLUS channel
flags tell if HT40 operation is allowed on a channel or not.

This patch ensures ht_capability information is modified
accordingly so that we don't end up creating a HT40 connection
when it's not allowed for current regulatory domain.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
---
 drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 44 +++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
index d8de432..8e08626 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
@@ -146,6 +146,7 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
 	size_t beacon_ie_len;
 	struct mwifiex_bss_priv *bss_priv = (void *)bss->priv;
 	const struct cfg80211_bss_ies *ies;
+	int ret;
 
 	rcu_read_lock();
 	ies = rcu_dereference(bss->ies);
@@ -189,7 +190,48 @@ int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
 	if (bss_desc->cap_info_bitmap & WLAN_CAPABILITY_SPECTRUM_MGMT)
 		bss_desc->sensed_11h = true;
 
-	return mwifiex_update_bss_desc_with_ie(priv->adapter, bss_desc);
+	ret = mwifiex_update_bss_desc_with_ie(priv->adapter, bss_desc);
+	if (ret)
+		return ret;
+
+	/* Update HT40 capability based on current channel information */
+	if (bss_desc->bcn_ht_oper && bss_desc->bcn_ht_cap) {
+		u8 ht_param = bss_desc->bcn_ht_oper->ht_param;
+		u8 radio = mwifiex_band_to_radio_type(bss_desc->bss_band);
+		struct ieee80211_supported_band *sband =
+						priv->wdev.wiphy->bands[radio];
+		int freq = ieee80211_channel_to_frequency(bss_desc->channel,
+							  radio);
+		struct ieee80211_channel *chan =
+			ieee80211_get_channel(priv->adapter->wiphy, freq);
+
+		switch (ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
+		case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
+			if (chan->flags & IEEE80211_CHAN_NO_HT40PLUS) {
+				sband->ht_cap.cap &=
+					~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
+				sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40;
+			} else {
+				sband->ht_cap.cap |=
+					IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
+					IEEE80211_HT_CAP_SGI_40;
+			}
+			break;
+		case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
+			if (chan->flags & IEEE80211_CHAN_NO_HT40MINUS) {
+				sband->ht_cap.cap &=
+					~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
+				sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40;
+			} else {
+				sband->ht_cap.cap |=
+					IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
+					IEEE80211_HT_CAP_SGI_40;
+			}
+			break;
+		}
+	}
+
+	return 0;
 }
 
 void mwifiex_dnld_txpwr_table(struct mwifiex_private *priv)
-- 
1.8.1.4


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

* Re: [1/5] mwifiex: missing break statement
  2016-04-11 14:52 [PATCH 1/5] mwifiex: missing break statement Amitkumar Karwar
                   ` (3 preceding siblings ...)
  2016-04-11 14:52 ` [PATCH 5/5] mwifiex: fix incorrect ht capability problem Amitkumar Karwar
@ 2016-04-14 13:03 ` Kalle Valo
  4 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2016-04-14 13:03 UTC (permalink / raw)
  To: Amitkumar Karwar
  Cc: linux-wireless, Cathy Luo, Nishant Sarmukadam, Amitkumar Karwar


> This patch adds missing break statement at the end of
> PCIE_DEVICE_ID_MARVELL_88W8897 switch section.
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>

Thanks, 5 patches applied to wireless-drivers-next.git:

c865a70098d9 mwifiex: missing break statement
e87650bce9a5 mwifiex: add pcie usb/uart firmware download support
b9db39787933 mwifiex: add default setting for pcie firmware download
c3ec0ff6425b mwifiex: do not wait on semaphore during card removal
bcc920e8f083 mwifiex: fix incorrect ht capability problem

Kalle Valo

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

end of thread, other threads:[~2016-04-14 13:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-11 14:52 [PATCH 1/5] mwifiex: missing break statement Amitkumar Karwar
2016-04-11 14:52 ` [PATCH 2/5] mwifiex: add pcie usb/uart firmware download support Amitkumar Karwar
2016-04-11 14:52 ` [PATCH 3/5] mwifiex: add default setting for pcie firmware download Amitkumar Karwar
2016-04-11 14:52 ` [PATCH 4/5] mwifiex: do not wait on semaphore during card removal Amitkumar Karwar
2016-04-11 14:52 ` [PATCH 5/5] mwifiex: fix incorrect ht capability problem Amitkumar Karwar
2016-04-14 13:03 ` [1/5] mwifiex: missing break statement Kalle Valo

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.