diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 5f67955c76cf..d2222782f46c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -357,7 +357,9 @@ static unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv, | |||
357 | 357 | ||
358 | /* Set up TX command fields */ | 358 | /* Set up TX command fields */ |
359 | tx_beacon_cmd->tx.len = cpu_to_le16((u16)frame_size); | 359 | tx_beacon_cmd->tx.len = cpu_to_le16((u16)frame_size); |
360 | tx_beacon_cmd->tx.sta_id = priv->hw_params.bcast_sta_id; | 360 | #warning "Use proper STA ID" |
361 | tx_beacon_cmd->tx.sta_id = | ||
362 | priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id; | ||
361 | tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; | 363 | tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; |
362 | tx_beacon_cmd->tx.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK | | 364 | tx_beacon_cmd->tx.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK | |
363 | TX_CMD_FLG_TSF_MSK | TX_CMD_FLG_STA_RATE_MSK; | 365 | TX_CMD_FLG_TSF_MSK | TX_CMD_FLG_STA_RATE_MSK; |
@@ -2829,7 +2831,7 @@ static void __iwl_down(struct iwl_priv *priv) | |||
2829 | del_timer_sync(&priv->monitor_recover); | 2831 | del_timer_sync(&priv->monitor_recover); |
2830 | 2832 | ||
2831 | iwl_clear_ucode_stations(priv); | 2833 | iwl_clear_ucode_stations(priv); |
2832 | iwl_dealloc_bcast_station(priv); | 2834 | iwl_dealloc_bcast_stations(priv); |
2833 | iwl_clear_driver_stations(priv); | 2835 | iwl_clear_driver_stations(priv); |
2834 | 2836 | ||
2835 | /* reset BT coex data */ | 2837 | /* reset BT coex data */ |
@@ -2971,6 +2973,7 @@ static int iwl_prepare_card_hw(struct iwl_priv *priv) | |||
2971 | 2973 | ||
2972 | static int __iwl_up(struct iwl_priv *priv) | 2974 | static int __iwl_up(struct iwl_priv *priv) |
2973 | { | 2975 | { |
2976 | struct iwl_rxon_context *ctx; | ||
2974 | int i; | 2977 | int i; |
2975 | int ret; | 2978 | int ret; |
2976 | 2979 | ||
@@ -2984,9 +2987,13 @@ static int __iwl_up(struct iwl_priv *priv) | |||
2984 | return -EIO; | 2987 | return -EIO; |
2985 | } | 2988 | } |
2986 | 2989 | ||
2987 | ret = iwl_alloc_bcast_station(priv, true); | 2990 | for_each_context(priv, ctx) { |
2988 | if (ret) | 2991 | ret = iwl_alloc_bcast_station(priv, ctx, true); |
2989 | return ret; | 2992 | if (ret) { |
2993 | iwl_dealloc_bcast_stations(priv); | ||
2994 | return ret; | ||
2995 | } | ||
2996 | } | ||
2990 | 2997 | ||
2991 | iwl_prepare_card_hw(priv); | 2998 | iwl_prepare_card_hw(priv); |
2992 | 2999 | ||
@@ -3520,9 +3527,11 @@ static void iwl_mac_update_tkip_key(struct ieee80211_hw *hw, | |||
3520 | { | 3527 | { |
3521 | 3528 | ||
3522 | struct iwl_priv *priv = hw->priv; | 3529 | struct iwl_priv *priv = hw->priv; |
3530 | struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv; | ||
3531 | |||
3523 | IWL_DEBUG_MAC80211(priv, "enter\n"); | 3532 | IWL_DEBUG_MAC80211(priv, "enter\n"); |
3524 | 3533 | ||
3525 | iwl_update_tkip_key(priv, keyconf, sta, | 3534 | iwl_update_tkip_key(priv, vif_priv->ctx, keyconf, sta, |
3526 | iv32, phase1key); | 3535 | iv32, phase1key); |
3527 | 3536 | ||
3528 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 3537 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
@@ -3534,6 +3543,7 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3534 | struct ieee80211_key_conf *key) | 3543 | struct ieee80211_key_conf *key) |
3535 | { | 3544 | { |
3536 | struct iwl_priv *priv = hw->priv; | 3545 | struct iwl_priv *priv = hw->priv; |
3546 | struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv; | ||
3537 | int ret; | 3547 | int ret; |
3538 | u8 sta_id; | 3548 | u8 sta_id; |
3539 | bool is_default_wep_key = false; | 3549 | bool is_default_wep_key = false; |
@@ -3545,7 +3555,7 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3545 | return -EOPNOTSUPP; | 3555 | return -EOPNOTSUPP; |
3546 | } | 3556 | } |
3547 | 3557 | ||
3548 | sta_id = iwl_sta_id_or_broadcast(priv, sta); | 3558 | sta_id = iwl_sta_id_or_broadcast(priv, vif_priv->ctx, sta); |
3549 | if (sta_id == IWL_INVALID_STATION) | 3559 | if (sta_id == IWL_INVALID_STATION) |
3550 | return -EINVAL; | 3560 | return -EINVAL; |
3551 | 3561 | ||
@@ -3573,7 +3583,8 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3573 | if (is_default_wep_key) | 3583 | if (is_default_wep_key) |
3574 | ret = iwl_set_default_wep_key(priv, key); | 3584 | ret = iwl_set_default_wep_key(priv, key); |
3575 | else | 3585 | else |
3576 | ret = iwl_set_dynamic_key(priv, key, sta_id); | 3586 | ret = iwl_set_dynamic_key(priv, vif_priv->ctx, |
3587 | key, sta_id); | ||
3577 | 3588 | ||
3578 | IWL_DEBUG_MAC80211(priv, "enable hwcrypto key\n"); | 3589 | IWL_DEBUG_MAC80211(priv, "enable hwcrypto key\n"); |
3579 | break; | 3590 | break; |
@@ -3713,6 +3724,7 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw, | |||
3713 | { | 3724 | { |
3714 | struct iwl_priv *priv = hw->priv; | 3725 | struct iwl_priv *priv = hw->priv; |
3715 | struct iwl_station_priv *sta_priv = (void *)sta->drv_priv; | 3726 | struct iwl_station_priv *sta_priv = (void *)sta->drv_priv; |
3727 | struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv; | ||
3716 | bool is_ap = vif->type == NL80211_IFTYPE_STATION; | 3728 | bool is_ap = vif->type == NL80211_IFTYPE_STATION; |
3717 | int ret; | 3729 | int ret; |
3718 | u8 sta_id; | 3730 | u8 sta_id; |
@@ -3728,8 +3740,8 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw, | |||
3728 | if (vif->type == NL80211_IFTYPE_AP) | 3740 | if (vif->type == NL80211_IFTYPE_AP) |
3729 | sta_priv->client = true; | 3741 | sta_priv->client = true; |
3730 | 3742 | ||
3731 | ret = iwl_add_station_common(priv, sta->addr, is_ap, &sta->ht_cap, | 3743 | ret = iwl_add_station_common(priv, vif_priv->ctx, sta->addr, |
3732 | &sta_id); | 3744 | is_ap, &sta->ht_cap, &sta_id); |
3733 | if (ret) { | 3745 | if (ret) { |
3734 | IWL_ERR(priv, "Unable to add station %pM (%d)\n", | 3746 | IWL_ERR(priv, "Unable to add station %pM (%d)\n", |
3735 | sta->addr, ret); | 3747 | sta->addr, ret); |