Commit c91ba8c8 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman
Browse files

staging: wfx: simplify wfx_conf_tx()



Error management of wfx_conf_tx() can be simplified.

In add, the hardware command "hif_set_edca_queue_params" never returns
any error.

Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191217161318.31402-38-Jerome.Pouiller@silabs.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8a274dfb
Loading
Loading
Loading
Loading
+16 −28
Original line number Diff line number Diff line
@@ -370,39 +370,27 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
{
	struct wfx_dev *wdev = hw->priv;
	struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv;
	int ret = 0;
	struct hif_req_edca_queue_params *edca;

	mutex_lock(&wdev->conf_mutex);

	if (queue < hw->queues) {
		edca = &wvif->edca.params[queue];
	WARN_ON(queue >= hw->queues);

	mutex_lock(&wdev->conf_mutex);
	wvif->edca.uapsd_enable[queue] = params->uapsd;
	edca = &wvif->edca.params[queue];
	edca->aifsn = params->aifs;
	edca->cw_min = params->cw_min;
	edca->cw_max = params->cw_max;
	edca->tx_op_limit = params->txop * TXOP_UNIT;
	edca->allowed_medium_time = 0;
		ret = hif_set_edca_queue_params(wvif, edca);
		if (ret) {
			ret = -EINVAL;
			goto out;
		}
	hif_set_edca_queue_params(wvif, edca);

	if (wvif->vif->type == NL80211_IFTYPE_STATION) {
			ret = wfx_set_uapsd_param(wvif, &wvif->edca);
			if (!ret && wvif->setbssparams_done &&
			    wvif->state == WFX_STATE_STA)
				ret = wfx_update_pm(wvif);
		}
	} else {
		ret = -EINVAL;
		wfx_set_uapsd_param(wvif, &wvif->edca);
		if (wvif->setbssparams_done && wvif->state == WFX_STATE_STA)
			wfx_update_pm(wvif);
	}

out:
	mutex_unlock(&wdev->conf_mutex);
	return ret;
	return 0;
}

int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value)