Skip to contentSkip to conversation

mwifiex: configure p2p interface during initialization

PATCH New Bing Zhao 1 participant 4 messages Apr 20, 2013 Networking drivers (wireless)

lore
Share & tools
lore

Bing Zhao

author
#0 lore raw

PATCH 1/1 mwifiex: configure p2p interface during initialization

Send P2P_MODE_CFG cmd to firmware when p2p interface is created. Without proper p2p configuration firmware may behave incorrectly while handling commands sent through this interface.

---
 drivers/net/wireless/mwifiex/cfg80211.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/wireless/mwifiex/cfg80211.c +3 -0
index 8c468c3..2a604eb 100644
@@ -2152,6 +2152,9 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
 		priv->bss_started = 0;
 		priv->bss_num = 0;
 
+		if (mwifiex_cfg80211_init_p2p_client(priv))
+			return ERR_PTR(-EFAULT);
+
 		break;
 	default:
 		wiphy_err(wiphy, "type not supported\n");
Signature · 1 line
1.7.0.2
author
#1 lore raw

PATCH 1/1 mwifiex: use PCI_DMA_FROMDEVICE for RX queue de-init

From: Avinash Patil <[email protected]>

There is a typo in mwifiex_cleanup_rxq_ring() which uses PCI_DMA_TODEVICE while unmapping PCI memory.
We should actually use PCI_DMA_FROMDEVICE.

---
 drivers/net/wireless/mwifiex/pcie.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/mwifiex/pcie.c +2 -2
index 856959b..80f282c 100644
@@ -572,7 +572,7 @@ static void mwifiex_cleanup_rxq_ring(struct mwifiex_adapter *adapter)
 			if (card->rx_buf_list[i]) {
 				skb = card->rx_buf_list[i];
 				pci_unmap_single(card->dev, desc2->paddr,
-						 skb->len, PCI_DMA_TODEVICE);
+						 skb->len, PCI_DMA_FROMDEVICE);
 				dev_kfree_skb_any(skb);
 			}
 			memset(desc2, 0, sizeof(*desc2));
@@ -581,7 +581,7 @@ static void mwifiex_cleanup_rxq_ring(struct mwifiex_adapter *adapter)
 			if (card->rx_buf_list[i]) {
 				skb = card->rx_buf_list[i];
 				pci_unmap_single(card->dev, desc->paddr,
-						 skb->len, PCI_DMA_TODEVICE);
+						 skb->len, PCI_DMA_FROMDEVICE);
 				dev_kfree_skb_any(skb);
 			}
 			memset(desc, 0, sizeof(*desc));
Signature · 1 line
1.7.0.2
author
#2 lore raw

PATCH 1/1 mwifiex: make use of msecs_to_jiffies()

In reply to Bing Zhao

Use msecs_to_jiffies() wherever possible.

---
 drivers/net/wireless/mwifiex/11n_rxreorder.c |    2 +-
 drivers/net/wireless/mwifiex/cmdevt.c        |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/mwifiex/11n_rxreorder.c +1 -1
index 5e796f8..ada809f 100644
@@ -447,7 +447,7 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv,
 	end_win = ((start_win + win_size) - 1) & (MAX_TID_VALUE - 1);
 	del_timer(&tbl->timer_context.timer);
 	mod_timer(&tbl->timer_context.timer,
-		  jiffies + (MIN_FLUSH_TIMER_MS * win_size * HZ) / 1000);
+		  jiffies + msecs_to_jiffies(MIN_FLUSH_TIMER_MS * win_size));
 
 	/*
 	 * If seq_num is less then starting win then ignore and drop the
drivers/net/wireless/mwifiex/cmdevt.c +1 -1
index da469c3..74db0d2 100644
@@ -250,7 +250,7 @@ static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv,
 
 	/* Setup the timer after transmit command */
 	mod_timer(&adapter->cmd_timer,
-		  jiffies + (MWIFIEX_TIMER_10S * HZ) / 1000);
+		  jiffies + msecs_to_jiffies(MWIFIEX_TIMER_10S));
 
 	return 0;
 }
Signature · 1 line
1.7.0.2
author
#3 lore raw

PATCH 1/1 mwifiex: correct bss_mode check while appending vht operation IE

In reply to Bing Zhao

priv->bss_mode uses NL80211_IFTYPE_* definitions. HostCmd_BSS_MODE_IBSS is used in ad-hoc start/join command between driver and firmware.

Coincidentally both HostCmd_BSS_MODE_IBSS and NL80211_IFTYPE_STATION are defined as 2. That explains why nobody complained.

---
 drivers/net/wireless/mwifiex/11ac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/mwifiex/11ac.c +1 -1
index 966a78f..5e0eec4 100644
@@ -200,7 +200,7 @@ int mwifiex_cmd_append_11ac_tlv(struct mwifiex_private *priv,
 
 	/* VHT Operation IE */
 	if (bss_desc->bcn_vht_oper) {
-		if (priv->bss_mode == HostCmd_BSS_MODE_IBSS) {
+		if (priv->bss_mode == NL80211_IFTYPE_STATION) {
 			vht_op = (struct mwifiex_ie_types_vht_oper *)*buffer;
 			memset(vht_op, 0, sizeof(*vht_op));
 			vht_op->header.type =
Signature · 1 line
1.7.0.2