diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-05-29 04:35:03 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-03 15:00:23 -0400 |
commit | 42132bce8011bf9507cfbb920ced2235d8dd5fce (patch) | |
tree | 5e7ea4db898d32a31157a55353447787898eecbd | |
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>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 37 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 10 |
2 files changed, 36 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 11ec408f99c5..ed07566f22ee 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) | |||
74 | } | 74 | } |
75 | EXPORT_SYMBOL(iwl_find_station); | 75 | EXPORT_SYMBOL(iwl_find_station); |
76 | 76 | ||
77 | static int iwl_add_sta_callback(struct iwl_priv *priv, | ||
78 | struct iwl_cmd *cmd, struct sk_buff *skb) | ||
79 | { | ||
80 | struct iwl_rx_packet *res = NULL; | ||
81 | |||
82 | if (!skb) { | ||
83 | IWL_ERROR("Error: Response NULL in REPLY_ADD_STA.\n"); | ||
84 | return 1; | ||
85 | } | ||
86 | |||
87 | res = (struct iwl_rx_packet *)skb->data; | ||
88 | if (res->hdr.flags & IWL_CMD_FAILED_MSK) { | ||
89 | IWL_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n", | ||
90 | res->hdr.flags); | ||
91 | return 1; | ||
92 | } | ||
93 | |||
94 | switch (res->u.add_sta.status) { | ||
95 | case ADD_STA_SUCCESS_MSK: | ||
96 | /* FIXME: implement iwl_sta_ucode_activate(priv, addr); */ | ||
97 | /* fail through */ | ||
98 | default: | ||
99 | IWL_DEBUG_HC("Received REPLY_ADD_STA:(0x%08X)\n", | ||
100 | res->u.add_sta.status); | ||
101 | break; | ||
102 | } | ||
103 | |||
104 | /* We didn't cache the SKB; let the caller free it */ | ||
105 | return 1; | ||
106 | } | ||
107 | |||
108 | |||
109 | |||
77 | int iwl_send_add_sta(struct iwl_priv *priv, | 110 | int iwl_send_add_sta(struct iwl_priv *priv, |
78 | struct iwl_addsta_cmd *sta, u8 flags) | 111 | struct iwl_addsta_cmd *sta, u8 flags) |
79 | { | 112 | { |
@@ -86,7 +119,9 @@ int iwl_send_add_sta(struct iwl_priv *priv, | |||
86 | .data = data, | 119 | .data = data, |
87 | }; | 120 | }; |
88 | 121 | ||
89 | if (!(flags & CMD_ASYNC)) | 122 | if (flags & CMD_ASYNC) |
123 | cmd.meta.u.callback = iwl_add_sta_callback; | ||
124 | else | ||
90 | cmd.meta.flags |= CMD_WANT_SKB; | 125 | cmd.meta.flags |= CMD_WANT_SKB; |
91 | 126 | ||
92 | cmd.len = priv->cfg->ops->utils->build_addsta_hcmd(sta, data); | 127 | cmd.len = priv->cfg->ops->utils->build_addsta_hcmd(sta, data); |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 185d667fc71b..f3815b79b6af 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -1921,15 +1921,6 @@ static void iwl_rx_reply_alive(struct iwl_priv *priv, | |||
1921 | IWL_WARNING("uCode did not respond OK.\n"); | 1921 | IWL_WARNING("uCode did not respond OK.\n"); |
1922 | } | 1922 | } |
1923 | 1923 | ||
1924 | static void iwl4965_rx_reply_add_sta(struct iwl_priv *priv, | ||
1925 | struct iwl_rx_mem_buffer *rxb) | ||
1926 | { | ||
1927 | struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; | ||
1928 | |||
1929 | IWL_DEBUG_RX("Received REPLY_ADD_STA: 0x%02X\n", pkt->u.status); | ||
1930 | return; | ||
1931 | } | ||
1932 | |||
1933 | static void iwl4965_rx_reply_error(struct iwl_priv *priv, | 1924 | static void iwl4965_rx_reply_error(struct iwl_priv *priv, |
1934 | struct iwl_rx_mem_buffer *rxb) | 1925 | struct iwl_rx_mem_buffer *rxb) |
1935 | { | 1926 | { |
@@ -2238,7 +2229,6 @@ static void iwl4965_rx_card_state_notif(struct iwl_priv *priv, | |||
2238 | static void iwl4965_setup_rx_handlers(struct iwl_priv *priv) | 2229 | static void iwl4965_setup_rx_handlers(struct iwl_priv *priv) |
2239 | { | 2230 | { |
2240 | priv->rx_handlers[REPLY_ALIVE] = iwl_rx_reply_alive; | 2231 | priv->rx_handlers[REPLY_ALIVE] = iwl_rx_reply_alive; |
2241 | priv->rx_handlers[REPLY_ADD_STA] = iwl4965_rx_reply_add_sta; | ||
2242 | priv->rx_handlers[REPLY_ERROR] = iwl4965_rx_reply_error; | 2232 | priv->rx_handlers[REPLY_ERROR] = iwl4965_rx_reply_error; |
2243 | priv->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl4965_rx_csa; | 2233 | priv->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl4965_rx_csa; |
2244 | priv->rx_handlers[SPECTRUM_MEASURE_NOTIFICATION] = | 2234 | priv->rx_handlers[SPECTRUM_MEASURE_NOTIFICATION] = |