aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-01-04 19:22:01 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-21 15:32:21 -0500
commit311dce71b6af263a630717d77bd49cffc0d122a5 (patch)
tree935d2ebaccc6537cd13b1d9e98b5d83432063c35 /drivers/net/wireless
parent7194207ceea7a54c846e0865d2459f4887fe1e0d (diff)
iwlagn: properly wait for PAN disable
Previously I hacked this with an msleep(300) which was fine since we never had longer PAN time slots, but now that we will have them I need to fix that. Use the new notification wait support to properly wait for the WIPAN deactivation complete signal from the ucode. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c15
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-hcmd.c1
3 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 6d140bd53291..99e96508b1dc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -52,10 +52,14 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,
52 struct iwl_rxon_context *ctx, 52 struct iwl_rxon_context *ctx,
53 struct iwl_rxon_cmd *send) 53 struct iwl_rxon_cmd *send)
54{ 54{
55 struct iwl_notification_wait disable_wait;
55 __le32 old_filter = send->filter_flags; 56 __le32 old_filter = send->filter_flags;
56 u8 old_dev_type = send->dev_type; 57 u8 old_dev_type = send->dev_type;
57 int ret; 58 int ret;
58 59
60 iwlagn_init_notification_wait(priv, &disable_wait, NULL,
61 REPLY_WIPAN_DEACTIVATION_COMPLETE);
62
59 send->filter_flags &= ~RXON_FILTER_ASSOC_MSK; 63 send->filter_flags &= ~RXON_FILTER_ASSOC_MSK;
60 send->dev_type = RXON_DEV_TYPE_P2P; 64 send->dev_type = RXON_DEV_TYPE_P2P;
61 ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, sizeof(*send), send); 65 ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, sizeof(*send), send);
@@ -63,11 +67,16 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,
63 send->filter_flags = old_filter; 67 send->filter_flags = old_filter;
64 send->dev_type = old_dev_type; 68 send->dev_type = old_dev_type;
65 69
66 if (ret) 70 if (ret) {
67 IWL_ERR(priv, "Error disabling PAN (%d)\n", ret); 71 IWL_ERR(priv, "Error disabling PAN (%d)\n", ret);
72 iwlagn_remove_notification(priv, &disable_wait);
73 } else {
74 signed long wait_res;
68 75
69 /* FIXME: WAIT FOR PAN DISABLE */ 76 wait_res = iwlagn_wait_notification(priv, &disable_wait, HZ);
70 msleep(300); 77 if (wait_res == 0)
78 IWL_ERR(priv, "Timed out waiting for PAN disable\n");
79 }
71 80
72 return ret; 81 return ret;
73} 82}
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index f893d4a6aa87..abe2479215f0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -189,6 +189,7 @@ enum {
189 REPLY_WIPAN_WEPKEY = 0xb8, /* use REPLY_WEPKEY structure */ 189 REPLY_WIPAN_WEPKEY = 0xb8, /* use REPLY_WEPKEY structure */
190 REPLY_WIPAN_P2P_CHANNEL_SWITCH = 0xb9, 190 REPLY_WIPAN_P2P_CHANNEL_SWITCH = 0xb9,
191 REPLY_WIPAN_NOA_NOTIFICATION = 0xbc, 191 REPLY_WIPAN_NOA_NOTIFICATION = 0xbc,
192 REPLY_WIPAN_DEACTIVATION_COMPLETE = 0xbd,
192 193
193 REPLY_MAX = 0xff 194 REPLY_MAX = 0xff
194}; 195};
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
index c373b53babea..e4b953d7b7bf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
@@ -108,6 +108,7 @@ const char *get_cmd_string(u8 cmd)
108 IWL_CMD(REPLY_WIPAN_WEPKEY); 108 IWL_CMD(REPLY_WIPAN_WEPKEY);
109 IWL_CMD(REPLY_WIPAN_P2P_CHANNEL_SWITCH); 109 IWL_CMD(REPLY_WIPAN_P2P_CHANNEL_SWITCH);
110 IWL_CMD(REPLY_WIPAN_NOA_NOTIFICATION); 110 IWL_CMD(REPLY_WIPAN_NOA_NOTIFICATION);
111 IWL_CMD(REPLY_WIPAN_DEACTIVATION_COMPLETE);
111 default: 112 default:
112 return "UNKNOWN"; 113 return "UNKNOWN";
113 114