staging: wfx: better naming for hif_req_join->short_preamble
authorJérôme Pouiller <jerome.pouiller@silabs.com>
Tue, 17 Dec 2019 16:15:05 +0000 (16:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Dec 2019 14:56:09 +0000 (15:56 +0100)
HIF_PREAMBLE_SHORT_LONG12 is never used. So it is possible to change
"preamble_type" into a boolean and drop "enum hif_preamble".

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191217161318.31402-28-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_mib.h
drivers/staging/wfx/sta.c

index e848bd3..fc078d5 100644 (file)
@@ -377,12 +377,6 @@ struct hif_cnf_edca_queue_params {
        u32   status;
 } __packed;
 
-enum hif_preamble {
-       HIF_PREAMBLE_LONG                          = 0x0,
-       HIF_PREAMBLE_SHORT                         = 0x1,
-       HIF_PREAMBLE_SHORT_LONG12                  = 0x2
-};
-
 struct hif_join_flags {
        u8    reserved1:2;
        u8    force_no_beacon:1;
@@ -397,9 +391,10 @@ struct hif_req_join {
        u16   channel_number;
        u8    bssid[ETH_ALEN];
        u16   atim_window;
-       u8    preamble_type;
+       u8    short_preamble:1;
+       u8    reserved2:7;
        u8    probe_for_join;
-       u8    reserved;
+       u8    reserved3;
        struct hif_join_flags join_flags;
        u32   ssid_length;
        u8    ssid[HIF_API_SSID_SIZE];
@@ -462,8 +457,9 @@ struct hif_req_start {
        u32   reserved1;
        u32   beacon_interval;
        u8    dtim_period;
-       u8    preamble_type;
-       u8    reserved2;
+       u8    short_preamble:1;
+       u8    reserved2:7;
+       u8    reserved3;
        u8    ssid_length;
        u8    ssid[HIF_API_SSID_SIZE];
        u32   basic_rate_set;
index 94b789c..34e4310 100644 (file)
@@ -471,8 +471,9 @@ struct hif_mib_set_association_mode {
        u8    mode:1;
        u8    rateset:1;
        u8    spacing:1;
-       u8    reserved:4;
-       u8    preamble_type;
+       u8    reserved1:4;
+       u8    short_preamble:1;
+       u8    reserved2:7;
        u8    mixed_or_greenfield_type;
        u8    mpdu_start_spacing;
        u32   basic_rate_set;
index 23ec7a4..e5c9336 100644 (file)
@@ -652,7 +652,7 @@ static void wfx_do_join(struct wfx_vif *wvif)
        struct cfg80211_bss *bss = NULL;
        struct hif_req_join join = {
                .infrastructure_bss_mode = !conf->ibss_joined,
-               .preamble_type = conf->use_short_preamble ? HIF_PREAMBLE_SHORT : HIF_PREAMBLE_LONG,
+               .short_preamble = conf->use_short_preamble,
                .probe_for_join = 1,
                .atim_window = 0,
                .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev,
@@ -843,7 +843,7 @@ static int wfx_start_ap(struct wfx_vif *wvif)
                .channel_number = wvif->channel->hw_value,
                .beacon_interval = conf->beacon_int,
                .dtim_period = conf->dtim_period,
-               .preamble_type = conf->use_short_preamble ? HIF_PREAMBLE_SHORT : HIF_PREAMBLE_LONG,
+               .short_preamble = conf->use_short_preamble,
                .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev,
                                                      conf->basic_rates),
        };
@@ -994,7 +994,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
        association_mode.mode = 1;
        association_mode.rateset = 1;
        association_mode.spacing = 1;
-       association_mode.preamble_type = info->use_short_preamble ? HIF_PREAMBLE_SHORT : HIF_PREAMBLE_LONG;
+       association_mode.short_preamble = info->use_short_preamble;
        association_mode.basic_rate_set = cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, info->basic_rates));
        association_mode.mixed_or_greenfield_type = wfx_ht_greenfield(&wvif->ht_info);
        association_mode.mpdu_start_spacing = wfx_ht_ampdu_density(&wvif->ht_info);