@@ -441,6 +441,45 @@ struct wpa_cred {
#define CFG_CHANGED_BGSCAN BIT(20)
#define CFG_CHANGED_FT_PREPEND_PMKID BIT(21)
+/**
+ * p2p_go_freq_change_policy - The GO frequency change policy
+ *
+ * This controls the behavior of the GO when there is a change in the
+ * map of the currently used frequencies in case more than one channel
+ * is supported.
+ *
+ * @P2P_GO_FREQ_MOVE_SCM: Prefer working in a single channel mode if
+ * possible. In case the GO is the only interface using its frequency
+ * and there are other station interfaces on other frequencies, the GO
+ * will migrate to one of these frequencies.
+ *
+ * @P2P_GO_FREQ_MOVE_SCM_PEER_SUPPORTS: Same as P2P_GO_FREQ_MOVE_SCM,
+ * but a transition is possible only in case one of the other used
+ * frequencies is one of the frequencies in the intersection of the
+ * frequency list of the local device and the peer device.
+ *
+ * @P2P_GO_FREQ_MOVE_STAY: Prefer to stay on the current frequency.
+ *
+ * @P2P_GO_FREQ_MOVE_SCM_ECSA: Same as
+ * P2P_GO_FREQ_MOVE_SCM_PEER_SUPPORTS but a transition is possible only
+ * if all the group members advertise eCSA support.
+ */
+enum p2p_go_freq_change_policy {
+ P2P_GO_FREQ_MOVE_SCM = 0,
+ P2P_GO_FREQ_MOVE_SCM_PEER_SUPPORTS = 1,
+ P2P_GO_FREQ_MOVE_STAY = 2,
+ P2P_GO_FREQ_MOVE_SCM_ECSA = 3,
+ P2P_GO_FREQ_MOVE_MAX = P2P_GO_FREQ_MOVE_SCM_ECSA,
+};
+
+enum mld_connect_band_pref {
+ MLD_CONNECT_BAND_PREF_AUTO = 0,
+ MLD_CONNECT_BAND_PREF_2GHZ = 1,
+ MLD_CONNECT_BAND_PREF_5GHZ = 2,
+ MLD_CONNECT_BAND_PREF_6GHZ = 3,
+ MLD_CONNECT_BAND_PREF_MAX = 4,
+};
+
/**
* struct wpa_config - wpa_supplicant configuration data
*
@@ -448,6 +487,9 @@ struct wpa_cred {
* data. In many cases, there is only one struct wpa_config instance,
but if
* more than one network interface is being controlled, one instance
is used
* for each.
+ *
+ * Warning: Pay attention to using enums in the structure as treating
enums as ints
+ * in the config parser could be dangerous if sizeof(enum) != sizeof(int).
*/
struct wpa_config {
/**
@@ -888,33 +930,9 @@ struct wpa_config {
/**
* p2p_go_freq_change_policy - The GO frequency change policy
*
- * This controls the behavior of the GO when there is a change in the
- * map of the currently used frequencies in case more than one channel
- * is supported.
- *
- * @P2P_GO_FREQ_MOVE_SCM: Prefer working in a single channel mode if
- * possible. In case the GO is the only interface using its frequency
- * and there are other station interfaces on other frequencies, the GO
- * will migrate to one of these frequencies.
- *
- * @P2P_GO_FREQ_MOVE_SCM_PEER_SUPPORTS: Same as P2P_GO_FREQ_MOVE_SCM,
- * but a transition is possible only in case one of the other used
- * frequencies is one of the frequencies in the intersection of the
- * frequency list of the local device and the peer device.
- *
- * @P2P_GO_FREQ_MOVE_STAY: Prefer to stay on the current frequency.
- *
- * @P2P_GO_FREQ_MOVE_SCM_ECSA: Same as
- * P2P_GO_FREQ_MOVE_SCM_PEER_SUPPORTS but a transition is possible only
- * if all the group members advertise eCSA support.
+ * Enumerations are defined in enum p2p_go_freq_change_policy.
*/
- enum {
- P2P_GO_FREQ_MOVE_SCM = 0,
- P2P_GO_FREQ_MOVE_SCM_PEER_SUPPORTS = 1,
- P2P_GO_FREQ_MOVE_STAY = 2,
- P2P_GO_FREQ_MOVE_SCM_ECSA = 3,
- P2P_GO_FREQ_MOVE_MAX = P2P_GO_FREQ_MOVE_SCM_ECSA,
- } p2p_go_freq_change_policy;
+ int p2p_go_freq_change_policy;
#define DEFAULT_P2P_GO_FREQ_MOVE P2P_GO_FREQ_MOVE_STAY
@@ -1261,12 +1279,13 @@ struct wpa_config {
/**
* pmf - Whether to enable/require PMF by default
*
+ * Enumerations are defined in enum mfp_options.
* By default, PMF is disabled unless enabled by the per-network
* ieee80211w=1 or ieee80211w=2 parameter. pmf=1/2 can be used to
change
* this default behavior for RSN network (this is not applicable for
* non-RSN cases).
*/
- enum mfp_options pmf;
+ int pmf;
/**
* sae_check_mfp - Whether to limit SAE based on PMF capabilities
@@ -1299,11 +1318,12 @@ struct wpa_config {
/**
* sae_pwe - SAE mechanism for PWE derivation
+ * Enumerations are defined in enum sae_pwe.
* 0 = hunting-and-pecking loop only
* 1 = hash-to-element only
* 2 = both hunting-and-pecking loop and hash-to-element enabled
*/
- enum sae_pwe sae_pwe;
+ int sae_pwe;
/**
* sae_pmkid_in_assoc - Whether to include PMKID in SAE Assoc Req
@@ -1415,6 +1435,7 @@ struct wpa_config {
/**
* mac_addr - MAC address policy default
*
+ * Enumerations are defined in enum wpas_mac_addr_style.
* 0 = use permanent MAC address
* 1 = use random MAC address for each ESS connection
* 2 = like 1, but maintain OUI (with local admin bit set)
@@ -1423,7 +1444,7 @@ struct wpa_config {
* the per-network mac_addr parameter. Global mac_addr=1 can be
used to
* change this default behavior.
*/
- enum wpas_mac_addr_style mac_addr;
+ int mac_addr;
/**
* rand_addr_lifetime - Lifetime of random MAC address in seconds
@@ -1433,11 +1454,12 @@ struct wpa_config {
/**
* preassoc_mac_addr - Pre-association MAC address policy
*
+ * Enumerations are defined in enum wpas_mac_addr_style.
* 0 = use permanent MAC address
* 1 = use random MAC address
* 2 = like 1, but maintain OUI (with local admin bit set)
*/
- enum wpas_mac_addr_style preassoc_mac_addr;
+ int preassoc_mac_addr;
/**
* key_mgmt_offload - Use key management offload
@@ -1573,8 +1595,10 @@ struct wpa_config {
/**
* mbo_cell_capa - Cellular capabilities for MBO
+ *
+ * Enumerations are defined in enum mbo_cellular_capa.
*/
- enum mbo_cellular_capa mbo_cell_capa;
+ int mbo_cell_capa;
/**
* disassoc_imminent_rssi_threshold - RSSI threshold of candidate AP
@@ -1635,11 +1659,12 @@ struct wpa_config {
/**
* gas_rand_mac_addr - GAS MAC address policy
*
+ * Enumerations are defined in enum wpas_mac_addr_style.
* 0 = use permanent MAC address
* 1 = use random MAC address
* 2 = like 1, but maintain OUI (with local admin bit set)
*/
- enum wpas_mac_addr_style gas_rand_mac_addr;
+ int gas_rand_mac_addr;
/**
* dpp_config_processing - How to process DPP configuration
@@ -1789,13 +1814,8 @@ struct wpa_config {
#endif /* CONFIG_PASN*/
#ifdef CONFIG_TESTING_OPTIONS
- enum {
- MLD_CONNECT_BAND_PREF_AUTO = 0,
- MLD_CONNECT_BAND_PREF_2GHZ = 1,
- MLD_CONNECT_BAND_PREF_5GHZ = 2,
- MLD_CONNECT_BAND_PREF_6GHZ = 3,
- MLD_CONNECT_BAND_PREF_MAX = 4,
- } mld_connect_band_pref;
+ /* Enumerations are defined in enum mld_connect_band_pref. */
+ int mld_connect_band_pref;
u8 mld_connect_bssid_pref[ETH_ALEN];
@@ -86,6 +86,9 @@ enum wpas_mac_addr_style {
* data is included in the per-interface configuration data as an
element of
* the network list, struct wpa_config::ssid. Each network block in the
* configuration is mapped to a struct wpa_ssid instance.
+ *
+ * Warning: Pay attention to using enums in the structure as treating
enums as ints
+ * in the config parser could be dangerous if sizeof(enum) != sizeof(int).
*/