wlcore/wl12xx/wl18xx: configure max_stations per-hw
authorEliad Peller <eliad@wizery.com>
Mon, 10 Feb 2014 11:47:23 +0000 (13:47 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 13 Feb 2014 20:20:15 +0000 (15:20 -0500)
Each hw supports a different max stations (connected to the
same ap). add a new wl->max_ap_stations and use it instead
of the current common AP_MAX_STATIONS.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ti/wl12xx/main.c
drivers/net/wireless/ti/wl12xx/wl12xx.h
drivers/net/wireless/ti/wl18xx/main.c
drivers/net/wireless/ti/wl18xx/wl18xx.h
drivers/net/wireless/ti/wlcore/main.c
drivers/net/wireless/ti/wlcore/wlcore.h
drivers/net/wireless/ti/wlcore/wlcore_i.h

index 69df5bc13dd203779d31403c73d88051069f73f4..f486f0f8becbe79a4204646b0cdb8eb83fe92e36 100644 (file)
@@ -1750,11 +1750,13 @@ static int wl12xx_setup(struct wl1271 *wl)
        struct wl12xx_platform_data *pdata = pdev_data->pdata;
 
        BUILD_BUG_ON(WL12XX_MAX_LINKS > WLCORE_MAX_LINKS);
+       BUILD_BUG_ON(WL12XX_MAX_AP_STATIONS > WL12XX_MAX_LINKS);
 
        wl->rtable = wl12xx_rtable;
        wl->num_tx_desc = WL12XX_NUM_TX_DESCRIPTORS;
        wl->num_rx_desc = WL12XX_NUM_RX_DESCRIPTORS;
        wl->num_links = WL12XX_MAX_LINKS;
+       wl->max_ap_stations = WL12XX_MAX_AP_STATIONS;
        wl->num_channels = 1;
        wl->num_mac_addr = WL12XX_NUM_MAC_ADDRESSES;
        wl->band_rate_to_idx = wl12xx_band_rate_to_idx;
index 26b1a3f9748535209fd8864944cef207f9d4c55b..75c92658bfeaecb3ccd356303fde6dc17efc92c4 100644 (file)
@@ -65,6 +65,7 @@
 
 #define WL12XX_RX_BA_MAX_SESSIONS 3
 
+#define WL12XX_MAX_AP_STATIONS 8
 #define WL12XX_MAX_LINKS 12
 
 struct wl127x_rx_mem_pool_addr {
index 6011b225fa175c0da6a3a6844bb12ab49da6b486..f19e9b5af58954ee56ec0b65c77d07bf98ddf9fa 100644 (file)
@@ -1753,11 +1753,13 @@ static int wl18xx_setup(struct wl1271 *wl)
        int ret;
 
        BUILD_BUG_ON(WL18XX_MAX_LINKS > WLCORE_MAX_LINKS);
+       BUILD_BUG_ON(WL18XX_MAX_AP_STATIONS > WL18XX_MAX_LINKS);
 
        wl->rtable = wl18xx_rtable;
        wl->num_tx_desc = WL18XX_NUM_TX_DESCRIPTORS;
        wl->num_rx_desc = WL18XX_NUM_RX_DESCRIPTORS;
        wl->num_links = WL18XX_MAX_LINKS;
+       wl->max_ap_stations = WL18XX_MAX_AP_STATIONS;
        wl->num_channels = 2;
        wl->num_mac_addr = WL18XX_NUM_MAC_ADDRESSES;
        wl->band_rate_to_idx = wl18xx_band_rate_to_idx;
index 38174e996d8a8931c300de264773bf5fda558ba7..9785bf87c6668342a5ccca4cc9b9fcb2593f0772 100644 (file)
@@ -42,6 +42,7 @@
 
 #define WL18XX_RX_BA_MAX_SESSIONS 5
 
+#define WL18XX_MAX_AP_STATIONS 8
 #define WL18XX_MAX_LINKS 12
 
 struct wl18xx_priv {
index c35d1dce67516fe8316b6a9f555799eb5034923e..b649726828f935a6d1faa829771e75f703525da0 100644 (file)
@@ -4662,7 +4662,7 @@ static int wl1271_allocate_sta(struct wl1271 *wl,
        int ret;
 
 
-       if (wl->active_sta_count >= AP_MAX_STATIONS) {
+       if (wl->active_sta_count >= wl->max_ap_stations) {
                wl1271_warning("could not allocate HLID - too much stations");
                return -EBUSY;
        }
@@ -5855,8 +5855,6 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size, u32 aggr_buf_size,
        int i, j, ret;
        unsigned int order;
 
-       BUILD_BUG_ON(AP_MAX_STATIONS > WLCORE_MAX_LINKS);
-
        hw = ieee80211_alloc_hw(sizeof(*wl), &wl1271_ops);
        if (!hw) {
                wl1271_error("could not alloc ieee80211_hw");
index 98b1875d6e91b9e45a649732b52c81fb6b6bd994..2356bddc7cdb7bbc84ee80c9e5970aa248094c01 100644 (file)
@@ -438,6 +438,8 @@ struct wl1271 {
        u32 num_rx_desc;
        /* number of links the HW supports */
        u8 num_links;
+       /* max stations a single AP can support */
+       u8 max_ap_stations;
 
        /* translate HW Tx rates to standard rate-indices */
        const u8 **band_rate_to_idx;
index 256d09b3d5817eba9c341722c77ee5d292d8c7b7..a53a37f2b45a5fe8e2def2b3bffe45011a07f157 100644 (file)
@@ -123,8 +123,6 @@ struct wl1271_chip {
 
 #define NUM_TX_QUEUES              4
 
-#define AP_MAX_STATIONS            8
-
 struct wl_fw_status {
        u32 intr;
        u8  fw_rx_counter;