[PATCH 26/31] staging: wfx: drop macro API_SSID_SIZE

From: Jerome Pouiller
Date: Mon Sep 07 2020 - 06:20:04 EST


From: Jérôme Pouiller <jerome.pouiller@xxxxxxxxxx>

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@xxxxxxxxxx>
---
drivers/staging/wfx/hif_api_cmd.h | 8 +++-----
drivers/staging/wfx/hif_api_general.h | 2 --
drivers/staging/wfx/hif_tx.c | 2 --
3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h
index ef5483609dcb..7b365bd01b81 100644
--- a/drivers/staging/wfx/hif_api_cmd.h
+++ b/drivers/staging/wfx/hif_api_cmd.h
@@ -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;

diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h
index da63ba6f5148..c9e3c0f758c8 100644
--- a/drivers/staging/wfx/hif_api_general.h
+++ b/drivers/staging/wfx/hif_api_general.h
@@ -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

diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c
index 0553e79595a6..a75c6b9804ba 100644
--- a/drivers/staging/wfx/hif_tx.c
+++ b/drivers/staging/wfx/hif_tx.c
@@ -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++) {
--
2.28.0