📄 iwl-commands.h
字号:
#define AGG_TX_STATE_SEQ_NUM_POS 16#define AGG_TX_STATE_SEQ_NUM_MSK 0xffff0000/* * REPLY_TX = 0x1c (response) */#if IWL == 4965struct iwl_tx_resp { u8 frame_count; /* 1 no aggregation, >1 aggregation */ u8 bt_kill_count; u8 failure_rts; u8 failure_frame; __le32 rate_n_flags; __le16 wireless_media_time; __le16 reserved; __le32 pa_power1; __le32 pa_power2; __le32 status; /* TX status (for aggregation status of 1st frame) */} __attribute__ ((packed));#elif IWL == 3945struct iwl_tx_resp { u8 failure_rts; u8 failure_frame; u8 bt_kill_count; u8 rate; __le32 wireless_media_time; __le32 status; /* TX status (for aggregation status of 1st frame) */} __attribute__ ((packed));#endif/* * REPLY_COMPRESSED_BA = 0xc5 (response only, not a command) */struct iwl_compressed_ba_resp { __le32 sta_addr_lo32; __le16 sta_addr_hi16; __le16 reserved; u8 sta_id; u8 tid; __le16 ba_seq_ctl; __le32 ba_bitmap0; __le32 ba_bitmap1; __le16 scd_flow; __le16 scd_ssn;} __attribute__ ((packed));/* * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response) */struct iwl_txpowertable_cmd { u8 band; /* 0: 5 GHz, 1: 2.4 GHz */ u8 reserved; __le16 channel;#if IWL == 3945 struct iwl_power_per_rate power[IWL_MAX_RATES];#elif IWL == 4965 struct iwl_tx_power_db tx_power;#endif} __attribute__ ((packed));#if IWL == 3945struct iwl_rate_scaling_info { __le16 rate_n_flags; u8 try_cnt; u8 next_rate_index;} __attribute__ ((packed));/** * struct iwl_rate_scaling_cmd - Rate Scaling Command & Response * * REPLY_RATE_SCALE = 0x47 (command, has simple generic response) * * NOTE: The table of rates passed to the uCode via the * RATE_SCALE command sets up the corresponding order of * rates used for all related commands, including rate * masks, etc. * * For example, if you set 9MB (PLCP 0x0f) as the first * rate in the rate table, the bit mask for that rate * when passed through ofdm_basic_rates on the REPLY_RXON * command would be bit 0 (1<<0) */struct iwl_rate_scaling_cmd { u8 table_id; u8 reserved[3]; struct iwl_rate_scaling_info table[IWL_MAX_RATES];} __attribute__ ((packed));#elif IWL == 4965/*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */#define LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK (1<<0)#define LINK_QUAL_AC_NUM AC_NUM#define LINK_QUAL_MAX_RETRY_NUM 16#define LINK_QUAL_ANT_A_MSK (1<<0)#define LINK_QUAL_ANT_B_MSK (1<<1)#define LINK_QUAL_ANT_MSK (LINK_QUAL_ANT_A_MSK|LINK_QUAL_ANT_B_MSK)struct iwl_link_qual_general_params { u8 flags; u8 mimo_delimiter; u8 single_stream_ant_msk; u8 dual_stream_ant_msk; u8 start_rate_index[LINK_QUAL_AC_NUM];} __attribute__ ((packed));struct iwl_link_qual_agg_params { __le16 agg_time_limit; u8 agg_dis_start_th; u8 agg_frame_cnt_limit; __le32 reserved;} __attribute__ ((packed));/* * REPLY_TX_LINK_QUALITY_CMD = 0x4e (command, has simple generic response) */struct iwl_link_quality_cmd { u8 sta_id; u8 reserved1; __le16 control; struct iwl_link_qual_general_params general_params; struct iwl_link_qual_agg_params agg_params; struct { __le32 rate_n_flags; } rs_table[LINK_QUAL_MAX_RETRY_NUM]; __le32 reserved2;} __attribute__ ((packed));#endif/* * REPLY_BT_CONFIG = 0x9b (command, has simple generic response) */struct iwl_bt_cmd { u8 flags; u8 lead_time; u8 max_kill; u8 reserved; __le32 kill_ack_mask; __le32 kill_cts_mask;} __attribute__ ((packed));/****************************************************************************** * (6) * Spectrum Management (802.11h) Commands, Responses, Notifications: * *****************************************************************************//* * Spectrum Management */#define MEASUREMENT_FILTER_FLAG (RXON_FILTER_PROMISC_MSK | \ RXON_FILTER_CTL2HOST_MSK | \ RXON_FILTER_ACCEPT_GRP_MSK | \ RXON_FILTER_DIS_DECRYPT_MSK | \ RXON_FILTER_DIS_GRP_DECRYPT_MSK | \ RXON_FILTER_ASSOC_MSK | \ RXON_FILTER_BCON_AWARE_MSK)struct iwl_measure_channel { __le32 duration; /* measurement duration in extended beacon * format */ u8 channel; /* channel to measure */ u8 type; /* see enum iwl_measure_type */ __le16 reserved;} __attribute__ ((packed));/* * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command) */struct iwl_spectrum_cmd { __le16 len; /* number of bytes starting from token */ u8 token; /* token id */ u8 id; /* measurement id -- 0 or 1 */ u8 origin; /* 0 = TGh, 1 = other, 2 = TGk */ u8 periodic; /* 1 = periodic */ __le16 path_loss_timeout; __le32 start_time; /* start time in extended beacon format */ __le32 reserved2; __le32 flags; /* rxon flags */ __le32 filter_flags; /* rxon filter flags */ __le16 channel_count; /* minimum 1, maximum 10 */ __le16 reserved3; struct iwl_measure_channel channels[10];} __attribute__ ((packed));/* * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response) */struct iwl_spectrum_resp { u8 token; u8 id; /* id of the prior command replaced, or 0xff */ __le16 status; /* 0 - command will be handled * 1 - cannot handle (conflicts with another * measurement) */} __attribute__ ((packed));enum iwl_measurement_state { IWL_MEASUREMENT_START = 0, IWL_MEASUREMENT_STOP = 1,};enum iwl_measurement_status { IWL_MEASUREMENT_OK = 0, IWL_MEASUREMENT_CONCURRENT = 1, IWL_MEASUREMENT_CSA_CONFLICT = 2, IWL_MEASUREMENT_TGH_CONFLICT = 3, /* 4-5 reserved */ IWL_MEASUREMENT_STOPPED = 6, IWL_MEASUREMENT_TIMEOUT = 7, IWL_MEASUREMENT_PERIODIC_FAILED = 8,};#define NUM_ELEMENTS_IN_HISTOGRAM 8struct iwl_measurement_histogram { __le32 ofdm[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 0.8usec counts */ __le32 cck[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 1usec counts */} __attribute__ ((packed));/* clear channel availability counters */struct iwl_measurement_cca_counters { __le32 ofdm; __le32 cck;} __attribute__ ((packed));enum iwl_measure_type { IWL_MEASURE_BASIC = (1 << 0), IWL_MEASURE_CHANNEL_LOAD = (1 << 1), IWL_MEASURE_HISTOGRAM_RPI = (1 << 2), IWL_MEASURE_HISTOGRAM_NOISE = (1 << 3), IWL_MEASURE_FRAME = (1 << 4), /* bits 5:6 are reserved */ IWL_MEASURE_IDLE = (1 << 7),};/* * SPECTRUM_MEASURE_NOTIFICATION = 0x75 (notification only, not a command) */struct iwl_spectrum_notification { u8 id; /* measurement id -- 0 or 1 */ u8 token; u8 channel_index; /* index in measurement channel list */ u8 state; /* 0 - start, 1 - stop */ __le32 start_time; /* lower 32-bits of TSF */ u8 band; /* 0 - 5.2GHz, 1 - 2.4GHz */ u8 channel; u8 type; /* see enum iwl_measurement_type */ u8 reserved1; /* NOTE: cca_ofdm, cca_cck, basic_type, and histogram are only only * valid if applicable for measurement type requested. */ __le32 cca_ofdm; /* cca fraction time in 40Mhz clock periods */ __le32 cca_cck; /* cca fraction time in 44Mhz clock periods */ __le32 cca_time; /* channel load time in usecs */ u8 basic_type; /* 0 - bss, 1 - ofdm preamble, 2 - * unidentified */ u8 reserved2[3]; struct iwl_measurement_histogram histogram; __le32 stop_time; /* lower 32-bits of TSF */ __le32 status; /* see iwl_measurement_status */} __attribute__ ((packed));/****************************************************************************** * (7) * Power Management Commands, Responses, Notifications: * *****************************************************************************//** * struct iwl_powertable_cmd - Power Table Command * @flags: See below: * * POWER_TABLE_CMD = 0x77 (command, has simple generic response) * * PM allow: * bit 0 - '0' Driver not allow power management * '1' Driver allow PM (use rest of parameters) * uCode send sleep notifications: * bit 1 - '0' Don't send sleep notification * '1' send sleep notification (SEND_PM_NOTIFICATION) * Sleep over DTIM * bit 2 - '0' PM have to walk up every DTIM * '1' PM could sleep over DTIM till listen Interval. * PCI power managed * bit 3 - '0' (PCI_LINK_CTRL & 0x1) * '1' !(PCI_LINK_CTRL & 0x1) * Force sleep Modes * bit 31/30- '00' use both mac/xtal sleeps * '01' force Mac sleep * '10' force xtal sleep * '11' Illegal set * * NOTE: if sleep_interval[SLEEP_INTRVL_TABLE_SIZE-1] > DTIM period then * ucode assume sleep over DTIM is allowed and we don't need to wakeup * for every DTIM. */#define IWL_POWER_VEC_SIZE 5#if IWL == 3945#define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK __constant_cpu_to_le32(1<<0)#define IWL_POWER_SLEEP_OVER_DTIM_MSK __constant_cpu_to_le32(1<<2)#define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le32(1<<3)struct iwl_powertable_cmd { __le32 flags; __le32 rx_data_timeout; __le32 tx_data_timeout; __le32 sleep_interval[IWL_POWER_VEC_SIZE];} __attribute__((packed));#elif IWL == 4965#define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK __constant_cpu_to_le16(1<<0)#define IWL_POWER_SLEEP_OVER_DTIM_MSK __constant_cpu_to_le16(1<<2)#define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le16(1<<3)struct iwl_powertable_cmd { __le16 flags; u8 keep_alive_seconds; u8 debug_flags; __le32 rx_data_timeout; __le32 tx_data_timeout; __le32 sleep_interval[IWL_POWER_VEC_SIZE]; __le32 keep_alive_beacons;} __attribute__ ((packed));#endif/* * PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command) * 3945 and 4965 identical. */struct iwl_sleep_notification { u8 pm_sleep_mode; u8 pm_wakeup_src; __le16 reserved; __le32 sleep_time; __le32 tsf_low; __le32 bcon_timer;} __attribute__ ((packed));/* Sleep states. 3945 and 4965 identical. */enum { IWL_PM_NO_SLEEP = 0, IWL_PM_SLP_MAC = 1, IWL_PM_SLP_FULL_MAC_UNASSOCIATE = 2, IWL_PM_SLP_FULL_MAC_CARD_STATE = 3, IWL_PM_SLP_PHY = 4, IWL_PM_SLP_REPENT = 5, IWL_PM_WAKEUP_BY_TIMER = 6, IWL_PM_WAKEUP_BY_DRIVER = 7, IWL_PM_WAKEUP_BY_RFKILL = 8, /* 3 reserved */ IWL_PM_NUM_OF_MODES = 12,};/* * REPLY_CARD_STATE_CMD = 0xa0 (command, has simple generic response) */#define CARD_STATE_CMD_DISABLE 0x00 /* Put card to sleep */#define CARD_STATE_CMD_ENABLE 0x01 /* Wake up card */#define CARD_STATE_CMD_HALT 0x02 /* Power down permanently */struct iwl_card_state_cmd { __le32 status; /* CARD_STATE_CMD_* request new power state */} __attribute__ ((packed));/* * CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command) */struct iwl_card_state_notif { __le32 flags;} __attribute__ ((packed));#define HW_CARD_DISABLED 0x01#define SW_CARD_DISABLED 0x02#define RF_CARD_DISABLED 0x04#define RXON_CARD_DISABLED 0x10struct iwl_ct_kill_config { __le32 reserved; __le32 critical_temperature_M; __le32 critical_temperature_R;} __attribute__ ((packed));/****************************************************************************** * (8) * Scan Commands, Responses, Notifications: * *****************************************************************************/struct iwl_scan_channel { /* type is defined as: * 0:0 active (0 - passive) * 1:4 SSID direct * If 1 is set then corresponding SSID IE is transmitted in probe * 5:7 reserved */ u8 type; u8 channel; struct iwl_tx_power tpc; __le16 active_dwell; __le16 passive_dwell;} __attribute__ ((packed));struct iwl_ssid_ie { u8 id; u8 len; u8 ssid[32];} __attribute__ ((packed));#define PROBE_OPTION_MAX 0x4#define TX_CMD_LIFE_TIME_INFINITE __constant_cpu_to_le32(0xFFFFFFFF)#define IWL_GOOD_CRC_TH __constant_cpu_to_le16(1)#define IWL_MAX_SCAN_SIZE 1024/* * REPLY_SCAN_CMD = 0x80 (command) */struct iwl_scan_cmd { __le16 len; u8 reserved0; u8 channel_count; __le16 quiet_time; /* dwell only this long on quiet chnl * (active scan) */ __le16 quiet_plcp_th; /* quiet chnl is < this # pkts (typ. 1) */ __le16 good_CRC_th; /* passive -> active promotion threshold */#if IWL == 3945 __le16 reserved1;#elif IWL == 4965 __le16 rx_chain;#endif __le32 max_out_time; /* max usec to be out of associated (service)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -