aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h256
1 files changed, 222 insertions, 34 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
index 6959fda3fe09..c02a9e45ec5e 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
@@ -170,18 +170,12 @@ enum iwl_scan_type {
170}; /* SCAN_ACTIVITY_TYPE_E_VER_1 */ 170}; /* SCAN_ACTIVITY_TYPE_E_VER_1 */
171 171
172/** 172/**
173 * Maximal number of channels to scan
174 * it should be equal to:
175 * max(IWL_NUM_CHANNELS, IWL_NUM_CHANNELS_FAMILY_8000)
176 */
177#define MAX_NUM_SCAN_CHANNELS 50
178
179/**
180 * struct iwl_scan_cmd - scan request command 173 * struct iwl_scan_cmd - scan request command
181 * ( SCAN_REQUEST_CMD = 0x80 ) 174 * ( SCAN_REQUEST_CMD = 0x80 )
182 * @len: command length in bytes 175 * @len: command length in bytes
183 * @scan_flags: scan flags from SCAN_FLAGS_* 176 * @scan_flags: scan flags from SCAN_FLAGS_*
184 * @channel_count: num of channels in channel list (1 - MAX_NUM_SCAN_CHANNELS) 177 * @channel_count: num of channels in channel list
178 * (1 - ucode_capa.n_scan_channels)
185 * @quiet_time: in msecs, dwell this time for active scan on quiet channels 179 * @quiet_time: in msecs, dwell this time for active scan on quiet channels
186 * @quiet_plcp_th: quiet PLCP threshold (channel is quiet if less than 180 * @quiet_plcp_th: quiet PLCP threshold (channel is quiet if less than
187 * this number of packets were received (typically 1) 181 * this number of packets were received (typically 1)
@@ -345,7 +339,7 @@ struct iwl_scan_results_notif {
345 * @last_channel: last channel that was scanned 339 * @last_channel: last channel that was scanned
346 * @tsf_low: TSF timer (lower half) in usecs 340 * @tsf_low: TSF timer (lower half) in usecs
347 * @tsf_high: TSF timer (higher half) in usecs 341 * @tsf_high: TSF timer (higher half) in usecs
348 * @results: all scan results, only "scanned_channels" of them are valid 342 * @results: array of scan results, only "scanned_channels" of them are valid
349 */ 343 */
350struct iwl_scan_complete_notif { 344struct iwl_scan_complete_notif {
351 u8 scanned_channels; 345 u8 scanned_channels;
@@ -354,11 +348,10 @@ struct iwl_scan_complete_notif {
354 u8 last_channel; 348 u8 last_channel;
355 __le32 tsf_low; 349 __le32 tsf_low;
356 __le32 tsf_high; 350 __le32 tsf_high;
357 struct iwl_scan_results_notif results[MAX_NUM_SCAN_CHANNELS]; 351 struct iwl_scan_results_notif results[];
358} __packed; /* SCAN_COMPLETE_NTF_API_S_VER_2 */ 352} __packed; /* SCAN_COMPLETE_NTF_API_S_VER_2 */
359 353
360/* scan offload */ 354/* scan offload */
361#define IWL_MAX_SCAN_CHANNELS 40
362#define IWL_SCAN_MAX_BLACKLIST_LEN 64 355#define IWL_SCAN_MAX_BLACKLIST_LEN 64
363#define IWL_SCAN_SHORT_BLACKLIST_LEN 16 356#define IWL_SCAN_SHORT_BLACKLIST_LEN 16
364#define IWL_SCAN_MAX_PROFILES 11 357#define IWL_SCAN_MAX_PROFILES 11
@@ -423,36 +416,24 @@ enum iwl_scan_offload_channel_flags {
423 IWL_SCAN_OFFLOAD_CHANNEL_PARTIAL = BIT(25), 416 IWL_SCAN_OFFLOAD_CHANNEL_PARTIAL = BIT(25),
424}; 417};
425 418
426/** 419/* channel configuration for struct iwl_scan_offload_cfg. Each channels needs:
427 * iwl_scan_channel_cfg - SCAN_CHANNEL_CFG_S 420 * __le32 type: bitmap; bits 1-20 are for directed scan to i'th ssid and
428 * @type: bitmap - see enum iwl_scan_offload_channel_flags. 421 * see enum iwl_scan_offload_channel_flags.
429 * 0: passive (0) or active (1) scan. 422 * __le16 channel_number: channel number 1-13 etc.
430 * 1-20: directed scan to i'th ssid. 423 * __le16 iter_count: repetition count for the channel.
431 * 22: channel width configuation - 1 for narrow. 424 * __le32 iter_interval: interval between two innteration on one channel.
432 * 24: full scan. 425 * u8 active_dwell.
433 * 25: partial scan. 426 * u8 passive_dwell.
434 * @channel_number: channel number 1-13 etc.
435 * @iter_count: repetition count for the channel.
436 * @iter_interval: interval between two innteration on one channel.
437 * @dwell_time: entry 0 - active scan, entry 1 - passive scan.
438 */ 427 */
439struct iwl_scan_channel_cfg { 428#define IWL_SCAN_CHAN_SIZE 14
440 __le32 type[IWL_MAX_SCAN_CHANNELS];
441 __le16 channel_number[IWL_MAX_SCAN_CHANNELS];
442 __le16 iter_count[IWL_MAX_SCAN_CHANNELS];
443 __le32 iter_interval[IWL_MAX_SCAN_CHANNELS];
444 u8 dwell_time[IWL_MAX_SCAN_CHANNELS][2];
445} __packed;
446 429
447/** 430/**
448 * iwl_scan_offload_cfg - SCAN_OFFLOAD_CONFIG_API_S 431 * iwl_scan_offload_cfg - SCAN_OFFLOAD_CONFIG_API_S
449 * @scan_cmd: scan command fixed part 432 * @scan_cmd: scan command fixed part
450 * @channel_cfg: scan channel configuration 433 * @data: scan channel configuration and probe request frames
451 * @data: probe request frames (one per band)
452 */ 434 */
453struct iwl_scan_offload_cfg { 435struct iwl_scan_offload_cfg {
454 struct iwl_scan_offload_cmd scan_cmd; 436 struct iwl_scan_offload_cmd scan_cmd;
455 struct iwl_scan_channel_cfg channel_cfg;
456 u8 data[0]; 437 u8 data[0];
457} __packed; 438} __packed;
458 439
@@ -528,7 +509,7 @@ struct iwl_scan_offload_profile_cfg {
528 * @full_scan_mul: number of partial scans before each full scan 509 * @full_scan_mul: number of partial scans before each full scan
529 */ 510 */
530struct iwl_scan_offload_schedule { 511struct iwl_scan_offload_schedule {
531 u16 delay; 512 __le16 delay;
532 u8 iterations; 513 u8 iterations;
533 u8 full_scan_mul; 514 u8 full_scan_mul;
534} __packed; 515} __packed;
@@ -601,4 +582,211 @@ struct iwl_sched_scan_results {
601 u8 reserved; 582 u8 reserved;
602}; 583};
603 584
585/* Unified LMAC scan API */
586
587#define IWL_MVM_BASIC_PASSIVE_DWELL 110
588
589/**
590 * iwl_scan_req_tx_cmd - SCAN_REQ_TX_CMD_API_S
591 * @tx_flags: combination of TX_CMD_FLG_*
592 * @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is
593 * cleared. Combination of RATE_MCS_*
594 * @sta_id: index of destination station in FW station table
595 * @reserved: for alignment and future use
596 */
597struct iwl_scan_req_tx_cmd {
598 __le32 tx_flags;
599 __le32 rate_n_flags;
600 u8 sta_id;
601 u8 reserved[3];
602} __packed;
603
604enum iwl_scan_channel_flags_lmac {
605 IWL_UNIFIED_SCAN_CHANNEL_FULL = BIT(27),
606 IWL_UNIFIED_SCAN_CHANNEL_PARTIAL = BIT(28),
607};
608
609/**
610 * iwl_scan_channel_cfg_lmac - SCAN_CHANNEL_CFG_S_VER2
611 * @flags: bits 1-20: directed scan to i'th ssid
612 * other bits &enum iwl_scan_channel_flags_lmac
613 * @channel_number: channel number 1-13 etc
614 * @iter_count: scan iteration on this channel
615 * @iter_interval: interval in seconds between iterations on one channel
616 */
617struct iwl_scan_channel_cfg_lmac {
618 __le32 flags;
619 __le16 channel_num;
620 __le16 iter_count;
621 __le32 iter_interval;
622} __packed;
623
624/*
625 * iwl_scan_probe_segment - PROBE_SEGMENT_API_S_VER_1
626 * @offset: offset in the data block
627 * @len: length of the segment
628 */
629struct iwl_scan_probe_segment {
630 __le16 offset;
631 __le16 len;
632} __packed;
633
634/* iwl_scan_probe_req - PROBE_REQUEST_FRAME_API_S_VER_2
635 * @mac_header: first (and common) part of the probe
636 * @band_data: band specific data
637 * @common_data: last (and common) part of the probe
638 * @buf: raw data block
639 */
640struct iwl_scan_probe_req {
641 struct iwl_scan_probe_segment mac_header;
642 struct iwl_scan_probe_segment band_data[2];
643 struct iwl_scan_probe_segment common_data;
644 u8 buf[SCAN_OFFLOAD_PROBE_REQ_SIZE];
645} __packed;
646
647enum iwl_scan_channel_flags {
648 IWL_SCAN_CHANNEL_FLAG_EBS = BIT(0),
649 IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE = BIT(1),
650 IWL_SCAN_CHANNEL_FLAG_CACHE_ADD = BIT(2),
651};
652
653/* iwl_scan_channel_opt - CHANNEL_OPTIMIZATION_API_S
654 * @flags: enum iwl_scan_channel_flgs
655 * @non_ebs_ratio: how many regular scan iteration before EBS
656 */
657struct iwl_scan_channel_opt {
658 __le16 flags;
659 __le16 non_ebs_ratio;
660} __packed;
661
662/**
663 * iwl_mvm_lmac_scan_flags
664 * @IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL: pass all beacons and probe responses
665 * without filtering.
666 * @IWL_MVM_LMAC_SCAN_FLAG_PASSIVE: force passive scan on all channels
667 * @IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION: single channel scan
668 * @IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE: send iteration complete notification
669 * @IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS multiple SSID matching
670 * @IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED: all passive scans will be fragmented
671 */
672enum iwl_mvm_lmac_scan_flags {
673 IWL_MVM_LMAC_SCAN_FLAG_PASS_ALL = BIT(0),
674 IWL_MVM_LMAC_SCAN_FLAG_PASSIVE = BIT(1),
675 IWL_MVM_LMAC_SCAN_FLAG_PRE_CONNECTION = BIT(2),
676 IWL_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE = BIT(3),
677 IWL_MVM_LMAC_SCAN_FLAG_MULTIPLE_SSIDS = BIT(4),
678 IWL_MVM_LMAC_SCAN_FLAG_FRAGMENTED = BIT(5),
679};
680
681enum iwl_scan_priority {
682 IWL_SCAN_PRIORITY_LOW,
683 IWL_SCAN_PRIORITY_MEDIUM,
684 IWL_SCAN_PRIORITY_HIGH,
685};
686
687/**
688 * iwl_scan_req_unified_lmac - SCAN_REQUEST_CMD_API_S_VER_1
689 * @reserved1: for alignment and future use
690 * @channel_num: num of channels to scan
691 * @active-dwell: dwell time for active channels
692 * @passive-dwell: dwell time for passive channels
693 * @fragmented-dwell: dwell time for fragmented passive scan
694 * @reserved2: for alignment and future use
695 * @rx_chain_selct: PHY_RX_CHAIN_* flags
696 * @scan_flags: &enum iwl_mvm_lmac_scan_flags
697 * @max_out_time: max time (in TU) to be out of associated channel
698 * @suspend_time: pause scan this long (TUs) when returning to service channel
699 * @flags: RXON flags
700 * @filter_flags: RXON filter
701 * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz
702 * @direct_scan: list of SSIDs for directed active scan
703 * @scan_prio: enum iwl_scan_priority
704 * @iter_num: number of scan iterations
705 * @delay: delay in seconds before first iteration
706 * @schedule: two scheduling plans. The first one is finite, the second one can
707 * be infinite.
708 * @channel_opt: channel optimization options, for full and partial scan
709 * @data: channel configuration and probe request packet.
710 */
711struct iwl_scan_req_unified_lmac {
712 /* SCAN_REQUEST_FIXED_PART_API_S_VER_7 */
713 __le32 reserved1;
714 u8 n_channels;
715 u8 active_dwell;
716 u8 passive_dwell;
717 u8 fragmented_dwell;
718 __le16 reserved2;
719 __le16 rx_chain_select;
720 __le32 scan_flags;
721 __le32 max_out_time;
722 __le32 suspend_time;
723 /* RX_ON_FLAGS_API_S_VER_1 */
724 __le32 flags;
725 __le32 filter_flags;
726 struct iwl_scan_req_tx_cmd tx_cmd[2];
727 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX];
728 __le32 scan_prio;
729 /* SCAN_REQ_PERIODIC_PARAMS_API_S */
730 __le32 iter_num;
731 __le32 delay;
732 struct iwl_scan_offload_schedule schedule[2];
733 struct iwl_scan_channel_opt channel_opt[2];
734 u8 data[];
735} __packed;
736
737/**
738 * struct iwl_lmac_scan_results_notif - scan results for one channel -
739 * SCAN_RESULT_NTF_API_S_VER_3
740 * @channel: which channel the results are from
741 * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
742 * @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request
743 * @num_probe_not_sent: # of request that weren't sent due to not enough time
744 * @duration: duration spent in channel, in usecs
745 */
746struct iwl_lmac_scan_results_notif {
747 u8 channel;
748 u8 band;
749 u8 probe_status;
750 u8 num_probe_not_sent;
751 __le32 duration;
752} __packed;
753
754/**
755 * struct iwl_lmac_scan_complete_notif - notifies end of scanning (all channels)
756 * SCAN_COMPLETE_NTF_API_S_VER_3
757 * @scanned_channels: number of channels scanned (and number of valid results)
758 * @status: one of SCAN_COMP_STATUS_*
759 * @bt_status: BT on/off status
760 * @last_channel: last channel that was scanned
761 * @tsf_low: TSF timer (lower half) in usecs
762 * @tsf_high: TSF timer (higher half) in usecs
763 * @results: an array of scan results, only "scanned_channels" of them are valid
764 */
765struct iwl_lmac_scan_complete_notif {
766 u8 scanned_channels;
767 u8 status;
768 u8 bt_status;
769 u8 last_channel;
770 __le32 tsf_low;
771 __le32 tsf_high;
772 struct iwl_scan_results_notif results[];
773} __packed;
774
775/**
776 * iwl_scan_offload_complete - PERIODIC_SCAN_COMPLETE_NTF_API_S_VER_2
777 * @last_schedule_line: last schedule line executed (fast or regular)
778 * @last_schedule_iteration: last scan iteration executed before scan abort
779 * @status: enum iwl_scan_offload_complete_status
780 * @ebs_status: EBS success status &enum iwl_scan_ebs_status
781 * @time_after_last_iter; time in seconds elapsed after last iteration
782 */
783struct iwl_periodic_scan_complete {
784 u8 last_schedule_line;
785 u8 last_schedule_iteration;
786 u8 status;
787 u8 ebs_status;
788 __le32 time_after_last_iter;
789 __le32 reserved;
790} __packed;
791
604#endif 792#endif