Skip to content

Commit

Permalink
wlcore/wl12xx/wl18xx: configure max_stations per-hw
Browse files Browse the repository at this point in the history
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.

Increase wl18xx max stations to 10.

Signed-off-by: Eliad Peller <eliad@wizery.com>
  • Loading branch information
elp committed Jan 16, 2014
1 parent 80127b9 commit fefa58f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/ti/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1751,11 +1751,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;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ti/wl12xx/wl12xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ti/wl18xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1765,11 +1765,13 @@ static int wl18xx_setup(struct wl1271 *wl)
int i;

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;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/ti/wl18xx/wl18xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

#define WL18XX_RX_BA_MAX_SESSIONS 8

#define WL18XX_MAX_AP_STATIONS 10
#define WL18XX_MAX_LINKS 16

struct wl18xx_priv {
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/wireless/ti/wlcore/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4796,7 +4796,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;
}
Expand Down Expand Up @@ -6059,8 +6059,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");
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ti/wlcore/wlcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,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;
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/wireless/ti/wlcore/wlcore_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ struct wl1271_chip {

#define NUM_TX_QUEUES 4

#define AP_MAX_STATIONS 8

struct wl_fw_status {
u32 intr;
u8 fw_rx_counter;
Expand Down

0 comments on commit fefa58f

Please sign in to comment.