* [PATCH 3.3] mwifiex: handle association failure case correctly
@ 2012-02-02 4:41 Bing Zhao
2012-02-02 4:41 ` [PATCH] mwifiex: fix NULL pointer dereference in set_channel() Bing Zhao
2012-02-02 4:41 ` [PATCH] mwifiex: enable HT operating mode Bing Zhao
0 siblings, 2 replies; 3+ messages in thread
From: Bing Zhao @ 2012-02-02 4:41 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
Avinash Patil, Frank Huang, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
Currently even if association is failed "iw link" shows some
information about connected BSS and "Tx timeout" error is seen in
dmesg log.
This patch fixes below issues in the code to handle assoc failure
case correctly.
1) "status" variable in mwifiex_wait_queue_complete() is not
correctly updated. Hence driver doesn't inform cfg80211 stack
about association failure.
2) During association network queues are stopped but carrier is
not cleared, which gives Tx timeout error in failure case
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/sta_ioctl.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 470ca75..b0fbf5d 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -54,7 +54,7 @@ int mwifiex_copy_mcast_addr(struct mwifiex_multicast_list *mlist,
int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
{
bool cancel_flag = false;
- int status = adapter->cmd_wait_q.status;
+ int status;
struct cmd_ctrl_node *cmd_queued;
if (!adapter->cmd_queued)
@@ -79,6 +79,8 @@ int mwifiex_wait_queue_complete(struct mwifiex_adapter *adapter)
mwifiex_cancel_pending_ioctl(adapter);
dev_dbg(adapter->dev, "cmd cancel\n");
}
+
+ status = adapter->cmd_wait_q.status;
adapter->cmd_wait_q.status = 0;
return status;
@@ -240,6 +242,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
if (!netif_queue_stopped(priv->netdev))
mwifiex_stop_net_dev_queue(priv->netdev, adapter);
+ if (netif_carrier_ok(priv->netdev))
+ netif_carrier_off(priv->netdev);
/* Clear any past association response stored for
* application retrieval */
@@ -271,6 +275,8 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
if (!netif_queue_stopped(priv->netdev))
mwifiex_stop_net_dev_queue(priv->netdev, adapter);
+ if (netif_carrier_ok(priv->netdev))
+ netif_carrier_off(priv->netdev);
if (!ret) {
dev_dbg(adapter->dev, "info: network found in scan"
--
1.7.0.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] mwifiex: fix NULL pointer dereference in set_channel()
2012-02-02 4:41 [PATCH 3.3] mwifiex: handle association failure case correctly Bing Zhao
@ 2012-02-02 4:41 ` Bing Zhao
2012-02-02 4:41 ` [PATCH] mwifiex: enable HT operating mode Bing Zhao
1 sibling, 0 replies; 3+ messages in thread
From: Bing Zhao @ 2012-02-02 4:41 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
Avinash Patil, Frank Huang, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
In set_channel() callback handler, "priv" pointer is derived from
net_device. Sometimes net_device pointer coming from the stack
is NULL which causes kernel crash.
This patch fixes the problem by deriving "priv" from wiphy
when net_device pointer is NULL.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/cfg80211.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 6fef492..54e45c8 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -376,7 +376,12 @@ mwifiex_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev,
struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type)
{
- struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
+ struct mwifiex_private *priv;
+
+ if (dev)
+ priv = mwifiex_netdev_get_priv(dev);
+ else
+ priv = mwifiex_cfg80211_get_priv(wiphy);
if (priv->media_connected) {
wiphy_err(wiphy, "This setting is valid only when station "
--
1.7.0.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] mwifiex: enable HT operating mode
2012-02-02 4:41 [PATCH 3.3] mwifiex: handle association failure case correctly Bing Zhao
2012-02-02 4:41 ` [PATCH] mwifiex: fix NULL pointer dereference in set_channel() Bing Zhao
@ 2012-02-02 4:41 ` Bing Zhao
1 sibling, 0 replies; 3+ messages in thread
From: Bing Zhao @ 2012-02-02 4:41 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
Avinash Patil, Frank Huang, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
This patch sets default adapter channel_type as HT. Hence the device
will opearate in HT mode.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/init.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index e13b6d9..83cc10f 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -280,6 +280,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter)
adapter->adhoc_awake_period = 0;
memset(&adapter->arp_filter, 0, sizeof(adapter->arp_filter));
adapter->arp_filter_size = 0;
+ adapter->channel_type = NL80211_CHAN_HT20;
}
/*
--
1.7.0.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-02 4:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-02 4:41 [PATCH 3.3] mwifiex: handle association failure case correctly Bing Zhao
2012-02-02 4:41 ` [PATCH] mwifiex: fix NULL pointer dereference in set_channel() Bing Zhao
2012-02-02 4:41 ` [PATCH] mwifiex: enable HT operating mode 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).