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

Commit 47684808 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by John W. Linville
Browse files

wl12xx: support FW TX inactivity triggers



In AP mode we register for the MAX_TX_RETRY and INACTIVE_STA events.
Both are reported to the upper layers as a TX failure in the offending
stations.

In STA mode we register only for the MAX_TX_RETRY event. A TX failure is
interpreted as a loss of connection.

Support for IEEE80211_HW_REPORTS_TX_ACK_STATUS has been removed to avoid
the inherent race condition of a mac80211 TX failure counter in addition
to the FW counter.

This patch depends on "mac80211: allow low level driver to report packet
loss"

Signed-off-by: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a039a993
Loading
Loading
Loading
Loading
+29 −5
Original line number Diff line number Diff line
@@ -1524,22 +1524,46 @@ int wl1271_acx_tsf_info(struct wl1271 *wl, u64 *mactime)
	return ret;
}

int wl1271_acx_max_tx_retry(struct wl1271 *wl)
int wl1271_acx_ap_max_tx_retry(struct wl1271 *wl)
{
	struct wl1271_acx_max_tx_retry *acx = NULL;
	struct wl1271_acx_ap_max_tx_retry *acx = NULL;
	int ret;

	wl1271_debug(DEBUG_ACX, "acx max tx retry");
	wl1271_debug(DEBUG_ACX, "acx ap max tx retry");

	acx = kzalloc(sizeof(*acx), GFP_KERNEL);
	if (!acx)
		return -ENOMEM;

	acx->max_tx_retry = cpu_to_le16(wl->conf.tx.ap_max_tx_retries);
	acx->max_tx_retry = cpu_to_le16(wl->conf.tx.max_tx_retries);

	ret = wl1271_cmd_configure(wl, ACX_MAX_TX_FAILURE, acx, sizeof(*acx));
	if (ret < 0) {
		wl1271_warning("acx max tx retry failed: %d", ret);
		wl1271_warning("acx ap max tx retry failed: %d", ret);
		goto out;
	}

out:
	kfree(acx);
	return ret;
}

int wl1271_acx_sta_max_tx_retry(struct wl1271 *wl)
{
	struct wl1271_acx_sta_max_tx_retry *acx = NULL;
	int ret;

	wl1271_debug(DEBUG_ACX, "acx sta max tx retry");

	acx = kzalloc(sizeof(*acx), GFP_KERNEL);
	if (!acx)
		return -ENOMEM;

	acx->max_tx_retry = wl->conf.tx.max_tx_retries;

	ret = wl1271_cmd_configure(wl, ACX_CONS_TX_FAILURE, acx, sizeof(*acx));
	if (ret < 0) {
		wl1271_warning("acx sta max tx retry failed: %d", ret);
		goto out;
	}

+10 −2
Original line number Diff line number Diff line
@@ -1145,7 +1145,7 @@ struct wl1271_acx_fw_tsf_information {
	u8 padding[3];
} __packed;

struct wl1271_acx_max_tx_retry {
struct wl1271_acx_ap_max_tx_retry {
	struct acx_header header;

	/*
@@ -1156,6 +1156,13 @@ struct wl1271_acx_max_tx_retry {
	u8 padding_1[2];
} __packed;

struct wl1271_acx_sta_max_tx_retry {
	struct acx_header header;

	u8 max_tx_retry;
	u8 padding_1[3];
} __packed;

struct wl1271_acx_config_ps {
	struct acx_header header;

@@ -1307,7 +1314,8 @@ int wl1271_acx_set_ba_session(struct wl1271 *wl,
int wl1271_acx_set_ba_receiver_session(struct wl1271 *wl, u8 tid_index, u16 ssn,
				       bool enable);
int wl1271_acx_tsf_info(struct wl1271 *wl, u64 *mactime);
int wl1271_acx_max_tx_retry(struct wl1271 *wl);
int wl1271_acx_ap_max_tx_retry(struct wl1271 *wl);
int wl1271_acx_sta_max_tx_retry(struct wl1271 *wl);
int wl1271_acx_config_ps(struct wl1271 *wl);
int wl1271_acx_set_inconnection_sta(struct wl1271 *wl, u8 *addr);

+4 −2
Original line number Diff line number Diff line
@@ -478,10 +478,12 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl)
		DISCONNECT_EVENT_COMPLETE_ID |
		RSSI_SNR_TRIGGER_0_EVENT_ID |
		PSPOLL_DELIVERY_FAILURE_EVENT_ID |
		SOFT_GEMINI_SENSE_EVENT_ID;
		SOFT_GEMINI_SENSE_EVENT_ID |
		MAX_TX_RETRY_EVENT_ID;

	if (wl->bss_type == BSS_TYPE_AP_BSS)
		wl->event_mask |= STA_REMOVE_COMPLETE_EVENT_ID;
		wl->event_mask |= STA_REMOVE_COMPLETE_EVENT_ID |
				  INACTIVE_STA_EVENT_ID;
	else
		wl->event_mask |= DUMMY_PACKET_EVENT_ID;

+1 −1
Original line number Diff line number Diff line
@@ -1070,7 +1070,7 @@ int wl1271_cmd_start_bss(struct wl1271 *wl)

	memcpy(cmd->bssid, bss_conf->bssid, ETH_ALEN);

	cmd->aging_period = cpu_to_le16(WL1271_AP_DEF_INACTIV_SEC);
	cmd->aging_period = cpu_to_le16(wl->conf.tx.ap_aging_period);
	cmd->bss_index = WL1271_AP_BSS_INDEX;
	cmd->global_hlid = WL1271_AP_GLOBAL_HLID;
	cmd->broadcast_hlid = WL1271_AP_BROADCAST_HLID;
+10 −2
Original line number Diff line number Diff line
@@ -683,10 +683,18 @@ struct conf_tx_settings {
	struct conf_tx_rate_class ap_bcst_conf;

	/*
	 * AP-mode - allow this number of TX retries to a station before an
	 * Allow this number of TX retries to a connected station/AP before an
	 * event is triggered from FW.
	 * In AP-mode the hlids of unreachable stations are given in the
	 * "sta_tx_retry_exceeded" member in the event mailbox.
	 */
	u16 ap_max_tx_retries;
	u8 max_tx_retries;

	/*
	 * AP-mode - after this number of seconds a connected station is
	 * considered inactive.
	 */
	u16 ap_aging_period;

	/*
	 * Configuration for TID parameters.
Loading