Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da08fdfa authored by Eliad Peller's avatar Eliad Peller Committed by John W. Linville
Browse files

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: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 75fb4df7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1749,9 +1749,12 @@ static int wl12xx_setup(struct wl1271 *wl)
	struct wlcore_platdev_data *pdev_data = dev_get_platdata(&wl->pdev->dev);
	struct wl12xx_platform_data *pdata = pdev_data->pdata;

	BUILD_BUG_ON(WL12XX_MAX_LINKS > WLCORE_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->num_channels = 1;
	wl->num_mac_addr = WL12XX_NUM_MAC_ADDRESSES;
	wl->band_rate_to_idx = wl12xx_band_rate_to_idx;
+2 −0
Original line number Diff line number Diff line
@@ -65,6 +65,8 @@

#define WL12XX_RX_BA_MAX_SESSIONS 3

#define WL12XX_MAX_LINKS 12

struct wl127x_rx_mem_pool_addr {
	u32 addr;
	u32 addr_extra;
+3 −0
Original line number Diff line number Diff line
@@ -1752,9 +1752,12 @@ static int wl18xx_setup(struct wl1271 *wl)
	struct wl18xx_priv *priv = wl->priv;
	int ret;

	BUILD_BUG_ON(WL18XX_MAX_LINKS > WLCORE_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->num_channels = 2;
	wl->num_mac_addr = WL18XX_NUM_MAC_ADDRESSES;
	wl->band_rate_to_idx = wl18xx_band_rate_to_idx;
+3 −1
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@

#define WL18XX_RX_BA_MAX_SESSIONS 5

#define WL18XX_MAX_LINKS 12

struct wl18xx_priv {
	/* buffer for sending commands to FW */
	u8 cmd_buf[WL18XX_CMD_MAX_SIZE];
@@ -114,7 +116,7 @@ struct wl18xx_fw_packet_counters {
	u8 tx_released_pkts[NUM_TX_QUEUES];

	/* Cumulative counter of freed packets per HLID */
	u8 tx_lnk_free_pkts[WL12XX_MAX_LINKS];
	u8 tx_lnk_free_pkts[WL18XX_MAX_LINKS];

	/* Cumulative counter of released Voice memory blocks */
	u8 tx_voice_released_blks;
+2 −2
Original line number Diff line number Diff line
@@ -312,8 +312,8 @@ static int wlcore_get_new_session_id(struct wl1271 *wl, u8 hlid)
int wl12xx_allocate_link(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 *hlid)
{
	unsigned long flags;
	u8 link = find_first_zero_bit(wl->links_map, WL12XX_MAX_LINKS);
	if (link >= WL12XX_MAX_LINKS)
	u8 link = find_first_zero_bit(wl->links_map, wl->num_links);
	if (link >= wl->num_links)
		return -EBUSY;

	wl->session_ids[link] = wlcore_get_new_session_id(wl, link);
Loading