⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iwl-commands.h

📁 linux内核源码
💻 H
📖 第 1 页 / 共 4 页
字号:
/****************************************************************************** * * This file is provided under a dual BSD/GPLv2 license.  When using or * redistributing this file, you may do so under either license. * * GPL LICENSE SUMMARY * * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU Geeral Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, * USA * * The full GNU General Public License is included in this distribution * in the file called LICENSE.GPL. * * Contact Information: * James P. Ketrenos <ipw2100-admin@linux.intel.com> * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 * * BSD LICENSE * * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * *  * Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. *  * Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in *    the documentation and/or other materials provided with the *    distribution. *  * Neither the name Intel Corporation nor the names of its *    contributors may be used to endorse or promote products derived *    from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * *****************************************************************************/#ifndef __iwl_commands_h__#define __iwl_commands_h__enum {	REPLY_ALIVE = 0x1,	REPLY_ERROR = 0x2,	/* RXON and QOS commands */	REPLY_RXON = 0x10,	REPLY_RXON_ASSOC = 0x11,	REPLY_QOS_PARAM = 0x13,	REPLY_RXON_TIMING = 0x14,	/* Multi-Station support */	REPLY_ADD_STA = 0x18,	REPLY_REMOVE_STA = 0x19,	/* not used */	REPLY_REMOVE_ALL_STA = 0x1a,	/* not used */	/* RX, TX, LEDs */#if IWL == 3945	REPLY_3945_RX = 0x1b,		/* 3945 only */#endif	REPLY_TX = 0x1c,	REPLY_RATE_SCALE = 0x47,	/* 3945 only */	REPLY_LEDS_CMD = 0x48,	REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* 4965 only */	/* 802.11h related */	RADAR_NOTIFICATION = 0x70,	/* not used */	REPLY_QUIET_CMD = 0x71,		/* not used */	REPLY_CHANNEL_SWITCH = 0x72,	CHANNEL_SWITCH_NOTIFICATION = 0x73,	REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74,	SPECTRUM_MEASURE_NOTIFICATION = 0x75,	/* Power Management */	POWER_TABLE_CMD = 0x77,	PM_SLEEP_NOTIFICATION = 0x7A,	PM_DEBUG_STATISTIC_NOTIFIC = 0x7B,	/* Scan commands and notifications */	REPLY_SCAN_CMD = 0x80,	REPLY_SCAN_ABORT_CMD = 0x81,	SCAN_START_NOTIFICATION = 0x82,	SCAN_RESULTS_NOTIFICATION = 0x83,	SCAN_COMPLETE_NOTIFICATION = 0x84,	/* IBSS/AP commands */	BEACON_NOTIFICATION = 0x90,	REPLY_TX_BEACON = 0x91,	WHO_IS_AWAKE_NOTIFICATION = 0x94,	/* not used */	/* Miscellaneous commands */	QUIET_NOTIFICATION = 0x96,		/* not used */	REPLY_TX_PWR_TABLE_CMD = 0x97,	MEASURE_ABORT_NOTIFICATION = 0x99,	/* not used */	/* BT config command */	REPLY_BT_CONFIG = 0x9b,	/* 4965 Statistics */	REPLY_STATISTICS_CMD = 0x9c,	STATISTICS_NOTIFICATION = 0x9d,	/* RF-KILL commands and notifications */	REPLY_CARD_STATE_CMD = 0xa0,	CARD_STATE_NOTIFICATION = 0xa1,	/* Missed beacons notification */	MISSED_BEACONS_NOTIFICATION = 0xa2,#if IWL == 4965	REPLY_CT_KILL_CONFIG_CMD = 0xa4,	SENSITIVITY_CMD = 0xa8,	REPLY_PHY_CALIBRATION_CMD = 0xb0,	REPLY_RX_PHY_CMD = 0xc0,	REPLY_RX_MPDU_CMD = 0xc1,	REPLY_4965_RX = 0xc3,	REPLY_COMPRESSED_BA = 0xc5,#endif	REPLY_MAX = 0xff};/****************************************************************************** * (0) * Header * *****************************************************************************/#define IWL_CMD_FAILED_MSK 0x40struct iwl_cmd_header {	u8 cmd;	u8 flags;	/* We have 15 LSB to use as we please (MSB indicates	 * a frame Rx'd from the HW).  We encode the following	 * information into the sequence field:	 *	 *  0:7    index in fifo	 *  8:13   fifo selection	 * 14:14   bit indicating if this packet references the 'extra'	 *         storage at the end of the memory queue	 * 15:15   (Rx indication)	 *	 */	__le16 sequence;	/* command data follows immediately */	u8 data[0];} __attribute__ ((packed));/****************************************************************************** * (0a) * Alive and Error Commands & Responses: * *****************************************************************************/#define UCODE_VALID_OK	__constant_cpu_to_le32(0x1)#define INITIALIZE_SUBTYPE    (9)/* * REPLY_ALIVE = 0x1 (response only, not a command) */struct iwl_alive_resp {	u8 ucode_minor;	u8 ucode_major;	__le16 reserved1;	u8 sw_rev[8];	u8 ver_type;	u8 ver_subtype;	__le16 reserved2;	__le32 log_event_table_ptr;	__le32 error_event_table_ptr;	__le32 timestamp;	__le32 is_valid;} __attribute__ ((packed));struct iwl_init_alive_resp {	u8 ucode_minor;	u8 ucode_major;	__le16 reserved1;	u8 sw_rev[8];	u8 ver_type;	u8 ver_subtype;	__le16 reserved2;	__le32 log_event_table_ptr;	__le32 error_event_table_ptr;	__le32 timestamp;	__le32 is_valid;#if IWL == 4965	/* calibration values from "initialize" uCode */	__le32 voltage;		/* signed */	__le32 therm_r1[2];	/* signed 1st for normal, 2nd for FAT channel */	__le32 therm_r2[2];	/* signed */	__le32 therm_r3[2];	/* signed */	__le32 therm_r4[2];	/* signed */	__le32 tx_atten[5][2];	/* signed MIMO gain comp, 5 freq groups,				 * 2 Tx chains */#endif} __attribute__ ((packed));union tsf {	u8 byte[8];	__le16 word[4];	__le32 dw[2];};/* * REPLY_ERROR = 0x2 (response only, not a command) */struct iwl_error_resp {	__le32 error_type;	u8 cmd_id;	u8 reserved1;	__le16 bad_cmd_seq_num;#if IWL == 3945	__le16 reserved2;#endif	__le32 error_info;	union tsf timestamp;} __attribute__ ((packed));/****************************************************************************** * (1) * RXON Commands & Responses: * *****************************************************************************//* * Rx config defines & structure *//* rx_config device types  */enum {	RXON_DEV_TYPE_AP = 1,	RXON_DEV_TYPE_ESS = 3,	RXON_DEV_TYPE_IBSS = 4,	RXON_DEV_TYPE_SNIFFER = 6,};/* rx_config flags *//* band & modulation selection */#define RXON_FLG_BAND_24G_MSK           __constant_cpu_to_le32(1 << 0)#define RXON_FLG_CCK_MSK                __constant_cpu_to_le32(1 << 1)/* auto detection enable */#define RXON_FLG_AUTO_DETECT_MSK        __constant_cpu_to_le32(1 << 2)/* TGg protection when tx */#define RXON_FLG_TGG_PROTECT_MSK        __constant_cpu_to_le32(1 << 3)/* cck short slot & preamble */#define RXON_FLG_SHORT_SLOT_MSK          __constant_cpu_to_le32(1 << 4)#define RXON_FLG_SHORT_PREAMBLE_MSK     __constant_cpu_to_le32(1 << 5)/* antenna selection */#define RXON_FLG_DIS_DIV_MSK            __constant_cpu_to_le32(1 << 7)#define RXON_FLG_ANT_SEL_MSK            __constant_cpu_to_le32(0x0f00)#define RXON_FLG_ANT_A_MSK              __constant_cpu_to_le32(1 << 8)#define RXON_FLG_ANT_B_MSK              __constant_cpu_to_le32(1 << 9)/* radar detection enable */#define RXON_FLG_RADAR_DETECT_MSK       __constant_cpu_to_le32(1 << 12)#define RXON_FLG_TGJ_NARROW_BAND_MSK    __constant_cpu_to_le32(1 << 13)/* rx response to host with 8-byte TSF* (according to ON_AIR deassertion) */#define RXON_FLG_TSF2HOST_MSK           __constant_cpu_to_le32(1 << 15)/* rx_config filter flags *//* accept all data frames */#define RXON_FILTER_PROMISC_MSK         __constant_cpu_to_le32(1 << 0)/* pass control & management to host */#define RXON_FILTER_CTL2HOST_MSK        __constant_cpu_to_le32(1 << 1)/* accept multi-cast */#define RXON_FILTER_ACCEPT_GRP_MSK      __constant_cpu_to_le32(1 << 2)/* don't decrypt uni-cast frames */#define RXON_FILTER_DIS_DECRYPT_MSK     __constant_cpu_to_le32(1 << 3)/* don't decrypt multi-cast frames */#define RXON_FILTER_DIS_GRP_DECRYPT_MSK __constant_cpu_to_le32(1 << 4)/* STA is associated */#define RXON_FILTER_ASSOC_MSK           __constant_cpu_to_le32(1 << 5)/* transfer to host non bssid beacons in associated state */#define RXON_FILTER_BCON_AWARE_MSK      __constant_cpu_to_le32(1 << 6)/* * REPLY_RXON = 0x10 (command, has simple generic response) */struct iwl_rxon_cmd {	u8 node_addr[6];	__le16 reserved1;	u8 bssid_addr[6];	__le16 reserved2;	u8 wlap_bssid_addr[6];	__le16 reserved3;	u8 dev_type;	u8 air_propagation;#if IWL == 3945	__le16 reserved4;#elif IWL == 4965	__le16 rx_chain;#endif	u8 ofdm_basic_rates;	u8 cck_basic_rates;	__le16 assoc_id;	__le32 flags;	__le32 filter_flags;	__le16 channel;#if IWL == 3945	__le16 reserved5;#elif IWL == 4965	u8 ofdm_ht_single_stream_basic_rates;	u8 ofdm_ht_dual_stream_basic_rates;#endif} __attribute__ ((packed));/* * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response) */struct iwl_rxon_assoc_cmd {	__le32 flags;	__le32 filter_flags;	u8 ofdm_basic_rates;	u8 cck_basic_rates;#if IWL == 4965	u8 ofdm_ht_single_stream_basic_rates;	u8 ofdm_ht_dual_stream_basic_rates;	__le16 rx_chain_select_flags;#endif	__le16 reserved;} __attribute__ ((packed));/* * REPLY_RXON_TIMING = 0x14 (command, has simple generic response) */struct iwl_rxon_time_cmd {	union tsf timestamp;	__le16 beacon_interval;	__le16 atim_window;	__le32 beacon_init_val;	__le16 listen_interval;	__le16 reserved;} __attribute__ ((packed));struct iwl_tx_power {	u8 tx_gain;		/* gain for analog radio */	u8 dsp_atten;		/* gain for DSP */} __attribute__ ((packed));#if IWL == 3945struct iwl_power_per_rate {	u8 rate;		/* plcp */	struct iwl_tx_power tpc;	u8 reserved;} __attribute__ ((packed));#elif IWL == 4965#define POWER_TABLE_NUM_ENTRIES			33#define POWER_TABLE_NUM_HT_OFDM_ENTRIES		32#define POWER_TABLE_CCK_ENTRY			32struct tx_power_dual_stream {	__le32 dw;} __attribute__ ((packed));struct iwl_tx_power_db {	struct tx_power_dual_stream power_tbl[POWER_TABLE_NUM_ENTRIES];} __attribute__ ((packed));#endif/* * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) */struct iwl_channel_switch_cmd {	u8 band;	u8 expect_beacon;	__le16 channel;	__le32 rxon_flags;	__le32 rxon_filter_flags;	__le32 switch_time;#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));/* * CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command) */struct iwl_csa_notification {	__le16 band;	__le16 channel;	__le32 status;		/* 0 - OK, 1 - fail */} __attribute__ ((packed));/****************************************************************************** * (2) * Quality-of-Service (QOS) Commands & Responses: * *****************************************************************************/struct iwl_ac_qos {	__le16 cw_min;	__le16 cw_max;	u8 aifsn;	u8 reserved1;	__le16 edca_txop;} __attribute__ ((packed));/* QoS flags defines */#define QOS_PARAM_FLG_UPDATE_EDCA_MSK	__constant_cpu_to_le32(0x01)#define QOS_PARAM_FLG_TGN_MSK		__constant_cpu_to_le32(0x02)#define QOS_PARAM_FLG_TXOP_TYPE_MSK	__constant_cpu_to_le32(0x10)/* *  TXFIFO Queue number defines *//* number of Access categories (AC) (EDCA), queues 0..3 */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -