Commit 9ba221b3 authored by Sara Sharon's avatar Sara Sharon Committed by Luca Coelho

iwlwifi: mvm: support new scan API

For CDB devices we will want to configure scan parameters
per band.
Support the new scan API for now. Logic per band will be
added in the future.
Signed-off-by: default avatarSara Sharon <sara.sharon@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 0e7ac018
...@@ -453,6 +453,8 @@ enum scan_config_flags { ...@@ -453,6 +453,8 @@ enum scan_config_flags {
SCAN_CONFIG_FLAG_CLEAR_CAM_MODE = BIT(19), SCAN_CONFIG_FLAG_CLEAR_CAM_MODE = BIT(19),
SCAN_CONFIG_FLAG_SET_PROMISC_MODE = BIT(20), SCAN_CONFIG_FLAG_SET_PROMISC_MODE = BIT(20),
SCAN_CONFIG_FLAG_CLEAR_PROMISC_MODE = BIT(21), SCAN_CONFIG_FLAG_CLEAR_PROMISC_MODE = BIT(21),
SCAN_CONFIG_FLAG_SET_LMAC2_FRAGMENTED = BIT(22),
SCAN_CONFIG_FLAG_CLEAR_LMAC2_FRAGMENTED = BIT(23),
/* Bits 26-31 are for num of channels in channel_array */ /* Bits 26-31 are for num of channels in channel_array */
#define SCAN_CONFIG_N_CHANNELS(n) ((n) << 26) #define SCAN_CONFIG_N_CHANNELS(n) ((n) << 26)
...@@ -485,6 +487,20 @@ enum iwl_channel_flags { ...@@ -485,6 +487,20 @@ enum iwl_channel_flags {
IWL_CHANNEL_FLAG_PRE_SCAN_PASSIVE2ACTIVE = BIT(3), IWL_CHANNEL_FLAG_PRE_SCAN_PASSIVE2ACTIVE = BIT(3),
}; };
/**
* struct iwl_scan_dwell
* @active: default dwell time for active scan
* @passive: default dwell time for passive scan
* @fragmented: default dwell time for fragmented scan
* @extended: default dwell time for channels 1, 6 and 11
*/
struct iwl_scan_dwell {
u8 active;
u8 passive;
u8 fragmented;
u8 extended;
} __packed;
/** /**
* struct iwl_scan_config * struct iwl_scan_config
* @flags: enum scan_config_flags * @flags: enum scan_config_flags
...@@ -493,10 +509,7 @@ enum iwl_channel_flags { ...@@ -493,10 +509,7 @@ enum iwl_channel_flags {
* @legacy_rates: default legacy rates - enum scan_config_rates * @legacy_rates: default legacy rates - enum scan_config_rates
* @out_of_channel_time: default max out of serving channel time * @out_of_channel_time: default max out of serving channel time
* @suspend_time: default max suspend time * @suspend_time: default max suspend time
* @dwell_active: default dwell time for active scan * @dwell: dwells for the scan
* @dwell_passive: default dwell time for passive scan
* @dwell_fragmented: default dwell time for fragmented scan
* @dwell_extended: default dwell time for channels 1, 6 and 11
* @mac_addr: default mac address to be used in probes * @mac_addr: default mac address to be used in probes
* @bcast_sta_id: the index of the station in the fw * @bcast_sta_id: the index of the station in the fw
* @channel_flags: default channel flags - enum iwl_channel_flags * @channel_flags: default channel flags - enum iwl_channel_flags
...@@ -510,16 +523,29 @@ struct iwl_scan_config { ...@@ -510,16 +523,29 @@ struct iwl_scan_config {
__le32 legacy_rates; __le32 legacy_rates;
__le32 out_of_channel_time; __le32 out_of_channel_time;
__le32 suspend_time; __le32 suspend_time;
u8 dwell_active; struct iwl_scan_dwell dwell;
u8 dwell_passive;
u8 dwell_fragmented;
u8 dwell_extended;
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
u8 bcast_sta_id; u8 bcast_sta_id;
u8 channel_flags; u8 channel_flags;
u8 channel_array[]; u8 channel_array[];
} __packed; /* SCAN_CONFIG_DB_CMD_API_S */ } __packed; /* SCAN_CONFIG_DB_CMD_API_S */
#define SCAN_TWO_LMACS 2
struct iwl_scan_config_cdb {
__le32 flags;
__le32 tx_chains;
__le32 rx_chains;
__le32 legacy_rates;
__le32 out_of_channel_time[SCAN_TWO_LMACS];
__le32 suspend_time[SCAN_TWO_LMACS];
struct iwl_scan_dwell dwell;
u8 mac_addr[ETH_ALEN];
u8 bcast_sta_id;
u8 channel_flags;
u8 channel_array[];
} __packed; /* SCAN_CONFIG_DB_CMD_API_S_3 */
/** /**
* iwl_umac_scan_flags * iwl_umac_scan_flags
*@IWL_UMAC_SCAN_FLAG_PREEMPTIVE: scan process triggered by this scan request *@IWL_UMAC_SCAN_FLAG_PREEMPTIVE: scan process triggered by this scan request
...@@ -551,6 +577,7 @@ enum iwl_umac_scan_general_flags { ...@@ -551,6 +577,7 @@ enum iwl_umac_scan_general_flags {
IWL_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED = BIT(8), IWL_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED = BIT(8),
IWL_UMAC_SCAN_GEN_FLAGS_MATCH = BIT(9), IWL_UMAC_SCAN_GEN_FLAGS_MATCH = BIT(9),
IWL_UMAC_SCAN_GEN_FLAGS_EXTENDED_DWELL = BIT(10), IWL_UMAC_SCAN_GEN_FLAGS_EXTENDED_DWELL = BIT(10),
IWL_UMAC_SCAN_GEN_FLAGS_LMAC2_FRAGMENTED = BIT(11),
}; };
/** /**
...@@ -610,8 +637,9 @@ struct iwl_scan_req_umac_tail { ...@@ -610,8 +637,9 @@ struct iwl_scan_req_umac_tail {
* @active_dwell: dwell time for active scan * @active_dwell: dwell time for active scan
* @passive_dwell: dwell time for passive scan * @passive_dwell: dwell time for passive scan
* @fragmented_dwell: dwell time for fragmented passive scan * @fragmented_dwell: dwell time for fragmented passive scan
* @max_out_time: max out of serving channel time * @max_out_time: max out of serving channel time, per LMAC - for CDB there
* @suspend_time: max suspend time * are 2 LMACs
* @suspend_time: max suspend time, per LMAC - for CDB there are 2 LMACs
* @scan_priority: scan internal prioritization &enum iwl_scan_priority * @scan_priority: scan internal prioritization &enum iwl_scan_priority
* @channel_flags: &enum iwl_scan_channel_flags * @channel_flags: &enum iwl_scan_channel_flags
* @n_channels: num of channels in scan request * @n_channels: num of channels in scan request
...@@ -631,6 +659,8 @@ struct iwl_scan_req_umac { ...@@ -631,6 +659,8 @@ struct iwl_scan_req_umac {
u8 active_dwell; u8 active_dwell;
u8 passive_dwell; u8 passive_dwell;
u8 fragmented_dwell; u8 fragmented_dwell;
union {
struct {
__le32 max_out_time; __le32 max_out_time;
__le32 suspend_time; __le32 suspend_time;
__le32 scan_priority; __le32 scan_priority;
...@@ -639,7 +669,23 @@ struct iwl_scan_req_umac { ...@@ -639,7 +669,23 @@ struct iwl_scan_req_umac {
u8 n_channels; u8 n_channels;
__le16 reserved; __le16 reserved;
u8 data[]; u8 data[];
} __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_1 */ } no_cdb; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_1 */
struct {
__le32 max_out_time[SCAN_TWO_LMACS];
__le32 suspend_time[SCAN_TWO_LMACS];
__le32 scan_priority;
/* SCAN_CHANNEL_PARAMS_API_S_VER_4 */
u8 channel_flags;
u8 n_channels;
__le16 reserved;
u8 data[];
} cdb; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_5 */
};
} __packed;
#define IWL_SCAN_REQ_UMAC_SIZE_CDB sizeof(struct iwl_scan_req_umac)
#define IWL_SCAN_REQ_UMAC_SIZE (sizeof(struct iwl_scan_req_umac) - \
2 * sizeof(__le32))
/** /**
* struct iwl_umac_scan_abort * struct iwl_umac_scan_abort
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment