staging: wfx: relocate LINK_ID_NO_ASSOC and MAX_STA_IN_AP_MODE to hif API
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Mon, 6 Apr 2020 11:17:47 +0000 (13:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Apr 2020 12:32:35 +0000 (14:32 +0200)
The definitions LINK_ID_NO_ASSOC and MAX_STA_IN_AP_MODE are imposed by
the hardware. Therefore, they should be located in the hardware
interface API.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200406111756.154086-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/data_tx.c
drivers/staging/wfx/hif_api_cmd.h
drivers/staging/wfx/main.c
drivers/staging/wfx/queue.h
drivers/staging/wfx/sta.c

index c88d14fe614b4c28c13f6b6568cd4344ebbaabf0..757e37454391d8668d40ef78e207c1e5e077fc59 100644 (file)
@@ -246,7 +246,7 @@ static u8 wfx_tx_get_link_id(struct wfx_vif *wvif, struct ieee80211_sta *sta,
                return 0;
        if (is_multicast_ether_addr(da))
                return 0;
-       return WFX_LINK_ID_NO_ASSOC;
+       return HIF_LINK_ID_NOT_ASSOCIATED;
 }
 
 static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates)
index 071b71e2a107db32ab5d8dfbc69675add745f136..f6934598f3198244bc7dabcf68022791f575cded 100644 (file)
@@ -480,6 +480,9 @@ struct hif_cnf_beacon_transmit {
        u32   status;
 } __packed;
 
+#define HIF_LINK_ID_MAX            14
+#define HIF_LINK_ID_NOT_ASSOCIATED (HIF_LINK_ID_MAX + 1)
+
 enum hif_sta_map_direction {
        HIF_STA_MAP                       = 0x0,
        HIF_STA_UNMAP                     = 0x1
index 738016d45d630f12a3cf279f87996459b9d433f9..1e9f6da7502439add019cc707a7e07d1a7fa6582 100644 (file)
@@ -313,7 +313,7 @@ struct wfx_dev *wfx_init_common(struct device *dev,
        hw->wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD;
        hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD;
        hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
-       hw->wiphy->max_ap_assoc_sta = WFX_MAX_STA_IN_AP_MODE;
+       hw->wiphy->max_ap_assoc_sta = HIF_LINK_ID_MAX;
        hw->wiphy->max_scan_ssids = 2;
        hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
        hw->wiphy->n_iface_combinations = ARRAY_SIZE(wfx_iface_combinations);
index ab45e32cbfbc91b236595c65b4389968403d8261..1020dfde399b8c4dbe55a4cd1ff5a241258a05a2 100644 (file)
@@ -13,9 +13,6 @@
 
 #include "hif_api_cmd.h"
 
-#define WFX_MAX_STA_IN_AP_MODE    14
-#define WFX_LINK_ID_NO_ASSOC      15
-
 struct wfx_dev;
 struct wfx_vif;
 
index 2e8d3f571c3eb8b032fa47972bb97ce0d78fb023..64cf5812266170fe593d192cd5a401837f9fa051 100644 (file)
@@ -563,7 +563,7 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        sta_priv->link_id = ffz(wvif->link_id_map);
        wvif->link_id_map |= BIT(sta_priv->link_id);
        WARN_ON(!sta_priv->link_id);
-       WARN_ON(sta_priv->link_id >= WFX_MAX_STA_IN_AP_MODE);
+       WARN_ON(sta_priv->link_id >= HIF_LINK_ID_MAX);
        hif_map_link(wvif, sta->addr, 0, sta_priv->link_id);
 
        return 0;