diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-05-29 16:35:03 +0800 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-03 15:00:23 -0400 |
commit | 42132bce8011bf9507cfbb920ced2235d8dd5fce (patch) | |
tree | 5e7ea4db898d32a31157a55353447787898eecbd /drivers/net/wireless/iwlwifi/iwl-sta.c | |
parent | 7a999bf0c5eb19b20ac6ab0f21f6e5013400fa51 (diff) |
iwlwifi: move add sta handler to iwl-sta.c
This patch moves add_sta hander to iwl-sta.c.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-sta.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 11ec408f99c..ed07566f22e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c @@ -74,6 +74,39 @@ u8 iwl_find_station(struct iwl_priv *priv, const u8 *addr) } EXPORT_SYMBOL(iwl_find_station); +static int iwl_add_sta_callback(struct iwl_priv *priv, + struct iwl_cmd *cmd, struct sk_buff *skb) +{ + struct iwl_rx_packet *res = NULL; + + if (!skb) { + IWL_ERROR("Error: Response NULL in REPLY_ADD_STA.\n"); + return 1; + } + + res = (struct iwl_rx_packet *)skb->data; + if (res->hdr.flags & IWL_CMD_FAILED_MSK) { + IWL_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n", + res->hdr.flags); + return 1; + } + + switch (res->u.add_sta.status) { + case ADD_STA_SUCCESS_MSK: + /* FIXME: implement iwl_sta_ucode_activate(priv, addr); */ + /* fail through */ + default: + IWL_DEBUG_HC("Received REPLY_ADD_STA:(0x%08X)\n", + res->u.add_sta.status); + break; + } + + /* We didn't cache the SKB; let the caller free it */ + return 1; +} + + + int iwl_send_add_sta(struct iwl_priv *priv, struct iwl_addsta_cmd *sta, u8 flags) { @@ -86,7 +119,9 @@ int iwl_send_add_sta(struct iwl_priv *priv, .data = data, }; - if (!(flags & CMD_ASYNC)) + if (flags & CMD_ASYNC) + cmd.meta.u.callback = iwl_add_sta_callback; + else cmd.meta.flags |= CMD_WANT_SKB; cmd.len = priv->cfg->ops->utils->build_addsta_hcmd(sta, data); |