diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-06-14 11:32:38 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-06-21 13:46:50 -0400 |
commit | 09034cb77ec8530728dd672db7580faeaa29df10 (patch) | |
tree | 8210793c1f5448c6b4be8941ebc41353f2d725cc /drivers | |
parent | e666674eec98752d82388ae009e9039a62e744e7 (diff) |
iwlwifi: return ucode errors from station management
When station management calls to ucode return
an error we could previously do nothing, but
now that almost all calls are synchronous we
can actually let the error bubble up. Use EIO
as the error as it best indicates a problem
with the device.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index d39bfac8740a..6a9cd08bd449 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -55,18 +55,19 @@ static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id) | |||
55 | } | 55 | } |
56 | } | 56 | } |
57 | 57 | ||
58 | static void iwl_process_add_sta_resp(struct iwl_priv *priv, | 58 | static int iwl_process_add_sta_resp(struct iwl_priv *priv, |
59 | struct iwl_addsta_cmd *addsta, | 59 | struct iwl_addsta_cmd *addsta, |
60 | struct iwl_rx_packet *pkt, | 60 | struct iwl_rx_packet *pkt, |
61 | bool sync) | 61 | bool sync) |
62 | { | 62 | { |
63 | u8 sta_id = addsta->sta.sta_id; | 63 | u8 sta_id = addsta->sta.sta_id; |
64 | unsigned long flags; | 64 | unsigned long flags; |
65 | int ret = -EIO; | ||
65 | 66 | ||
66 | if (pkt->hdr.flags & IWL_CMD_FAILED_MSK) { | 67 | if (pkt->hdr.flags & IWL_CMD_FAILED_MSK) { |
67 | IWL_ERR(priv, "Bad return from REPLY_ADD_STA (0x%08X)\n", | 68 | IWL_ERR(priv, "Bad return from REPLY_ADD_STA (0x%08X)\n", |
68 | pkt->hdr.flags); | 69 | pkt->hdr.flags); |
69 | return; | 70 | return ret; |
70 | } | 71 | } |
71 | 72 | ||
72 | IWL_DEBUG_INFO(priv, "Processing response for adding station %u\n", | 73 | IWL_DEBUG_INFO(priv, "Processing response for adding station %u\n", |
@@ -78,6 +79,7 @@ static void iwl_process_add_sta_resp(struct iwl_priv *priv, | |||
78 | case ADD_STA_SUCCESS_MSK: | 79 | case ADD_STA_SUCCESS_MSK: |
79 | IWL_DEBUG_INFO(priv, "REPLY_ADD_STA PASSED\n"); | 80 | IWL_DEBUG_INFO(priv, "REPLY_ADD_STA PASSED\n"); |
80 | iwl_sta_ucode_activate(priv, sta_id); | 81 | iwl_sta_ucode_activate(priv, sta_id); |
82 | ret = 0; | ||
81 | break; | 83 | break; |
82 | case ADD_STA_NO_ROOM_IN_TABLE: | 84 | case ADD_STA_NO_ROOM_IN_TABLE: |
83 | IWL_ERR(priv, "Adding station %d failed, no room in table.\n", | 85 | IWL_ERR(priv, "Adding station %d failed, no room in table.\n", |
@@ -115,6 +117,8 @@ static void iwl_process_add_sta_resp(struct iwl_priv *priv, | |||
115 | STA_CONTROL_MODIFY_MSK ? "Modified" : "Added", | 117 | STA_CONTROL_MODIFY_MSK ? "Modified" : "Added", |
116 | addsta->sta.addr); | 118 | addsta->sta.addr); |
117 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 119 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
120 | |||
121 | return ret; | ||
118 | } | 122 | } |
119 | 123 | ||
120 | static void iwl_add_sta_callback(struct iwl_priv *priv, | 124 | static void iwl_add_sta_callback(struct iwl_priv *priv, |
@@ -159,7 +163,7 @@ int iwl_send_add_sta(struct iwl_priv *priv, | |||
159 | 163 | ||
160 | if (ret == 0) { | 164 | if (ret == 0) { |
161 | pkt = (struct iwl_rx_packet *)cmd.reply_page; | 165 | pkt = (struct iwl_rx_packet *)cmd.reply_page; |
162 | iwl_process_add_sta_resp(priv, sta, pkt, true); | 166 | ret = iwl_process_add_sta_resp(priv, sta, pkt, true); |
163 | } | 167 | } |
164 | iwl_free_pages(priv, cmd.reply_page); | 168 | iwl_free_pages(priv, cmd.reply_page); |
165 | 169 | ||