Skip to contentSkip to conversation

mwifiex: put multicast/broadcast packets to the same RA

PATCH New Bing Zhao 1 participant 4 messages Jul 14, 2011 – Jul 21, 2011 Networking drivers (wireless)

lore
Share & tools
lore

Bing Zhao

author
#0 lore raw

PATCH 1/1 mwifiex: put multicast/broadcast packets to the same RA

From: Amitkumar Karwar <[email protected]>

For ad-hoc mode, RA is created for each peer connected. In case of multicast traffic new RA will be created for each multicast address. While processing Tx packets we have to go through this RA list. We can avoid some RA nodes by sharing same RA for both multicast and broadcast packets.

Therefore "memset(0xff)" is used to treat multicast packet as broadcast one while choosing RA.

---
 drivers/net/wireless/mwifiex/wmm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/wireless/mwifiex/wmm.c +2 -0
index 67b2d0b..69e260b 100644
@@ -634,6 +634,8 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_adapter *adapter,
 			ra_list = NULL;
 	} else {
 		memcpy(ra, skb->data, ETH_ALEN);
+		if (ra[0] & 0x01)
+			memset(ra, 0xff, ETH_ALEN);
 		ra_list = mwifiex_wmm_get_queue_raptr(priv, tid_down, ra);
 	}
 
Signature · 1 line
1.7.0.2
author
#1 lore raw

PATCH 1/1 mwifiex: check SDIO multi-port aggregation buffer room correctly

From: Amitkumar Karwar <[email protected]>

We should consider current packet length also while checking Tx aggregation buffer room.

---
 drivers/net/wireless/mwifiex/sdio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/mwifiex/sdio.c +1 -1
index 711fa68..f7105a9 100644
@@ -1319,7 +1319,7 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
 				if (!(card->mp_wr_bitmap &
 						(1 << card->curr_wr_port))
 						|| !MP_TX_AGGR_BUF_HAS_ROOM(
-							card, next_pkt_len))
+						card, pkt_len + next_pkt_len))
 					f_send_aggr_buf = 1;
 			} else {
 				/* No room in Aggr buf, send it */
Signature · 1 line
1.7.0.2
author
#2 lore raw

PATCH 1/1 mwifiex: disable auto deep sleep before unloading the driver

In reply to Bing Zhao

From: Amitkumar Karwar <[email protected]>

Since the auto deep sleep mode has been enabled at driver init time we should disable it at driver unloading to shutdown the function gracefully.

---
 drivers/net/wireless/mwifiex/ioctl.h     |    1 +
 drivers/net/wireless/mwifiex/main.h      |    1 +
 drivers/net/wireless/mwifiex/sdio.c      |    3 +++
 drivers/net/wireless/mwifiex/sta_ioctl.c |   14 ++++++++++++++
 4 files changed, 19 insertions(+), 0 deletions(-)
drivers/net/wireless/mwifiex/ioctl.h +1 -0
index 9929749..bd9e074 100644
@@ -249,6 +249,7 @@ struct mwifiex_ds_hs_cfg {
 };
 
 #define DEEP_SLEEP_ON  1
+#define DEEP_SLEEP_OFF 0
 #define DEEP_SLEEP_IDLE_TIME	100
 #define PS_MODE_AUTO		1
 
drivers/net/wireless/mwifiex/main.h +1 -0
index 84f780d..e6db047 100644
@@ -929,6 +929,7 @@ int mwifiex_set_hs_params(struct mwifiex_private *priv,
 			      struct mwifiex_ds_hs_cfg *hscfg);
 int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type);
 int mwifiex_enable_hs(struct mwifiex_adapter *adapter);
+int mwifiex_disable_auto_ds(struct mwifiex_private *priv);
 int mwifiex_get_signal_info(struct mwifiex_private *priv,
 			    struct mwifiex_ds_get_signal *signal);
 int mwifiex_drv_get_data_rate(struct mwifiex_private *priv,
drivers/net/wireless/mwifiex/sdio.c +3 -0
index f7105a9..82098ac 100644
@@ -133,6 +133,9 @@ mwifiex_sdio_remove(struct sdio_func *func)
 					adapter->priv[i]->media_connected)
 				mwifiex_deauthenticate(adapter->priv[i], NULL);
 
+		mwifiex_disable_auto_ds(mwifiex_get_priv(adapter,
+							 MWIFIEX_BSS_ROLE_ANY));
+
 		mwifiex_init_shutdown_fw(mwifiex_get_priv(adapter,
 						MWIFIEX_BSS_ROLE_ANY),
 					 MWIFIEX_FUNC_SHUTDOWN);
drivers/net/wireless/mwifiex/sta_ioctl.c +14 -0
index 6547013..10ef9e9 100644
@@ -487,6 +487,20 @@ int mwifiex_set_radio_band_cfg(struct mwifiex_private *priv,
 }
 
 /*
+ * The function disables auto deep sleep mode.
+ */
+int mwifiex_disable_auto_ds(struct mwifiex_private *priv)
+{
+	struct mwifiex_ds_auto_ds auto_ds;
+
+	auto_ds.auto_ds = DEEP_SLEEP_OFF;
+
+	return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_PS_MODE_ENH,
+				     DIS_AUTO_PS, BITMAP_AUTO_DS, &auto_ds);
+}
+EXPORT_SYMBOL_GPL(mwifiex_disable_auto_ds);
+
+/*
  * IOCTL request handler to set/get active channel.
  *
  * This function performs validity checking on channel/frequency
Signature · 1 line
1.7.0.2
author
#3 lore raw

RE: [PATCH] mwifiex: disable auto deep sleep before unloading the driver

Hi John,

Quoted 8 lines

From: Amitkumar Karwar <[email protected]>

Since the auto deep sleep mode has been enabled at driver init time we should disable it at driver unloading to shutdown the function gracefully.

This patch and the following two patches

[PATCH] mwifiex: check SDIO multi-port aggregation buffer room correctly [PATCH] mwifiex: put multicast/broadcast packets to the same RA

do not depend on the 'wireless.h' removal patch series.

If these 3 patches look OK could you please apply them?

Thanks,
Bing

Quoted 72 lines
---
 drivers/net/wireless/mwifiex/ioctl.h     |    1 +
 drivers/net/wireless/mwifiex/main.h      |    1 +
 drivers/net/wireless/mwifiex/sdio.c      |    3 +++
 drivers/net/wireless/mwifiex/sta_ioctl.c |   14 ++++++++++++++
 4 files changed, 19 insertions(+), 0 deletions(-)
drivers/net/wireless/mwifiex/ioctl.h +1 -0
index 9929749..bd9e074 100644
@@ -249,6 +249,7 @@ struct mwifiex_ds_hs_cfg {
 };
 
 #define DEEP_SLEEP_ON  1
+#define DEEP_SLEEP_OFF 0
 #define DEEP_SLEEP_IDLE_TIME	100
 #define PS_MODE_AUTO		1
 
drivers/net/wireless/mwifiex/main.h +1 -0
index 84f780d..e6db047 100644
@@ -929,6 +929,7 @@ int mwifiex_set_hs_params(struct mwifiex_private *priv,
 			      struct mwifiex_ds_hs_cfg *hscfg);
 int mwifiex_cancel_hs(struct mwifiex_private *priv, int cmd_type);
 int mwifiex_enable_hs(struct mwifiex_adapter *adapter);
+int mwifiex_disable_auto_ds(struct mwifiex_private *priv);
 int mwifiex_get_signal_info(struct mwifiex_private *priv,
 			    struct mwifiex_ds_get_signal *signal);
 int mwifiex_drv_get_data_rate(struct mwifiex_private *priv,
drivers/net/wireless/mwifiex/sdio.c +3 -0
index f7105a9..82098ac 100644
@@ -133,6 +133,9 @@ mwifiex_sdio_remove(struct sdio_func *func)
 					adapter->priv[i]->media_connected)
 				mwifiex_deauthenticate(adapter->priv[i], NULL);
 
+		mwifiex_disable_auto_ds(mwifiex_get_priv(adapter,
+							 MWIFIEX_BSS_ROLE_ANY));
+
 		mwifiex_init_shutdown_fw(mwifiex_get_priv(adapter,
 						MWIFIEX_BSS_ROLE_ANY),
 					 MWIFIEX_FUNC_SHUTDOWN);
drivers/net/wireless/mwifiex/sta_ioctl.c +14 -1
index 6547013..10ef9e9 100644
@@ -487,6 +487,20 @@ int mwifiex_set_radio_band_cfg(struct mwifiex_private *priv,
 }
 
 /*
+ * The function disables auto deep sleep mode.
+ */
+int mwifiex_disable_auto_ds(struct mwifiex_private *priv)
+{
+	struct mwifiex_ds_auto_ds auto_ds;
+
+	auto_ds.auto_ds = DEEP_SLEEP_OFF;
+
+	return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_PS_MODE_ENH,
+				     DIS_AUTO_PS, BITMAP_AUTO_DS, &auto_ds);
+}
+EXPORT_SYMBOL_GPL(mwifiex_disable_auto_ds);
+
+/*
  * IOCTL request handler to set/get active channel.
  *
  * This function performs validity checking on channel/frequency
--

1.7.0.2