aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-sta.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-05-15 03:52:37 -0400
committerDavid S. Miller <davem@davemloft.net>2008-05-15 03:52:37 -0400
commitf42a44494bcdf03fc851c03d438464d59c0ceaf5 (patch)
tree986ea7b54e9fc79a64863fd7e92eabd99ffd37a3 /drivers/net/wireless/iwlwifi/iwl-sta.c
parent63fe46da9c380b3f2bbdf3765044649517cc717c (diff)
parentef85ad541f9a6ccd3f89ec73f92b2d6f45a9d3e8 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-sta.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c61
1 files changed, 55 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 31b37a1a6430..f2267047d102 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -70,6 +70,52 @@ u8 iwl_find_station(struct iwl_priv *priv, const u8 *addr)
70} 70}
71EXPORT_SYMBOL(iwl_find_station); 71EXPORT_SYMBOL(iwl_find_station);
72 72
73int iwl_send_add_sta(struct iwl_priv *priv,
74 struct iwl_addsta_cmd *sta, u8 flags)
75{
76 struct iwl_rx_packet *res = NULL;
77 int ret = 0;
78 u8 data[sizeof(*sta)];
79 struct iwl_host_cmd cmd = {
80 .id = REPLY_ADD_STA,
81 .meta.flags = flags,
82 .data = data,
83 };
84
85 if (!(flags & CMD_ASYNC))
86 cmd.meta.flags |= CMD_WANT_SKB;
87
88 cmd.len = priv->cfg->ops->utils->build_addsta_hcmd(sta, data);
89 ret = iwl_send_cmd(priv, &cmd);
90
91 if (ret || (flags & CMD_ASYNC))
92 return ret;
93
94 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
95 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
96 IWL_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n",
97 res->hdr.flags);
98 ret = -EIO;
99 }
100
101 if (ret == 0) {
102 switch (res->u.add_sta.status) {
103 case ADD_STA_SUCCESS_MSK:
104 IWL_DEBUG_INFO("REPLY_ADD_STA PASSED\n");
105 break;
106 default:
107 ret = -EIO;
108 IWL_WARNING("REPLY_ADD_STA failed\n");
109 break;
110 }
111 }
112
113 priv->alloc_rxb_skb--;
114 dev_kfree_skb_any(cmd.meta.u.skb);
115
116 return ret;
117}
118EXPORT_SYMBOL(iwl_send_add_sta);
73 119
74int iwl_get_free_ucode_key_index(struct iwl_priv *priv) 120int iwl_get_free_ucode_key_index(struct iwl_priv *priv)
75{ 121{
@@ -124,6 +170,7 @@ int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty)
124 else 170 else
125 return 0; 171 return 0;
126} 172}
173EXPORT_SYMBOL(iwl_send_static_wepkey_cmd);
127 174
128int iwl_remove_default_wep_key(struct iwl_priv *priv, 175int iwl_remove_default_wep_key(struct iwl_priv *priv,
129 struct ieee80211_key_conf *keyconf) 176 struct ieee80211_key_conf *keyconf)
@@ -144,6 +191,7 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv,
144 191
145 return ret; 192 return ret;
146} 193}
194EXPORT_SYMBOL(iwl_remove_default_wep_key);
147 195
148int iwl_set_default_wep_key(struct iwl_priv *priv, 196int iwl_set_default_wep_key(struct iwl_priv *priv,
149 struct ieee80211_key_conf *keyconf) 197 struct ieee80211_key_conf *keyconf)
@@ -171,6 +219,7 @@ int iwl_set_default_wep_key(struct iwl_priv *priv,
171 219
172 return ret; 220 return ret;
173} 221}
222EXPORT_SYMBOL(iwl_set_default_wep_key);
174 223
175static int iwl_set_wep_dynamic_key_info(struct iwl_priv *priv, 224static int iwl_set_wep_dynamic_key_info(struct iwl_priv *priv,
176 struct ieee80211_key_conf *keyconf, 225 struct ieee80211_key_conf *keyconf,
@@ -216,8 +265,7 @@ static int iwl_set_wep_dynamic_key_info(struct iwl_priv *priv,
216 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; 265 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
217 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; 266 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
218 267
219 ret = iwl4965_send_add_station(priv, 268 ret = iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
220 &priv->stations[sta_id].sta, CMD_ASYNC);
221 269
222 spin_unlock_irqrestore(&priv->sta_lock, flags); 270 spin_unlock_irqrestore(&priv->sta_lock, flags);
223 271
@@ -265,8 +313,7 @@ static int iwl_set_ccmp_dynamic_key_info(struct iwl_priv *priv,
265 spin_unlock_irqrestore(&priv->sta_lock, flags); 313 spin_unlock_irqrestore(&priv->sta_lock, flags);
266 314
267 IWL_DEBUG_INFO("hwcrypto: modify ucode station key info\n"); 315 IWL_DEBUG_INFO("hwcrypto: modify ucode station key info\n");
268 return iwl4965_send_add_station(priv, 316 return iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
269 &priv->stations[sta_id].sta, CMD_ASYNC);
270} 317}
271 318
272static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv, 319static int iwl_set_tkip_dynamic_key_info(struct iwl_priv *priv,
@@ -333,7 +380,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
333 IWL_ERROR("index %d not used in uCode key table.\n", 380 IWL_ERROR("index %d not used in uCode key table.\n",
334 priv->stations[sta_id].sta.key.key_offset); 381 priv->stations[sta_id].sta.key.key_offset);
335 memset(&priv->stations[sta_id].keyinfo, 0, 382 memset(&priv->stations[sta_id].keyinfo, 0,
336 sizeof(struct iwl4965_hw_key)); 383 sizeof(struct iwl_hw_key));
337 memset(&priv->stations[sta_id].sta.key, 0, 384 memset(&priv->stations[sta_id].sta.key, 0,
338 sizeof(struct iwl4965_keyinfo)); 385 sizeof(struct iwl4965_keyinfo));
339 priv->stations[sta_id].sta.key.key_flags = 386 priv->stations[sta_id].sta.key.key_flags =
@@ -343,10 +390,11 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
343 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; 390 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
344 391
345 IWL_DEBUG_INFO("hwcrypto: clear ucode station key info\n"); 392 IWL_DEBUG_INFO("hwcrypto: clear ucode station key info\n");
346 ret = iwl4965_send_add_station(priv, &priv->stations[sta_id].sta, 0); 393 ret = iwl_send_add_sta(priv, &priv->stations[sta_id].sta, 0);
347 spin_unlock_irqrestore(&priv->sta_lock, flags); 394 spin_unlock_irqrestore(&priv->sta_lock, flags);
348 return ret; 395 return ret;
349} 396}
397EXPORT_SYMBOL(iwl_remove_dynamic_key);
350 398
351int iwl_set_dynamic_key(struct iwl_priv *priv, 399int iwl_set_dynamic_key(struct iwl_priv *priv,
352 struct ieee80211_key_conf *key, u8 sta_id) 400 struct ieee80211_key_conf *key, u8 sta_id)
@@ -372,6 +420,7 @@ int iwl_set_dynamic_key(struct iwl_priv *priv,
372 420
373 return ret; 421 return ret;
374} 422}
423EXPORT_SYMBOL(iwl_set_dynamic_key);
375 424
376#ifdef CONFIG_IWLWIFI_DEBUG 425#ifdef CONFIG_IWLWIFI_DEBUG
377static void iwl_dump_lq_cmd(struct iwl_priv *priv, 426static void iwl_dump_lq_cmd(struct iwl_priv *priv,