aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl4965-base.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-05-04 22:22:34 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-14 16:29:45 -0400
commit133636deffc86809f59a0c8b768408d13237a9a2 (patch)
tree2c1d156db37f33ad9dd7eb311c6977d2948e9277 /drivers/net/wireless/iwlwifi/iwl4965-base.c
parentdb11d6343aa14ab61258bfad9178042d4be49333 (diff)
iwlwifi: generalize iwl4965_send_add_station function
This patch moves iwl4965_send_add_station to iwlcore under new name iwl_send_add_sta. Function uses build command handler in order to support multiple HWs. 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/iwl4965-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c51
1 files changed, 3 insertions, 48 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 5b9cbbd197f6..8427bc9a9bbc 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -476,7 +476,7 @@ u8 iwl4965_add_station_flags(struct iwl_priv *priv, const u8 *addr,
476 priv->num_stations++; 476 priv->num_stations++;
477 477
478 /* Set up the REPLY_ADD_STA command to send to device */ 478 /* Set up the REPLY_ADD_STA command to send to device */
479 memset(&station->sta, 0, sizeof(struct iwl4965_addsta_cmd)); 479 memset(&station->sta, 0, sizeof(struct iwl_addsta_cmd));
480 memcpy(station->sta.sta.addr, addr, ETH_ALEN); 480 memcpy(station->sta.sta.addr, addr, ETH_ALEN);
481 station->sta.mode = 0; 481 station->sta.mode = 0;
482 station->sta.sta.sta_id = index; 482 station->sta.sta.sta_id = index;
@@ -493,7 +493,7 @@ u8 iwl4965_add_station_flags(struct iwl_priv *priv, const u8 *addr,
493 spin_unlock_irqrestore(&priv->sta_lock, flags_spin); 493 spin_unlock_irqrestore(&priv->sta_lock, flags_spin);
494 494
495 /* Add station to device's station table */ 495 /* Add station to device's station table */
496 iwl4965_send_add_station(priv, &station->sta, flags); 496 iwl_send_add_sta(priv, &station->sta, flags);
497 return index; 497 return index;
498 498
499} 499}
@@ -963,51 +963,6 @@ static int iwl4965_send_card_state(struct iwl_priv *priv, u32 flags, u8 meta_fla
963 return iwl_send_cmd(priv, &cmd); 963 return iwl_send_cmd(priv, &cmd);
964} 964}
965 965
966int iwl4965_send_add_station(struct iwl_priv *priv,
967 struct iwl4965_addsta_cmd *sta, u8 flags)
968{
969 struct iwl_rx_packet *res = NULL;
970 int rc = 0;
971 struct iwl_host_cmd cmd = {
972 .id = REPLY_ADD_STA,
973 .len = sizeof(struct iwl4965_addsta_cmd),
974 .meta.flags = flags,
975 .data = sta,
976 };
977
978 if (!(flags & CMD_ASYNC))
979 cmd.meta.flags |= CMD_WANT_SKB;
980
981 rc = iwl_send_cmd(priv, &cmd);
982
983 if (rc || (flags & CMD_ASYNC))
984 return rc;
985
986 res = (struct iwl_rx_packet *)cmd.meta.u.skb->data;
987 if (res->hdr.flags & IWL_CMD_FAILED_MSK) {
988 IWL_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n",
989 res->hdr.flags);
990 rc = -EIO;
991 }
992
993 if (rc == 0) {
994 switch (res->u.add_sta.status) {
995 case ADD_STA_SUCCESS_MSK:
996 IWL_DEBUG_INFO("REPLY_ADD_STA PASSED\n");
997 break;
998 default:
999 rc = -EIO;
1000 IWL_WARNING("REPLY_ADD_STA failed\n");
1001 break;
1002 }
1003 }
1004
1005 priv->alloc_rxb_skb--;
1006 dev_kfree_skb_any(cmd.meta.u.skb);
1007
1008 return rc;
1009}
1010
1011static void iwl4965_clear_free_frames(struct iwl_priv *priv) 966static void iwl4965_clear_free_frames(struct iwl_priv *priv)
1012{ 967{
1013 struct list_head *element; 968 struct list_head *element;
@@ -5927,7 +5882,7 @@ static void iwl4965_mac_update_tkip_key(struct ieee80211_hw *hw,
5927 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; 5882 priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK;
5928 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; 5883 priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK;
5929 5884
5930 iwl4965_send_add_station(priv, &priv->stations[sta_id].sta, CMD_ASYNC); 5885 iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC);
5931 5886
5932 spin_unlock_irqrestore(&priv->sta_lock, flags); 5887 spin_unlock_irqrestore(&priv->sta_lock, flags);
5933 5888