Commit 654e3693 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman

staging: wfx: remove unnecessary EDCA initialisation

mac80211 already call wfx_conf_tx() on every VIF instanciation. So, the
driver does not need to do it.

Note that current code did dirty things with wvif->edca_params. This
struct was initialized, but only 'queue_id' was really used. The other
members are only used to store temporary values.
Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191217161318.31402-43-Jerome.Pouiller@silabs.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7e2b32f5
...@@ -334,6 +334,12 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -334,6 +334,12 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
edca->cw_max = params->cw_max; edca->cw_max = params->cw_max;
edca->tx_op_limit = params->txop * TXOP_UNIT; edca->tx_op_limit = params->txop * TXOP_UNIT;
edca->allowed_medium_time = 0; edca->allowed_medium_time = 0;
edca->queue_id = 3 - queue;
// API 2.0 has changed queue IDs values
if (wfx_api_older_than(wdev, 2, 0) && queue == IEEE80211_AC_BE)
edca->queue_id = HIF_QUEUE_ID_BACKGROUND;
if (wfx_api_older_than(wdev, 2, 0) && queue == IEEE80211_AC_BK)
edca->queue_id = HIF_QUEUE_ID_BESTEFFORT;
hif_set_edca_queue_params(wvif, edca); hif_set_edca_queue_params(wvif, edca);
if (wvif->vif->type == NL80211_IFTYPE_STATION) { if (wvif->vif->type == NL80211_IFTYPE_STATION) {
...@@ -1393,44 +1399,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -1393,44 +1399,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
int i; int i;
struct wfx_dev *wdev = hw->priv; struct wfx_dev *wdev = hw->priv;
struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv;
// FIXME: parameters are set by kernel juste after interface_add.
// Keep struct hif_req_edca_queue_params blank?
struct hif_req_edca_queue_params default_edca_params[] = {
[IEEE80211_AC_VO] = {
.queue_id = HIF_QUEUE_ID_VOICE,
.aifsn = 2,
.cw_min = 3,
.cw_max = 7,
.tx_op_limit = TXOP_UNIT * 47,
},
[IEEE80211_AC_VI] = {
.queue_id = HIF_QUEUE_ID_VIDEO,
.aifsn = 2,
.cw_min = 7,
.cw_max = 15,
.tx_op_limit = TXOP_UNIT * 94,
},
[IEEE80211_AC_BE] = {
.queue_id = HIF_QUEUE_ID_BESTEFFORT,
.aifsn = 3,
.cw_min = 15,
.cw_max = 1023,
.tx_op_limit = TXOP_UNIT * 0,
},
[IEEE80211_AC_BK] = {
.queue_id = HIF_QUEUE_ID_BACKGROUND,
.aifsn = 7,
.cw_min = 15,
.cw_max = 1023,
.tx_op_limit = TXOP_UNIT * 0,
},
};
BUILD_BUG_ON(ARRAY_SIZE(default_edca_params) != ARRAY_SIZE(wvif->edca_params));
if (wfx_api_older_than(wdev, 2, 0)) {
default_edca_params[IEEE80211_AC_BE].queue_id = HIF_QUEUE_ID_BACKGROUND;
default_edca_params[IEEE80211_AC_BK].queue_id = HIF_QUEUE_ID_BESTEFFORT;
}
vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER | vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER |
IEEE80211_VIF_SUPPORTS_UAPSD | IEEE80211_VIF_SUPPORTS_UAPSD |
...@@ -1501,13 +1469,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -1501,13 +1469,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
mutex_unlock(&wdev->conf_mutex); mutex_unlock(&wdev->conf_mutex);
hif_set_macaddr(wvif, vif->addr); hif_set_macaddr(wvif, vif->addr);
for (i = 0; i < IEEE80211_NUM_ACS; i++) {
memcpy(&wvif->edca_params[i], &default_edca_params[i],
sizeof(default_edca_params[i]));
hif_set_edca_queue_params(wvif, &wvif->edca_params[i]);
}
wvif->uapsd_mask = 0;
hif_set_uapsd_info(wvif, wvif->uapsd_mask);
wfx_tx_policy_init(wvif); wfx_tx_policy_init(wvif);
wvif = NULL; wvif = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment