]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
wifi: wcn36xx: Move capability bitmap to string translation function to firmware.c
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Wed, 27 Jul 2022 16:16:54 +0000 (17:16 +0100)
committerKalle Valo <quic_kvalo@quicinc.com>
Fri, 29 Jul 2022 13:24:38 +0000 (16:24 +0300)
Move wcn36xx_get_cap_name() function in main.c into firmware.c as
wcn36xx_firmware_get_cap_name().

Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220727161655.2286867-4-bryan.odonoghue@linaro.org
drivers/net/wireless/ath/wcn36xx/firmware.c
drivers/net/wireless/ath/wcn36xx/firmware.h
drivers/net/wireless/ath/wcn36xx/main.c

index 03b93d2bdcf96314bcc87443e0d1351a1b4720cf..4b7f439e4db58e201c181c997beaf98a5b07a769 100644 (file)
@@ -3,6 +3,81 @@
 #include "wcn36xx.h"
 #include "firmware.h"
 
+#define DEFINE(s)[s] = #s
+
+static const char * const wcn36xx_firmware_caps_names[] = {
+       DEFINE(MCC),
+       DEFINE(P2P),
+       DEFINE(DOT11AC),
+       DEFINE(SLM_SESSIONIZATION),
+       DEFINE(DOT11AC_OPMODE),
+       DEFINE(SAP32STA),
+       DEFINE(TDLS),
+       DEFINE(P2P_GO_NOA_DECOUPLE_INIT_SCAN),
+       DEFINE(WLANACTIVE_OFFLOAD),
+       DEFINE(BEACON_OFFLOAD),
+       DEFINE(SCAN_OFFLOAD),
+       DEFINE(ROAM_OFFLOAD),
+       DEFINE(BCN_MISS_OFFLOAD),
+       DEFINE(STA_POWERSAVE),
+       DEFINE(STA_ADVANCED_PWRSAVE),
+       DEFINE(AP_UAPSD),
+       DEFINE(AP_DFS),
+       DEFINE(BLOCKACK),
+       DEFINE(PHY_ERR),
+       DEFINE(BCN_FILTER),
+       DEFINE(RTT),
+       DEFINE(RATECTRL),
+       DEFINE(WOW),
+       DEFINE(WLAN_ROAM_SCAN_OFFLOAD),
+       DEFINE(SPECULATIVE_PS_POLL),
+       DEFINE(SCAN_SCH),
+       DEFINE(IBSS_HEARTBEAT_OFFLOAD),
+       DEFINE(WLAN_SCAN_OFFLOAD),
+       DEFINE(WLAN_PERIODIC_TX_PTRN),
+       DEFINE(ADVANCE_TDLS),
+       DEFINE(BATCH_SCAN),
+       DEFINE(FW_IN_TX_PATH),
+       DEFINE(EXTENDED_NSOFFLOAD_SLOT),
+       DEFINE(CH_SWITCH_V1),
+       DEFINE(HT40_OBSS_SCAN),
+       DEFINE(UPDATE_CHANNEL_LIST),
+       DEFINE(WLAN_MCADDR_FLT),
+       DEFINE(WLAN_CH144),
+       DEFINE(NAN),
+       DEFINE(TDLS_SCAN_COEXISTENCE),
+       DEFINE(LINK_LAYER_STATS_MEAS),
+       DEFINE(MU_MIMO),
+       DEFINE(EXTENDED_SCAN),
+       DEFINE(DYNAMIC_WMM_PS),
+       DEFINE(MAC_SPOOFED_SCAN),
+       DEFINE(BMU_ERROR_GENERIC_RECOVERY),
+       DEFINE(DISA),
+       DEFINE(FW_STATS),
+       DEFINE(WPS_PRBRSP_TMPL),
+       DEFINE(BCN_IE_FLT_DELTA),
+       DEFINE(TDLS_OFF_CHANNEL),
+       DEFINE(RTT3),
+       DEFINE(MGMT_FRAME_LOGGING),
+       DEFINE(ENHANCED_TXBD_COMPLETION),
+       DEFINE(LOGGING_ENHANCEMENT),
+       DEFINE(EXT_SCAN_ENHANCED),
+       DEFINE(MEMORY_DUMP_SUPPORTED),
+       DEFINE(PER_PKT_STATS_SUPPORTED),
+       DEFINE(EXT_LL_STAT),
+       DEFINE(WIFI_CONFIG),
+       DEFINE(ANTENNA_DIVERSITY_SELECTION),
+};
+
+#undef DEFINE
+
+const char *wcn36xx_firmware_get_cap_name(enum wcn36xx_firmware_feat_caps x)
+{
+       if (x >= ARRAY_SIZE(wcn36xx_firmware_caps_names))
+               return "UNKNOWN";
+       return wcn36xx_firmware_caps_names[x];
+}
+
 void wcn36xx_firmware_set_feat_caps(u32 *bitmap,
                                    enum wcn36xx_firmware_feat_caps cap)
 {
index 552c0e9325e186839953ccde2d34f2a322817dce..f991cf959f829f94e6ca35bb69c082fdf9f32439 100644 (file)
@@ -78,5 +78,7 @@ int wcn36xx_firmware_get_feat_caps(u32 *bitmap,
 void wcn36xx_firmware_clear_feat_caps(u32 *bitmap,
                                      enum wcn36xx_firmware_feat_caps cap);
 
+const char *wcn36xx_firmware_get_cap_name(enum wcn36xx_firmware_feat_caps x);
+
 #endif /* _FIRMWARE_H_ */
 
index da56ac1c2d9ea22d89d95a2146073b595ccfba04..6b8d2889d73f4406fe3b925cd720377ee740ba8c 100644 (file)
@@ -193,88 +193,15 @@ static inline u8 get_sta_index(struct ieee80211_vif *vif,
               sta_priv->sta_index;
 }
 
-#define DEFINE(s) [s] = #s
-
-static const char * const wcn36xx_caps_names[] = {
-       DEFINE(MCC),
-       DEFINE(P2P),
-       DEFINE(DOT11AC),
-       DEFINE(SLM_SESSIONIZATION),
-       DEFINE(DOT11AC_OPMODE),
-       DEFINE(SAP32STA),
-       DEFINE(TDLS),
-       DEFINE(P2P_GO_NOA_DECOUPLE_INIT_SCAN),
-       DEFINE(WLANACTIVE_OFFLOAD),
-       DEFINE(BEACON_OFFLOAD),
-       DEFINE(SCAN_OFFLOAD),
-       DEFINE(ROAM_OFFLOAD),
-       DEFINE(BCN_MISS_OFFLOAD),
-       DEFINE(STA_POWERSAVE),
-       DEFINE(STA_ADVANCED_PWRSAVE),
-       DEFINE(AP_UAPSD),
-       DEFINE(AP_DFS),
-       DEFINE(BLOCKACK),
-       DEFINE(PHY_ERR),
-       DEFINE(BCN_FILTER),
-       DEFINE(RTT),
-       DEFINE(RATECTRL),
-       DEFINE(WOW),
-       DEFINE(WLAN_ROAM_SCAN_OFFLOAD),
-       DEFINE(SPECULATIVE_PS_POLL),
-       DEFINE(SCAN_SCH),
-       DEFINE(IBSS_HEARTBEAT_OFFLOAD),
-       DEFINE(WLAN_SCAN_OFFLOAD),
-       DEFINE(WLAN_PERIODIC_TX_PTRN),
-       DEFINE(ADVANCE_TDLS),
-       DEFINE(BATCH_SCAN),
-       DEFINE(FW_IN_TX_PATH),
-       DEFINE(EXTENDED_NSOFFLOAD_SLOT),
-       DEFINE(CH_SWITCH_V1),
-       DEFINE(HT40_OBSS_SCAN),
-       DEFINE(UPDATE_CHANNEL_LIST),
-       DEFINE(WLAN_MCADDR_FLT),
-       DEFINE(WLAN_CH144),
-       DEFINE(NAN),
-       DEFINE(TDLS_SCAN_COEXISTENCE),
-       DEFINE(LINK_LAYER_STATS_MEAS),
-       DEFINE(MU_MIMO),
-       DEFINE(EXTENDED_SCAN),
-       DEFINE(DYNAMIC_WMM_PS),
-       DEFINE(MAC_SPOOFED_SCAN),
-       DEFINE(BMU_ERROR_GENERIC_RECOVERY),
-       DEFINE(DISA),
-       DEFINE(FW_STATS),
-       DEFINE(WPS_PRBRSP_TMPL),
-       DEFINE(BCN_IE_FLT_DELTA),
-       DEFINE(TDLS_OFF_CHANNEL),
-       DEFINE(RTT3),
-       DEFINE(MGMT_FRAME_LOGGING),
-       DEFINE(ENHANCED_TXBD_COMPLETION),
-       DEFINE(LOGGING_ENHANCEMENT),
-       DEFINE(EXT_SCAN_ENHANCED),
-       DEFINE(MEMORY_DUMP_SUPPORTED),
-       DEFINE(PER_PKT_STATS_SUPPORTED),
-       DEFINE(EXT_LL_STAT),
-       DEFINE(WIFI_CONFIG),
-       DEFINE(ANTENNA_DIVERSITY_SELECTION),
-};
-
-#undef DEFINE
-
-static const char *wcn36xx_get_cap_name(enum wcn36xx_firmware_feat_caps x)
-{
-       if (x >= ARRAY_SIZE(wcn36xx_caps_names))
-               return "UNKNOWN";
-       return wcn36xx_caps_names[x];
-}
-
 static void wcn36xx_feat_caps_info(struct wcn36xx *wcn)
 {
        int i;
 
        for (i = 0; i < MAX_FEATURE_SUPPORTED; i++) {
-               if (wcn36xx_firmware_get_feat_caps(wcn->fw_feat_caps, i))
-                       wcn36xx_dbg(WCN36XX_DBG_MAC, "FW Cap %s\n", wcn36xx_get_cap_name(i));
+               if (wcn36xx_firmware_get_feat_caps(wcn->fw_feat_caps, i)) {
+                       wcn36xx_dbg(WCN36XX_DBG_MAC, "FW Cap %s\n",
+                                   wcn36xx_firmware_get_cap_name(i));
+               }
        }
 }