diff options
author | Eliad Peller <eliad@wizery.com> | 2011-10-05 05:55:54 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-10-07 01:32:45 -0400 |
commit | a8ab39a4b588e8523be2fa75671bdc9612d3467a (patch) | |
tree | b0c82611cc83f65131e0d9eb862675f894398d19 /drivers/net/wireless/wl12xx/main.c | |
parent | 154da67c7da14ffd8da292394f8cbc81cc5ea4e3 (diff) |
wl12xx: move ap_global_hlid and ap_bcast_hlid into wlvif
move ap_global_hlid and ap_bcast_hlid into the per-interface
data, rather than being global.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/main.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 3358cfe5b019..731e34bc275a 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -1488,8 +1488,9 @@ int wl1271_plt_stop(struct wl1271 *wl) | |||
1488 | static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | 1488 | static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) |
1489 | { | 1489 | { |
1490 | struct wl1271 *wl = hw->priv; | 1490 | struct wl1271 *wl = hw->priv; |
1491 | struct ieee80211_tx_info *control = IEEE80211_SKB_CB(skb); | 1491 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
1492 | struct wl12xx_vif *wlvif = wl12xx_vif_to_data(control->control.vif); | 1492 | struct ieee80211_vif *vif = info->control.vif; |
1493 | struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif); | ||
1493 | unsigned long flags; | 1494 | unsigned long flags; |
1494 | int q, mapping; | 1495 | int q, mapping; |
1495 | u8 hlid = 0; | 1496 | u8 hlid = 0; |
@@ -1498,7 +1499,7 @@ static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
1498 | q = wl1271_tx_get_queue(mapping); | 1499 | q = wl1271_tx_get_queue(mapping); |
1499 | 1500 | ||
1500 | if (wlvif->bss_type == BSS_TYPE_AP_BSS) | 1501 | if (wlvif->bss_type == BSS_TYPE_AP_BSS) |
1501 | hlid = wl12xx_tx_get_hlid_ap(wl, skb); | 1502 | hlid = wl12xx_tx_get_hlid_ap(wl, wlvif, skb); |
1502 | 1503 | ||
1503 | spin_lock_irqsave(&wl->wl_lock, flags); | 1504 | spin_lock_irqsave(&wl->wl_lock, flags); |
1504 | 1505 | ||
@@ -1858,7 +1859,12 @@ static void wl12xx_init_vif_data(struct wl12xx_vif *wlvif) | |||
1858 | wlvif->bss_type = MAX_BSS_TYPE; | 1859 | wlvif->bss_type = MAX_BSS_TYPE; |
1859 | wlvif->role_id = WL12XX_INVALID_ROLE_ID; | 1860 | wlvif->role_id = WL12XX_INVALID_ROLE_ID; |
1860 | wlvif->dev_role_id = WL12XX_INVALID_ROLE_ID; | 1861 | wlvif->dev_role_id = WL12XX_INVALID_ROLE_ID; |
1862 | |||
1863 | /* TODO: init union by type */ | ||
1861 | wlvif->sta.hlid = WL12XX_INVALID_LINK_ID; | 1864 | wlvif->sta.hlid = WL12XX_INVALID_LINK_ID; |
1865 | wlvif->ap.bcast_hlid = WL12XX_INVALID_LINK_ID; | ||
1866 | wlvif->ap.global_hlid = WL12XX_INVALID_LINK_ID; | ||
1867 | |||
1862 | wlvif->basic_rate_set = CONF_TX_RATE_MASK_BASIC; | 1868 | wlvif->basic_rate_set = CONF_TX_RATE_MASK_BASIC; |
1863 | wlvif->basic_rate = CONF_TX_RATE_MASK_BASIC; | 1869 | wlvif->basic_rate = CONF_TX_RATE_MASK_BASIC; |
1864 | wlvif->rate_set = CONF_TX_RATE_MASK_BASIC; | 1870 | wlvif->rate_set = CONF_TX_RATE_MASK_BASIC; |
@@ -2084,8 +2090,8 @@ deinit: | |||
2084 | /* clear all hlids (except system_hlid) */ | 2090 | /* clear all hlids (except system_hlid) */ |
2085 | wlvif->sta.hlid = WL12XX_INVALID_LINK_ID; | 2091 | wlvif->sta.hlid = WL12XX_INVALID_LINK_ID; |
2086 | wl->dev_hlid = WL12XX_INVALID_LINK_ID; | 2092 | wl->dev_hlid = WL12XX_INVALID_LINK_ID; |
2087 | wl->ap_bcast_hlid = WL12XX_INVALID_LINK_ID; | 2093 | wlvif->ap.bcast_hlid = WL12XX_INVALID_LINK_ID; |
2088 | wl->ap_global_hlid = WL12XX_INVALID_LINK_ID; | 2094 | wlvif->ap.global_hlid = WL12XX_INVALID_LINK_ID; |
2089 | 2095 | ||
2090 | /* | 2096 | /* |
2091 | * this must be before the cancel_work calls below, so that the work | 2097 | * this must be before the cancel_work calls below, so that the work |
@@ -2653,7 +2659,7 @@ static void wl1271_free_ap_keys(struct wl1271 *wl) | |||
2653 | } | 2659 | } |
2654 | } | 2660 | } |
2655 | 2661 | ||
2656 | static int wl1271_ap_init_hwenc(struct wl1271 *wl) | 2662 | static int wl1271_ap_init_hwenc(struct wl1271 *wl, struct wl12xx_vif *wlvif) |
2657 | { | 2663 | { |
2658 | int i, ret = 0; | 2664 | int i, ret = 0; |
2659 | struct wl1271_ap_key *key; | 2665 | struct wl1271_ap_key *key; |
@@ -2667,9 +2673,9 @@ static int wl1271_ap_init_hwenc(struct wl1271 *wl) | |||
2667 | key = wl->recorded_ap_keys[i]; | 2673 | key = wl->recorded_ap_keys[i]; |
2668 | hlid = key->hlid; | 2674 | hlid = key->hlid; |
2669 | if (hlid == WL12XX_INVALID_LINK_ID) | 2675 | if (hlid == WL12XX_INVALID_LINK_ID) |
2670 | hlid = wl->ap_bcast_hlid; | 2676 | hlid = wlvif->ap.bcast_hlid; |
2671 | 2677 | ||
2672 | ret = wl1271_cmd_set_ap_key(wl, KEY_ADD_OR_REPLACE, | 2678 | ret = wl1271_cmd_set_ap_key(wl, wlvif, KEY_ADD_OR_REPLACE, |
2673 | key->id, key->key_type, | 2679 | key->id, key->key_type, |
2674 | key->key_size, key->key, | 2680 | key->key_size, key->key, |
2675 | hlid, key->tx_seq_32, | 2681 | hlid, key->tx_seq_32, |
@@ -2683,7 +2689,7 @@ static int wl1271_ap_init_hwenc(struct wl1271 *wl) | |||
2683 | 2689 | ||
2684 | if (wep_key_added) { | 2690 | if (wep_key_added) { |
2685 | ret = wl12xx_cmd_set_default_wep_key(wl, wl->default_key, | 2691 | ret = wl12xx_cmd_set_default_wep_key(wl, wl->default_key, |
2686 | wl->ap_bcast_hlid); | 2692 | wlvif->ap.bcast_hlid); |
2687 | if (ret < 0) | 2693 | if (ret < 0) |
2688 | goto out; | 2694 | goto out; |
2689 | } | 2695 | } |
@@ -2709,7 +2715,7 @@ static int wl1271_set_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
2709 | wl_sta = (struct wl1271_station *)sta->drv_priv; | 2715 | wl_sta = (struct wl1271_station *)sta->drv_priv; |
2710 | hlid = wl_sta->hlid; | 2716 | hlid = wl_sta->hlid; |
2711 | } else { | 2717 | } else { |
2712 | hlid = wl->ap_bcast_hlid; | 2718 | hlid = wlvif->ap.bcast_hlid; |
2713 | } | 2719 | } |
2714 | 2720 | ||
2715 | if (!test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) { | 2721 | if (!test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) { |
@@ -2725,7 +2731,7 @@ static int wl1271_set_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
2725 | key, hlid, tx_seq_32, | 2731 | key, hlid, tx_seq_32, |
2726 | tx_seq_16); | 2732 | tx_seq_16); |
2727 | } else { | 2733 | } else { |
2728 | ret = wl1271_cmd_set_ap_key(wl, action, | 2734 | ret = wl1271_cmd_set_ap_key(wl, wlvif, action, |
2729 | id, key_type, key_size, | 2735 | id, key_type, key_size, |
2730 | key, hlid, tx_seq_32, | 2736 | key, hlid, tx_seq_32, |
2731 | tx_seq_16); | 2737 | tx_seq_16); |
@@ -2769,7 +2775,7 @@ static int wl1271_set_key(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
2769 | wlvif->sta.hlid == WL12XX_INVALID_LINK_ID) | 2775 | wlvif->sta.hlid == WL12XX_INVALID_LINK_ID) |
2770 | return 0; | 2776 | return 0; |
2771 | 2777 | ||
2772 | ret = wl1271_cmd_set_sta_key(wl, vif, action, | 2778 | ret = wl1271_cmd_set_sta_key(wl, wlvif, action, |
2773 | id, key_type, key_size, | 2779 | id, key_type, key_size, |
2774 | key, addr, tx_seq_32, | 2780 | key, addr, tx_seq_32, |
2775 | tx_seq_16); | 2781 | tx_seq_16); |
@@ -3375,7 +3381,7 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl, | |||
3375 | if (ret < 0) | 3381 | if (ret < 0) |
3376 | goto out; | 3382 | goto out; |
3377 | 3383 | ||
3378 | ret = wl1271_ap_init_hwenc(wl); | 3384 | ret = wl1271_ap_init_hwenc(wl, wlvif); |
3379 | if (ret < 0) | 3385 | if (ret < 0) |
3380 | goto out; | 3386 | goto out; |
3381 | 3387 | ||
@@ -4891,8 +4897,6 @@ struct ieee80211_hw *wl1271_alloc_hw(void) | |||
4891 | wl->system_hlid = WL12XX_SYSTEM_HLID; | 4897 | wl->system_hlid = WL12XX_SYSTEM_HLID; |
4892 | wl->dev_hlid = WL12XX_INVALID_LINK_ID; | 4898 | wl->dev_hlid = WL12XX_INVALID_LINK_ID; |
4893 | wl->session_counter = 0; | 4899 | wl->session_counter = 0; |
4894 | wl->ap_bcast_hlid = WL12XX_INVALID_LINK_ID; | ||
4895 | wl->ap_global_hlid = WL12XX_INVALID_LINK_ID; | ||
4896 | wl->active_sta_count = 0; | 4900 | wl->active_sta_count = 0; |
4897 | setup_timer(&wl->rx_streaming_timer, wl1271_rx_streaming_timer, | 4901 | setup_timer(&wl->rx_streaming_timer, wl1271_rx_streaming_timer, |
4898 | (unsigned long) wl); | 4902 | (unsigned long) wl); |