staging: wfx: drop macro API_SSID_SIZE
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Mon, 7 Sep 2020 10:15:16 +0000 (12:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2020 07:23:05 +0000 (09:23 +0200)
The maximum length of a SSID is defined by 802.11 specification. It is
already defined in mac80211: IEEE80211_MAX_SSID_LEN. Therefore, use this
generic definition.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200907101521.66082-27-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wfx/hif_api_cmd.h
drivers/staging/wfx/hif_api_general.h
drivers/staging/wfx/hif_tx.c

index ef54836..7b365bd 100644 (file)
@@ -12,8 +12,6 @@
 
 #include "hif_api_general.h"
 
-#define HIF_API_SSID_SIZE                      API_SSID_SIZE
-
 enum hif_requests_ids {
        HIF_REQ_ID_RESET                = 0x0a,
        HIF_REQ_ID_READ_MIB             = 0x05,
@@ -111,7 +109,7 @@ struct hif_cnf_update_ie {
 
 struct hif_ssid_def {
        __le32 ssid_length;
-       u8     ssid[HIF_API_SSID_SIZE];
+       u8     ssid[IEEE80211_MAX_SSID_LEN];
 } __packed;
 
 #define HIF_API_MAX_NB_SSIDS                           2
@@ -307,7 +305,7 @@ struct hif_req_join {
        u8     force_with_ind:1;
        u8     reserved6:4;
        __le32 ssid_length;
-       u8     ssid[HIF_API_SSID_SIZE];
+       u8     ssid[IEEE80211_MAX_SSID_LEN];
        __le32 beacon_interval;
        __le32 basic_rate_set;
 } __packed;
@@ -364,7 +362,7 @@ struct hif_req_start {
        u8     reserved3:7;
        u8     reserved4;
        u8     ssid_length;
-       u8     ssid[HIF_API_SSID_SIZE];
+       u8     ssid[IEEE80211_MAX_SSID_LEN];
        __le32 basic_rate_set;
 } __packed;
 
index da63ba6..c9e3c0f 100644 (file)
@@ -17,8 +17,6 @@
 #define __packed __attribute__((__packed__))
 #endif
 
-#define API_SSID_SIZE             32
-
 #define HIF_ID_IS_INDICATION      0x80
 #define HIF_COUNTER_MAX           7
 
index 0553e79..a75c6b9 100644 (file)
@@ -245,8 +245,6 @@ int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
        WARN(chan_num > HIF_API_MAX_NB_CHANNELS, "invalid params");
        WARN(req->n_ssids > HIF_API_MAX_NB_SSIDS, "invalid params");
 
-       compiletime_assert(IEEE80211_MAX_SSID_LEN == HIF_API_SSID_SIZE,
-                          "API inconsistency");
        if (!hif)
                return -ENOMEM;
        for (i = 0; i < req->n_ssids; i++) {