diff options
author | Eliad Peller <eliad@wizery.com> | 2014-02-10 06:47:22 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-13 15:20:15 -0500 |
commit | da08fdfaf09f161c923c9d2b7db2fba8cc9c457c (patch) | |
tree | 58e656a0d257a899082ec2d24469eb9523f33fa8 | |
parent | 75fb4df7f804229372e073977615a149a4a28dc0 (diff) |
wlcore/wl12xx/wl18xx: configure num_links per-hw
Upcoming fw versions will have different max links support
(according to the hw). Get ready for it by configuring
wl->num_links per-hw, instead of using the const WL12XX_MAX_LINKS.
However, continue using WLCORE_MAX_LINKS in order to simplify
structs declarations (we use it in multiple bitmaps, and converting
them to dynamic arrays is just cumbersome).
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ti/wl12xx/main.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl12xx/wl12xx.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/wl18xx.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/cmd.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/event.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/main.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/rx.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/tx.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/wlcore.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/wlcore_i.h | 13 |
11 files changed, 51 insertions, 30 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c index 3ad8767505c5..69df5bc13dd2 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c | |||
@@ -1749,9 +1749,12 @@ static int wl12xx_setup(struct wl1271 *wl) | |||
1749 | struct wlcore_platdev_data *pdev_data = dev_get_platdata(&wl->pdev->dev); | 1749 | struct wlcore_platdev_data *pdev_data = dev_get_platdata(&wl->pdev->dev); |
1750 | struct wl12xx_platform_data *pdata = pdev_data->pdata; | 1750 | struct wl12xx_platform_data *pdata = pdev_data->pdata; |
1751 | 1751 | ||
1752 | BUILD_BUG_ON(WL12XX_MAX_LINKS > WLCORE_MAX_LINKS); | ||
1753 | |||
1752 | wl->rtable = wl12xx_rtable; | 1754 | wl->rtable = wl12xx_rtable; |
1753 | wl->num_tx_desc = WL12XX_NUM_TX_DESCRIPTORS; | 1755 | wl->num_tx_desc = WL12XX_NUM_TX_DESCRIPTORS; |
1754 | wl->num_rx_desc = WL12XX_NUM_RX_DESCRIPTORS; | 1756 | wl->num_rx_desc = WL12XX_NUM_RX_DESCRIPTORS; |
1757 | wl->num_links = WL12XX_MAX_LINKS; | ||
1755 | wl->num_channels = 1; | 1758 | wl->num_channels = 1; |
1756 | wl->num_mac_addr = WL12XX_NUM_MAC_ADDRESSES; | 1759 | wl->num_mac_addr = WL12XX_NUM_MAC_ADDRESSES; |
1757 | wl->band_rate_to_idx = wl12xx_band_rate_to_idx; | 1760 | wl->band_rate_to_idx = wl12xx_band_rate_to_idx; |
diff --git a/drivers/net/wireless/ti/wl12xx/wl12xx.h b/drivers/net/wireless/ti/wl12xx/wl12xx.h index b9950f87f01f..26b1a3f97485 100644 --- a/drivers/net/wireless/ti/wl12xx/wl12xx.h +++ b/drivers/net/wireless/ti/wl12xx/wl12xx.h | |||
@@ -65,6 +65,8 @@ | |||
65 | 65 | ||
66 | #define WL12XX_RX_BA_MAX_SESSIONS 3 | 66 | #define WL12XX_RX_BA_MAX_SESSIONS 3 |
67 | 67 | ||
68 | #define WL12XX_MAX_LINKS 12 | ||
69 | |||
68 | struct wl127x_rx_mem_pool_addr { | 70 | struct wl127x_rx_mem_pool_addr { |
69 | u32 addr; | 71 | u32 addr; |
70 | u32 addr_extra; | 72 | u32 addr_extra; |
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index cbf9bf375c14..6011b225fa17 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -1752,9 +1752,12 @@ static int wl18xx_setup(struct wl1271 *wl) | |||
1752 | struct wl18xx_priv *priv = wl->priv; | 1752 | struct wl18xx_priv *priv = wl->priv; |
1753 | int ret; | 1753 | int ret; |
1754 | 1754 | ||
1755 | BUILD_BUG_ON(WL18XX_MAX_LINKS > WLCORE_MAX_LINKS); | ||
1756 | |||
1755 | wl->rtable = wl18xx_rtable; | 1757 | wl->rtable = wl18xx_rtable; |
1756 | wl->num_tx_desc = WL18XX_NUM_TX_DESCRIPTORS; | 1758 | wl->num_tx_desc = WL18XX_NUM_TX_DESCRIPTORS; |
1757 | wl->num_rx_desc = WL18XX_NUM_RX_DESCRIPTORS; | 1759 | wl->num_rx_desc = WL18XX_NUM_RX_DESCRIPTORS; |
1760 | wl->num_links = WL18XX_MAX_LINKS; | ||
1758 | wl->num_channels = 2; | 1761 | wl->num_channels = 2; |
1759 | wl->num_mac_addr = WL18XX_NUM_MAC_ADDRESSES; | 1762 | wl->num_mac_addr = WL18XX_NUM_MAC_ADDRESSES; |
1760 | wl->band_rate_to_idx = wl18xx_band_rate_to_idx; | 1763 | wl->band_rate_to_idx = wl18xx_band_rate_to_idx; |
diff --git a/drivers/net/wireless/ti/wl18xx/wl18xx.h b/drivers/net/wireless/ti/wl18xx/wl18xx.h index d32a6af2df68..38174e996d8a 100644 --- a/drivers/net/wireless/ti/wl18xx/wl18xx.h +++ b/drivers/net/wireless/ti/wl18xx/wl18xx.h | |||
@@ -42,6 +42,8 @@ | |||
42 | 42 | ||
43 | #define WL18XX_RX_BA_MAX_SESSIONS 5 | 43 | #define WL18XX_RX_BA_MAX_SESSIONS 5 |
44 | 44 | ||
45 | #define WL18XX_MAX_LINKS 12 | ||
46 | |||
45 | struct wl18xx_priv { | 47 | struct wl18xx_priv { |
46 | /* buffer for sending commands to FW */ | 48 | /* buffer for sending commands to FW */ |
47 | u8 cmd_buf[WL18XX_CMD_MAX_SIZE]; | 49 | u8 cmd_buf[WL18XX_CMD_MAX_SIZE]; |
@@ -114,7 +116,7 @@ struct wl18xx_fw_packet_counters { | |||
114 | u8 tx_released_pkts[NUM_TX_QUEUES]; | 116 | u8 tx_released_pkts[NUM_TX_QUEUES]; |
115 | 117 | ||
116 | /* Cumulative counter of freed packets per HLID */ | 118 | /* Cumulative counter of freed packets per HLID */ |
117 | u8 tx_lnk_free_pkts[WL12XX_MAX_LINKS]; | 119 | u8 tx_lnk_free_pkts[WL18XX_MAX_LINKS]; |
118 | 120 | ||
119 | /* Cumulative counter of released Voice memory blocks */ | 121 | /* Cumulative counter of released Voice memory blocks */ |
120 | u8 tx_voice_released_blks; | 122 | u8 tx_voice_released_blks; |
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c index 4d19fd22e23c..ab5ca32dd3d1 100644 --- a/drivers/net/wireless/ti/wlcore/cmd.c +++ b/drivers/net/wireless/ti/wlcore/cmd.c | |||
@@ -312,8 +312,8 @@ static int wlcore_get_new_session_id(struct wl1271 *wl, u8 hlid) | |||
312 | int wl12xx_allocate_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid) | 312 | int wl12xx_allocate_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid) |
313 | { | 313 | { |
314 | unsigned long flags; | 314 | unsigned long flags; |
315 | u8 link = find_first_zero_bit(wl->links_map, WL12XX_MAX_LINKS); | 315 | u8 link = find_first_zero_bit(wl->links_map, wl->num_links); |
316 | if (link >= WL12XX_MAX_LINKS) | 316 | if (link >= wl->num_links) |
317 | return -EBUSY; | 317 | return -EBUSY; |
318 | 318 | ||
319 | wl->session_ids[link] = wlcore_get_new_session_id(wl, link); | 319 | wl->session_ids[link] = wlcore_get_new_session_id(wl, link); |
diff --git a/drivers/net/wireless/ti/wlcore/event.c b/drivers/net/wireless/ti/wlcore/event.c index 8d3b34965db3..1f9a36031b06 100644 --- a/drivers/net/wireless/ti/wlcore/event.c +++ b/drivers/net/wireless/ti/wlcore/event.c | |||
@@ -67,7 +67,7 @@ static void wl1271_stop_ba_event(struct wl1271 *wl, struct wl12xx_vif *wlvif) | |||
67 | u8 hlid; | 67 | u8 hlid; |
68 | struct wl1271_link *lnk; | 68 | struct wl1271_link *lnk; |
69 | for_each_set_bit(hlid, wlvif->ap.sta_hlid_map, | 69 | for_each_set_bit(hlid, wlvif->ap.sta_hlid_map, |
70 | WL12XX_MAX_LINKS) { | 70 | wl->num_links) { |
71 | lnk = &wl->links[hlid]; | 71 | lnk = &wl->links[hlid]; |
72 | if (!lnk->ba_bitmap) | 72 | if (!lnk->ba_bitmap) |
73 | continue; | 73 | continue; |
@@ -172,7 +172,7 @@ static void wlcore_disconnect_sta(struct wl1271 *wl, unsigned long sta_bitmap) | |||
172 | const u8 *addr; | 172 | const u8 *addr; |
173 | int h; | 173 | int h; |
174 | 174 | ||
175 | for_each_set_bit(h, &sta_bitmap, WL12XX_MAX_LINKS) { | 175 | for_each_set_bit(h, &sta_bitmap, wl->num_links) { |
176 | bool found = false; | 176 | bool found = false; |
177 | /* find the ap vif connected to this sta */ | 177 | /* find the ap vif connected to this sta */ |
178 | wl12xx_for_each_wlvif_ap(wl, wlvif) { | 178 | wl12xx_for_each_wlvif_ap(wl, wlvif) { |
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 70a3e573ca3d..c35d1dce6751 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c | |||
@@ -372,7 +372,7 @@ static void wl12xx_irq_update_links_status(struct wl1271 *wl, | |||
372 | wl->ap_fw_ps_map = cur_fw_ps_map; | 372 | wl->ap_fw_ps_map = cur_fw_ps_map; |
373 | } | 373 | } |
374 | 374 | ||
375 | for_each_set_bit(hlid, wlvif->ap.sta_hlid_map, WL12XX_MAX_LINKS) | 375 | for_each_set_bit(hlid, wlvif->ap.sta_hlid_map, wl->num_links) |
376 | wl12xx_irq_ps_regulate_link(wl, wlvif, hlid, | 376 | wl12xx_irq_ps_regulate_link(wl, wlvif, hlid, |
377 | wl->links[hlid].allocated_pkts); | 377 | wl->links[hlid].allocated_pkts); |
378 | } | 378 | } |
@@ -412,7 +412,7 @@ static int wlcore_fw_status(struct wl1271 *wl, struct wl_fw_status *status) | |||
412 | } | 412 | } |
413 | 413 | ||
414 | 414 | ||
415 | for_each_set_bit(i, wl->links_map, WL12XX_MAX_LINKS) { | 415 | for_each_set_bit(i, wl->links_map, wl->num_links) { |
416 | u8 diff; | 416 | u8 diff; |
417 | lnk = &wl->links[i]; | 417 | lnk = &wl->links[i]; |
418 | 418 | ||
@@ -5855,7 +5855,7 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size, | |||
5855 | int i, j, ret; | 5855 | int i, j, ret; |
5856 | unsigned int order; | 5856 | unsigned int order; |
5857 | 5857 | ||
5858 | BUILD_BUG_ON(AP_MAX_STATIONS > WL12XX_MAX_LINKS); | 5858 | BUILD_BUG_ON(AP_MAX_STATIONS > WLCORE_MAX_LINKS); |
5859 | 5859 | ||
5860 | hw = ieee80211_alloc_hw(sizeof(*wl), &wl1271_ops); | 5860 | hw = ieee80211_alloc_hw(sizeof(*wl), &wl1271_ops); |
5861 | if (!hw) { | 5861 | if (!hw) { |
@@ -5878,8 +5878,12 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size, | |||
5878 | 5878 | ||
5879 | wl->hw = hw; | 5879 | wl->hw = hw; |
5880 | 5880 | ||
5881 | /* | ||
5882 | * wl->num_links is not configured yet, so just use WLCORE_MAX_LINKS. | ||
5883 | * we don't allocate any additional resource here, so that's fine. | ||
5884 | */ | ||
5881 | for (i = 0; i < NUM_TX_QUEUES; i++) | 5885 | for (i = 0; i < NUM_TX_QUEUES; i++) |
5882 | for (j = 0; j < WL12XX_MAX_LINKS; j++) | 5886 | for (j = 0; j < WLCORE_MAX_LINKS; j++) |
5883 | skb_queue_head_init(&wl->links[j].tx_queue[i]); | 5887 | skb_queue_head_init(&wl->links[j].tx_queue[i]); |
5884 | 5888 | ||
5885 | skb_queue_head_init(&wl->deferred_rx_queue); | 5889 | skb_queue_head_init(&wl->deferred_rx_queue); |
diff --git a/drivers/net/wireless/ti/wlcore/rx.c b/drivers/net/wireless/ti/wlcore/rx.c index a047e879d37b..e125974285cc 100644 --- a/drivers/net/wireless/ti/wlcore/rx.c +++ b/drivers/net/wireless/ti/wlcore/rx.c | |||
@@ -205,7 +205,7 @@ static int wl1271_rx_handle_data(struct wl1271 *wl, u8 *data, u32 length, | |||
205 | 205 | ||
206 | int wlcore_rx(struct wl1271 *wl, struct wl_fw_status *status) | 206 | int wlcore_rx(struct wl1271 *wl, struct wl_fw_status *status) |
207 | { | 207 | { |
208 | unsigned long active_hlids[BITS_TO_LONGS(WL12XX_MAX_LINKS)] = {0}; | 208 | unsigned long active_hlids[BITS_TO_LONGS(WLCORE_MAX_LINKS)] = {0}; |
209 | u32 buf_size; | 209 | u32 buf_size; |
210 | u32 fw_rx_counter = status->fw_rx_counter % wl->num_rx_desc; | 210 | u32 fw_rx_counter = status->fw_rx_counter % wl->num_rx_desc; |
211 | u32 drv_rx_counter = wl->rx_counter % wl->num_rx_desc; | 211 | u32 drv_rx_counter = wl->rx_counter % wl->num_rx_desc; |
@@ -263,12 +263,12 @@ int wlcore_rx(struct wl1271 *wl, struct wl_fw_status *status) | |||
263 | wl->aggr_buf + pkt_offset, | 263 | wl->aggr_buf + pkt_offset, |
264 | pkt_len, rx_align, | 264 | pkt_len, rx_align, |
265 | &hlid) == 1) { | 265 | &hlid) == 1) { |
266 | if (hlid < WL12XX_MAX_LINKS) | 266 | if (hlid < wl->num_links) |
267 | __set_bit(hlid, active_hlids); | 267 | __set_bit(hlid, active_hlids); |
268 | else | 268 | else |
269 | WARN(1, | 269 | WARN(1, |
270 | "hlid exceeded WL12XX_MAX_LINKS " | 270 | "hlid (%d) exceeded MAX_LINKS\n", |
271 | "(%d)\n", hlid); | 271 | hlid); |
272 | } | 272 | } |
273 | 273 | ||
274 | wl->rx_counter++; | 274 | wl->rx_counter++; |
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c index ca886efb0a57..06ab5c6d6bef 100644 --- a/drivers/net/wireless/ti/wlcore/tx.c +++ b/drivers/net/wireless/ti/wlcore/tx.c | |||
@@ -565,11 +565,11 @@ static struct sk_buff *wlcore_vif_dequeue_high_prio(struct wl1271 *wl, | |||
565 | int i, h, start_hlid; | 565 | int i, h, start_hlid; |
566 | 566 | ||
567 | /* start from the link after the last one */ | 567 | /* start from the link after the last one */ |
568 | start_hlid = (wlvif->last_tx_hlid + 1) % WL12XX_MAX_LINKS; | 568 | start_hlid = (wlvif->last_tx_hlid + 1) % wl->num_links; |
569 | 569 | ||
570 | /* dequeue according to AC, round robin on each link */ | 570 | /* dequeue according to AC, round robin on each link */ |
571 | for (i = 0; i < WL12XX_MAX_LINKS; i++) { | 571 | for (i = 0; i < wl->num_links; i++) { |
572 | h = (start_hlid + i) % WL12XX_MAX_LINKS; | 572 | h = (start_hlid + i) % wl->num_links; |
573 | 573 | ||
574 | /* only consider connected stations */ | 574 | /* only consider connected stations */ |
575 | if (!test_bit(h, wlvif->links_map)) | 575 | if (!test_bit(h, wlvif->links_map)) |
@@ -693,8 +693,8 @@ static void wl1271_skb_queue_head(struct wl1271 *wl, struct wl12xx_vif *wlvif, | |||
693 | skb_queue_head(&wl->links[hlid].tx_queue[q], skb); | 693 | skb_queue_head(&wl->links[hlid].tx_queue[q], skb); |
694 | 694 | ||
695 | /* make sure we dequeue the same packet next time */ | 695 | /* make sure we dequeue the same packet next time */ |
696 | wlvif->last_tx_hlid = (hlid + WL12XX_MAX_LINKS - 1) % | 696 | wlvif->last_tx_hlid = (hlid + wl->num_links - 1) % |
697 | WL12XX_MAX_LINKS; | 697 | wl->num_links; |
698 | } | 698 | } |
699 | 699 | ||
700 | spin_lock_irqsave(&wl->wl_lock, flags); | 700 | spin_lock_irqsave(&wl->wl_lock, flags); |
@@ -727,7 +727,7 @@ void wl12xx_rearm_rx_streaming(struct wl1271 *wl, unsigned long *active_hlids) | |||
727 | timeout = wl->conf.rx_streaming.duration; | 727 | timeout = wl->conf.rx_streaming.duration; |
728 | wl12xx_for_each_wlvif_sta(wl, wlvif) { | 728 | wl12xx_for_each_wlvif_sta(wl, wlvif) { |
729 | bool found = false; | 729 | bool found = false; |
730 | for_each_set_bit(hlid, active_hlids, WL12XX_MAX_LINKS) { | 730 | for_each_set_bit(hlid, active_hlids, wl->num_links) { |
731 | if (test_bit(hlid, wlvif->links_map)) { | 731 | if (test_bit(hlid, wlvif->links_map)) { |
732 | found = true; | 732 | found = true; |
733 | break; | 733 | break; |
@@ -764,7 +764,7 @@ int wlcore_tx_work_locked(struct wl1271 *wl) | |||
764 | struct wl1271_tx_hw_descr *desc; | 764 | struct wl1271_tx_hw_descr *desc; |
765 | u32 buf_offset = 0, last_len = 0; | 765 | u32 buf_offset = 0, last_len = 0; |
766 | bool sent_packets = false; | 766 | bool sent_packets = false; |
767 | unsigned long active_hlids[BITS_TO_LONGS(WL12XX_MAX_LINKS)] = {0}; | 767 | unsigned long active_hlids[BITS_TO_LONGS(WLCORE_MAX_LINKS)] = {0}; |
768 | int ret = 0; | 768 | int ret = 0; |
769 | int bus_ret = 0; | 769 | int bus_ret = 0; |
770 | u8 hlid; | 770 | u8 hlid; |
@@ -1066,7 +1066,7 @@ void wl12xx_tx_reset_wlvif(struct wl1271 *wl, struct wl12xx_vif *wlvif) | |||
1066 | int i; | 1066 | int i; |
1067 | 1067 | ||
1068 | /* TX failure */ | 1068 | /* TX failure */ |
1069 | for_each_set_bit(i, wlvif->links_map, WL12XX_MAX_LINKS) { | 1069 | for_each_set_bit(i, wlvif->links_map, wl->num_links) { |
1070 | if (wlvif->bss_type == BSS_TYPE_AP_BSS && | 1070 | if (wlvif->bss_type == BSS_TYPE_AP_BSS && |
1071 | i != wlvif->ap.bcast_hlid && i != wlvif->ap.global_hlid) { | 1071 | i != wlvif->ap.bcast_hlid && i != wlvif->ap.global_hlid) { |
1072 | /* this calls wl12xx_free_link */ | 1072 | /* this calls wl12xx_free_link */ |
@@ -1090,7 +1090,7 @@ void wl12xx_tx_reset(struct wl1271 *wl) | |||
1090 | 1090 | ||
1091 | /* only reset the queues if something bad happened */ | 1091 | /* only reset the queues if something bad happened */ |
1092 | if (wl1271_tx_total_queue_count(wl) != 0) { | 1092 | if (wl1271_tx_total_queue_count(wl) != 0) { |
1093 | for (i = 0; i < WL12XX_MAX_LINKS; i++) | 1093 | for (i = 0; i < wl->num_links; i++) |
1094 | wl1271_tx_reset_link_queues(wl, i); | 1094 | wl1271_tx_reset_link_queues(wl, i); |
1095 | 1095 | ||
1096 | for (i = 0; i < NUM_TX_QUEUES; i++) | 1096 | for (i = 0; i < NUM_TX_QUEUES; i++) |
@@ -1183,7 +1183,7 @@ void wl1271_tx_flush(struct wl1271 *wl) | |||
1183 | WL1271_TX_FLUSH_TIMEOUT / 1000); | 1183 | WL1271_TX_FLUSH_TIMEOUT / 1000); |
1184 | 1184 | ||
1185 | /* forcibly flush all Tx buffers on our queues */ | 1185 | /* forcibly flush all Tx buffers on our queues */ |
1186 | for (i = 0; i < WL12XX_MAX_LINKS; i++) | 1186 | for (i = 0; i < wl->num_links; i++) |
1187 | wl1271_tx_reset_link_queues(wl, i); | 1187 | wl1271_tx_reset_link_queues(wl, i); |
1188 | 1188 | ||
1189 | out_wake: | 1189 | out_wake: |
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h index cec526502054..98b1875d6e91 100644 --- a/drivers/net/wireless/ti/wlcore/wlcore.h +++ b/drivers/net/wireless/ti/wlcore/wlcore.h | |||
@@ -222,7 +222,7 @@ struct wl1271 { | |||
222 | int channel; | 222 | int channel; |
223 | u8 system_hlid; | 223 | u8 system_hlid; |
224 | 224 | ||
225 | unsigned long links_map[BITS_TO_LONGS(WL12XX_MAX_LINKS)]; | 225 | unsigned long links_map[BITS_TO_LONGS(WLCORE_MAX_LINKS)]; |
226 | unsigned long roles_map[BITS_TO_LONGS(WL12XX_MAX_ROLES)]; | 226 | unsigned long roles_map[BITS_TO_LONGS(WL12XX_MAX_ROLES)]; |
227 | unsigned long roc_map[BITS_TO_LONGS(WL12XX_MAX_ROLES)]; | 227 | unsigned long roc_map[BITS_TO_LONGS(WL12XX_MAX_ROLES)]; |
228 | unsigned long rate_policies_map[ | 228 | unsigned long rate_policies_map[ |
@@ -230,7 +230,7 @@ struct wl1271 { | |||
230 | unsigned long klv_templates_map[ | 230 | unsigned long klv_templates_map[ |
231 | BITS_TO_LONGS(WLCORE_MAX_KLV_TEMPLATES)]; | 231 | BITS_TO_LONGS(WLCORE_MAX_KLV_TEMPLATES)]; |
232 | 232 | ||
233 | u8 session_ids[WL12XX_MAX_LINKS]; | 233 | u8 session_ids[WLCORE_MAX_LINKS]; |
234 | 234 | ||
235 | struct list_head wlvif_list; | 235 | struct list_head wlvif_list; |
236 | 236 | ||
@@ -378,7 +378,7 @@ struct wl1271 { | |||
378 | * AP-mode - links indexed by HLID. The global and broadcast links | 378 | * AP-mode - links indexed by HLID. The global and broadcast links |
379 | * are always active. | 379 | * are always active. |
380 | */ | 380 | */ |
381 | struct wl1271_link links[WL12XX_MAX_LINKS]; | 381 | struct wl1271_link links[WLCORE_MAX_LINKS]; |
382 | 382 | ||
383 | /* number of currently active links */ | 383 | /* number of currently active links */ |
384 | int active_link_count; | 384 | int active_link_count; |
@@ -436,6 +436,8 @@ struct wl1271 { | |||
436 | u32 num_tx_desc; | 436 | u32 num_tx_desc; |
437 | /* number of RX descriptors the HW supports. */ | 437 | /* number of RX descriptors the HW supports. */ |
438 | u32 num_rx_desc; | 438 | u32 num_rx_desc; |
439 | /* number of links the HW supports */ | ||
440 | u8 num_links; | ||
439 | 441 | ||
440 | /* translate HW Tx rates to standard rate-indices */ | 442 | /* translate HW Tx rates to standard rate-indices */ |
441 | const u8 **band_rate_to_idx; | 443 | const u8 **band_rate_to_idx; |
diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h index 32e1e8b23a8b..256d09b3d581 100644 --- a/drivers/net/wireless/ti/wlcore/wlcore_i.h +++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h | |||
@@ -58,10 +58,15 @@ | |||
58 | #define WL1271_DEFAULT_DTIM_PERIOD 1 | 58 | #define WL1271_DEFAULT_DTIM_PERIOD 1 |
59 | 59 | ||
60 | #define WL12XX_MAX_ROLES 4 | 60 | #define WL12XX_MAX_ROLES 4 |
61 | #define WL12XX_MAX_LINKS 12 | ||
62 | #define WL12XX_INVALID_ROLE_ID 0xff | 61 | #define WL12XX_INVALID_ROLE_ID 0xff |
63 | #define WL12XX_INVALID_LINK_ID 0xff | 62 | #define WL12XX_INVALID_LINK_ID 0xff |
64 | 63 | ||
64 | /* | ||
65 | * max number of links allowed by all HWs. | ||
66 | * this is NOT the actual max links supported by the current hw. | ||
67 | */ | ||
68 | #define WLCORE_MAX_LINKS 12 | ||
69 | |||
65 | /* the driver supports the 2.4Ghz and 5Ghz bands */ | 70 | /* the driver supports the 2.4Ghz and 5Ghz bands */ |
66 | #define WLCORE_NUM_BANDS 2 | 71 | #define WLCORE_NUM_BANDS 2 |
67 | 72 | ||
@@ -156,7 +161,7 @@ struct wl_fw_status { | |||
156 | 161 | ||
157 | /* | 162 | /* |
158 | * Cumulative counter of freed packets per HLID | 163 | * Cumulative counter of freed packets per HLID |
159 | * (length of the array is WL12XX_MAX_LINKS) | 164 | * (length of the array is wl->num_links) |
160 | */ | 165 | */ |
161 | u8 *tx_lnk_free_pkts; | 166 | u8 *tx_lnk_free_pkts; |
162 | 167 | ||
@@ -357,7 +362,7 @@ struct wl12xx_vif { | |||
357 | 362 | ||
358 | /* HLIDs bitmap of associated stations */ | 363 | /* HLIDs bitmap of associated stations */ |
359 | unsigned long sta_hlid_map[BITS_TO_LONGS( | 364 | unsigned long sta_hlid_map[BITS_TO_LONGS( |
360 | WL12XX_MAX_LINKS)]; | 365 | WLCORE_MAX_LINKS)]; |
361 | 366 | ||
362 | /* recoreded keys - set here before AP startup */ | 367 | /* recoreded keys - set here before AP startup */ |
363 | struct wl1271_ap_key *recorded_keys[MAX_NUM_KEYS]; | 368 | struct wl1271_ap_key *recorded_keys[MAX_NUM_KEYS]; |
@@ -374,7 +379,7 @@ struct wl12xx_vif { | |||
374 | /* counters of packets per AC, across all links in the vif */ | 379 | /* counters of packets per AC, across all links in the vif */ |
375 | int tx_queue_count[NUM_TX_QUEUES]; | 380 | int tx_queue_count[NUM_TX_QUEUES]; |
376 | 381 | ||
377 | unsigned long links_map[BITS_TO_LONGS(WL12XX_MAX_LINKS)]; | 382 | unsigned long links_map[BITS_TO_LONGS(WLCORE_MAX_LINKS)]; |
378 | 383 | ||
379 | u8 ssid[IEEE80211_MAX_SSID_LEN + 1]; | 384 | u8 ssid[IEEE80211_MAX_SSID_LEN + 1]; |
380 | u8 ssid_len; | 385 | u8 ssid_len; |