aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-testmode.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-03-15 16:26:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-09 16:37:15 -0400
commitdb662d478695a967b9d0a4c9893278e797b73f6c (patch)
tree3a5cf5c45c1bf241eb5dbf354c5122d53c55a14a /drivers/net/wireless/iwlwifi/iwl-testmode.c
parent0c19744c344cf1bfda04f681ff4e1e46455577bd (diff)
iwlwifi: extend notification wait
Sometimes, for example when we ask the uCode for calibration, we wait for the "complete" response while we also need the results that are sent in other, interim, notifications. Currently we handle this by installing an RX handler globally, but that isn't needed as this is the only time we want to use these notifications. So in order to be able to simplify at least future code that does the same, extend the notification wait framework to allow you to wait for multiple commands and decide based on the command whether the wait finished. While at it, also fix a race that can then become relevant -- if the wait function has returned true once it shouldn't be called again, today this can happen due to races between the triggering and the wakeup. 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/iwlwifi/iwl-testmode.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-testmode.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-testmode.c b/drivers/net/wireless/iwlwifi/iwl-testmode.c
index 76f7f9251436..645b8500d02f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-testmode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-testmode.c
@@ -420,10 +420,13 @@ nla_put_failure:
420static int iwl_testmode_cfg_init_calib(struct iwl_priv *priv) 420static int iwl_testmode_cfg_init_calib(struct iwl_priv *priv)
421{ 421{
422 struct iwl_notification_wait calib_wait; 422 struct iwl_notification_wait calib_wait;
423 static const u8 calib_complete[] = {
424 CALIBRATION_COMPLETE_NOTIFICATION
425 };
423 int ret; 426 int ret;
424 427
425 iwl_init_notification_wait(&priv->notif_wait, &calib_wait, 428 iwl_init_notification_wait(&priv->notif_wait, &calib_wait,
426 CALIBRATION_COMPLETE_NOTIFICATION, 429 calib_complete, ARRAY_SIZE(calib_complete),
427 NULL, NULL); 430 NULL, NULL);
428 ret = iwl_init_alive_start(priv); 431 ret = iwl_init_alive_start(priv);
429 if (ret) { 432 if (ret) {