1b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 2b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 3b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * This file is provided under a dual BSD/GPLv2 license. When using or 4b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * redistributing this file, you may do so under either license. 5b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 6b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * GPL LICENSE SUMMARY 7b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 8901069c71415a76d731857ccda814e18ded062f7Wey-Yi Guy * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved. 9b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 10b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * This program is free software; you can redistribute it and/or modify 1101ebd063e11bdcf1ddc605d968ea89aef48e34e0Ian Schram * it under the terms of version 2 of the GNU General Public License as 12b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * published by the Free Software Foundation. 13b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 14b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * This program is distributed in the hope that it will be useful, but 15b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * WITHOUT ANY WARRANTY; without even the implied warranty of 16b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * General Public License for more details. 18b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 19b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * You should have received a copy of the GNU General Public License 20b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * along with this program; if not, write to the Free Software 21b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 22b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * USA 23b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 24b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * The full GNU General Public License is included in this distribution 25b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * in the file called LICENSE.GPL. 26b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 27b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Contact Information: 28759ef89fb096c4a6ef078d3cfd5682ac037bd789Winkler, Tomas * Intel Linux Wireless <ilw@linux.intel.com> 29b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 30b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 31b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * BSD LICENSE 32b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 33901069c71415a76d731857ccda814e18ded062f7Wey-Yi Guy * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved. 34b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * All rights reserved. 35b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 36b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Redistribution and use in source and binary forms, with or without 37b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * modification, are permitted provided that the following conditions 38b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * are met: 39b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 40b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * * Redistributions of source code must retain the above copyright 41b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * notice, this list of conditions and the following disclaimer. 42b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * * Redistributions in binary form must reproduce the above copyright 43b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * notice, this list of conditions and the following disclaimer in 44b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * the documentation and/or other materials provided with the 45b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * distribution. 46b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * * Neither the name Intel Corporation nor the names of its 47b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * contributors may be used to endorse or promote products derived 48b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * from this software without specific prior written permission. 49b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 50b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 51b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 52b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 53b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 54b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 55b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 56b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 57b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 58b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 59b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 60b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 61b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 62b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 63fcd427bbba10fc315d1c958b85bba74448db4eb4Ben M Cahill/* 645a36ba0e412a0e12a8bf2648a075226c1dd7870dTomas Winkler * Please use this file (iwl-commands.h) only for uCode API definitions. 65767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * Please use iwl-xxxx-hw.h for hardware-related definitions. 663e0d4cb12f6fd97193a455b49125398b2231c87cTomas Winkler * Please use iwl-dev.h for driver implementation definitions. 67fcd427bbba10fc315d1c958b85bba74448db4eb4Ben M Cahill */ 68b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 696a63578ddf6148927a80c07a73b40ccc8f3ac8e2Emmanuel Grumbach#ifndef __iwl_commands_h__ 706a63578ddf6148927a80c07a73b40ccc8f3ac8e2Emmanuel Grumbach#define __iwl_commands_h__ 71b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 721f7b6172db86e9ab2b4cd794441bb2c40ab287fcEmmanuel Grumbach#include <linux/etherdevice.h> 731f7b6172db86e9ab2b4cd794441bb2c40ab287fcEmmanuel Grumbach#include <linux/ieee80211.h> 741f7b6172db86e9ab2b4cd794441bb2c40ab287fcEmmanuel Grumbach 75a3139c5956702c9ff957ac9fe2d902de355b063eSamuel Ortizstruct iwl_priv; 76a3139c5956702c9ff957ac9fe2d902de355b063eSamuel Ortiz 77c02b3acd29766c6f79c2411cb5b85e1ee72c4c8fChatre, Reinette/* uCode version contains 4 values: Major/Minor/API/Serial */ 78c02b3acd29766c6f79c2411cb5b85e1ee72c4c8fChatre, Reinette#define IWL_UCODE_MAJOR(ver) (((ver) & 0xFF000000) >> 24) 79c02b3acd29766c6f79c2411cb5b85e1ee72c4c8fChatre, Reinette#define IWL_UCODE_MINOR(ver) (((ver) & 0x00FF0000) >> 16) 80c02b3acd29766c6f79c2411cb5b85e1ee72c4c8fChatre, Reinette#define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8) 81c02b3acd29766c6f79c2411cb5b85e1ee72c4c8fChatre, Reinette#define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF) 82c02b3acd29766c6f79c2411cb5b85e1ee72c4c8fChatre, Reinette 834c897253cc9ae1c6a2798b27b5fe8e6d94ab6185Tomas Winkler 844c897253cc9ae1c6a2798b27b5fe8e6d94ab6185Tomas Winkler/* Tx rates */ 854c897253cc9ae1c6a2798b27b5fe8e6d94ab6185Tomas Winkler#define IWL_CCK_RATES 4 864c897253cc9ae1c6a2798b27b5fe8e6d94ab6185Tomas Winkler#define IWL_OFDM_RATES 8 874c897253cc9ae1c6a2798b27b5fe8e6d94ab6185Tomas Winkler#define IWL_MAX_RATES (IWL_CCK_RATES + IWL_OFDM_RATES) 884c897253cc9ae1c6a2798b27b5fe8e6d94ab6185Tomas Winkler 89b481de9ca074528fe8c429604e2777db8b89806aZhu Yienum { 90b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_ALIVE = 0x1, 91b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_ERROR = 0x2, 92e80eb00276c990b8d192cc594e607d2f4b4bfc65Wey-Yi Guy REPLY_ECHO = 0x3, /* test command */ 93b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 94b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* RXON and QOS commands */ 95b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_RXON = 0x10, 96b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_RXON_ASSOC = 0x11, 97b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_QOS_PARAM = 0x13, 98b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_RXON_TIMING = 0x14, 99b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 100b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* Multi-Station support */ 101b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_ADD_STA = 0x18, 102fc66be2a808724d61134e420ef9d7082653c72ebWey-Yi Guy REPLY_REMOVE_STA = 0x19, 103b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_REMOVE_ALL_STA = 0x1a, /* not used */ 104947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy REPLY_TXFIFO_FLUSH = 0x1e, 105b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1060a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach /* Security */ 1070a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach REPLY_WEPKEY = 0x20, 1080a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach 109b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* RX, TX, LEDs */ 110b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_TX = 0x1c, 111b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_LEDS_CMD = 0x48, 1127f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy REPLY_TX_LINK_QUALITY_CMD = 0x4e, 113b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1149636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky /* WiMAX coexistence */ 1157f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy COEX_PRIORITY_TABLE_CMD = 0x5a, 1169636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_MEDIUM_NOTIFICATION = 0x5b, 1179636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_EVENT_CMD = 0x5c, 1189636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky 119be5d56ed885a2897ec813eab4a8055d495816e9aTomas Winkler /* Calibration */ 1201a5c3d61993f56daf15c35bea8d3943f4e835638Jay Sternberg TEMPERATURE_NOTIFICATION = 0x62, 121be5d56ed885a2897ec813eab4a8055d495816e9aTomas Winkler CALIBRATION_CFG_CMD = 0x65, 122be5d56ed885a2897ec813eab4a8055d495816e9aTomas Winkler CALIBRATION_RES_NOTIFICATION = 0x66, 123be5d56ed885a2897ec813eab4a8055d495816e9aTomas Winkler CALIBRATION_COMPLETE_NOTIFICATION = 0x67, 124be5d56ed885a2897ec813eab4a8055d495816e9aTomas Winkler 125b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* 802.11h related */ 126b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_QUIET_CMD = 0x71, /* not used */ 127b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_CHANNEL_SWITCH = 0x72, 128b481de9ca074528fe8c429604e2777db8b89806aZhu Yi CHANNEL_SWITCH_NOTIFICATION = 0x73, 129b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74, 130b481de9ca074528fe8c429604e2777db8b89806aZhu Yi SPECTRUM_MEASURE_NOTIFICATION = 0x75, 131b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 132b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* Power Management */ 133b481de9ca074528fe8c429604e2777db8b89806aZhu Yi POWER_TABLE_CMD = 0x77, 134b481de9ca074528fe8c429604e2777db8b89806aZhu Yi PM_SLEEP_NOTIFICATION = 0x7A, 135b481de9ca074528fe8c429604e2777db8b89806aZhu Yi PM_DEBUG_STATISTIC_NOTIFIC = 0x7B, 136b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 137b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* Scan commands and notifications */ 138b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_SCAN_CMD = 0x80, 139b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_SCAN_ABORT_CMD = 0x81, 140b481de9ca074528fe8c429604e2777db8b89806aZhu Yi SCAN_START_NOTIFICATION = 0x82, 141b481de9ca074528fe8c429604e2777db8b89806aZhu Yi SCAN_RESULTS_NOTIFICATION = 0x83, 142b481de9ca074528fe8c429604e2777db8b89806aZhu Yi SCAN_COMPLETE_NOTIFICATION = 0x84, 143b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 144b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* IBSS/AP commands */ 145b481de9ca074528fe8c429604e2777db8b89806aZhu Yi BEACON_NOTIFICATION = 0x90, 146b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_TX_BEACON = 0x91, 147b481de9ca074528fe8c429604e2777db8b89806aZhu Yi WHO_IS_AWAKE_NOTIFICATION = 0x94, /* not used */ 148b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 149b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* Miscellaneous commands */ 15076a2407a5b043d0950d5657184118e89860d545cJay Sternberg REPLY_TX_POWER_DBM_CMD = 0x95, 151b481de9ca074528fe8c429604e2777db8b89806aZhu Yi QUIET_NOTIFICATION = 0x96, /* not used */ 152b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_TX_PWR_TABLE_CMD = 0x97, 15376a2407a5b043d0950d5657184118e89860d545cJay Sternberg REPLY_TX_POWER_DBM_CMD_V1 = 0x98, /* old version of API */ 1542f748deceee10bac563df0e859830cc628d1a841Wey-Yi Guy TX_ANT_CONFIGURATION_CMD = 0x98, 155b481de9ca074528fe8c429604e2777db8b89806aZhu Yi MEASURE_ABORT_NOTIFICATION = 0x99, /* not used */ 156b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 157a96a27f97f2bbfc1fca54bc3c0b0d41484152740Tomas Winkler /* Bluetooth device coexistence config command */ 158b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_BT_CONFIG = 0x9b, 159b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 16080cc0c382db318de88577eff027d5c4097abef81Ben M Cahill /* Statistics */ 161b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_STATISTICS_CMD = 0x9c, 162b481de9ca074528fe8c429604e2777db8b89806aZhu Yi STATISTICS_NOTIFICATION = 0x9d, 163b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 164b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* RF-KILL commands and notifications */ 165b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_CARD_STATE_CMD = 0xa0, 166b481de9ca074528fe8c429604e2777db8b89806aZhu Yi CARD_STATE_NOTIFICATION = 0xa1, 167b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 168b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* Missed beacons notification */ 169b481de9ca074528fe8c429604e2777db8b89806aZhu Yi MISSED_BEACONS_NOTIFICATION = 0xa2, 170b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 171b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_CT_KILL_CONFIG_CMD = 0xa4, 172b481de9ca074528fe8c429604e2777db8b89806aZhu Yi SENSITIVITY_CMD = 0xa8, 173b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_PHY_CALIBRATION_CMD = 0xb0, 174b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_RX_PHY_CMD = 0xc0, 175b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_RX_MPDU_CMD = 0xc1, 176857485c0c46ceee5c658c1761bba4d9a5ddf433fTomas Winkler REPLY_RX = 0xc3, 177b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_COMPRESSED_BA = 0xc5, 1780288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg 1790288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg /* BT Coex */ 1800288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg REPLY_BT_COEX_PRIO_TABLE = 0xcc, 1810288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg REPLY_BT_COEX_PROT_ENV = 0xcd, 1820288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg REPLY_BT_COEX_PROFILE_NOTIF = 0xce, 1830288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg 184946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg /* PAN commands */ 185946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg REPLY_WIPAN_PARAMS = 0xb2, 186946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg REPLY_WIPAN_RXON = 0xb3, /* use REPLY_RXON structure */ 187946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg REPLY_WIPAN_RXON_TIMING = 0xb4, /* use REPLY_RXON_TIMING structure */ 188946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg REPLY_WIPAN_RXON_ASSOC = 0xb6, /* use REPLY_RXON_ASSOC structure */ 189946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg REPLY_WIPAN_QOS_PARAM = 0xb7, /* use REPLY_QOS_PARAM structure */ 190946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg REPLY_WIPAN_WEPKEY = 0xb8, /* use REPLY_WEPKEY structure */ 191946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg REPLY_WIPAN_P2P_CHANNEL_SWITCH = 0xb9, 192946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg REPLY_WIPAN_NOA_NOTIFICATION = 0xbc, 193311dce71b6af263a630717d77bd49cffc0d122a5Johannes Berg REPLY_WIPAN_DEACTIVATION_COMPLETE = 0xbd, 194946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg 195c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg REPLY_WOWLAN_PATTERNS = 0xe0, 196c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg REPLY_WOWLAN_WAKEUP_FILTER = 0xe1, 197c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg REPLY_WOWLAN_TSC_RSC_PARAMS = 0xe2, 198c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg REPLY_WOWLAN_TKIP_PARAMS = 0xe3, 199c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg REPLY_WOWLAN_KEK_KCK_MATERIAL = 0xe4, 200c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg REPLY_WOWLAN_GET_STATUS = 0xe5, 201560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg REPLY_D3_CONFIG = 0xd3, 202c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 203b481de9ca074528fe8c429604e2777db8b89806aZhu Yi REPLY_MAX = 0xff 204b481de9ca074528fe8c429604e2777db8b89806aZhu Yi}; 205b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 206b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 207b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (0) 208abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * Commonly used structures and definitions: 20980cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * Command header, rate_n_flags, txpower 210b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 211b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 212b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 213857485c0c46ceee5c658c1761bba4d9a5ddf433fTomas Winkler/* iwl_cmd_header flags value */ 214b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define IWL_CMD_FAILED_MSK 0x40 215b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2169734cb23a02f8de5fa99225ca61c7019ca9f232fTomas Winkler#define SEQ_TO_QUEUE(s) (((s) >> 8) & 0x1f) 2179734cb23a02f8de5fa99225ca61c7019ca9f232fTomas Winkler#define QUEUE_TO_SEQ(q) (((q) & 0x1f) << 8) 2189734cb23a02f8de5fa99225ca61c7019ca9f232fTomas Winkler#define SEQ_TO_INDEX(s) ((s) & 0xff) 2199734cb23a02f8de5fa99225ca61c7019ca9f232fTomas Winkler#define INDEX_TO_SEQ(i) ((i) & 0xff) 22051e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define SEQ_RX_FRAME cpu_to_le16(0x8000) 2219734cb23a02f8de5fa99225ca61c7019ca9f232fTomas Winkler 222075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill/** 223857485c0c46ceee5c658c1761bba4d9a5ddf433fTomas Winkler * struct iwl_cmd_header 224075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 225075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * This header format appears in the beginning of each command sent from the 226075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * driver, and each response/notification received from uCode. 227075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill */ 228857485c0c46ceee5c658c1761bba4d9a5ddf433fTomas Winklerstruct iwl_cmd_header { 229075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill u8 cmd; /* Command ID: REPLY_RXON, etc. */ 2309734cb23a02f8de5fa99225ca61c7019ca9f232fTomas Winkler u8 flags; /* 0:5 reserved, 6 abort, 7 internal */ 231075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill /* 232a96a27f97f2bbfc1fca54bc3c0b0d41484152740Tomas Winkler * The driver sets up the sequence number to values of its choosing. 233075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * uCode does not use this value, but passes it back to the driver 234075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * when sending the response to each driver-originated command, so 235075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * the driver can match the response to the command. Since the values 236075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * don't get used by uCode, the driver may set up an arbitrary format. 237b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 238075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * There is one exception: uCode sets bit 15 when it originates 239075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * the response/notification, i.e. when the response/notification 240075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * is not a direct response to a command sent by the driver. For 2413240cab3ddfb2637cfca3a078078cdeda44d0a99Johannes Berg * example, uCode issues REPLY_RX when it sends a received frame 242075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * to the driver; it is not a direct response to any driver command. 243b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 244075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * The Linux driver uses the following format: 245075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 2469734cb23a02f8de5fa99225ca61c7019ca9f232fTomas Winkler * 0:7 tfd index - position within TX queue 2479734cb23a02f8de5fa99225ca61c7019ca9f232fTomas Winkler * 8:12 TX queue id 2484ce7cc2b09553a91d4aea014c39674685715173aJohannes Berg * 13:14 reserved 2499734cb23a02f8de5fa99225ca61c7019ca9f232fTomas Winkler * 15 unsolicited RX or uCode-originated notification 250b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 251b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 sequence; 252b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 253075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill /* command or response/notification data follows immediately */ 254b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 data[0]; 255ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 256b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2573d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler 2583d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler/** 2595c5aa3f13a50881b8f6e529e321bbefb5faec37bHalperin, Daniel C * iwlagn rate_n_flags bit fields 260abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 2615c5aa3f13a50881b8f6e529e321bbefb5faec37bHalperin, Daniel C * rate_n_flags format is used in following iwlagn commands: 262857485c0c46ceee5c658c1761bba4d9a5ddf433fTomas Winkler * REPLY_RX (response only) 2635c5aa3f13a50881b8f6e529e321bbefb5faec37bHalperin, Daniel C * REPLY_RX_MPDU (response only) 264abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * REPLY_TX (both command and response) 265abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * REPLY_TX_LINK_QUALITY_CMD 266abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 267abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * High-throughput (HT) rate format for bits 7:0 (bit 8 must be "1"): 268abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 2-0: 0) 6 Mbps 269abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 1) 12 Mbps 270abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 2) 18 Mbps 271abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 3) 24 Mbps 272abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 4) 36 Mbps 273abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 5) 48 Mbps 274abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 6) 54 Mbps 275abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 7) 60 Mbps 276abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 2775c5aa3f13a50881b8f6e529e321bbefb5faec37bHalperin, Daniel C * 4-3: 0) Single stream (SISO) 278abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 1) Dual stream (MIMO) 2795c5aa3f13a50881b8f6e529e321bbefb5faec37bHalperin, Daniel C * 2) Triple stream (MIMO) 280abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 2817aafef1c6e2e24f9a10dc2972bf0ee70624ccc47Wey-Yi Guy * 5: Value of 0x20 in bits 7:0 indicates 6 Mbps HT40 duplicate data 282abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 283abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * Legacy OFDM rate format for bits 7:0 (bit 8 must be "0", bit 9 "0"): 284abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 3-0: 0xD) 6 Mbps 285abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 0xF) 9 Mbps 286abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 0x5) 12 Mbps 287abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 0x7) 18 Mbps 288abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 0x9) 24 Mbps 289abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 0xB) 36 Mbps 290abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 0x1) 48 Mbps 291abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 0x3) 54 Mbps 292abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 293abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * Legacy CCK rate format for bits 7:0 (bit 8 must be "0", bit 9 "1"): 2941061787967db03975dc02030d6815811f4eb9231Daniel Wu * 6-0: 10) 1 Mbps 295abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 20) 2 Mbps 296abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 55) 5.5 Mbps 297abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill * 110) 11 Mbps 298abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill */ 299abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_CODE_MSK 0x7 3005c5aa3f13a50881b8f6e529e321bbefb5faec37bHalperin, Daniel C#define RATE_MCS_SPATIAL_POS 3 3015c5aa3f13a50881b8f6e529e321bbefb5faec37bHalperin, Daniel C#define RATE_MCS_SPATIAL_MSK 0x18 302abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_HT_DUP_POS 5 303abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_HT_DUP_MSK 0x20 3042520546aecc969372080448a2422b39eedb2a528Daniel Halperin/* Both legacy and HT use bits 7:0 as the CCK/OFDM rate or HT MCS */ 3052520546aecc969372080448a2422b39eedb2a528Daniel Halperin#define RATE_MCS_RATE_MSK 0xff 306abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill 307075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill/* Bit 8: (1) HT format, (0) legacy format in bits 7:0 */ 308abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_FLAGS_POS 8 309abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_HT_POS 8 310abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_HT_MSK 0x100 311abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill 312075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill/* Bit 9: (1) CCK, (0) OFDM. HT (bit 8) must be "0" for this bit to be valid */ 313abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_CCK_POS 9 314abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_CCK_MSK 0x200 315abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill 316075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill/* Bit 10: (1) Use Green Field preamble */ 317abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_GF_POS 10 318abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_GF_MSK 0x400 319abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill 3207aafef1c6e2e24f9a10dc2972bf0ee70624ccc47Wey-Yi Guy/* Bit 11: (1) Use 40Mhz HT40 chnl width, (0) use 20 MHz legacy chnl width */ 3217aafef1c6e2e24f9a10dc2972bf0ee70624ccc47Wey-Yi Guy#define RATE_MCS_HT40_POS 11 3227aafef1c6e2e24f9a10dc2972bf0ee70624ccc47Wey-Yi Guy#define RATE_MCS_HT40_MSK 0x800 323abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill 3247aafef1c6e2e24f9a10dc2972bf0ee70624ccc47Wey-Yi Guy/* Bit 12: (1) Duplicate data on both 20MHz chnls. HT40 (bit 11) must be set. */ 325abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_DUP_POS 12 326abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_DUP_MSK 0x1000 327abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill 328075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill/* Bit 13: (1) Short guard interval (0.4 usec), (0) normal GI (0.8 usec) */ 329abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_SGI_POS 13 330abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill#define RATE_MCS_SGI_MSK 0x2000 331abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill 332abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill/** 33376eff18bdc5feaa53f1be33709b67df02f1d55e9Tomas Winkler * rate_n_flags Tx antenna masks 33476eff18bdc5feaa53f1be33709b67df02f1d55e9Tomas Winkler * 4965 has 2 transmitters 33576eff18bdc5feaa53f1be33709b67df02f1d55e9Tomas Winkler * 5100 has 1 transmitter B 33676eff18bdc5feaa53f1be33709b67df02f1d55e9Tomas Winkler * 5150 has 1 transmitter A 33776eff18bdc5feaa53f1be33709b67df02f1d55e9Tomas Winkler * 5300 has 3 transmitters 33876eff18bdc5feaa53f1be33709b67df02f1d55e9Tomas Winkler * 5350 has 3 transmitters 33976eff18bdc5feaa53f1be33709b67df02f1d55e9Tomas Winkler * bit14:16 340abceddb40728397fcfd0b295d7530920a606ab88Ben M Cahill */ 341600c0e11ea6161e00e8cb4b4dda39a64ce988c60Tomas Winkler#define RATE_MCS_ANT_POS 14 342600c0e11ea6161e00e8cb4b4dda39a64ce988c60Tomas Winkler#define RATE_MCS_ANT_A_MSK 0x04000 343600c0e11ea6161e00e8cb4b4dda39a64ce988c60Tomas Winkler#define RATE_MCS_ANT_B_MSK 0x08000 344600c0e11ea6161e00e8cb4b4dda39a64ce988c60Tomas Winkler#define RATE_MCS_ANT_C_MSK 0x10000 345600c0e11ea6161e00e8cb4b4dda39a64ce988c60Tomas Winkler#define RATE_MCS_ANT_AB_MSK (RATE_MCS_ANT_A_MSK | RATE_MCS_ANT_B_MSK) 346600c0e11ea6161e00e8cb4b4dda39a64ce988c60Tomas Winkler#define RATE_MCS_ANT_ABC_MSK (RATE_MCS_ANT_AB_MSK | RATE_MCS_ANT_C_MSK) 34776eff18bdc5feaa53f1be33709b67df02f1d55e9Tomas Winkler#define RATE_ANT_NUM 3 34880cc0c382db318de88577eff027d5c4097abef81Ben M Cahill 34980cc0c382db318de88577eff027d5c4097abef81Ben M Cahill#define POWER_TABLE_NUM_ENTRIES 33 35080cc0c382db318de88577eff027d5c4097abef81Ben M Cahill#define POWER_TABLE_NUM_HT_OFDM_ENTRIES 32 35180cc0c382db318de88577eff027d5c4097abef81Ben M Cahill#define POWER_TABLE_CCK_ENTRY 32 35280cc0c382db318de88577eff027d5c4097abef81Ben M Cahill 353e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy#define IWL_PWR_NUM_HT_OFDM_ENTRIES 24 354e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy#define IWL_PWR_CCK_ENTRIES 2 355e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy 35680cc0c382db318de88577eff027d5c4097abef81Ben M Cahill/** 35780cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * struct tx_power_dual_stream 35880cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * 35980cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * Table entries in REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH 36080cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * 36180cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * Same format as iwl_tx_power_dual_stream, but __le32 36280cc0c382db318de88577eff027d5c4097abef81Ben M Cahill */ 36380cc0c382db318de88577eff027d5c4097abef81Ben M Cahillstruct tx_power_dual_stream { 36480cc0c382db318de88577eff027d5c4097abef81Ben M Cahill __le32 dw; 365ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 36680cc0c382db318de88577eff027d5c4097abef81Ben M Cahill 36780cc0c382db318de88577eff027d5c4097abef81Ben M Cahill/** 368a96a27f97f2bbfc1fca54bc3c0b0d41484152740Tomas Winkler * Command REPLY_TX_POWER_DBM_CMD = 0x98 369ab63c68adaabb670f0513d5b63f3b233b16ea8b4Wey-Yi Guy * struct iwlagn_tx_power_dbm_cmd 370630fe9b6f774dd55b71fe94392101eb00df58762Tomas Winkler */ 371ab63c68adaabb670f0513d5b63f3b233b16ea8b4Wey-Yi Guy#define IWLAGN_TX_POWER_AUTO 0x7f 372ab63c68adaabb670f0513d5b63f3b233b16ea8b4Wey-Yi Guy#define IWLAGN_TX_POWER_NO_CLOSED (0x1 << 6) 373853554accce19d16b03476676bdcb1ccdd44caaeGregory Greenman 374ab63c68adaabb670f0513d5b63f3b233b16ea8b4Wey-Yi Guystruct iwlagn_tx_power_dbm_cmd { 375630fe9b6f774dd55b71fe94392101eb00df58762Tomas Winkler s8 global_lmt; /*in half-dBm (e.g. 30 = 15 dBm) */ 376630fe9b6f774dd55b71fe94392101eb00df58762Tomas Winkler u8 flags; 377630fe9b6f774dd55b71fe94392101eb00df58762Tomas Winkler s8 srv_chan_lmt; /*in half-dBm (e.g. 30 = 15 dBm) */ 378630fe9b6f774dd55b71fe94392101eb00df58762Tomas Winkler u8 reserved; 379ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 38080cc0c382db318de88577eff027d5c4097abef81Ben M Cahill 3812f748deceee10bac563df0e859830cc628d1a841Wey-Yi Guy/** 3822f748deceee10bac563df0e859830cc628d1a841Wey-Yi Guy * Command TX_ANT_CONFIGURATION_CMD = 0x98 3832f748deceee10bac563df0e859830cc628d1a841Wey-Yi Guy * This command is used to configure valid Tx antenna. 3842f748deceee10bac563df0e859830cc628d1a841Wey-Yi Guy * By default uCode concludes the valid antenna according to the radio flavor. 3852f748deceee10bac563df0e859830cc628d1a841Wey-Yi Guy * This command enables the driver to override/modify this conclusion. 3862f748deceee10bac563df0e859830cc628d1a841Wey-Yi Guy */ 3872f748deceee10bac563df0e859830cc628d1a841Wey-Yi Guystruct iwl_tx_ant_config_cmd { 3882f748deceee10bac563df0e859830cc628d1a841Wey-Yi Guy __le32 valid; 389ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 3902f748deceee10bac563df0e859830cc628d1a841Wey-Yi Guy 391b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 392b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (0a) 393b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Alive and Error Commands & Responses: 394b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 395b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 396b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 39751e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define UCODE_VALID_OK cpu_to_le32(0x1) 398ca7966c88e44233fac113579071a6f55e00ef5acJohannes Berg 399075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill/** 400075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * REPLY_ALIVE = 0x1 (response only, not a command) 401075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 402075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * uCode issues this "alive" notification once the runtime image is ready 403075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * to receive commands from the driver. This is the *second* "alive" 404075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * notification that the driver will receive after rebooting uCode; 405075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * this "alive" is indicated by subtype field != 9. 406075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 407075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * See comments documenting "BSM" (bootstrap state machine). 408075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 409075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * This response includes two pointers to structures within the device's 410075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * data SRAM (access via HBUS_TARG_MEM_* regs) that are useful for debugging: 411075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 412075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 1) log_event_table_ptr indicates base of the event log. This traces 413075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * a 256-entry history of uCode execution within a circular buffer. 414075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * Its header format is: 415075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 416075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * __le32 log_size; log capacity (in number of entries) 417075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * __le32 type; (1) timestamp with each entry, (0) no timestamp 418075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * __le32 wraps; # times uCode has wrapped to top of circular buffer 419075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * __le32 write_index; next circular buffer entry that uCode would fill 420075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 421075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * The header is followed by the circular buffer of log entries. Entries 422075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * with timestamps have the following format: 423075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 424075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * __le32 event_id; range 0 - 1500 425075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * __le32 timestamp; low 32 bits of TSF (of network, if associated) 426075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * __le32 data; event_id-specific data value 427075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 428075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * Entries without timestamps contain only event_id and data. 429075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 430461ef382fd68f02b7bac8f94f7f2b85162bad896Wey-Yi Guy * 431075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 2) error_event_table_ptr indicates base of the error log. This contains 432461ef382fd68f02b7bac8f94f7f2b85162bad896Wey-Yi Guy * information about any uCode error that occurs. For agn, the format 433e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg * of the error log is defined by struct iwl_error_event_table. 434075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * 435075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * The Linux driver can print both logs to the system log when a uCode error 436075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill * occurs. 437075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill */ 438e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg 439e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg/* 440e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg * Note: This structure is read from the device with IO accesses, 441e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg * and the reading already does the endian conversion. As it is 442e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg * read with u32-sized accesses, any members with a different size 443e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg * need to be ordered correctly though! 444e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg */ 445e46f6538c24f01bb68dc374358ce85a0af666682Johannes Bergstruct iwl_error_event_table { 446e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 valid; /* (nonzero) valid, (0) log is empty */ 447e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 error_id; /* type of error */ 448e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 pc; /* program counter */ 449e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 blink1; /* branch link */ 450e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 blink2; /* branch link */ 451e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 ilink1; /* interrupt link */ 452e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 ilink2; /* interrupt link */ 453e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 data1; /* error-specific data */ 454e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 data2; /* error-specific data */ 455e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 line; /* source code line of error */ 456e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 bcon_time; /* beacon timer */ 457e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 tsf_low; /* network timestamp function timer */ 458e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 tsf_hi; /* network timestamp function timer */ 459e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 gp1; /* GP1 timer register */ 460e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 gp2; /* GP2 timer register */ 461e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 gp3; /* GP3 timer register */ 462e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 ucode_ver; /* uCode version */ 463e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 hw_ver; /* HW Silicon version */ 464e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 brd_ver; /* HW board version */ 465e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 log_pc; /* log program counter */ 466e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 frame_ptr; /* frame pointer */ 467e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 stack_ptr; /* stack pointer */ 468e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 hcmd; /* last host command header */ 469d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy u32 isr0; /* isr status register LMPM_NIC_ISR0: 470d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy * rxtx_flag */ 471d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy u32 isr1; /* isr status register LMPM_NIC_ISR1: 472d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy * host_flag */ 473d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy u32 isr2; /* isr status register LMPM_NIC_ISR2: 474d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy * enc_flag */ 475d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy u32 isr3; /* isr status register LMPM_NIC_ISR3: 476d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy * time_flag */ 477d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy u32 isr4; /* isr status register LMPM_NIC_ISR4: 478d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy * wico interrupt */ 479e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 isr_pref; /* isr status register LMPM_NIC_PREF_STAT */ 480e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 wait_event; /* wait event() caller address */ 481e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 l2p_control; /* L2pControlField */ 482e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 l2p_duration; /* L2pDurationField */ 483e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 l2p_mhvalid; /* L2pMhValidBits */ 484e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 l2p_addr_match; /* L2pAddrMatchStat */ 485d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy u32 lmpm_pmg_sel; /* indicate which clocks are turned on 486d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy * (LMPM_PMG_SEL) */ 487d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy u32 u_timestamp; /* indicate when the date and time of the 488d332f591daca5f5301782bad69f94e160b5fa665Wey-Yi Guy * compilation */ 489e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg u32 flow_handler; /* FH read/write pointers, RX credit */ 490e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg} __packed; 491e46f6538c24f01bb68dc374358ce85a0af666682Johannes Berg 492885ba202cabd90b8ade1fe59185dc96ed4d69e02Tomas Winklerstruct iwl_alive_resp { 493b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 ucode_minor; 494b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 ucode_major; 495b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 reserved1; 496b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 sw_rev[8]; 497b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 ver_type; 498075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill u8 ver_subtype; /* not "9" for runtime alive */ 499b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 reserved2; 500075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill __le32 log_event_table_ptr; /* SRAM address for event log */ 501075416cd18cb4a7ed057d9a96b388bc23b43c4b1Ben M Cahill __le32 error_event_table_ptr; /* SRAM address for error log */ 502b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 timestamp; 503b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 is_valid; 504ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 505b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 506b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 507b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_ERROR = 0x2 (response only, not a command) 508b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 509885ba202cabd90b8ade1fe59185dc96ed4d69e02Tomas Winklerstruct iwl_error_resp { 510b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 error_type; 511b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 cmd_id; 512b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 reserved1; 513b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 bad_cmd_seq_num; 514b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 error_info; 5153195c1f3499912b207ae600968488759b16037fcTomas Winkler __le64 timestamp; 516ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 517b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 518b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 519b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (1) 520b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * RXON Commands & Responses: 521b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 522b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 523b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 524b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 525b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Rx config defines & structure 526b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 527b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* rx_config device types */ 528b481de9ca074528fe8c429604e2777db8b89806aZhu Yienum { 529b481de9ca074528fe8c429604e2777db8b89806aZhu Yi RXON_DEV_TYPE_AP = 1, 530b481de9ca074528fe8c429604e2777db8b89806aZhu Yi RXON_DEV_TYPE_ESS = 3, 531b481de9ca074528fe8c429604e2777db8b89806aZhu Yi RXON_DEV_TYPE_IBSS = 4, 532b481de9ca074528fe8c429604e2777db8b89806aZhu Yi RXON_DEV_TYPE_SNIFFER = 6, 533946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg RXON_DEV_TYPE_CP = 7, 534946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg RXON_DEV_TYPE_2STA = 8, 535946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg RXON_DEV_TYPE_P2P = 9, 536b481de9ca074528fe8c429604e2777db8b89806aZhu Yi}; 537b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 53814519a0b46085db68e610147098d03386c34801fBen M Cahill 53951e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_RX_CHAIN_DRIVER_FORCE_MSK cpu_to_le16(0x1 << 0) 5407b841727d2715d97592f46164804b34d6241644fRick Farrington#define RXON_RX_CHAIN_DRIVER_FORCE_POS (0) 54151e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_RX_CHAIN_VALID_MSK cpu_to_le16(0x7 << 1) 54214519a0b46085db68e610147098d03386c34801fBen M Cahill#define RXON_RX_CHAIN_VALID_POS (1) 54351e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_RX_CHAIN_FORCE_SEL_MSK cpu_to_le16(0x7 << 4) 54414519a0b46085db68e610147098d03386c34801fBen M Cahill#define RXON_RX_CHAIN_FORCE_SEL_POS (4) 54551e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_RX_CHAIN_FORCE_MIMO_SEL_MSK cpu_to_le16(0x7 << 7) 54614519a0b46085db68e610147098d03386c34801fBen M Cahill#define RXON_RX_CHAIN_FORCE_MIMO_SEL_POS (7) 54751e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_RX_CHAIN_CNT_MSK cpu_to_le16(0x3 << 10) 54814519a0b46085db68e610147098d03386c34801fBen M Cahill#define RXON_RX_CHAIN_CNT_POS (10) 54951e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_RX_CHAIN_MIMO_CNT_MSK cpu_to_le16(0x3 << 12) 55014519a0b46085db68e610147098d03386c34801fBen M Cahill#define RXON_RX_CHAIN_MIMO_CNT_POS (12) 55151e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_RX_CHAIN_MIMO_FORCE_MSK cpu_to_le16(0x1 << 14) 55214519a0b46085db68e610147098d03386c34801fBen M Cahill#define RXON_RX_CHAIN_MIMO_FORCE_POS (14) 55314519a0b46085db68e610147098d03386c34801fBen M Cahill 554b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* rx_config flags */ 555b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* band & modulation selection */ 55651e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_BAND_24G_MSK cpu_to_le32(1 << 0) 55751e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_CCK_MSK cpu_to_le32(1 << 1) 558b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* auto detection enable */ 55951e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_AUTO_DETECT_MSK cpu_to_le32(1 << 2) 560b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* TGg protection when tx */ 56151e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_TGG_PROTECT_MSK cpu_to_le32(1 << 3) 562b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* cck short slot & preamble */ 56351e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_SHORT_SLOT_MSK cpu_to_le32(1 << 4) 56451e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_SHORT_PREAMBLE_MSK cpu_to_le32(1 << 5) 565b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* antenna selection */ 56651e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_DIS_DIV_MSK cpu_to_le32(1 << 7) 56751e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_ANT_SEL_MSK cpu_to_le32(0x0f00) 56851e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_ANT_A_MSK cpu_to_le32(1 << 8) 56951e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_ANT_B_MSK cpu_to_le32(1 << 9) 570b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* radar detection enable */ 57151e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_RADAR_DETECT_MSK cpu_to_le32(1 << 12) 57251e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_TGJ_NARROW_BAND_MSK cpu_to_le32(1 << 13) 573b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* rx response to host with 8-byte TSF 574b481de9ca074528fe8c429604e2777db8b89806aZhu Yi* (according to ON_AIR deassertion) */ 57551e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_TSF2HOST_MSK cpu_to_le32(1 << 15) 576b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 57714519a0b46085db68e610147098d03386c34801fBen M Cahill 57814519a0b46085db68e610147098d03386c34801fBen M Cahill/* HT flags */ 57914519a0b46085db68e610147098d03386c34801fBen M Cahill#define RXON_FLG_CTRL_CHANNEL_LOC_POS (22) 58051e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK cpu_to_le32(0x1 << 22) 58114519a0b46085db68e610147098d03386c34801fBen M Cahill 58214519a0b46085db68e610147098d03386c34801fBen M Cahill#define RXON_FLG_HT_OPERATING_MODE_POS (23) 58314519a0b46085db68e610147098d03386c34801fBen M Cahill 58451e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_HT_PROT_MSK cpu_to_le32(0x1 << 23) 5857aafef1c6e2e24f9a10dc2972bf0ee70624ccc47Wey-Yi Guy#define RXON_FLG_HT40_PROT_MSK cpu_to_le32(0x2 << 23) 58614519a0b46085db68e610147098d03386c34801fBen M Cahill 58714519a0b46085db68e610147098d03386c34801fBen M Cahill#define RXON_FLG_CHANNEL_MODE_POS (25) 58851e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_CHANNEL_MODE_MSK cpu_to_le32(0x3 << 25) 589a2b0f02e4795bfde5f11720a10af8923cb98b654Wey-Yi Guy 590a2b0f02e4795bfde5f11720a10af8923cb98b654Wey-Yi Guy/* channel mode */ 591a2b0f02e4795bfde5f11720a10af8923cb98b654Wey-Yi Guyenum { 592a2b0f02e4795bfde5f11720a10af8923cb98b654Wey-Yi Guy CHANNEL_MODE_LEGACY = 0, 593a2b0f02e4795bfde5f11720a10af8923cb98b654Wey-Yi Guy CHANNEL_MODE_PURE_40 = 1, 594a2b0f02e4795bfde5f11720a10af8923cb98b654Wey-Yi Guy CHANNEL_MODE_MIXED = 2, 595a2b0f02e4795bfde5f11720a10af8923cb98b654Wey-Yi Guy CHANNEL_MODE_RESERVED = 3, 596a2b0f02e4795bfde5f11720a10af8923cb98b654Wey-Yi Guy}; 597a2b0f02e4795bfde5f11720a10af8923cb98b654Wey-Yi Guy#define RXON_FLG_CHANNEL_MODE_LEGACY cpu_to_le32(CHANNEL_MODE_LEGACY << RXON_FLG_CHANNEL_MODE_POS) 598a2b0f02e4795bfde5f11720a10af8923cb98b654Wey-Yi Guy#define RXON_FLG_CHANNEL_MODE_PURE_40 cpu_to_le32(CHANNEL_MODE_PURE_40 << RXON_FLG_CHANNEL_MODE_POS) 599a2b0f02e4795bfde5f11720a10af8923cb98b654Wey-Yi Guy#define RXON_FLG_CHANNEL_MODE_MIXED cpu_to_le32(CHANNEL_MODE_MIXED << RXON_FLG_CHANNEL_MODE_POS) 600a2b0f02e4795bfde5f11720a10af8923cb98b654Wey-Yi Guy 601a326a5d096f031af46c0073dd78eb80dea1f311aEmmanuel Grumbach/* CTS to self (if spec allows) flag */ 60251e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FLG_SELF_CTS_EN cpu_to_le32(0x1<<30) 60314519a0b46085db68e610147098d03386c34801fBen M Cahill 604b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* rx_config filter flags */ 605b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* accept all data frames */ 60651e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FILTER_PROMISC_MSK cpu_to_le32(1 << 0) 607b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* pass control & management to host */ 60851e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FILTER_CTL2HOST_MSK cpu_to_le32(1 << 1) 609b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* accept multi-cast */ 61051e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FILTER_ACCEPT_GRP_MSK cpu_to_le32(1 << 2) 611b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* don't decrypt uni-cast frames */ 61251e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FILTER_DIS_DECRYPT_MSK cpu_to_le32(1 << 3) 613b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* don't decrypt multi-cast frames */ 61451e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FILTER_DIS_GRP_DECRYPT_MSK cpu_to_le32(1 << 4) 615b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* STA is associated */ 61651e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FILTER_ASSOC_MSK cpu_to_le32(1 << 5) 617b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* transfer to host non bssid beacons in associated state */ 61851e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RXON_FILTER_BCON_AWARE_MSK cpu_to_le32(1 << 6) 619b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 62080cc0c382db318de88577eff027d5c4097abef81Ben M Cahill/** 621b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_RXON = 0x10 (command, has simple generic response) 62280cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * 62380cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * RXON tunes the radio tuner to a service channel, and sets up a number 62480cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * of parameters that are used primarily for Rx, but also for Tx operations. 62580cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * 62680cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * NOTE: When tuning to a new channel, driver must set the 62780cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * RXON_FILTER_ASSOC_MSK to 0. This will clear station-dependent 62880cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * info within the device, including the station tables, tx retry 62980cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * rate tables, and txpower tables. Driver must build a new station 63080cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * table and txpower table before transmitting anything on the RXON 63180cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * channel. 63280cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * 63380cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * NOTE: All RXONs wipe clean the internal txpower table. Driver must 63480cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * issue a new REPLY_TX_PWR_TABLE_CMD after each REPLY_RXON (0x10), 63580cc0c382db318de88577eff027d5c4097abef81Ben M Cahill * regardless of whether RXON_FILTER_ASSOC_MSK is set. 636b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 6373d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler 638c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenmanstruct iwl_rxon_cmd { 639c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman u8 node_addr[6]; 640c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman __le16 reserved1; 641c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman u8 bssid_addr[6]; 642c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman __le16 reserved2; 643c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman u8 wlap_bssid_addr[6]; 644c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman __le16 reserved3; 645c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman u8 dev_type; 646c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman u8 air_propagation; 647c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman __le16 rx_chain; 648c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman u8 ofdm_basic_rates; 649c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman u8 cck_basic_rates; 650c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman __le16 assoc_id; 651c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman __le32 flags; 652c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman __le32 filter_flags; 653c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman __le16 channel; 654c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman u8 ofdm_ht_single_stream_basic_rates; 655c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman u8 ofdm_ht_dual_stream_basic_rates; 656c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman u8 ofdm_ht_triple_stream_basic_rates; 657c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman u8 reserved5; 658c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman __le16 acquisition_data; 659c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman __le16 reserved6; 660ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 661c1adf9fb31e31ee753d613bd5bc6aef9b762b747Gregory Greenman 6623d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler/* 6633d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response) 6643d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler */ 66589e746b244064406c3bfe442bb64c3230f42fa98Wey-Yi Guystruct iwl_rxon_assoc_cmd { 666b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 flags; 667b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 filter_flags; 668b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 ofdm_basic_rates; 669b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 cck_basic_rates; 6703d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler __le16 reserved1; 671b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 ofdm_ht_single_stream_basic_rates; 672b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 ofdm_ht_dual_stream_basic_rates; 6733d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler u8 ofdm_ht_triple_stream_basic_rates; 6743d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler u8 reserved2; 675b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 rx_chain_select_flags; 6763d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler __le16 acquisition_data; 6773d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler __le32 reserved3; 678ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 679b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 680b5d7be5e665f29274cfe6645b661acb38cb1d19bTomas Winkler#define IWL_CONN_MAX_LISTEN_INTERVAL 10 6812c2f3b33888419fb9e7d015b9dc67b9db4437efaTomas Winkler#define IWL_MAX_UCODE_BEACON_INTERVAL 4 /* 4096 */ 682fe7a90c2b73f0c1da0882861cd015c835ed28781Ron Rindjunsky 683b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 684b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_RXON_TIMING = 0x14 (command, has simple generic response) 685b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 6863195c1f3499912b207ae600968488759b16037fcTomas Winklerstruct iwl_rxon_time_cmd { 6873195c1f3499912b207ae600968488759b16037fcTomas Winkler __le64 timestamp; 688b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 beacon_interval; 689b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 atim_window; 690b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 beacon_init_val; 691b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 listen_interval; 692946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg u8 dtim_period; 693946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg u8 delta_cp_bss_tbtts; 694ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 695b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 696b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 697b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) 698b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 699e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy/** 700e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * struct iwl5000_channel_switch_cmd 701e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @band: 0- 5.2GHz, 1- 2.4GHz 702e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @expect_beacon: 0- resume transmits after channel switch 703e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * 1- wait for beacon to resume transmits 704e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @channel: new channel number 705e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @rxon_flags: Rx on flags 706e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @rxon_filter_flags: filtering parameters 707e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @switch_time: switch time in extended beacon format 708e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @reserved: reserved bytes 709e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy */ 710e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guystruct iwl5000_channel_switch_cmd { 711e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy u8 band; 712e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy u8 expect_beacon; 713e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy __le16 channel; 714e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy __le32 rxon_flags; 715e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy __le32 rxon_filter_flags; 716e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy __le32 switch_time; 717e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy __le32 reserved[2][IWL_PWR_NUM_HT_OFDM_ENTRIES + IWL_PWR_CCK_ENTRIES]; 718ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 719e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy 720e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy/** 721e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * struct iwl6000_channel_switch_cmd 722e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @band: 0- 5.2GHz, 1- 2.4GHz 723e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @expect_beacon: 0- resume transmits after channel switch 724e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * 1- wait for beacon to resume transmits 725e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @channel: new channel number 726e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @rxon_flags: Rx on flags 727e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @rxon_filter_flags: filtering parameters 728e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @switch_time: switch time in extended beacon format 729e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy * @reserved: reserved bytes 730e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy */ 731e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guystruct iwl6000_channel_switch_cmd { 732e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy u8 band; 733e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy u8 expect_beacon; 734e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy __le16 channel; 735e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy __le32 rxon_flags; 736e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy __le32 rxon_filter_flags; 737e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy __le32 switch_time; 738e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy __le32 reserved[3][IWL_PWR_NUM_HT_OFDM_ENTRIES + IWL_PWR_CCK_ENTRIES]; 739ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 740e57f14895bf6bc7f16df760963427ac6ee6ff7e1Wey-Yi Guy 741b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 742b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command) 743b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 7442aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_csa_notification { 745b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 band; 746b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 channel; 747b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 status; /* 0 - OK, 1 - fail */ 748ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 749b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 750b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 751b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (2) 752b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Quality-of-Service (QOS) Commands & Responses: 753b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 754b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 7552054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill 7562054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill/** 7572054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * struct iwl_ac_qos -- QOS timing params for REPLY_QOS_PARAM 7582054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * One for each of 4 EDCA access categories in struct iwl_qosparam_cmd 7592054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * 7602054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * @cw_min: Contention window, start value in numbers of slots. 7612054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * Should be a power-of-2, minus 1. Device's default is 0x0f. 7622054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * @cw_max: Contention window, max value in numbers of slots. 7632054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * Should be a power-of-2, minus 1. Device's default is 0x3f. 7642054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * @aifsn: Number of slots in Arbitration Interframe Space (before 7652054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * performing random backoff timing prior to Tx). Device default 1. 7662054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * @edca_txop: Length of Tx opportunity, in uSecs. Device default is 0. 7672054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * 7682054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * Device will automatically increase contention window by (2*CW) + 1 for each 7692054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * transmission retry. Device uses cw_max as a bit mask, ANDed with new CW 7702054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * value, to cap the CW value. 7712054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill */ 7721ff50bda6eef4466366e197541508fc69af0f0c0Emmanuel Grumbachstruct iwl_ac_qos { 773b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 cw_min; 774b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 cw_max; 775b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 aifsn; 776b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 reserved1; 777b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 edca_txop; 778ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 779b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 780b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* QoS flags defines */ 78151e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define QOS_PARAM_FLG_UPDATE_EDCA_MSK cpu_to_le32(0x01) 78251e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define QOS_PARAM_FLG_TGN_MSK cpu_to_le32(0x02) 78351e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define QOS_PARAM_FLG_TXOP_TYPE_MSK cpu_to_le32(0x10) 784b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 7852054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill/* Number of Access Categories (AC) (EDCA), queues 0..3 */ 786b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define AC_NUM 4 787b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 788b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 789b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_QOS_PARAM = 0x13 (command, has simple generic response) 7902054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * 7912054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * This command sets up timings for each of the 4 prioritized EDCA Tx FIFOs 7922054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * 0: Background, 1: Best Effort, 2: Video, 3: Voice. 793b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 7941ff50bda6eef4466366e197541508fc69af0f0c0Emmanuel Grumbachstruct iwl_qosparam_cmd { 795b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 qos_flags; 7961ff50bda6eef4466366e197541508fc69af0f0c0Emmanuel Grumbach struct iwl_ac_qos ac[AC_NUM]; 797ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 798b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 799b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 800b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (3) 801b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Add/Modify Stations Commands & Responses: 802b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 803b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 804b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 805b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Multi station support 806b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 8072054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill 8082054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill/* Special, dedicated locations within device's station table */ 809b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define IWL_AP_ID 0 810946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg#define IWL_AP_ID_PAN 1 811b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define IWL_STA_ID 2 812946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg#define IWLAGN_PAN_BCAST_ID 14 813bf3c7fddf9dffb0e5c76da3a94b8f5817a72f92cWey-Yi Guy#define IWLAGN_BROADCAST_ID 15 814bf3c7fddf9dffb0e5c76da3a94b8f5817a72f92cWey-Yi Guy#define IWLAGN_STATION_COUNT 16 815b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 816b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define IWL_INVALID_STATION 255 8179a215e40d70ae63762963ab3ccc7f31dd966dc6aJohannes Berg#define IWL_MAX_TID_COUNT 8 8183d29dd9b5b160ba4542a9b8f869a220559e633a0Emmanuel Grumbach#define IWL_TID_NON_QOS IWL_MAX_TID_COUNT 819b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 8201bd14eaf9e2e790c79c6060b9c630afddc67dfacJohannes Berg#define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2) 8211bd14eaf9e2e790c79c6060b9c630afddc67dfacJohannes Berg#define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8) 822946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg#define STA_FLG_PAN_STATION cpu_to_le32(1 << 13) 82351e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_FLG_RTS_MIMO_PROT_MSK cpu_to_le32(1 << 17) 82451e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_FLG_AGG_MPDU_8US_MSK cpu_to_le32(1 << 18) 82574093ddf4c42da74922b63fb6844989e21164d9eBen M Cahill#define STA_FLG_MAX_AGG_SIZE_POS (19) 82651e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_FLG_MAX_AGG_SIZE_MSK cpu_to_le32(3 << 19) 8277aafef1c6e2e24f9a10dc2972bf0ee70624ccc47Wey-Yi Guy#define STA_FLG_HT40_EN_MSK cpu_to_le32(1 << 21) 82851e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_FLG_MIMO_DIS_MSK cpu_to_le32(1 << 22) 82974093ddf4c42da74922b63fb6844989e21164d9eBen M Cahill#define STA_FLG_AGG_MPDU_DENSITY_POS (23) 83051e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_FLG_AGG_MPDU_DENSITY_MSK cpu_to_le32(7 << 23) 831b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 8322054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill/* Use in mode field. 1: modify existing entry, 0: add new station entry */ 833b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define STA_CONTROL_MODIFY_MSK 0x01 834b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 835b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* key flags __le16*/ 83651e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_KEY_FLG_ENCRYPT_MSK cpu_to_le16(0x0007) 83751e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_KEY_FLG_NO_ENC cpu_to_le16(0x0000) 83851e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_KEY_FLG_WEP cpu_to_le16(0x0001) 83951e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_KEY_FLG_CCMP cpu_to_le16(0x0002) 84051e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_KEY_FLG_TKIP cpu_to_le16(0x0003) 841b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 842b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define STA_KEY_FLG_KEYID_POS 8 84351e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_KEY_FLG_INVALID cpu_to_le16(0x0800) 844eaaf7894959d413d1e01443a622c507e1b4f61dbEmmanuel Grumbach/* wep key is either from global key (0) or from station info array (1) */ 84551e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_KEY_FLG_MAP_KEY_MSK cpu_to_le16(0x0008) 846eaaf7894959d413d1e01443a622c507e1b4f61dbEmmanuel Grumbach 847eaaf7894959d413d1e01443a622c507e1b4f61dbEmmanuel Grumbach/* wep key in STA: 5-bytes (0) or 13-bytes (1) */ 84851e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_KEY_FLG_KEY_SIZE_MSK cpu_to_le16(0x1000) 84951e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STA_KEY_MULTICAST_MSK cpu_to_le16(0x4000) 850deb09c435e3f947f8b2c9d5df6a9c0a5b472b125Emmanuel Grumbach#define STA_KEY_MAX_NUM 8 851c10afb6e844b7936092396f719b794c4d0038f27Johannes Berg#define STA_KEY_MAX_NUM_PAN 16 8525a3d9882b84edf5fa8e8ca33a5d6df25e2e727a5Johannes Berg/* must not match WEP_INVALID_OFFSET */ 8535a3d9882b84edf5fa8e8ca33a5d6df25e2e727a5Johannes Berg#define IWLAGN_HW_KEY_DEFAULT 0xfe 854b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 8552054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill/* Flags indicate whether to modify vs. don't change various station params */ 856b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define STA_MODIFY_KEY_MASK 0x01 857b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define STA_MODIFY_TID_DISABLE_TX 0x02 858b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define STA_MODIFY_TX_RATE_MSK 0x04 859b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define STA_MODIFY_ADDBA_TID_MSK 0x08 860b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define STA_MODIFY_DELBA_TID_MSK 0x10 8616ab10ff8738dfb098fd32132b7ebcf5cdb43ebdeJohannes Berg#define STA_MODIFY_SLEEP_TX_COUNT_MSK 0x20 8622054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill 8632054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill/* Receiver address (actually, Rx station's index into station table), 8642054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * combined with Traffic ID (QOS priority), in format used by Tx Scheduler */ 865b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid)) 866b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 867a8029bb79ec6de4acab5a6d3b931990152e8d5c1Wey-Yi Guy/* agn */ 868133636deffc86809f59a0c8b768408d13237a9a2Tomas Winklerstruct iwl_keyinfo { 869133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler __le16 key_flags; 870133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */ 871133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler u8 reserved1; 872133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler __le16 tkip_rx_ttak[5]; /* 10-byte unicast TKIP TTAK */ 873133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler u8 key_offset; 874133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler u8 reserved2; 875133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler u8 key[16]; /* 16-byte unicast decryption key */ 876133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler __le64 tx_secur_seq_cnt; 877133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler __le64 hw_tkip_mic_rx_key; 878133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler __le64 hw_tkip_mic_tx_key; 879ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 880133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler 8812054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill/** 8822054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * struct sta_id_modify 8832054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * @addr[ETH_ALEN]: station's MAC address 8842054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * @sta_id: index of station in uCode's station table 8852054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * @modify_mask: STA_MODIFY_*, 1: modify, 0: don't change 8862054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * 8872054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * Driver selects unused table index when adding new station, 8882054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * or the index to a pre-existing station entry when modifying that station. 8892054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * Some indexes have special purposes (IWL_AP_ID, index 0, is for AP). 8902054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * 8912054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * modify_mask flags select which parameters to modify vs. leave alone. 8922054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill */ 893b481de9ca074528fe8c429604e2777db8b89806aZhu Yistruct sta_id_modify { 894b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 addr[ETH_ALEN]; 895b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 reserved1; 896b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 sta_id; 897b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 modify_mask; 898b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 reserved2; 899ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 900b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 901b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 902b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_ADD_STA = 0x18 (command) 9032054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * 9042054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * The device contains an internal table of per-station information, 9052054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * with info on security keys, aggregation parameters, and Tx rates for 906767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * initial Tx attempt and any retries (agn devices uses 907767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * REPLY_TX_LINK_QUALITY_CMD, 9082054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * 9092054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * REPLY_ADD_STA sets up the table entry for one station, either creating 9102054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * a new entry, or modifying a pre-existing one. 9112054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * 9122054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * NOTE: RXON command (without "associated" bit set) wipes the station table 9132054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * clean. Moving into RF_KILL state does this also. Driver must set up 9142054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * new station table before transmitting anything on the RXON channel 9152054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * (except active scans or active measurements; those commands carry 9162054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * their own txpower/rate setup data). 9172054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * 9182054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * When getting started on a new channel, driver must set up the 9192054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * IWL_BROADCAST_ID entry (last entry in the table). For a client 9202054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * station in a BSS, once an AP is selected, driver sets up the AP STA 9212054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * in the IWL_AP_ID entry (1st entry in the table). BROADCAST and AP 9222054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * are all that are needed for a BSS client station. If the device is 9232054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * used as AP, or in an IBSS network, driver must set up station table 9242054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill * entries for all STAs in network, starting with index IWL_STA_ID. 925b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 9263d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler 927133636deffc86809f59a0c8b768408d13237a9a2Tomas Winklerstruct iwl_addsta_cmd { 928133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler u8 mode; /* 1: modify existing, 0: add new station */ 929133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler u8 reserved[3]; 930133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler struct sta_id_modify sta; 931133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler struct iwl_keyinfo key; 932133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler __le32 station_flags; /* STA_FLG_* */ 933133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler __le32 station_flags_msk; /* STA_FLG_* */ 934133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler 935133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler /* bit field to disable (1) or enable (0) Tx for Traffic ID (TID) 936133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler * corresponding to bit (e.g. bit 5 controls TID 5). 937133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler * Set modify_mask bit STA_MODIFY_TID_DISABLE_TX to use this field. */ 938133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler __le16 tid_disable_tx; 9397f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy __le16 legacy_reserved; 940133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler 941133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler /* TID for which to add block-ack support. 942133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */ 943133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler u8 add_immediate_ba_tid; 944133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler 945133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler /* TID for which to remove block-ack support. 946133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler * Set modify_mask bit STA_MODIFY_DELBA_TID_MSK to use this field. */ 947133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler u8 remove_immediate_ba_tid; 948133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler 949133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler /* Starting Sequence Number for added block-ack support. 950133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */ 951133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler __le16 add_immediate_ba_ssn; 952133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler 9539bb487b406692e172b15eba58de7d69358ac2005Johannes Berg /* 9549bb487b406692e172b15eba58de7d69358ac2005Johannes Berg * Number of packets OK to transmit to station even though 9559bb487b406692e172b15eba58de7d69358ac2005Johannes Berg * it is asleep -- used to synchronise PS-poll and u-APSD 9569bb487b406692e172b15eba58de7d69358ac2005Johannes Berg * responses while ucode keeps track of STA sleep state. 9579bb487b406692e172b15eba58de7d69358ac2005Johannes Berg */ 9589bb487b406692e172b15eba58de7d69358ac2005Johannes Berg __le16 sleep_tx_count; 9599bb487b406692e172b15eba58de7d69358ac2005Johannes Berg 9609bb487b406692e172b15eba58de7d69358ac2005Johannes Berg __le16 reserved2; 961ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 962133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler 963133636deffc86809f59a0c8b768408d13237a9a2Tomas Winkler 9642054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill#define ADD_STA_SUCCESS_MSK 0x1 9652054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill#define ADD_STA_NO_ROOM_IN_TABLE 0x2 9662054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill#define ADD_STA_NO_BLOCK_ACK_RESOURCE 0x4 9672054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill#define ADD_STA_MODIFY_NON_EXIST_STA 0x8 968b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 969b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_ADD_STA = 0x18 (response) 970b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 9717a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winklerstruct iwl_add_sta_resp { 9722054a00bb83409345d14a944e25c15e6ea317651Ben M Cahill u8 status; /* ADD_STA_* */ 973ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 974b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 9757a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler#define REM_STA_SUCCESS_MSK 0x1 9767a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler/* 9777a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler * REPLY_REM_STA = 0x19 (response) 9787a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler */ 9797a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winklerstruct iwl_rem_sta_resp { 9807a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler u8 status; 981ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 9827a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler 9837a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler/* 9847a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler * REPLY_REM_STA = 0x19 (command) 9857a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler */ 9867a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winklerstruct iwl_rem_sta_cmd { 9877a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler u8 num_sta; /* number of removed stations */ 9887a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler u8 reserved[3]; 9897a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler u8 addr[ETH_ALEN]; /* MAC addr of the first station */ 9907a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler u8 reserved2[2]; 991ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 9927a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler 993f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy 994f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy/* WiFi queues mask */ 995f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy#define IWL_SCD_BK_MSK cpu_to_le32(BIT(0)) 996f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy#define IWL_SCD_BE_MSK cpu_to_le32(BIT(1)) 997f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy#define IWL_SCD_VI_MSK cpu_to_le32(BIT(2)) 998f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy#define IWL_SCD_VO_MSK cpu_to_le32(BIT(3)) 999f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy#define IWL_SCD_MGMT_MSK cpu_to_le32(BIT(3)) 1000f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy 1001f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy/* PAN queues mask */ 1002f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy#define IWL_PAN_SCD_BK_MSK cpu_to_le32(BIT(4)) 1003f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy#define IWL_PAN_SCD_BE_MSK cpu_to_le32(BIT(5)) 1004f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy#define IWL_PAN_SCD_VI_MSK cpu_to_le32(BIT(6)) 1005f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy#define IWL_PAN_SCD_VO_MSK cpu_to_le32(BIT(7)) 1006f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy#define IWL_PAN_SCD_MGMT_MSK cpu_to_le32(BIT(7)) 1007f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy#define IWL_PAN_SCD_MULTICAST_MSK cpu_to_le32(BIT(8)) 1008f88e0ecc896f91d6965ba2935dcdf2280044a30aWey-Yi Guy 1009947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy#define IWL_AGG_TX_QUEUE_MSK cpu_to_le32(0xffc00) 1010947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy 1011716c74b00717ad9caedb4a46059fb64a3da99808Wey-Yi Guy#define IWL_DROP_SINGLE 0 1012ecdbe86eda74005d1b4bc8387e1825ad95fab705Wey-Yi Guy#define IWL_DROP_ALL (BIT(IWL_RXON_CTX_BSS) | BIT(IWL_RXON_CTX_PAN)) 1013716c74b00717ad9caedb4a46059fb64a3da99808Wey-Yi Guy 1014947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy/* 1015947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * REPLY_TXFIFO_FLUSH = 0x1e(command and response) 1016947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * 1017947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * When using full FIFO flush this command checks the scheduler HW block WR/RD 1018947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * pointers to check if all the frames were transferred by DMA into the 1019947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * relevant TX FIFO queue. Only when the DMA is finished and the queue is 1020947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * empty the command can finish. 1021947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * This command is used to flush the TXFIFO from transmit commands, it may 1022947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * operate on single or multiple queues, the command queue can't be flushed by 1023947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * this command. The command response is returned when all the queue flush 1024947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * operations are done. Each TX command flushed return response with the FLUSH 1025947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * status set in the TX response status. When FIFO flush operation is used, 1026947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * the flush operation ends when both the scheduler DMA done and TXFIFO empty 1027947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * are set. 1028947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * 1029947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * @fifo_control: bit mask for which queues to flush 1030947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * @flush_control: flush controls 1031947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * 0: Dump single MSDU 1032947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * 1: Dump multiple MSDU according to PS, INVALID STA, TTL, TID disable. 1033947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy * 2: Dump all FIFO 1034947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy */ 1035947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guystruct iwl_txfifo_flush_cmd { 1036947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy __le32 fifo_control; 1037947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy __le16 flush_control; 1038947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy __le16 reserved; 10390e954099b7910524b7fae831fbf2933bd25cb6d0John W. Linville} __packed; 1040947279eefb77f79015a79b032eb825a065ab035fWey-Yi Guy 10410a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach/* 10420a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach * REPLY_WEP_KEY = 0x20 10430a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach */ 10440a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbachstruct iwl_wep_key { 10450a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach u8 key_index; 10460a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach u8 key_offset; 10470a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach u8 reserved1[2]; 10480a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach u8 key_size; 10490a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach u8 reserved2[3]; 10500a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach u8 key[16]; 1051ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 10520a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach 10530a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbachstruct iwl_wep_cmd { 10540a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach u8 num_keys; 10550a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach u8 global_key_type; 10560a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach u8 flags; 10570a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach u8 reserved; 10580a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach struct iwl_wep_key key[0]; 1059ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 10600a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach 10610a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach#define WEP_KEY_WEP_TYPE 1 10620a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach#define WEP_KEYS_MAX 4 10630a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach#define WEP_INVALID_OFFSET 0xff 10644564ce8b0e17d91d047aa875843deb2cccf3f268Emmanuel Grumbach#define WEP_KEY_LEN_64 5 10650a0bed1d10105a9f58cd14ebe216e8479dd31fdaEmmanuel Grumbach#define WEP_KEY_LEN_128 13 1066b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1067b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 1068b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (4) 1069b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Rx Responses: 1070b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 1071b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 1072b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 107351e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RX_RES_STATUS_NO_CRC32_ERROR cpu_to_le32(1 << 0) 107451e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RX_RES_STATUS_NO_RXE_OVERFLOW cpu_to_le32(1 << 1) 10758211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler 107651e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RX_RES_PHY_FLAGS_BAND_24_MSK cpu_to_le16(1 << 0) 107751e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RX_RES_PHY_FLAGS_MOD_CCK_MSK cpu_to_le16(1 << 1) 107851e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK cpu_to_le16(1 << 2) 107951e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define RX_RES_PHY_FLAGS_NARROW_BAND_MSK cpu_to_le16(1 << 3) 10809024adf5c81c94f7b5c6fd26942b075e2a26e085Reinette Chatre#define RX_RES_PHY_FLAGS_ANTENNA_MSK 0xf0 10819f30e04e041cf9943940f71fd76094dd5a237018Daniel C Halperin#define RX_RES_PHY_FLAGS_ANTENNA_POS 4 10828211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler 10838211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler#define RX_RES_STATUS_SEC_TYPE_MSK (0x7 << 8) 10848211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler#define RX_RES_STATUS_SEC_TYPE_NONE (0x0 << 8) 10858211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler#define RX_RES_STATUS_SEC_TYPE_WEP (0x1 << 8) 10868211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler#define RX_RES_STATUS_SEC_TYPE_CCMP (0x2 << 8) 10878211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler#define RX_RES_STATUS_SEC_TYPE_TKIP (0x3 << 8) 108817e476b8db13790c03e2c46d93abc71468fca47eEmmanuel Grumbach#define RX_RES_STATUS_SEC_TYPE_ERR (0x7 << 8) 108917e476b8db13790c03e2c46d93abc71468fca47eEmmanuel Grumbach 109017e476b8db13790c03e2c46d93abc71468fca47eEmmanuel Grumbach#define RX_RES_STATUS_STATION_FOUND (1<<6) 109117e476b8db13790c03e2c46d93abc71468fca47eEmmanuel Grumbach#define RX_RES_STATUS_NO_STATION_INFO_MISMATCH (1<<7) 10928211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler 10938211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler#define RX_RES_STATUS_DECRYPT_TYPE_MSK (0x3 << 11) 10948211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler#define RX_RES_STATUS_NOT_DECRYPT (0x0 << 11) 10958211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler#define RX_RES_STATUS_DECRYPT_OK (0x3 << 11) 10968211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler#define RX_RES_STATUS_BAD_ICV_MIC (0x1 << 11) 10978211ef78d9023a8772e5acf6b7934598156b2fc8Tomas Winkler#define RX_RES_STATUS_BAD_KEY_TTAK (0x2 << 11) 1098b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 109917e476b8db13790c03e2c46d93abc71468fca47eEmmanuel Grumbach#define RX_MPDU_RES_STATUS_ICV_OK (0x20) 110017e476b8db13790c03e2c46d93abc71468fca47eEmmanuel Grumbach#define RX_MPDU_RES_STATUS_MIC_OK (0x40) 110117e476b8db13790c03e2c46d93abc71468fca47eEmmanuel Grumbach#define RX_MPDU_RES_STATUS_TTAK_OK (1 << 7) 110217e476b8db13790c03e2c46d93abc71468fca47eEmmanuel Grumbach#define RX_MPDU_RES_STATUS_DEC_DONE_MSK (0x800) 110317e476b8db13790c03e2c46d93abc71468fca47eEmmanuel Grumbach 11043d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler 11057ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_RX_RES_PHY_CNT 8 11067ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_RX_RES_AGC_IDX 1 11077ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_RX_RES_RSSI_AB_IDX 2 11087ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_RX_RES_RSSI_C_IDX 3 11097ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_OFDM_AGC_MSK 0xfe00 11107ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_OFDM_AGC_BIT_POS 9 11117ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_OFDM_RSSI_INBAND_A_BITMSK 0x00ff 11127ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_OFDM_RSSI_ALLBAND_A_BITMSK 0xff00 11137ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_OFDM_RSSI_A_BIT_POS 0 11147ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_OFDM_RSSI_INBAND_B_BITMSK 0xff0000 11157ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_OFDM_RSSI_ALLBAND_B_BITMSK 0xff000000 11167ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_OFDM_RSSI_B_BIT_POS 16 11177ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_OFDM_RSSI_INBAND_C_BITMSK 0x00ff 11187ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_OFDM_RSSI_ALLBAND_C_BITMSK 0xff00 11197ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy#define IWLAGN_OFDM_RSSI_C_BIT_POS 0 11207ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy 11217ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guystruct iwlagn_non_cfg_phy { 11227ccc896f4c9d5f11e449368cf520565bf2073a9bWey-Yi Guy __le32 non_cfg_phy[IWLAGN_RX_RES_PHY_CNT]; /* up to 8 phy entries */ 1123ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 1124caab8f1a5d0da583b6ffe41afea2774c676444caTomas Winkler 1125caab8f1a5d0da583b6ffe41afea2774c676444caTomas Winkler 1126b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 1127857485c0c46ceee5c658c1761bba4d9a5ddf433fTomas Winkler * REPLY_RX = 0xc3 (response only, not a command) 1128b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Used only for legacy (non 11n) frames. 1129b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 1130caab8f1a5d0da583b6ffe41afea2774c676444caTomas Winklerstruct iwl_rx_phy_res { 1131b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 non_cfg_phy_cnt; /* non configurable DSP phy data byte count */ 1132b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 cfg_phy_cnt; /* configurable DSP phy data byte count */ 1133b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 stat_id; /* configurable DSP phy data set ID */ 1134b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 reserved1; 1135b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le64 timestamp; /* TSF at on air rise */ 1136b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 beacon_time_stamp; /* beacon at on-air rise */ 1137b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 phy_flags; /* general phy flags: band, modulation, ... */ 1138b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 channel; /* channel number */ 1139caab8f1a5d0da583b6ffe41afea2774c676444caTomas Winkler u8 non_cfg_phy_buf[32]; /* for various implementations of non_cfg_phy */ 1140529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill __le32 rate_n_flags; /* RATE_MCS_* */ 1141529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill __le16 byte_count; /* frame's byte-count */ 114230c1b0f7e96144e42e2be0bdec18d2475f5af31bWey-Yi Guy __le16 frame_time; /* frame's time on the air */ 1143ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 1144b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 11452fb291eea70353618fe10d94f05d16caf51f435fEmmanuel Grumbachstruct iwl_rx_mpdu_res_start { 1146b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 byte_count; 1147b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 reserved; 1148ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 1149b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1150b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1151b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 1152b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (5) 1153b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Tx Commands & Responses: 1154b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 1155529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Driver must place each REPLY_TX command into one of the prioritized Tx 1156529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * queues in host DRAM, shared between driver and device (see comments for 1157529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * SCD registers and Tx/Rx Queues). When the device's Tx scheduler and uCode 1158529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * are preparing to transmit, the device pulls the Tx command over the PCI 1159529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * bus via one of the device's Tx DMA channels, to fill an internal FIFO 1160529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * from which data will be transmitted. 1161529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 1162529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * uCode handles all timing and protocol related to control frames 1163529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * (RTS/CTS/ACK), based on flags in the Tx command. uCode and Tx scheduler 1164529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * handle reception of block-acks; uCode updates the host driver via 1165767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * REPLY_COMPRESSED_BA. 1166529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 1167529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * uCode handles retrying Tx when an ACK is expected but not received. 1168529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * This includes trying lower data rates than the one requested in the Tx 11697f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy * command, as set up by the REPLY_TX_LINK_QUALITY_CMD (agn). 1170529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 1171529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Driver sets up transmit power for various rates via REPLY_TX_PWR_TABLE_CMD. 1172529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * This command must be executed after every RXON command, before Tx can occur. 1173b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 1174b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1175529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill/* REPLY_TX Tx flags field */ 1176529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 11774e3243f549540235d180e446715a14c1b5827902Wey-Yi Guy/* 11784e3243f549540235d180e446715a14c1b5827902Wey-Yi Guy * 1: Use RTS/CTS protocol or CTS-to-self if spec allows it 1179a326a5d096f031af46c0073dd78eb80dea1f311aEmmanuel Grumbach * before this frame. if CTS-to-self required check 11804e3243f549540235d180e446715a14c1b5827902Wey-Yi Guy * RXON_FLG_SELF_CTS_EN status. 11814e3243f549540235d180e446715a14c1b5827902Wey-Yi Guy */ 11824e3243f549540235d180e446715a14c1b5827902Wey-Yi Guy#define TX_CMD_FLG_PROT_REQUIRE_MSK cpu_to_le32(1 << 0) 1183a326a5d096f031af46c0073dd78eb80dea1f311aEmmanuel Grumbach 1184529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill/* 1: Expect ACK from receiving station 1185529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 0: Don't expect ACK (MAC header's duration field s/b 0) 1186529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Set this for unicast frames, but not broadcast/multicast. */ 118751e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define TX_CMD_FLG_ACK_MSK cpu_to_le32(1 << 3) 1188529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1189767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy/* For agn devices: 1190529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 1: Use rate scale table (see REPLY_TX_LINK_QUALITY_CMD). 1191529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Tx command's initial_rate_index indicates first rate to try; 1192529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * uCode walks through table for additional Tx attempts. 1193529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 0: Use Tx rate/MCS from Tx command's rate_n_flags field. 1194529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * This rate will be used for all Tx attempts; it will not be scaled. */ 119551e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define TX_CMD_FLG_STA_RATE_MSK cpu_to_le32(1 << 4) 1196529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1197529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill/* 1: Expect immediate block-ack. 1198529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Set when Txing a block-ack request frame. Also set TX_CMD_FLG_ACK_MSK. */ 119951e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define TX_CMD_FLG_IMM_BA_RSP_MASK cpu_to_le32(1 << 6) 1200529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 12017f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy/* Tx antenna selection field; reserved (0) for agn devices. */ 120251e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define TX_CMD_FLG_ANT_SEL_MSK cpu_to_le32(0xf00) 1203b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1204529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill/* 1: Ignore Bluetooth priority for this frame. 1205529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 0: Delay Tx until Bluetooth device is done (normal usage). */ 1206b2e8690d5a4d1868ee12f50aa00c138bec985b3cJohannes Berg#define TX_CMD_FLG_IGNORE_BT cpu_to_le32(1 << 12) 1207b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1208529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill/* 1: uCode overrides sequence control field in MAC header. 1209529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 0: Driver provides sequence control field in MAC header. 1210529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Set this for management frames, non-QOS data frames, non-unicast frames, 1211529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * and also in Tx command embedded in REPLY_SCAN_CMD for active scans. */ 121251e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define TX_CMD_FLG_SEQ_CTL_MSK cpu_to_le32(1 << 13) 1213b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1214529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill/* 1: This frame is non-last MPDU; more fragments are coming. 1215529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 0: Last fragment, or not using fragmentation. */ 121651e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define TX_CMD_FLG_MORE_FRAG_MSK cpu_to_le32(1 << 14) 1217b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1218529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill/* 1: uCode calculates and inserts Timestamp Function (TSF) in outgoing frame. 1219529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 0: No TSF required in outgoing frame. 1220529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Set this for transmitting beacons and probe responses. */ 122151e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define TX_CMD_FLG_TSF_MSK cpu_to_le32(1 << 16) 1222b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1223529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill/* 1: Driver inserted 2 bytes pad after the MAC header, for (required) dword 1224529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * alignment of frame's payload data field. 1225529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 0: No pad 1226529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Set this for MAC headers with 26 or 30 bytes, i.e. those with QOS or ADDR4 1227529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * field (but not both). Driver must align frame data (i.e. data following 1228529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * MAC header) to DWORD boundary. */ 122951e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define TX_CMD_FLG_MH_PAD_MSK cpu_to_le32(1 << 20) 1230b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 12318236e183fc53be2b5d81a4f547f9c5b645e10fe0Max Stepanov/* accelerate aggregation support 12328236e183fc53be2b5d81a4f547f9c5b645e10fe0Max Stepanov * 0 - no CCMP encryption; 1 - CCMP encryption */ 123351e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define TX_CMD_FLG_AGG_CCMP_MSK cpu_to_le32(1 << 22) 12348236e183fc53be2b5d81a4f547f9c5b645e10fe0Max Stepanov 1235b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* HCCA-AP - disable duration overwriting. */ 123651e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define TX_CMD_FLG_DUR_MSK cpu_to_le32(1 << 25) 1237b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1238529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1239b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 1240b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * TX command security control 1241b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 1242b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define TX_CMD_SEC_WEP 0x01 1243b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define TX_CMD_SEC_CCM 0x02 1244b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define TX_CMD_SEC_TKIP 0x03 1245b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define TX_CMD_SEC_MSK 0x03 1246b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define TX_CMD_SEC_SHIFT 6 1247b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define TX_CMD_SEC_KEY128 0x08 1248b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1249b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 12503195cdb7424b4207f6903f1f3ddadcab49fa22f2Tomas Winkler * security overhead sizes 12513195cdb7424b4207f6903f1f3ddadcab49fa22f2Tomas Winkler */ 12523195cdb7424b4207f6903f1f3ddadcab49fa22f2Tomas Winkler#define WEP_IV_LEN 4 12533195cdb7424b4207f6903f1f3ddadcab49fa22f2Tomas Winkler#define WEP_ICV_LEN 4 12543195cdb7424b4207f6903f1f3ddadcab49fa22f2Tomas Winkler#define CCMP_MIC_LEN 8 12553195cdb7424b4207f6903f1f3ddadcab49fa22f2Tomas Winkler#define TKIP_ICV_LEN 4 12563195cdb7424b4207f6903f1f3ddadcab49fa22f2Tomas Winkler 12573195cdb7424b4207f6903f1f3ddadcab49fa22f2Tomas Winkler/* 12583d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler * REPLY_TX = 0x1c (command) 12593d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler */ 12603d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler 12613d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler/* 1262529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 4965 uCode updates these Tx attempt count values in host DRAM. 1263529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Used for managing Tx retries when expecting block-acks. 1264529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Driver should set these fields to 0. 1265b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 12662aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_dram_scratch { 1267529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill u8 try_cnt; /* Tx attempts */ 1268529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill u8 bt_kill_cnt; /* Tx attempts blocked by Bluetooth device */ 1269b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 reserved; 1270ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 1271b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 127283d527d9e8f9aff92cbd33f208f77c055dabb499Tomas Winklerstruct iwl_tx_cmd { 1273529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill /* 1274529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * MPDU byte count: 1275529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * MAC header (24/26/30/32 bytes) + 2 bytes pad if 26/30 header size, 1276529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * + 8 byte IV for CCM or TKIP (not used for WEP) 1277529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * + Data payload 1278529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * + 8-byte MIC (not used for CCM/WEP) 1279529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * NOTE: Does not include Tx command bytes, post-MAC pad bytes, 1280529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * MIC (CCM) 8 bytes, ICV (WEP/TKIP/CKIP) 4 bytes, CRC 4 bytes.i 1281529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Range: 14-2342 bytes. 1282529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill */ 1283b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 len; 1284529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1285529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill /* 1286529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * MPDU or MSDU byte count for next frame. 1287529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Used for fragmentation and bursting, but not 11n aggregation. 1288529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Same as "len", but for next frame. Set to 0 if not applicable. 1289529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill */ 1290b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 next_frame_len; 1291529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1292529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill __le32 tx_flags; /* TX_CMD_FLG_* */ 1293529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 12942aa6ab86bc475a115f56645591d2413981846509Tomas Winkler /* uCode may modify this field of the Tx command (in host DRAM!). 1295529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Driver must also set dram_lsb_ptr and dram_msb_ptr in this cmd. */ 12962aa6ab86bc475a115f56645591d2413981846509Tomas Winkler struct iwl_dram_scratch scratch; 1297529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1298529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill /* Rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is cleared. */ 1299529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill __le32 rate_n_flags; /* RATE_MCS_* */ 1300529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1301529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill /* Index of destination station in uCode's station table */ 1302b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 sta_id; 1303529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1304529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill /* Type of security encryption: CCM or TKIP */ 1305529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill u8 sec_ctl; /* TX_CMD_SEC_* */ 1306529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1307529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill /* 1308529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Index into rate table (see REPLY_TX_LINK_QUALITY_CMD) for initial 1309529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Tx attempt, if TX_CMD_FLG_STA_RATE_MSK is set. Normally "0" for 1310529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * data frames, this field may be used to selectively reduce initial 1311529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * rate (via non-0 value) for special frames (e.g. management), while 1312529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * still supporting rate scaling for all frames. 1313529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill */ 1314b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 initial_rate_index; 1315b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 reserved; 1316b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 key[16]; 1317b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 next_frame_flags; 1318b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 reserved2; 1319b481de9ca074528fe8c429604e2777db8b89806aZhu Yi union { 1320b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 life_time; 1321b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 attempt; 1322b481de9ca074528fe8c429604e2777db8b89806aZhu Yi } stop_time; 1323529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1324529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill /* Host DRAM physical address pointer to "scratch" in this command. 1325529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Must be dword aligned. "0" in dram_lsb_ptr disables usage. */ 1326b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 dram_lsb_ptr; 1327b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 dram_msb_ptr; 1328529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1329b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 rts_retry_limit; /*byte 50 */ 1330b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 data_retry_limit; /*byte 51 */ 1331b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 tid_tspec; 1332b481de9ca074528fe8c429604e2777db8b89806aZhu Yi union { 1333b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 pm_frame_timeout; 1334b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 attempt_duration; 1335b481de9ca074528fe8c429604e2777db8b89806aZhu Yi } timeout; 1336529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1337529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill /* 1338529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Duration of EDCA burst Tx Opportunity, in 32-usec units. 1339529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Set this if txop time is not specified by HCCA protocol (e.g. by AP). 1340529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill */ 1341b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 driver_txop; 1342529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1343529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill /* 1344529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * MAC header goes here, followed by 2 bytes padding if MAC header 1345529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * length is 26 or 30 bytes, followed by payload data 1346529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill */ 1347b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 payload[0]; 1348b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct ieee80211_hdr hdr[0]; 1349ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 1350b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 135104569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy/* 135204569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy * TX command response is sent after *agn* transmission attempts. 135304569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy * 135404569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy * both postpone and abort status are expected behavior from uCode. there is 135504569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy * no special operation required from driver; except for RFKILL_FLUSH, 135604569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy * which required tx flush host command to flush all the tx frames in queues 135704569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy */ 135804569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guyenum { 1359b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_SUCCESS = 0x01, 1360b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_DIRECT_DONE = 0x02, 136104569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy /* postpone TX */ 136204569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy TX_STATUS_POSTPONE_DELAY = 0x40, 136304569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy TX_STATUS_POSTPONE_FEW_BYTES = 0x41, 136404569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy TX_STATUS_POSTPONE_BT_PRIO = 0x42, 136504569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy TX_STATUS_POSTPONE_QUIET_PERIOD = 0x43, 136604569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy TX_STATUS_POSTPONE_CALC_TTAK = 0x44, 136704569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy /* abort TX */ 136804569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY = 0x81, 1369b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_FAIL_SHORT_LIMIT = 0x82, 1370b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_FAIL_LONG_LIMIT = 0x83, 1371b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_FAIL_FIFO_UNDERRUN = 0x84, 137204569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy TX_STATUS_FAIL_DRAIN_FLOW = 0x85, 137304569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy TX_STATUS_FAIL_RFKILL_FLUSH = 0x86, 1374b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_FAIL_LIFE_EXPIRE = 0x87, 1375b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_FAIL_DEST_PS = 0x88, 137604569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy TX_STATUS_FAIL_HOST_ABORTED = 0x89, 1377b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_FAIL_BT_RETRY = 0x8a, 1378b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_FAIL_STA_INVALID = 0x8b, 1379b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_FAIL_FRAG_DROPPED = 0x8c, 1380b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_FAIL_TID_DISABLE = 0x8d, 138104569cbe7653fe0057acc46afc07f2c2fd2508b3Wey-Yi Guy TX_STATUS_FAIL_FIFO_FLUSHED = 0x8e, 1382b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_FAIL_INSUFFICIENT_CF_POLL = 0x8f, 13831d270075be62fb8212bd5afebd0bab693759a1a0Wey-Yi Guy TX_STATUS_FAIL_PASSIVE_NO_RX = 0x90, 13841d270075be62fb8212bd5afebd0bab693759a1a0Wey-Yi Guy TX_STATUS_FAIL_NO_BEACON_ON_RADAR = 0x91, 1385b481de9ca074528fe8c429604e2777db8b89806aZhu Yi}; 1386b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1387b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define TX_PACKET_MODE_REGULAR 0x0000 1388b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define TX_PACKET_MODE_BURST_SEQ 0x0100 1389b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define TX_PACKET_MODE_BURST_FIRST 0x0200 1390b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1391b481de9ca074528fe8c429604e2777db8b89806aZhu Yienum { 1392b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_POWER_PA_NOT_ACTIVE = 0x0, 1393b481de9ca074528fe8c429604e2777db8b89806aZhu Yi}; 1394b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1395b481de9ca074528fe8c429604e2777db8b89806aZhu Yienum { 13963fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler TX_STATUS_MSK = 0x000000ff, /* bits 0:7 */ 1397b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_DELAY_MSK = 0x00000040, 1398b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_STATUS_ABORT_MSK = 0x00000080, 1399b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_PACKET_MODE_MSK = 0x0000ff00, /* bits 8:15 */ 1400b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_FIFO_NUMBER_MSK = 0x00070000, /* bits 16:18 */ 14013fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler TX_RESERVED = 0x00780000, /* bits 19:22 */ 1402b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_POWER_PA_DETECT_MSK = 0x7f800000, /* bits 23:30 */ 1403b481de9ca074528fe8c429604e2777db8b89806aZhu Yi TX_ABORT_REQUIRED_MSK = 0x80000000, /* bits 31:31 */ 1404b481de9ca074528fe8c429604e2777db8b89806aZhu Yi}; 1405b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1406b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* ******************************* 1407529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * TX aggregation status 1408b481de9ca074528fe8c429604e2777db8b89806aZhu Yi ******************************* */ 1409b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1410b481de9ca074528fe8c429604e2777db8b89806aZhu Yienum { 1411b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_TRANSMITTED = 0x00, 1412b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_UNDERRUN_MSK = 0x01, 1413b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_BT_PRIO_MSK = 0x02, 1414b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_FEW_BYTES_MSK = 0x04, 1415b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_ABORT_MSK = 0x08, 1416b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_LAST_SENT_TTL_MSK = 0x10, 1417b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK = 0x20, 1418b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_LAST_SENT_BT_KILL_MSK = 0x40, 1419b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_SCD_QUERY_MSK = 0x80, 1420b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_TEST_BAD_CRC32_MSK = 0x100, 1421b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_RESPONSE_MSK = 0x1ff, 1422b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_DUMP_TX_MSK = 0x200, 1423b481de9ca074528fe8c429604e2777db8b89806aZhu Yi AGG_TX_STATE_DELAY_TX_MSK = 0x400 1424b481de9ca074528fe8c429604e2777db8b89806aZhu Yi}; 1425b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1426e1b3fa0c22625d985cc7f82b7f3aa90a6fc75c2fWey-Yi Guy#define AGG_TX_STATUS_MSK 0x00000fff /* bits 0:11 */ 1427e1b3fa0c22625d985cc7f82b7f3aa90a6fc75c2fWey-Yi Guy#define AGG_TX_TRY_MSK 0x0000f000 /* bits 12:15 */ 1428e1b3fa0c22625d985cc7f82b7f3aa90a6fc75c2fWey-Yi Guy 14293fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler#define AGG_TX_STATE_LAST_SENT_MSK (AGG_TX_STATE_LAST_SENT_TTL_MSK | \ 14303fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK | \ 14313fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler AGG_TX_STATE_LAST_SENT_BT_KILL_MSK) 1432b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1433529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill/* # tx attempts for first frame in aggregation */ 1434b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define AGG_TX_STATE_TRY_CNT_POS 12 1435b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define AGG_TX_STATE_TRY_CNT_MSK 0xf000 1436b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1437529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill/* Command ID and sequence number of Tx command for this frame */ 1438b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define AGG_TX_STATE_SEQ_NUM_POS 16 1439b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define AGG_TX_STATE_SEQ_NUM_MSK 0xffff0000 1440b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1441b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 1442b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_TX = 0x1c (response) 1443529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 1444529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * This response may be in one of two slightly different formats, indicated 1445529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * by the frame_count field: 1446529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 1447529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 1) No aggregation (frame_count == 1). This reports Tx results for 1448529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * a single frame. Multiple attempts, at various bit rates, may have 1449529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * been made for this frame. 1450529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 1451529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 2) Aggregation (frame_count > 1). This reports Tx results for 1452529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 2 or more frames that used block-acknowledge. All frames were 1453529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * transmitted at same rate. Rate scaling may have been used if first 1454529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * frame in this new agg block failed in previous agg block(s). 1455529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 1456529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Note that, for aggregation, ACK (block-ack) status is not delivered here; 1457767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * block-ack has not been received by the time the agn device records 1458767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * this status. 1459529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * This status relates to reasons the tx might have been blocked or aborted 1460767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * within the sending station (this agn device), rather than whether it was 1461529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * received successfully by the destination station. 1462b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 1463001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunskystruct agg_tx_status { 1464001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky __le16 status; 1465001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky __le16 sequence; 1466ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 1467001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky 14683fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler/* 14693fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler * definitions for initial rate index field 1470a96a27f97f2bbfc1fca54bc3c0b0d41484152740Tomas Winkler * bits [3:0] initial rate index 14713fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler * bits [6:4] rate table color, used for the initial rate 14723fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler * bit-7 invalid rate indication 14733fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler * i.e. rate was not chosen from rate table 14743fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler * or rate table color was changed during frame retries 14753fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler * refer tlc rate info 14763fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler */ 14773fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler 14783fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler#define IWL50_TX_RES_INIT_RATE_INDEX_POS 0 14793fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler#define IWL50_TX_RES_INIT_RATE_INDEX_MSK 0x0f 14803fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler#define IWL50_TX_RES_RATE_TABLE_COLOR_POS 4 14813fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler#define IWL50_TX_RES_RATE_TABLE_COLOR_MSK 0x70 14823fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler#define IWL50_TX_RES_INV_RATE_INDEX_MSK 0x80 14833fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler 14843fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler/* refer to ra_tid */ 1485898dade1162970fe7af45e47062f9d1d999c46e6Wey-Yi Guy#define IWLAGN_TX_RES_TID_POS 0 1486898dade1162970fe7af45e47062f9d1d999c46e6Wey-Yi Guy#define IWLAGN_TX_RES_TID_MSK 0x0f 1487898dade1162970fe7af45e47062f9d1d999c46e6Wey-Yi Guy#define IWLAGN_TX_RES_RA_POS 4 1488898dade1162970fe7af45e47062f9d1d999c46e6Wey-Yi Guy#define IWLAGN_TX_RES_RA_MSK 0xf0 14893fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler 1490898dade1162970fe7af45e47062f9d1d999c46e6Wey-Yi Guystruct iwlagn_tx_resp { 1491001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky u8 frame_count; /* 1 no aggregation, >1 aggregation */ 1492001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky u8 bt_kill_count; /* # blocked by bluetooth (unused for agg) */ 1493001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky u8 failure_rts; /* # failures due to unsuccessful RTS */ 1494001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky u8 failure_frame; /* # failures due to no ACK (unused for agg) */ 1495001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky 1496001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky /* For non-agg: Rate at which frame was successful. 1497001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * For agg: Rate at which all frames were transmitted. */ 1498001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky __le32 rate_n_flags; /* RATE_MCS_* */ 1499001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky 1500001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky /* For non-agg: RTS + CTS + frame tx attempts time + ACK. 1501001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * For agg: RTS + CTS + aggregation tx time + block-ack time. */ 1502001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky __le16 wireless_media_time; /* uSecs */ 1503001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky 15043fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler u8 pa_status; /* RF power amplifier measurement (not used) */ 15053fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler u8 pa_integ_res_a[3]; 15063fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler u8 pa_integ_res_b[3]; 15073fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler u8 pa_integ_res_C[3]; 1508001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky 1509001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky __le32 tfd_info; 1510001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky __le16 seq_ctl; 1511001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky __le16 byte_cnt; 15123fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler u8 tlc_info; 15133fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler u8 ra_tid; /* tid (0:3), sta_id (4:7) */ 15143fd07a1e5aba89d4be3696c46cb7297f1873195aTomas Winkler __le16 frame_ctrl; 1515001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky /* 1516001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * For non-agg: frame status TX_STATUS_* 1517001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * For agg: status of 1st frame, AGG_TX_STATE_*; other frame status 1518001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * fields follow this one, up to frame_count. 1519001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * Bit fields: 1520001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * 11- 0: AGG_TX_STATE_* status code 1521001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * 15-12: Retry count for 1st frame in aggregation (retries 1522001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * occur if tx failed for this frame when it was a 1523001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * member of a previous aggregation block). If rate 1524001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * scaling is used, retry count indicates the rate 1525001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * table entry used for all frames in the new agg. 1526001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * 31-16: Sequence # for this frame's Tx cmd (not SSN!) 1527001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky */ 1528001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky struct agg_tx_status status; /* TX status (in aggregation - 1529001caff0da8784989ef208af0f39d55ea07dfef5Ron Rindjunsky * status of 1st frame) */ 1530ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 1531b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 1532b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_COMPRESSED_BA = 0xc5 (response only, not a command) 1533529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * 1534529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill * Reports Block-Acknowledge from recipient station 1535b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 1536653fa4a07525e4cd9e7b90e6fc1f792119910636Emmanuel Grumbachstruct iwl_compressed_ba_resp { 1537b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 sta_addr_lo32; 1538b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 sta_addr_hi16; 1539b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 reserved; 1540529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill 1541529699815b79f15a6644786dc4d6e9dd5153a447Ben M Cahill /* Index of recipient (BA-sending) station in uCode's station table */ 1542b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 sta_id; 1543b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 tid; 1544fe01b477bbd23e69c3bdc6bce5be510ddad8297dRon Rindjunsky __le16 seq_ctl; 1545fe01b477bbd23e69c3bdc6bce5be510ddad8297dRon Rindjunsky __le64 bitmap; 1546b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 scd_flow; 1547b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 scd_ssn; 15488829c9e2ec144baeb3cee599e1e653a396ad521bWey-Yi Guy u8 txed; /* number of frames sent */ 15498829c9e2ec144baeb3cee599e1e653a396ad521bWey-Yi Guy u8 txed_2_done; /* number of frames acked */ 1550ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 1551b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1552b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 1553b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response) 15542bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 15553d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler */ 15563d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler 1557b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */ 15588a1b02452862dd30980ad0ef493eed687bc81474Reinette Chatre#define LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK (1 << 0) 1559b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 15602bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill/* # of EDCA prioritized tx fifos */ 1561b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define LINK_QUAL_AC_NUM AC_NUM 15622bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill 15632bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill/* # entries in rate scale table to support Tx retries */ 1564b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define LINK_QUAL_MAX_RETRY_NUM 16 1565b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 15662bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill/* Tx antenna selection values */ 15678a1b02452862dd30980ad0ef493eed687bc81474Reinette Chatre#define LINK_QUAL_ANT_A_MSK (1 << 0) 15688a1b02452862dd30980ad0ef493eed687bc81474Reinette Chatre#define LINK_QUAL_ANT_B_MSK (1 << 1) 1569b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define LINK_QUAL_ANT_MSK (LINK_QUAL_ANT_A_MSK|LINK_QUAL_ANT_B_MSK) 1570b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 15712bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill 15722bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill/** 157366c73db7c6f7672e40c0bb1d2689f2d0d0922aadTomas Winkler * struct iwl_link_qual_general_params 15742bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 15752bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Used in REPLY_TX_LINK_QUALITY_CMD 15762bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill */ 157766c73db7c6f7672e40c0bb1d2689f2d0d0922aadTomas Winklerstruct iwl_link_qual_general_params { 1578b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 flags; 15792bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill 15802bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill /* No entries at or above this (driver chosen) index contain MIMO */ 1581b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 mimo_delimiter; 15822bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill 15832bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill /* Best single antenna to use for single stream (legacy, SISO). */ 15842bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill u8 single_stream_ant_msk; /* LINK_QUAL_ANT_* */ 15852bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill 15862bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill /* Best antennas to use for MIMO (unused for 4965, assumes both). */ 15872bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill u8 dual_stream_ant_msk; /* LINK_QUAL_ANT_* */ 15882bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill 15892bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill /* 15902bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * If driver needs to use different initial rates for different 15912bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * EDCA QOS access categories (as implemented by tx fifos 0-3), 15922bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * this table will set that up, by indicating the indexes in the 15932bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * rs_table[LINK_QUAL_MAX_RETRY_NUM] rate table at which to start. 15942bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Otherwise, driver should set all entries to 0. 15952bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 15962bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Entry usage: 15972bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 0 = Background, 1 = Best Effort (normal), 2 = Video, 3 = Voice 15982bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * TX FIFOs above 3 use same value (typically 0) as TX FIFO 3. 15992bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill */ 1600b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 start_rate_index[LINK_QUAL_AC_NUM]; 1601ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 1602b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 160313c33a09b3703c2956345482017600434c853889Wey-Yi Guy#define LINK_QUAL_AGG_TIME_LIMIT_DEF (4000) /* 4 milliseconds */ 1604b15826a795969cbdd85a0b5100165e240e6508e4Wey-Yi Guy#define LINK_QUAL_AGG_TIME_LIMIT_MAX (8000) 1605b15826a795969cbdd85a0b5100165e240e6508e4Wey-Yi Guy#define LINK_QUAL_AGG_TIME_LIMIT_MIN (100) 160613c33a09b3703c2956345482017600434c853889Wey-Yi Guy 160713c33a09b3703c2956345482017600434c853889Wey-Yi Guy#define LINK_QUAL_AGG_DISABLE_START_DEF (3) 160813c33a09b3703c2956345482017600434c853889Wey-Yi Guy#define LINK_QUAL_AGG_DISABLE_START_MAX (255) 160913c33a09b3703c2956345482017600434c853889Wey-Yi Guy#define LINK_QUAL_AGG_DISABLE_START_MIN (0) 161013c33a09b3703c2956345482017600434c853889Wey-Yi Guy 16114263108c2a9028544cf4037fa4e72000ee456c33Daniel Halperin#define LINK_QUAL_AGG_FRAME_LIMIT_DEF (63) 1612b623a9f7c488e51dbe4320d8b5cdd0ba242d0067Johannes Berg#define LINK_QUAL_AGG_FRAME_LIMIT_MAX (63) 161313c33a09b3703c2956345482017600434c853889Wey-Yi Guy#define LINK_QUAL_AGG_FRAME_LIMIT_MIN (0) 161413c33a09b3703c2956345482017600434c853889Wey-Yi Guy 16152bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill/** 161666c73db7c6f7672e40c0bb1d2689f2d0d0922aadTomas Winkler * struct iwl_link_qual_agg_params 16172bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 16182bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Used in REPLY_TX_LINK_QUALITY_CMD 16192bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill */ 162066c73db7c6f7672e40c0bb1d2689f2d0d0922aadTomas Winklerstruct iwl_link_qual_agg_params { 16212bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill 16227469701e10adb6bcc3d66544bd9f6d553fc678c9Wey-Yi Guy /* 16237469701e10adb6bcc3d66544bd9f6d553fc678c9Wey-Yi Guy *Maximum number of uSec in aggregation. 16247469701e10adb6bcc3d66544bd9f6d553fc678c9Wey-Yi Guy * default set to 4000 (4 milliseconds) if not configured in .cfg 16257469701e10adb6bcc3d66544bd9f6d553fc678c9Wey-Yi Guy */ 1626b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 agg_time_limit; 16272bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill 16282bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill /* 16292bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Number of Tx retries allowed for a frame, before that frame will 16302bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * no longer be considered for the start of an aggregation sequence 16312bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * (scheduler will then try to tx it as single frame). 16322bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Driver should set this to 3. 16332bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill */ 1634b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 agg_dis_start_th; 16352bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill 16362bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill /* 16372bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Maximum number of frames in aggregation. 16382bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 0 = no limit (default). 1 = no aggregation. 16392bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Other values = max # frames in aggregation. 16402bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill */ 1641b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 agg_frame_cnt_limit; 16422bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill 1643b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 reserved; 1644ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 1645b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1646b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 1647b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_TX_LINK_QUALITY_CMD = 0x4e (command, has simple generic response) 16482bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 16497f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy * For agn devices 16502bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 1651767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * Each station in the agn device's internal station table has its own table 1652767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * of 16 16532bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Tx rates and modulation modes (e.g. legacy/SISO/MIMO) for retrying Tx when 16542bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * an ACK is not received. This command replaces the entire table for 16552bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * one station. 16562bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 1657767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * NOTE: Station must already be in agn device's station table. 1658767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * Use REPLY_ADD_STA. 16592bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 16602bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * The rate scaling procedures described below work well. Of course, other 16612bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * procedures are possible, and may work better for particular environments. 16622bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 16632bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 16642bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * FILLING THE RATE TABLE 16652bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 16662bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Given a particular initial rate and mode, as determined by the rate 16672bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * scaling algorithm described below, the Linux driver uses the following 16682bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * formula to fill the rs_table[LINK_QUAL_MAX_RETRY_NUM] rate table in the 16692bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Link Quality command: 16702bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 16712bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 16722bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 1) If using High-throughput (HT) (SISO or MIMO) initial rate: 16732bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * a) Use this same initial rate for first 3 entries. 16742bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * b) Find next lower available rate using same mode (SISO or MIMO), 16752bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * use for next 3 entries. If no lower rate available, switch to 16767aafef1c6e2e24f9a10dc2972bf0ee70624ccc47Wey-Yi Guy * legacy mode (no HT40 channel, no MIMO, no short guard interval). 16772bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * c) If using MIMO, set command's mimo_delimiter to number of entries 16782bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * using MIMO (3 or 6). 16797aafef1c6e2e24f9a10dc2972bf0ee70624ccc47Wey-Yi Guy * d) After trying 2 HT rates, switch to legacy mode (no HT40 channel, 16802bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * no MIMO, no short guard interval), at the next lower bit rate 16812bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * (e.g. if second HT bit rate was 54, try 48 legacy), and follow 16822bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * legacy procedure for remaining table entries. 16832bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 16842bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 2) If using legacy initial rate: 16852bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * a) Use the initial rate for only one entry. 16862bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * b) For each following entry, reduce the rate to next lower available 16872bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * rate, until reaching the lowest available rate. 16882bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * c) When reducing rate, also switch antenna selection. 16892bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * d) Once lowest available rate is reached, repeat this rate until 16902bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * rate table is filled (16 entries), switching antenna each entry. 16912bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 16922bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 16932bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * ACCUMULATING HISTORY 16942bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 1695767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * The rate scaling algorithm for agn devices, as implemented in Linux driver, 1696767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * uses two sets of frame Tx success history: One for the current/active 1697767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * modulation mode, and one for a speculative/search mode that is being 1698767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * attempted. If the speculative mode turns out to be more effective (i.e. 1699767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * actual transfer rate is better), then the driver continues to use the 1700767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * speculative mode as the new current active mode. 17012bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17022bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Each history set contains, separately for each possible rate, data for a 17032bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * sliding window of the 62 most recent tx attempts at that rate. The data 17042bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * includes a shifting bitmap of success(1)/failure(0), and sums of successful 17052bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * and attempted frames, from which the driver can additionally calculate a 17062bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * success ratio (success / attempted) and number of failures 17072bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * (attempted - success), and control the size of the window (attempted). 17082bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * The driver uses the bit map to remove successes from the success sum, as 17092bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * the oldest tx attempts fall out of the window. 17102bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 1711767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * When the agn device makes multiple tx attempts for a given frame, each 1712767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * attempt might be at a different rate, and have different modulation 1713767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * characteristics (e.g. antenna, fat channel, short guard interval), as set 1714767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * up in the rate scaling table in the Link Quality command. The driver must 1715767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * determine which rate table entry was used for each tx attempt, to determine 1716767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * which rate-specific history to update, and record only those attempts that 17172bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * match the modulation characteristics of the history set. 17182bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17192bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * When using block-ack (aggregation), all frames are transmitted at the same 1720a96a27f97f2bbfc1fca54bc3c0b0d41484152740Tomas Winkler * rate, since there is no per-attempt acknowledgment from the destination 17212bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * station. The Tx response struct iwl_tx_resp indicates the Tx rate in 17222bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * rate_n_flags field. After receiving a block-ack, the driver can update 17232bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * history for the entire block all at once. 17242bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17252bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17262bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * FINDING BEST STARTING RATE: 17272bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17282bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * When working with a selected initial modulation mode (see below), the 17292bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * driver attempts to find a best initial rate. The initial rate is the 17302bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * first entry in the Link Quality command's rate table. 17312bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17322bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 1) Calculate actual throughput (success ratio * expected throughput, see 17332bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * table below) for current initial rate. Do this only if enough frames 17342bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * have been attempted to make the value meaningful: at least 6 failed 17352bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * tx attempts, or at least 8 successes. If not enough, don't try rate 17362bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * scaling yet. 17372bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17382bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 2) Find available rates adjacent to current initial rate. Available means: 17392bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * a) supported by hardware && 17402bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * b) supported by association && 17412bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * c) within any constraints selected by user 17422bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17432bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 3) Gather measured throughputs for adjacent rates. These might not have 17442bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * enough history to calculate a throughput. That's okay, we might try 17452bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * using one of them anyway! 17462bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17472bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 4) Try decreasing rate if, for current rate: 17482bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * a) success ratio is < 15% || 17492bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * b) lower adjacent rate has better measured throughput || 17502bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * c) higher adjacent rate has worse throughput, and lower is unmeasured 17512bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17522bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * As a sanity check, if decrease was determined above, leave rate 17532bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * unchanged if: 17542bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * a) lower rate unavailable 17552bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * b) success ratio at current rate > 85% (very good) 17562bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * c) current measured throughput is better than expected throughput 17572bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * of lower rate (under perfect 100% tx conditions, see table below) 17582bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17592bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 5) Try increasing rate if, for current rate: 17602bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * a) success ratio is < 15% || 17612bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * b) both adjacent rates' throughputs are unmeasured (try it!) || 17622bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * b) higher adjacent rate has better measured throughput || 17632bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * c) lower adjacent rate has worse throughput, and higher is unmeasured 17642bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17652bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * As a sanity check, if increase was determined above, leave rate 17662bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * unchanged if: 17672bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * a) success ratio at current rate < 70%. This is not particularly 17682bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * good performance; higher rate is sure to have poorer success. 17692bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17702bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 6) Re-evaluate the rate after each tx frame. If working with block- 17712bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * acknowledge, history and statistics may be calculated for the entire 17722bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * block (including prior history that fits within the history windows), 17732bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * before re-evaluation. 17742bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17752bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * FINDING BEST STARTING MODULATION MODE: 17762bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17772bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * After working with a modulation mode for a "while" (and doing rate scaling), 17782bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * the driver searches for a new initial mode in an attempt to improve 17792bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * throughput. The "while" is measured by numbers of attempted frames: 17802bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17812bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * For legacy mode, search for new mode after: 17822bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 480 successful frames, or 160 failed frames 17832bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * For high-throughput modes (SISO or MIMO), search for new mode after: 17842bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 4500 successful frames, or 400 failed frames 17852bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17862bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Mode switch possibilities are (3 for each mode): 17872bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17882bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * For legacy: 17892bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Change antenna, try SISO (if HT association), try MIMO (if HT association) 17902bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * For SISO: 17912bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Change antenna, try MIMO, try shortened guard interval (SGI) 17922bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * For MIMO: 17932bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Try SISO antenna A, SISO antenna B, try shortened guard interval (SGI) 17942bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 17952bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * When trying a new mode, use the same bit rate as the old/current mode when 17962bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * trying antenna switches and shortened guard interval. When switching to 17972bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * SISO from MIMO or legacy, or to MIMO from SISO or legacy, use a rate 17982bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * for which the expected throughput (under perfect conditions) is about the 17992bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * same or slightly better than the actual measured throughput delivered by 18002bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * the old/current mode. 18012bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 18022bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Actual throughput can be estimated by multiplying the expected throughput 18032bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * by the success ratio (successful / attempted tx frames). Frame size is 18042bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * not considered in this calculation; it assumes that frame size will average 18052bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * out to be fairly consistent over several samples. The following are 18062bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * metric values for expected throughput assuming 100% success ratio. 18072bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Only G band has support for CCK rates: 18082bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 18092bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * RATE: 1 2 5 11 6 9 12 18 24 36 48 54 60 18102bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 18112bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * G: 7 13 35 58 40 57 72 98 121 154 177 186 186 18122bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * A: 0 0 0 0 40 57 72 98 121 154 177 186 186 18132bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * SISO 20MHz: 0 0 0 0 42 42 76 102 124 159 183 193 202 18142bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * SGI SISO 20MHz: 0 0 0 0 46 46 82 110 132 168 192 202 211 18152bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * MIMO 20MHz: 0 0 0 0 74 74 123 155 179 214 236 244 251 18162bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * SGI MIMO 20MHz: 0 0 0 0 81 81 131 164 188 222 243 251 257 18172bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * SISO 40MHz: 0 0 0 0 77 77 127 160 184 220 242 250 257 18182bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * SGI SISO 40MHz: 0 0 0 0 83 83 135 169 193 229 250 257 264 18192bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * MIMO 40MHz: 0 0 0 0 123 123 182 214 235 264 279 285 289 18202bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * SGI MIMO 40MHz: 0 0 0 0 131 131 191 222 242 270 284 289 293 18212bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 18222bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * After the new mode has been tried for a short while (minimum of 6 failed 18232bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * frames or 8 successful frames), compare success ratio and actual throughput 18242bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * estimate of the new mode with the old. If either is better with the new 18252bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * mode, continue to use the new mode. 18262bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 18272bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Continue comparing modes until all 3 possibilities have been tried. 18282bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * If moving from legacy to HT, try all 3 possibilities from the new HT 18292bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * mode. After trying all 3, a best mode is found. Continue to use this mode 18302bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * for the longer "while" described above (e.g. 480 successful frames for 18312bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * legacy), and then repeat the search process. 18322bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * 1833b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 183466c73db7c6f7672e40c0bb1d2689f2d0d0922aadTomas Winklerstruct iwl_link_quality_cmd { 18352bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill 18362bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill /* Index of destination/recipient station in uCode's station table */ 1837b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 sta_id; 1838b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 reserved1; 18392bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill __le16 control; /* not used */ 184066c73db7c6f7672e40c0bb1d2689f2d0d0922aadTomas Winkler struct iwl_link_qual_general_params general_params; 184166c73db7c6f7672e40c0bb1d2689f2d0d0922aadTomas Winkler struct iwl_link_qual_agg_params agg_params; 18422bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill 18432bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill /* 18442bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * Rate info; when using rate-scaling, Tx command's initial_rate_index 18452bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill * specifies 1st Tx rate attempted, via index into this table. 1846767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * agn devices works its way through table when retrying Tx. 18472bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill */ 1848b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct { 18492bdc7031f9ea1826e16bffc3540d05de891c98bcBen M Cahill __le32 rate_n_flags; /* RATE_MCS_*, IWL_RATE_* */ 1850b481de9ca074528fe8c429604e2777db8b89806aZhu Yi } rs_table[LINK_QUAL_MAX_RETRY_NUM]; 1851b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 reserved2; 1852ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 1853b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1854dab1c161fed18eb6b3472bdbfd827264caae097fWey-Yi Guy/* 1855dab1c161fed18eb6b3472bdbfd827264caae097fWey-Yi Guy * BT configuration enable flags: 1856dab1c161fed18eb6b3472bdbfd827264caae097fWey-Yi Guy * bit 0 - 1: BT channel announcement enabled 1857dab1c161fed18eb6b3472bdbfd827264caae097fWey-Yi Guy * 0: disable 1858dab1c161fed18eb6b3472bdbfd827264caae097fWey-Yi Guy * bit 1 - 1: priority of BT device enabled 1859dab1c161fed18eb6b3472bdbfd827264caae097fWey-Yi Guy * 0: disable 1860dab1c161fed18eb6b3472bdbfd827264caae097fWey-Yi Guy * bit 2 - 1: BT 2 wire support enabled 1861dab1c161fed18eb6b3472bdbfd827264caae097fWey-Yi Guy * 0: disable 1862dab1c161fed18eb6b3472bdbfd827264caae097fWey-Yi Guy */ 1863456d0f76727ba6f97aa1cee63f1bae84642768c4Wey-Yi Guy#define BT_COEX_DISABLE (0x0) 1864dab1c161fed18eb6b3472bdbfd827264caae097fWey-Yi Guy#define BT_ENABLE_CHANNEL_ANNOUNCE BIT(0) 1865dab1c161fed18eb6b3472bdbfd827264caae097fWey-Yi Guy#define BT_ENABLE_PRIORITY BIT(1) 1866dab1c161fed18eb6b3472bdbfd827264caae097fWey-Yi Guy#define BT_ENABLE_2_WIRE BIT(2) 1867456d0f76727ba6f97aa1cee63f1bae84642768c4Wey-Yi Guy 186806702a735eacf8679e9ff0d49eb3c989bc6b96ceWey-Yi Guy#define BT_COEX_DISABLE (0x0) 186906702a735eacf8679e9ff0d49eb3c989bc6b96ceWey-Yi Guy#define BT_COEX_ENABLE (BT_ENABLE_CHANNEL_ANNOUNCE | BT_ENABLE_PRIORITY) 187006702a735eacf8679e9ff0d49eb3c989bc6b96ceWey-Yi Guy 1871456d0f76727ba6f97aa1cee63f1bae84642768c4Wey-Yi Guy#define BT_LEAD_TIME_MIN (0x0) 1872456d0f76727ba6f97aa1cee63f1bae84642768c4Wey-Yi Guy#define BT_LEAD_TIME_DEF (0x1E) 1873456d0f76727ba6f97aa1cee63f1bae84642768c4Wey-Yi Guy#define BT_LEAD_TIME_MAX (0xFF) 1874456d0f76727ba6f97aa1cee63f1bae84642768c4Wey-Yi Guy 1875456d0f76727ba6f97aa1cee63f1bae84642768c4Wey-Yi Guy#define BT_MAX_KILL_MIN (0x1) 1876456d0f76727ba6f97aa1cee63f1bae84642768c4Wey-Yi Guy#define BT_MAX_KILL_DEF (0x5) 1877456d0f76727ba6f97aa1cee63f1bae84642768c4Wey-Yi Guy#define BT_MAX_KILL_MAX (0xFF) 1878456d0f76727ba6f97aa1cee63f1bae84642768c4Wey-Yi Guy 187922bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy#define BT_DURATION_LIMIT_DEF 625 188022bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy#define BT_DURATION_LIMIT_MAX 1250 188122bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy#define BT_DURATION_LIMIT_MIN 625 188222bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy 188322bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy#define BT_ON_THRESHOLD_DEF 4 188422bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy#define BT_ON_THRESHOLD_MAX 1000 188522bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy#define BT_ON_THRESHOLD_MIN 1 188622bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy 188722bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy#define BT_FRAG_THRESHOLD_DEF 0 188822bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy#define BT_FRAG_THRESHOLD_MAX 0 188922bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy#define BT_FRAG_THRESHOLD_MIN 0 189022bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy 189195a5ede3ee9269e175bfe0e6f5a4a5fd2914ed6aWey-Yi Guy#define BT_AGG_THRESHOLD_DEF 1200 189295a5ede3ee9269e175bfe0e6f5a4a5fd2914ed6aWey-Yi Guy#define BT_AGG_THRESHOLD_MAX 8000 189395a5ede3ee9269e175bfe0e6f5a4a5fd2914ed6aWey-Yi Guy#define BT_AGG_THRESHOLD_MIN 400 189422bf59a03aacc221483e5aad1af903fc191ae958Wey-Yi Guy 1895b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 1896b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_BT_CONFIG = 0x9b (command, has simple generic response) 18973058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 18987f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy * agn devices support hardware handshake with Bluetooth device on 18993058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * same platform. Bluetooth device alerts wireless device when it will Tx; 1900a96a27f97f2bbfc1fca54bc3c0b0d41484152740Tomas Winkler * wireless device can delay or kill its own Tx to accommodate. 1901b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 19022aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_bt_cmd { 1903b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 flags; 1904b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 lead_time; 1905b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 max_kill; 1906b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 reserved; 1907b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 kill_ack_mask; 1908b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 kill_cts_mask; 1909ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 1910b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 1911b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_FLAG_CHANNEL_INHIBITION BIT(0) 1912670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg 1913b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_FLAG_COEX_MODE_MASK (BIT(3)|BIT(4)|BIT(5)) 1914b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_FLAG_COEX_MODE_SHIFT 3 1915b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_FLAG_COEX_MODE_DISABLED 0 1916b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_FLAG_COEX_MODE_LEGACY_2W 1 1917b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_FLAG_COEX_MODE_3W 2 1918b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_FLAG_COEX_MODE_4W 3 1919670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg 1920eeb1f83fa8f96501331cc17b73c57999e3a1ec5dWey-Yi Guy#define IWLAGN_BT_FLAG_UCODE_DEFAULT BIT(6) 1921eeb1f83fa8f96501331cc17b73c57999e3a1ec5dWey-Yi Guy/* Disable Sync PSPoll on SCO/eSCO */ 1922eeb1f83fa8f96501331cc17b73c57999e3a1ec5dWey-Yi Guy#define IWLAGN_BT_FLAG_SYNC_2_BT_DISABLE BIT(7) 1923670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg 1924207ecc5eab908843449c167f7264a35d7d5d5e0bMeenakshi Venkataraman#define IWLAGN_BT_PSP_MIN_RSSI_THRESHOLD -75 /* dBm */ 1925207ecc5eab908843449c167f7264a35d7d5d5e0bMeenakshi Venkataraman#define IWLAGN_BT_PSP_MAX_RSSI_THRESHOLD -65 /* dBm */ 1926207ecc5eab908843449c167f7264a35d7d5d5e0bMeenakshi Venkataraman 1927b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_PRIO_BOOST_MAX 0xFF 1928b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_PRIO_BOOST_MIN 0x00 1929b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_PRIO_BOOST_DEFAULT 0xF0 1930670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg 1931b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_MAX_KILL_DEFAULT 5 1932670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg 1933b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT3_T7_DEFAULT 1 1934670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg 193505433df23cf16a9ccbdd35964aba781cdf455034Wey-Yi Guy#define IWLAGN_BT_KILL_ACK_MASK_DEFAULT cpu_to_le32(0xffff0000) 193605433df23cf16a9ccbdd35964aba781cdf455034Wey-Yi Guy#define IWLAGN_BT_KILL_CTS_MASK_DEFAULT cpu_to_le32(0xffff0000) 1937506aa156fa736e9f9ce476239c9549ebbf6b08eaWey-Yi Guy#define IWLAGN_BT_KILL_ACK_CTS_MASK_SCO cpu_to_le32(0xffffffff) 1938670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg 1939b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT3_PRIO_SAMPLE_DEFAULT 2 1940670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg 1941b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT3_T2_DEFAULT 0xc 1942670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg 1943b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_VALID_ENABLE_FLAGS cpu_to_le16(BIT(0)) 1944b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_VALID_BOOST cpu_to_le16(BIT(1)) 1945b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_VALID_MAX_KILL cpu_to_le16(BIT(2)) 1946b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_VALID_3W_TIMERS cpu_to_le16(BIT(3)) 1947b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_VALID_KILL_ACK_MASK cpu_to_le16(BIT(4)) 1948b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_VALID_KILL_CTS_MASK cpu_to_le16(BIT(5)) 1949b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_VALID_BT4_TIMES cpu_to_le16(BIT(6)) 1950b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_VALID_3W_LUT cpu_to_le16(BIT(7)) 1951670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg 1952b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_ALL_VALID_MSK (IWLAGN_BT_VALID_ENABLE_FLAGS | \ 1953b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy IWLAGN_BT_VALID_BOOST | \ 1954b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy IWLAGN_BT_VALID_MAX_KILL | \ 1955b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy IWLAGN_BT_VALID_3W_TIMERS | \ 1956b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy IWLAGN_BT_VALID_KILL_ACK_MASK | \ 1957b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy IWLAGN_BT_VALID_KILL_CTS_MASK | \ 1958b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy IWLAGN_BT_VALID_BT4_TIMES | \ 1959b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy IWLAGN_BT_VALID_3W_LUT) 1960670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg 19616013270a030e370400e459922176c467a6c19293Wey-Yi Guystruct iwl_basic_bt_cmd { 1962670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg u8 flags; 1963670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg u8 ledtime; /* unused */ 1964670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg u8 max_kill; 1965670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg u8 bt3_timer_t7_value; 1966670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg __le32 kill_ack_mask; 1967670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg __le32 kill_cts_mask; 1968670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg u8 bt3_prio_sample_time; 1969670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg u8 bt3_timer_t2_value; 1970670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg __le16 bt4_reaction_time; /* unused */ 1971670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg __le32 bt3_lookup_table[12]; 1972670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg __le16 bt4_decision_time; /* unused */ 1973670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg __le16 valid; 19746013270a030e370400e459922176c467a6c19293Wey-Yi Guy}; 19756013270a030e370400e459922176c467a6c19293Wey-Yi Guy 19766013270a030e370400e459922176c467a6c19293Wey-Yi Guystruct iwl6000_bt_cmd { 19776013270a030e370400e459922176c467a6c19293Wey-Yi Guy struct iwl_basic_bt_cmd basic; 1978670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg u8 prio_boost; 1979b345f4da42da69f7136ea1b83ef38b3412e51b72Wey-Yi Guy /* 1980b345f4da42da69f7136ea1b83ef38b3412e51b72Wey-Yi Guy * set IWLAGN_BT_VALID_BOOST to "1" in "valid" bitmask 1981b345f4da42da69f7136ea1b83ef38b3412e51b72Wey-Yi Guy * if configure the following patterns 1982b345f4da42da69f7136ea1b83ef38b3412e51b72Wey-Yi Guy */ 1983b345f4da42da69f7136ea1b83ef38b3412e51b72Wey-Yi Guy u8 tx_prio_boost; /* SW boost of WiFi tx priority */ 1984b345f4da42da69f7136ea1b83ef38b3412e51b72Wey-Yi Guy __le16 rx_prio_boost; /* SW boost of WiFi rx priority */ 1985670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg}; 1986670245ed4515cbc5e39e39d44965cb7add2c8aa9Johannes Berg 1987d6f626553d13e66b36a1ea2dbf23a5c21277a004Wey-Yi Guystruct iwl2000_bt_cmd { 19886013270a030e370400e459922176c467a6c19293Wey-Yi Guy struct iwl_basic_bt_cmd basic; 1989d6f626553d13e66b36a1ea2dbf23a5c21277a004Wey-Yi Guy __le32 prio_boost; 1990d6f626553d13e66b36a1ea2dbf23a5c21277a004Wey-Yi Guy /* 1991d6f626553d13e66b36a1ea2dbf23a5c21277a004Wey-Yi Guy * set IWLAGN_BT_VALID_BOOST to "1" in "valid" bitmask 1992d6f626553d13e66b36a1ea2dbf23a5c21277a004Wey-Yi Guy * if configure the following patterns 1993d6f626553d13e66b36a1ea2dbf23a5c21277a004Wey-Yi Guy */ 1994d6f626553d13e66b36a1ea2dbf23a5c21277a004Wey-Yi Guy u8 reserved; 1995d6f626553d13e66b36a1ea2dbf23a5c21277a004Wey-Yi Guy u8 tx_prio_boost; /* SW boost of WiFi tx priority */ 1996d6f626553d13e66b36a1ea2dbf23a5c21277a004Wey-Yi Guy __le16 rx_prio_boost; /* SW boost of WiFi rx priority */ 1997d6f626553d13e66b36a1ea2dbf23a5c21277a004Wey-Yi Guy}; 1998d6f626553d13e66b36a1ea2dbf23a5c21277a004Wey-Yi Guy 1999b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guy#define IWLAGN_BT_SCO_ACTIVE cpu_to_le32(BIT(0)) 20009e4afc21895476114f131b70d1e8fdc3a9c75bb3Johannes Berg 2001b6e116e8bf7d749b0743c167bd47930c22c77a82Wey-Yi Guystruct iwlagn_bt_sco_cmd { 20029e4afc21895476114f131b70d1e8fdc3a9c75bb3Johannes Berg __le32 flags; 20039e4afc21895476114f131b70d1e8fdc3a9c75bb3Johannes Berg}; 20049e4afc21895476114f131b70d1e8fdc3a9c75bb3Johannes Berg 2005b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 2006b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (6) 2007b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Spectrum Management (802.11h) Commands, Responses, Notifications: 2008b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2009b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 2010b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2011b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2012b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Spectrum Management 2013b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 2014b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define MEASUREMENT_FILTER_FLAG (RXON_FILTER_PROMISC_MSK | \ 2015b481de9ca074528fe8c429604e2777db8b89806aZhu Yi RXON_FILTER_CTL2HOST_MSK | \ 2016b481de9ca074528fe8c429604e2777db8b89806aZhu Yi RXON_FILTER_ACCEPT_GRP_MSK | \ 2017b481de9ca074528fe8c429604e2777db8b89806aZhu Yi RXON_FILTER_DIS_DECRYPT_MSK | \ 2018b481de9ca074528fe8c429604e2777db8b89806aZhu Yi RXON_FILTER_DIS_GRP_DECRYPT_MSK | \ 2019b481de9ca074528fe8c429604e2777db8b89806aZhu Yi RXON_FILTER_ASSOC_MSK | \ 2020b481de9ca074528fe8c429604e2777db8b89806aZhu Yi RXON_FILTER_BCON_AWARE_MSK) 2021b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 20222aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_measure_channel { 2023b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 duration; /* measurement duration in extended beacon 2024b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * format */ 2025b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 channel; /* channel to measure */ 20262aa6ab86bc475a115f56645591d2413981846509Tomas Winkler u8 type; /* see enum iwl_measure_type */ 2027b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 reserved; 2028ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2029b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2030b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2031b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command) 2032b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 20332aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_spectrum_cmd { 2034b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 len; /* number of bytes starting from token */ 2035b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 token; /* token id */ 2036b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 id; /* measurement id -- 0 or 1 */ 2037b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 origin; /* 0 = TGh, 1 = other, 2 = TGk */ 2038b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 periodic; /* 1 = periodic */ 2039b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 path_loss_timeout; 2040b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 start_time; /* start time in extended beacon format */ 2041b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 reserved2; 2042b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 flags; /* rxon flags */ 2043b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 filter_flags; /* rxon filter flags */ 2044b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 channel_count; /* minimum 1, maximum 10 */ 2045b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 reserved3; 20462aa6ab86bc475a115f56645591d2413981846509Tomas Winkler struct iwl_measure_channel channels[10]; 2047ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2048b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2049b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2050b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response) 2051b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 20522aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_spectrum_resp { 2053b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 token; 2054b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 id; /* id of the prior command replaced, or 0xff */ 2055b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 status; /* 0 - command will be handled 2056b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 1 - cannot handle (conflicts with another 2057b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * measurement) */ 2058ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2059b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 20602aa6ab86bc475a115f56645591d2413981846509Tomas Winklerenum iwl_measurement_state { 2061b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASUREMENT_START = 0, 2062b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASUREMENT_STOP = 1, 2063b481de9ca074528fe8c429604e2777db8b89806aZhu Yi}; 2064b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 20652aa6ab86bc475a115f56645591d2413981846509Tomas Winklerenum iwl_measurement_status { 2066b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASUREMENT_OK = 0, 2067b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASUREMENT_CONCURRENT = 1, 2068b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASUREMENT_CSA_CONFLICT = 2, 2069b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASUREMENT_TGH_CONFLICT = 3, 2070b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* 4-5 reserved */ 2071b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASUREMENT_STOPPED = 6, 2072b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASUREMENT_TIMEOUT = 7, 2073b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASUREMENT_PERIODIC_FAILED = 8, 2074b481de9ca074528fe8c429604e2777db8b89806aZhu Yi}; 2075b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2076b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define NUM_ELEMENTS_IN_HISTOGRAM 8 2077b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 20782aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_measurement_histogram { 2079b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 ofdm[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 0.8usec counts */ 2080b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 cck[NUM_ELEMENTS_IN_HISTOGRAM]; /* in 1usec counts */ 2081ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2082b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2083b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* clear channel availability counters */ 20842aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_measurement_cca_counters { 2085b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 ofdm; 2086b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 cck; 2087ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2088b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 20892aa6ab86bc475a115f56645591d2413981846509Tomas Winklerenum iwl_measure_type { 2090b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASURE_BASIC = (1 << 0), 2091b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASURE_CHANNEL_LOAD = (1 << 1), 2092b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASURE_HISTOGRAM_RPI = (1 << 2), 2093b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASURE_HISTOGRAM_NOISE = (1 << 3), 2094b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASURE_FRAME = (1 << 4), 2095b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* bits 5:6 are reserved */ 2096b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_MEASURE_IDLE = (1 << 7), 2097b481de9ca074528fe8c429604e2777db8b89806aZhu Yi}; 2098b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2099b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2100b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * SPECTRUM_MEASURE_NOTIFICATION = 0x75 (notification only, not a command) 2101b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 21022aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_spectrum_notification { 2103b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 id; /* measurement id -- 0 or 1 */ 2104b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 token; 2105b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 channel_index; /* index in measurement channel list */ 2106b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 state; /* 0 - start, 1 - stop */ 2107b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 start_time; /* lower 32-bits of TSF */ 2108b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 band; /* 0 - 5.2GHz, 1 - 2.4GHz */ 2109b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 channel; 21102aa6ab86bc475a115f56645591d2413981846509Tomas Winkler u8 type; /* see enum iwl_measurement_type */ 2111b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 reserved1; 2112b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* NOTE: cca_ofdm, cca_cck, basic_type, and histogram are only only 2113b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * valid if applicable for measurement type requested. */ 2114b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 cca_ofdm; /* cca fraction time in 40Mhz clock periods */ 2115b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 cca_cck; /* cca fraction time in 44Mhz clock periods */ 2116b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 cca_time; /* channel load time in usecs */ 2117b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 basic_type; /* 0 - bss, 1 - ofdm preamble, 2 - 2118b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * unidentified */ 2119b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 reserved2[3]; 21202aa6ab86bc475a115f56645591d2413981846509Tomas Winkler struct iwl_measurement_histogram histogram; 2121b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 stop_time; /* lower 32-bits of TSF */ 21222aa6ab86bc475a115f56645591d2413981846509Tomas Winkler __le32 status; /* see iwl_measurement_status */ 2123ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2124b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2125b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 2126b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (7) 2127b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Power Management Commands, Responses, Notifications: 2128b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2129b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 2130b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2131b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/** 2132ca579617d81baf5865498eb5fae58e453ee77c2cMohamed Abbas * struct iwl_powertable_cmd - Power Table Command 2133b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * @flags: See below: 2134b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2135b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * POWER_TABLE_CMD = 0x77 (command, has simple generic response) 2136b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2137b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * PM allow: 2138b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * bit 0 - '0' Driver not allow power management 2139b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * '1' Driver allow PM (use rest of parameters) 2140e312c24cf8229f9b6e76dbfd5d99eefe21f4ac0aJohannes Berg * 2141b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * uCode send sleep notifications: 2142b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * bit 1 - '0' Don't send sleep notification 2143b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * '1' send sleep notification (SEND_PM_NOTIFICATION) 2144e312c24cf8229f9b6e76dbfd5d99eefe21f4ac0aJohannes Berg * 2145b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Sleep over DTIM 2146b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * bit 2 - '0' PM have to walk up every DTIM 2147b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * '1' PM could sleep over DTIM till listen Interval. 2148e312c24cf8229f9b6e76dbfd5d99eefe21f4ac0aJohannes Berg * 2149b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * PCI power managed 2150e7b635814b640c6fd9dca1c254dc22fac6fb9a1aTomas Winkler * bit 3 - '0' (PCI_CFG_LINK_CTRL & 0x1) 2151e7b635814b640c6fd9dca1c254dc22fac6fb9a1aTomas Winkler * '1' !(PCI_CFG_LINK_CTRL & 0x1) 2152e312c24cf8229f9b6e76dbfd5d99eefe21f4ac0aJohannes Berg * 2153e312c24cf8229f9b6e76dbfd5d99eefe21f4ac0aJohannes Berg * Fast PD 2154e312c24cf8229f9b6e76dbfd5d99eefe21f4ac0aJohannes Berg * bit 4 - '1' Put radio to sleep when receiving frame for others 2155e312c24cf8229f9b6e76dbfd5d99eefe21f4ac0aJohannes Berg * 2156b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Force sleep Modes 2157b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * bit 31/30- '00' use both mac/xtal sleeps 2158b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * '01' force Mac sleep 2159b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * '10' force xtal sleep 2160b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * '11' Illegal set 2161b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2162b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * NOTE: if sleep_interval[SLEEP_INTRVL_TABLE_SIZE-1] > DTIM period then 2163a96a27f97f2bbfc1fca54bc3c0b0d41484152740Tomas Winkler * ucode assume sleep over DTIM is allowed and we don't need to wake up 2164b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * for every DTIM. 2165b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 2166b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define IWL_POWER_VEC_SIZE 5 2167b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2168600c0e11ea6161e00e8cb4b4dda39a64ce988c60Tomas Winkler#define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK cpu_to_le16(BIT(0)) 216935162ba75900209755628ccf7357763797037ba6Wey-Yi Guy#define IWL_POWER_POWER_SAVE_ENA_MSK cpu_to_le16(BIT(0)) 217035162ba75900209755628ccf7357763797037ba6Wey-Yi Guy#define IWL_POWER_POWER_MANAGEMENT_ENA_MSK cpu_to_le16(BIT(1)) 2171600c0e11ea6161e00e8cb4b4dda39a64ce988c60Tomas Winkler#define IWL_POWER_SLEEP_OVER_DTIM_MSK cpu_to_le16(BIT(2)) 2172600c0e11ea6161e00e8cb4b4dda39a64ce988c60Tomas Winkler#define IWL_POWER_PCI_PM_MSK cpu_to_le16(BIT(3)) 2173600c0e11ea6161e00e8cb4b4dda39a64ce988c60Tomas Winkler#define IWL_POWER_FAST_PD cpu_to_le16(BIT(4)) 217497badb0eefc9b6f23f864c5348b695be35f05882Wey-Yi Guy#define IWL_POWER_BEACON_FILTERING cpu_to_le16(BIT(5)) 217597badb0eefc9b6f23f864c5348b695be35f05882Wey-Yi Guy#define IWL_POWER_SHADOW_REG_ENA cpu_to_le16(BIT(6)) 217697badb0eefc9b6f23f864c5348b695be35f05882Wey-Yi Guy#define IWL_POWER_CT_KILL_SET cpu_to_le16(BIT(7)) 217797badb0eefc9b6f23f864c5348b695be35f05882Wey-Yi Guy#define IWL_POWER_BT_SCO_ENA cpu_to_le16(BIT(8)) 217835162ba75900209755628ccf7357763797037ba6Wey-Yi Guy#define IWL_POWER_ADVANCE_PM_ENA_MSK cpu_to_le16(BIT(9)) 2179600c0e11ea6161e00e8cb4b4dda39a64ce988c60Tomas Winkler 2180ca579617d81baf5865498eb5fae58e453ee77c2cMohamed Abbasstruct iwl_powertable_cmd { 2181b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 flags; 21827f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy u8 keep_alive_seconds; 21837f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy u8 debug_flags; 2184b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 rx_data_timeout; 2185b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 tx_data_timeout; 2186b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 sleep_interval[IWL_POWER_VEC_SIZE]; 2187b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 keep_alive_beacons; 2188ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2189b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2190b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2191b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command) 2192767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * all devices identical. 2193b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 21942aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_sleep_notification { 2195b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 pm_sleep_mode; 2196b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 pm_wakeup_src; 2197b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 reserved; 2198b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 sleep_time; 2199b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 tsf_low; 2200b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 bcon_timer; 2201ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2202b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2203767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy/* Sleep states. all devices identical. */ 2204b481de9ca074528fe8c429604e2777db8b89806aZhu Yienum { 2205b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_PM_NO_SLEEP = 0, 2206b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_PM_SLP_MAC = 1, 2207b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_PM_SLP_FULL_MAC_UNASSOCIATE = 2, 2208b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_PM_SLP_FULL_MAC_CARD_STATE = 3, 2209b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_PM_SLP_PHY = 4, 2210b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_PM_SLP_REPENT = 5, 2211b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_PM_WAKEUP_BY_TIMER = 6, 2212b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_PM_WAKEUP_BY_DRIVER = 7, 2213b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_PM_WAKEUP_BY_RFKILL = 8, 2214b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* 3 reserved */ 2215b481de9ca074528fe8c429604e2777db8b89806aZhu Yi IWL_PM_NUM_OF_MODES = 12, 2216b481de9ca074528fe8c429604e2777db8b89806aZhu Yi}; 2217b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2218b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2219b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_CARD_STATE_CMD = 0xa0 (command, has simple generic response) 2220b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 2221b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define CARD_STATE_CMD_DISABLE 0x00 /* Put card to sleep */ 2222b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define CARD_STATE_CMD_ENABLE 0x01 /* Wake up card */ 2223b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define CARD_STATE_CMD_HALT 0x02 /* Power down permanently */ 22242aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_card_state_cmd { 2225b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 status; /* CARD_STATE_CMD_* request new power state */ 2226ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2227b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2228b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2229b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command) 2230b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 22312aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_card_state_notif { 2232b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 flags; 2233ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2234b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2235b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define HW_CARD_DISABLED 0x01 2236b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define SW_CARD_DISABLED 0x02 22373a41bbd515d449604f3488c5f8dd62802f09d19bWey-Yi Guy#define CT_CARD_DISABLED 0x04 2238b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define RXON_CARD_DISABLED 0x10 2239b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 224047f4a5871614756627d7209e0569b58faf99b0d9Emmanuel Grumbachstruct iwl_ct_kill_config { 2241b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 reserved; 2242b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 critical_temperature_M; 2243b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 critical_temperature_R; 2244ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2245b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2246672639de13c4db92ed6a47e68043a4317e219902Wey-Yi Guy/* 1000, and 6x00 */ 2247672639de13c4db92ed6a47e68043a4317e219902Wey-Yi Guystruct iwl_ct_kill_throttling_config { 2248672639de13c4db92ed6a47e68043a4317e219902Wey-Yi Guy __le32 critical_temperature_exit; 2249672639de13c4db92ed6a47e68043a4317e219902Wey-Yi Guy __le32 reserved; 2250672639de13c4db92ed6a47e68043a4317e219902Wey-Yi Guy __le32 critical_temperature_enter; 2251ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2252672639de13c4db92ed6a47e68043a4317e219902Wey-Yi Guy 2253b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 2254b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (8) 2255b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Scan Commands, Responses, Notifications: 2256b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2257b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 2258b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 225951e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define SCAN_CHANNEL_TYPE_PASSIVE cpu_to_le32(0) 226051e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define SCAN_CHANNEL_TYPE_ACTIVE cpu_to_le32(1) 2261d16dc48a2ea14af9980d0ea79d041f4b53e47b62Tomas Winkler 22623058f02137359efb412975cf94a9fa7c25413387Ben M Cahill/** 22632a421b91d6fe89e27ded7544a25449c0b050098fTomas Winkler * struct iwl_scan_channel - entry in REPLY_SCAN_CMD channel table 22643058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 22653058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * One for each channel in the scan list. 22663058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * Each channel can independently select: 22673058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 1) SSID for directed active scans 22683058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 2) Txpower setting (for rate specified within Tx command) 22693058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 3) How long to stay on-channel (behavior may be modified by quiet_time, 22703058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * quiet_plcp_th, good_CRC_th) 22713058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 22723058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * To avoid uCode errors, make sure the following are true (see comments 22732a421b91d6fe89e27ded7544a25449c0b050098fTomas Winkler * under struct iwl_scan_cmd about max_out_time and quiet_time): 22743058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 1) If using passive_dwell (i.e. passive_dwell != 0): 22753058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * active_dwell <= passive_dwell (< max_out_time if max_out_time != 0) 22763058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 2) quiet_time <= active_dwell 22773058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 3) If restricting off-channel time (i.e. max_out_time !=0): 22783058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * passive_dwell < max_out_time 22793058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * active_dwell < max_out_time 22803058f02137359efb412975cf94a9fa7c25413387Ben M Cahill */ 22813d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler 22822a421b91d6fe89e27ded7544a25449c0b050098fTomas Winklerstruct iwl_scan_channel { 22833058f02137359efb412975cf94a9fa7c25413387Ben M Cahill /* 22843058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * type is defined as: 22853058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 0:0 1 = active, 0 = passive 2286d16dc48a2ea14af9980d0ea79d041f4b53e47b62Tomas Winkler * 1:20 SSID direct bit map; if a bit is set, then corresponding 22873058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * SSID IE is transmitted in probe request. 2288d16dc48a2ea14af9980d0ea79d041f4b53e47b62Tomas Winkler * 21:31 reserved 2289b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 2290d16dc48a2ea14af9980d0ea79d041f4b53e47b62Tomas Winkler __le32 type; 2291d16dc48a2ea14af9980d0ea79d041f4b53e47b62Tomas Winkler __le16 channel; /* band is selected by iwl_scan_cmd "flags" field */ 2292f53696de6722a4aac00b76e25a5321c01e88a55fTomas Winkler u8 tx_gain; /* gain for analog radio */ 2293f53696de6722a4aac00b76e25a5321c01e88a55fTomas Winkler u8 dsp_atten; /* gain for DSP */ 22943058f02137359efb412975cf94a9fa7c25413387Ben M Cahill __le16 active_dwell; /* in 1024-uSec TU (time units), typ 5-50 */ 22953058f02137359efb412975cf94a9fa7c25413387Ben M Cahill __le16 passive_dwell; /* in 1024-uSec TU (time units), typ 20-500 */ 2296ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2297b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 22980d21044effa10044930419c6f837f75191229c3aWinkler, Tomas/* set number of direct probes __le32 type */ 22990d21044effa10044930419c6f837f75191229c3aWinkler, Tomas#define IWL_SCAN_PROBE_MASK(n) cpu_to_le32((BIT(n) | (BIT(n) - BIT(1)))) 23000d21044effa10044930419c6f837f75191229c3aWinkler, Tomas 23013058f02137359efb412975cf94a9fa7c25413387Ben M Cahill/** 23022a421b91d6fe89e27ded7544a25449c0b050098fTomas Winkler * struct iwl_ssid_ie - directed scan network information element 23033058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 23047f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy * Up to 20 of these may appear in REPLY_SCAN_CMD, 23057f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy * selected by "type" bit field in struct iwl_scan_channel; 23067f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy * each channel may select different ssids from among the 20 entries. 23072a3b793d6a0ff30ad4a541230a6dba2ecb6fff1bBen M Cahill * SSID IEs get transmitted in reverse order of entry. 23083058f02137359efb412975cf94a9fa7c25413387Ben M Cahill */ 23092a421b91d6fe89e27ded7544a25449c0b050098fTomas Winklerstruct iwl_ssid_ie { 2310b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 id; 2311b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 len; 2312b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 ssid[32]; 2313ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2314b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 23159b3bf06abad70db820c74c90118ea49358549d22Johannes Berg#define PROBE_OPTION_MAX 20 231651e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define TX_CMD_LIFE_TIME_INFINITE cpu_to_le32(0xFFFFFFFF) 231796ff56419504ac6a610ff1af42330e0423242e16Johannes Berg#define IWL_GOOD_CRC_TH_DISABLED 0 231896ff56419504ac6a610ff1af42330e0423242e16Johannes Berg#define IWL_GOOD_CRC_TH_DEFAULT cpu_to_le16(1) 231996ff56419504ac6a610ff1af42330e0423242e16Johannes Berg#define IWL_GOOD_CRC_TH_NEVER cpu_to_le16(0xffff) 2320b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define IWL_MAX_SCAN_SIZE 1024 232189612124d6d62230043ebd827a2b54ea5ea5280cAbhijeet Kolekar#define IWL_MAX_CMD_SIZE 4096 2322b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2323b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2324b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_SCAN_CMD = 0x80 (command) 23253058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 23263058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * The hardware scan command is very powerful; the driver can set it up to 23273058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * maintain (relatively) normal network traffic while doing a scan in the 23283058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * background. The max_out_time and suspend_time control the ratio of how 23293058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * long the device stays on an associated network channel ("service channel") 23303058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * vs. how long it's away from the service channel, i.e. tuned to other channels 23313058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * for scanning. 23323058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 23333058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * max_out_time is the max time off-channel (in usec), and suspend_time 23343058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * is how long (in "extended beacon" format) that the scan is "suspended" 23353058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * after returning to the service channel. That is, suspend_time is the 23363058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * time that we stay on the service channel, doing normal work, between 23373058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * scan segments. The driver may set these parameters differently to support 23383058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * scanning when associated vs. not associated, and light vs. heavy traffic 23393058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * loads when associated. 23403058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 23413058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * After receiving this command, the device's scan engine does the following; 23423058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 23433058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 1) Sends SCAN_START notification to driver 23443058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 2) Checks to see if it has time to do scan for one channel 23453058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 3) Sends NULL packet, with power-save (PS) bit set to 1, 23463058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * to tell AP that we're going off-channel 23473058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 4) Tunes to first channel in scan list, does active or passive scan 23483058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 5) Sends SCAN_RESULT notification to driver 23493058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 6) Checks to see if it has time to do scan on *next* channel in list 23503058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 7) Repeats 4-6 until it no longer has time to scan the next channel 23513058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * before max_out_time expires 23523058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 8) Returns to service channel 23533058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 9) Sends NULL packet with PS=0 to tell AP that we're back 23543058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 10) Stays on service channel until suspend_time expires 23553058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 11) Repeats entire process 2-10 until list is complete 23563058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 12) Sends SCAN_COMPLETE notification 23573058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 23583058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * For fast, efficient scans, the scan command also has support for staying on 23593058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * a channel for just a short time, if doing active scanning and getting no 23603058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * responses to the transmitted probe request. This time is controlled by 23613058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * quiet_time, and the number of received packets below which a channel is 23623058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * considered "quiet" is controlled by quiet_plcp_threshold. 23633058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 23643058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * For active scanning on channels that have regulatory restrictions against 23653058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * blindly transmitting, the scan can listen before transmitting, to make sure 23663058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * that there is already legitimate activity on the channel. If enough 23673058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * packets are cleanly received on the channel (controlled by good_CRC_th, 23683058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * typical value 1), the scan engine starts transmitting probe requests. 23693058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 23703058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * Driver must use separate scan commands for 2.4 vs. 5 GHz bands. 23713058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 23723058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * To avoid uCode errors, see timing restrictions described under 23732a421b91d6fe89e27ded7544a25449c0b050098fTomas Winkler * struct iwl_scan_channel. 2374b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 23753d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler 2376266af4c745952e9bebf687dd68af58df553cb59dJohannes Bergenum iwl_scan_flags { 2377266af4c745952e9bebf687dd68af58df553cb59dJohannes Berg /* BIT(0) currently unused */ 2378266af4c745952e9bebf687dd68af58df553cb59dJohannes Berg IWL_SCAN_FLAGS_ACTION_FRAME_TX = BIT(1), 2379266af4c745952e9bebf687dd68af58df553cb59dJohannes Berg /* bits 2-7 reserved */ 2380266af4c745952e9bebf687dd68af58df553cb59dJohannes Berg}; 2381266af4c745952e9bebf687dd68af58df553cb59dJohannes Berg 23822a421b91d6fe89e27ded7544a25449c0b050098fTomas Winklerstruct iwl_scan_cmd { 2383b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 len; 2384266af4c745952e9bebf687dd68af58df553cb59dJohannes Berg u8 scan_flags; /* scan flags: see enum iwl_scan_flags */ 23853058f02137359efb412975cf94a9fa7c25413387Ben M Cahill u8 channel_count; /* # channels in channel list */ 23863058f02137359efb412975cf94a9fa7c25413387Ben M Cahill __le16 quiet_time; /* dwell only this # millisecs on quiet channel 23873058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * (only for active scan) */ 23883058f02137359efb412975cf94a9fa7c25413387Ben M Cahill __le16 quiet_plcp_th; /* quiet chnl is < this # pkts (typ. 1) */ 23893058f02137359efb412975cf94a9fa7c25413387Ben M Cahill __le16 good_CRC_th; /* passive -> active promotion threshold */ 23903058f02137359efb412975cf94a9fa7c25413387Ben M Cahill __le16 rx_chain; /* RXON_RX_CHAIN_* */ 23913058f02137359efb412975cf94a9fa7c25413387Ben M Cahill __le32 max_out_time; /* max usec to be away from associated (service) 23923058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * channel */ 23933058f02137359efb412975cf94a9fa7c25413387Ben M Cahill __le32 suspend_time; /* pause scan this long (in "extended beacon 23943058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * format") when returning to service chnl: 23953058f02137359efb412975cf94a9fa7c25413387Ben M Cahill */ 23963058f02137359efb412975cf94a9fa7c25413387Ben M Cahill __le32 flags; /* RXON_FLG_* */ 23973058f02137359efb412975cf94a9fa7c25413387Ben M Cahill __le32 filter_flags; /* RXON_FILTER_* */ 23983058f02137359efb412975cf94a9fa7c25413387Ben M Cahill 23993058f02137359efb412975cf94a9fa7c25413387Ben M Cahill /* For active scans (set to all-0s for passive scans). 24003058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * Does not include payload. Must specify Tx rate; no rate scaling. */ 240183d527d9e8f9aff92cbd33f208f77c055dabb499Tomas Winkler struct iwl_tx_cmd tx_cmd; 24023058f02137359efb412975cf94a9fa7c25413387Ben M Cahill 24033058f02137359efb412975cf94a9fa7c25413387Ben M Cahill /* For directed active scans (set to all-0s otherwise) */ 24042a421b91d6fe89e27ded7544a25449c0b050098fTomas Winkler struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX]; 2405b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2406b481de9ca074528fe8c429604e2777db8b89806aZhu Yi /* 24073058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * Probe request frame, followed by channel list. 24083058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * 24093058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * Size of probe request frame is specified by byte count in tx_cmd. 24103058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * Channel list follows immediately after probe request frame. 24113058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * Number of channels in list is specified by channel_count. 24123058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * Each channel in list is of type: 2413b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 24142aa6ab86bc475a115f56645591d2413981846509Tomas Winkler * struct iwl_scan_channel channels[0]; 2415b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2416b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * NOTE: Only one band of channels can be scanned per pass. You 24173058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * must not mix 2.4GHz channels and 5.2GHz channels, and you must wait 24183058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * for one scan to complete (i.e. receive SCAN_COMPLETE_NOTIFICATION) 24193058f02137359efb412975cf94a9fa7c25413387Ben M Cahill * before requesting another scan. 2420b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 24213058f02137359efb412975cf94a9fa7c25413387Ben M Cahill u8 data[0]; 2422ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2423b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2424b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* Can abort will notify by complete notification with abort status. */ 242551e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define CAN_ABORT_STATUS cpu_to_le32(0x1) 2426b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* complete notification statuses */ 2427b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define ABORT_STATUS 0x2 2428b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2429b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2430b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_SCAN_CMD = 0x80 (response) 2431b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 24322a421b91d6fe89e27ded7544a25449c0b050098fTomas Winklerstruct iwl_scanreq_notification { 2433b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 status; /* 1: okay, 2: cannot fulfill request */ 2434ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2435b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2436b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2437b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * SCAN_START_NOTIFICATION = 0x82 (notification only, not a command) 2438b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 24392a421b91d6fe89e27ded7544a25449c0b050098fTomas Winklerstruct iwl_scanstart_notification { 2440b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 tsf_low; 2441b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 tsf_high; 2442b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 beacon_timer; 2443b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 channel; 2444b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 band; 2445b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 reserved[2]; 2446b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 status; 2447ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2448b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2449497888cf69bf607ac1fe061a6437e0a670b0022fPhil Carmody#define SCAN_OWNER_STATUS 0x1 2450497888cf69bf607ac1fe061a6437e0a670b0022fPhil Carmody#define MEASURE_OWNER_STATUS 0x2 2451b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 24520288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg#define IWL_PROBE_STATUS_OK 0 24530288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg#define IWL_PROBE_STATUS_TX_FAILED BIT(0) 24540288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg/* error statuses combined with TX_FAILED */ 24550288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg#define IWL_PROBE_STATUS_FAIL_TTL BIT(1) 24560288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg#define IWL_PROBE_STATUS_FAIL_BT BIT(2) 24570288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg 2458b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define NUMBER_OF_STATISTICS 1 /* first __le32 is good CRC */ 2459b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2460b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command) 2461b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 24622a421b91d6fe89e27ded7544a25449c0b050098fTomas Winklerstruct iwl_scanresults_notification { 2463b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 channel; 2464b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 band; 24650288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg u8 probe_status; 24660288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg u8 num_probe_not_sent; /* not enough time to send */ 2467b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 tsf_low; 2468b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 tsf_high; 2469b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 statistics[NUMBER_OF_STATISTICS]; 2470ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2471b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2472b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2473b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command) 2474b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 24752a421b91d6fe89e27ded7544a25449c0b050098fTomas Winklerstruct iwl_scancomplete_notification { 2476b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 scanned_channels; 2477b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 status; 2478f78e545449bb07a28b419d888c4c558b13d9e5e1Wey-Yi Guy u8 bt_status; /* BT On/Off status */ 2479b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 last_channel; 2480b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 tsf_low; 2481b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 tsf_high; 2482ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2483b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2484b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2485b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 2486b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (9) 2487b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * IBSS/AP Commands and Notifications: 2488b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2489b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 2490b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2491a85d7cca1204f2dba86d2f61693f0fe8c48f0fa5Johannes Bergenum iwl_ibss_manager { 2492a85d7cca1204f2dba86d2f61693f0fe8c48f0fa5Johannes Berg IWL_NOT_IBSS_MANAGER = 0, 2493a85d7cca1204f2dba86d2f61693f0fe8c48f0fa5Johannes Berg IWL_IBSS_MANAGER = 1, 2494a85d7cca1204f2dba86d2f61693f0fe8c48f0fa5Johannes Berg}; 2495a85d7cca1204f2dba86d2f61693f0fe8c48f0fa5Johannes Berg 2496b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2497b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * BEACON_NOTIFICATION = 0x90 (notification only, not a command) 2498b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 24993d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler 2500241887a2d3b725fd0f87113bb7c4a51b5c6a2d06Johannes Bergstruct iwlagn_beacon_notif { 2501241887a2d3b725fd0f87113bb7c4a51b5c6a2d06Johannes Berg struct iwlagn_tx_resp beacon_notify_hdr; 2502241887a2d3b725fd0f87113bb7c4a51b5c6a2d06Johannes Berg __le32 low_tsf; 2503241887a2d3b725fd0f87113bb7c4a51b5c6a2d06Johannes Berg __le32 high_tsf; 2504241887a2d3b725fd0f87113bb7c4a51b5c6a2d06Johannes Berg __le32 ibss_mgr_status; 2505241887a2d3b725fd0f87113bb7c4a51b5c6a2d06Johannes Berg} __packed; 2506241887a2d3b725fd0f87113bb7c4a51b5c6a2d06Johannes Berg 2507b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2508b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_TX_BEACON = 0x91 (command, has simple generic response) 2509b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 25103d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler 25114bf64efd26f5610cde4fb7846e2f37bd1f62d3a9Tomas Winklerstruct iwl_tx_beacon_cmd { 251283d527d9e8f9aff92cbd33f208f77c055dabb499Tomas Winkler struct iwl_tx_cmd tx; 2513b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le16 tim_idx; 2514b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 tim_size; 2515b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 reserved1; 2516b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct ieee80211_hdr frame[0]; /* beacon frame */ 2517ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2518b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2519b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 2520b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (10) 2521b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Statistics Commands and Notifications: 2522b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2523b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 2524b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2525b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define IWL_TEMP_CONVERT 260 2526b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2527b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define SUP_RATE_11A_MAX_NUM_CHANNELS 8 2528b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define SUP_RATE_11B_MAX_NUM_CHANNELS 4 2529b481de9ca074528fe8c429604e2777db8b89806aZhu Yi#define SUP_RATE_11G_MAX_NUM_CHANNELS 12 2530b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2531b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* Used for passing to driver number of successes and failures per rate */ 2532b481de9ca074528fe8c429604e2777db8b89806aZhu Yistruct rate_histogram { 2533b481de9ca074528fe8c429604e2777db8b89806aZhu Yi union { 2534b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 a[SUP_RATE_11A_MAX_NUM_CHANNELS]; 2535b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 b[SUP_RATE_11B_MAX_NUM_CHANNELS]; 2536b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 g[SUP_RATE_11G_MAX_NUM_CHANNELS]; 2537b481de9ca074528fe8c429604e2777db8b89806aZhu Yi } success; 2538b481de9ca074528fe8c429604e2777db8b89806aZhu Yi union { 2539b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 a[SUP_RATE_11A_MAX_NUM_CHANNELS]; 2540b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 b[SUP_RATE_11B_MAX_NUM_CHANNELS]; 2541b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 g[SUP_RATE_11G_MAX_NUM_CHANNELS]; 2542b481de9ca074528fe8c429604e2777db8b89806aZhu Yi } failed; 2543ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2544b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2545b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* statistics command response */ 2546b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 25473d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winklerstruct statistics_dbg { 25483d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler __le32 burst_check; 25493d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler __le32 burst_count; 25507c094c5cc4d28062abf0d33ca022dbea6c522558Wey-Yi Guy __le32 wait_for_silence_timeout_cnt; 25517c094c5cc4d28062abf0d33ca022dbea6c522558Wey-Yi Guy __le32 reserved[3]; 2552ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 25533d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler 2554b481de9ca074528fe8c429604e2777db8b89806aZhu Yistruct statistics_rx_phy { 2555b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 ina_cnt; 2556b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 fina_cnt; 2557b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 plcp_err; 2558b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 crc32_err; 2559b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 overrun_err; 2560b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 early_overrun_err; 2561b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 crc32_good; 2562b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 false_alarm_cnt; 2563b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 fina_sync_err_cnt; 2564b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 sfd_timeout; 2565b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 fina_timeout; 2566b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 unresponded_rts; 2567b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 rxe_frame_limit_overrun; 2568b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 sent_ack_cnt; 2569b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 sent_cts_cnt; 2570b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 sent_ba_rsp_cnt; 2571b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 dsp_self_kill; 2572b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 mh_format_err; 2573b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 re_acq_main_rssi_sum; 2574b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 reserved3; 2575ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2576b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2577b481de9ca074528fe8c429604e2777db8b89806aZhu Yistruct statistics_rx_ht_phy { 2578b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 plcp_err; 2579b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 overrun_err; 2580b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 early_overrun_err; 2581b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 crc32_good; 2582b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 crc32_err; 2583b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 mh_format_err; 2584b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 agg_crc32_good; 2585b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 agg_mpdu_cnt; 2586b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 agg_cnt; 2587f0118a4575d45ce3074c830660de938bc6e17bdaWey-Yi Guy __le32 unsupport_mcs; 2588ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2589b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2590c1b4aa3fb619782213af2af6652663c8f9cef373Harvey Harrison#define INTERFERENCE_DATA_AVAILABLE cpu_to_le32(1) 259134c22cf93d1446791c966c878cc691e07c39d8d3Winkler, Tomas 2592b481de9ca074528fe8c429604e2777db8b89806aZhu Yistruct statistics_rx_non_phy { 2593b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 bogus_cts; /* CTS received when not expecting CTS */ 2594b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 bogus_ack; /* ACK received when not expecting ACK */ 2595b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 non_bssid_frames; /* number of frames with BSSID that 2596b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * doesn't belong to the STA BSSID */ 2597b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 filtered_frames; /* count frames that were dumped in the 2598b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * filtering process */ 2599b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 non_channel_beacons; /* beacons with our bss id but not on 2600b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * our serving channel */ 2601b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 channel_beacons; /* beacons with our bss id and in our 2602b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * serving channel */ 2603b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 num_missed_bcon; /* number of missed beacons */ 2604b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 adc_rx_saturation_time; /* count in 0.8us units the time the 2605b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * ADC was in saturation */ 2606b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 ina_detection_search_time;/* total time (in 0.8us) searched 2607b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * for INA */ 2608b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 beacon_silence_rssi_a; /* RSSI silence after beacon frame */ 2609b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 beacon_silence_rssi_b; /* RSSI silence after beacon frame */ 2610b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 beacon_silence_rssi_c; /* RSSI silence after beacon frame */ 2611b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 interference_data_flag; /* flag for interference data 2612b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * availability. 1 when data is 2613b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * available. */ 26143058f02137359efb412975cf94a9fa7c25413387Ben M Cahill __le32 channel_load; /* counts RX Enable time in uSec */ 2615b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 dsp_false_alarms; /* DSP false alarm (both OFDM 2616b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * and CCK) counter */ 2617b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 beacon_rssi_a; 2618b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 beacon_rssi_b; 2619b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 beacon_rssi_c; 2620b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 beacon_energy_a; 2621b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 beacon_energy_b; 2622b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 beacon_energy_c; 2623ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2624b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2625325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guystruct statistics_rx_non_phy_bt { 2626325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy struct statistics_rx_non_phy common; 2627325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy /* additional stats for bt */ 2628325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 num_bt_kills; 2629325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 reserved[2]; 2630da22f795cefb7c9f8a7bc6f22b1c16f1ff15a392John W. Linville} __packed; 2631325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy 2632b481de9ca074528fe8c429604e2777db8b89806aZhu Yistruct statistics_rx { 2633b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct statistics_rx_phy ofdm; 2634b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct statistics_rx_phy cck; 2635b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct statistics_rx_non_phy general; 2636b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct statistics_rx_ht_phy ofdm_ht; 2637ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2638b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2639325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guystruct statistics_rx_bt { 2640325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy struct statistics_rx_phy ofdm; 2641325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy struct statistics_rx_phy cck; 2642325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy struct statistics_rx_non_phy_bt general; 2643325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy struct statistics_rx_ht_phy ofdm_ht; 2644da22f795cefb7c9f8a7bc6f22b1c16f1ff15a392John W. Linville} __packed; 2645325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy 2646fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy/** 2647fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy * struct statistics_tx_power - current tx power 2648fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy * 2649fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy * @ant_a: current tx power on chain a in 1/2 dB step 2650fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy * @ant_b: current tx power on chain b in 1/2 dB step 2651fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy * @ant_c: current tx power on chain c in 1/2 dB step 2652fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy */ 2653fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guystruct statistics_tx_power { 2654fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy u8 ant_a; 2655fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy u8 ant_b; 2656fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy u8 ant_c; 2657fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy u8 reserved; 2658ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2659fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy 2660b481de9ca074528fe8c429604e2777db8b89806aZhu Yistruct statistics_tx_non_phy_agg { 2661b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 ba_timeout; 2662b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 ba_reschedule_frames; 2663b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 scd_query_agg_frame_cnt; 2664b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 scd_query_no_agg; 2665b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 scd_query_agg; 2666b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 scd_query_mismatch; 2667b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 frame_not_ready; 2668b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 underrun; 2669b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 bt_prio_kill; 2670b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 rx_ba_rsp_cnt; 2671ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2672b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2673b481de9ca074528fe8c429604e2777db8b89806aZhu Yistruct statistics_tx { 2674b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 preamble_cnt; 2675b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 rx_detected_cnt; 2676b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 bt_prio_defer_cnt; 2677b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 bt_prio_kill_cnt; 2678b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 few_bytes_cnt; 2679b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 cts_timeout; 2680b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 ack_timeout; 2681b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 expected_ack_cnt; 2682b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 actual_ack_cnt; 2683b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 dump_msdu_cnt; 2684b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 burst_abort_next_frame_mismatch_cnt; 2685b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 burst_abort_missing_next_frame_cnt; 2686b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 cts_timeout_collision; 2687b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 ack_or_ba_timeout_collision; 2688b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct statistics_tx_non_phy_agg agg; 2689470356b891f1d18e87d5fdc393976fab6d0a978dWey-Yi Guy /* 2690470356b891f1d18e87d5fdc393976fab6d0a978dWey-Yi Guy * "tx_power" are optional parameters provided by uCode, 2691470356b891f1d18e87d5fdc393976fab6d0a978dWey-Yi Guy * 6000 series is the only device provide the information, 2692470356b891f1d18e87d5fdc393976fab6d0a978dWey-Yi Guy * Those are reserved fields for all the other devices 2693470356b891f1d18e87d5fdc393976fab6d0a978dWey-Yi Guy */ 2694fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy struct statistics_tx_power tx_power; 2695fcbaf8b06da385c73cb6218f079e9ddba9ee9f7cWey-Yi Guy __le32 reserved1; 2696ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2697b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2698b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2699b481de9ca074528fe8c429604e2777db8b89806aZhu Yistruct statistics_div { 2700b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 tx_on_a; 2701b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 tx_on_b; 2702b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 exec_time; 2703b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 probe_time; 2704b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 reserved1; 2705b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 reserved2; 2706ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2707b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2708325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guystruct statistics_general_common { 2709f0118a4575d45ce3074c830660de938bc6e17bdaWey-Yi Guy __le32 temperature; /* radio temperature */ 27107f62cd17e0ed90f8a1e9fbbb6480fa48ebc4c0a6Wey-Yi Guy __le32 temperature_m; /* radio voltage */ 2711b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct statistics_dbg dbg; 2712b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 sleep_time; 2713b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 slots_out; 2714b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 slots_idle; 2715b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 ttl_timestamp; 2716b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct statistics_div div; 2717b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 rx_enable_counter; 271811fc524941248dc717f1af5dfa844eceb7c0217fWey-Yi Guy /* 271911fc524941248dc717f1af5dfa844eceb7c0217fWey-Yi Guy * num_of_sos_states: 272011fc524941248dc717f1af5dfa844eceb7c0217fWey-Yi Guy * count the number of times we have to re-tune 272111fc524941248dc717f1af5dfa844eceb7c0217fWey-Yi Guy * in order to get out of bad PHY status 272211fc524941248dc717f1af5dfa844eceb7c0217fWey-Yi Guy */ 272311fc524941248dc717f1af5dfa844eceb7c0217fWey-Yi Guy __le32 num_of_sos_states; 2724da22f795cefb7c9f8a7bc6f22b1c16f1ff15a392John W. Linville} __packed; 2725325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy 2726325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guystruct statistics_bt_activity { 2727325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy /* Tx statistics */ 2728325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 hi_priority_tx_req_cnt; 2729325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 hi_priority_tx_denied_cnt; 2730325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 lo_priority_tx_req_cnt; 2731325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 lo_priority_tx_denied_cnt; 2732325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy /* Rx statistics */ 2733325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 hi_priority_rx_req_cnt; 2734325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 hi_priority_rx_denied_cnt; 2735325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 lo_priority_rx_req_cnt; 2736325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 lo_priority_rx_denied_cnt; 2737da22f795cefb7c9f8a7bc6f22b1c16f1ff15a392John W. Linville} __packed; 2738325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy 2739325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guystruct statistics_general { 2740325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy struct statistics_general_common common; 2741325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 reserved2; 2742325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 reserved3; 2743da22f795cefb7c9f8a7bc6f22b1c16f1ff15a392John W. Linville} __packed; 2744325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy 2745325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guystruct statistics_general_bt { 2746325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy struct statistics_general_common common; 2747325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy struct statistics_bt_activity activity; 2748b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 reserved2; 2749b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 reserved3; 2750ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2751b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2752ef8d5529b015d4c5db7fad1adfc91edfd5abad56Wey-Yi Guy#define UCODE_STATISTICS_CLEAR_MSK (0x1 << 0) 2753ef8d5529b015d4c5db7fad1adfc91edfd5abad56Wey-Yi Guy#define UCODE_STATISTICS_FREQUENCY_MSK (0x1 << 1) 2754ef8d5529b015d4c5db7fad1adfc91edfd5abad56Wey-Yi Guy#define UCODE_STATISTICS_NARROW_BAND_MSK (0x1 << 2) 2755ef8d5529b015d4c5db7fad1adfc91edfd5abad56Wey-Yi Guy 2756b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2757b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_STATISTICS_CMD = 0x9c, 2758767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * all devices identical. 2759b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2760b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * This command triggers an immediate response containing uCode statistics. 2761b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * The response is in the same format as STATISTICS_NOTIFICATION 0x9d, below. 2762b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2763b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * If the CLEAR_STATS configuration flag is set, uCode will clear its 2764b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * internal copy of the statistics (counters) after issuing the response. 2765b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * This flag does not affect STATISTICS_NOTIFICATIONs after beacons (see below). 2766b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2767b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * If the DISABLE_NOTIF configuration flag is set, uCode will not issue 2768b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * STATISTICS_NOTIFICATIONs after received beacons (see below). This flag 2769b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * does not affect the response to the REPLY_STATISTICS_CMD 0x9c itself. 2770b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 277151e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define IWL_STATS_CONF_CLEAR_STATS cpu_to_le32(0x1) /* see above */ 277251e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define IWL_STATS_CONF_DISABLE_NOTIF cpu_to_le32(0x2)/* see above */ 27738f91aecb4cdc2d786df8941e827b9dff3c10a4e4Emmanuel Grumbachstruct iwl_statistics_cmd { 2774b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 configuration_flags; /* IWL_STATS_CONF_* */ 2775ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2776b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2777b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2778b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command) 2779b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2780b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * By default, uCode issues this notification after receiving a beacon 2781b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * while associated. To disable this behavior, set DISABLE_NOTIF flag in the 2782b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_STATISTICS_CMD 0x9c, above. 2783b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2784b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Statistics counters continue to increment beacon after beacon, but are 2785b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * cleared when changing channels or when driver issues REPLY_STATISTICS_CMD 2786b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 0x9c with CLEAR_STATS bit set (see above). 2787b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2788b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * uCode also issues this notification during scans. uCode clears statistics 2789b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * appropriately so that each notification contains statistics for only the 2790b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * one channel that has just been scanned. 2791b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 279251e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define STATISTICS_REPLY_FLG_BAND_24G_MSK cpu_to_le32(0x2) 27937aafef1c6e2e24f9a10dc2972bf0ee70624ccc47Wey-Yi Guy#define STATISTICS_REPLY_FLG_HT40_MODE_MSK cpu_to_le32(0x8) 27943d24a9f790c0e39cfdef1446c7100e89c542805cTomas Winkler 27958f91aecb4cdc2d786df8941e827b9dff3c10a4e4Emmanuel Grumbachstruct iwl_notif_statistics { 2796b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 flag; 2797b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct statistics_rx rx; 2798b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct statistics_tx tx; 2799b481de9ca074528fe8c429604e2777db8b89806aZhu Yi struct statistics_general general; 2800ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2801b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2802325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guystruct iwl_bt_notif_statistics { 2803325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy __le32 flag; 2804325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy struct statistics_rx_bt rx; 2805325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy struct statistics_tx tx; 2806325322ee34d726bff922853d509e135c8d262e2fWey-Yi Guy struct statistics_general_bt general; 2807da22f795cefb7c9f8a7bc6f22b1c16f1ff15a392John W. Linville} __packed; 2808b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2809b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 2810b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * MISSED_BEACONS_NOTIFICATION = 0xa2 (notification only, not a command) 2811a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * 2812a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * uCode send MISSED_BEACONS_NOTIFICATION to driver when detect beacon missed 2813a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * in regardless of how many missed beacons, which mean when driver receive the 2814a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * notification, inside the command, it can find all the beacons information 2815a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * which include number of total missed beacons, number of consecutive missed 2816a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * beacons, number of beacons received and number of beacons expected to 2817a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * receive. 2818a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * 2819a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * If uCode detected consecutive_missed_beacons > 5, it will reset the radio 2820a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * in order to bring the radio/PHY back to working state; which has no relation 2821a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * to when driver will perform sensitivity calibration. 2822a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * 2823a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * Driver should set it own missed_beacon_threshold to decide when to perform 2824a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * sensitivity calibration based on number of consecutive missed beacons in 2825a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * order to improve overall performance, especially in noisy environment. 2826a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy * 2827b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 2828a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy 2829a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy#define IWL_MISSED_BEACON_THRESHOLD_MIN (1) 2830a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy#define IWL_MISSED_BEACON_THRESHOLD_DEF (5) 2831a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy#define IWL_MISSED_BEACON_THRESHOLD_MAX IWL_MISSED_BEACON_THRESHOLD_DEF 2832b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 28332aa6ab86bc475a115f56645591d2413981846509Tomas Winklerstruct iwl_missed_beacon_notif { 2834a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4Wey-Yi Guy __le32 consecutive_missed_beacons; 2835b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 total_missed_becons; 2836b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 num_expected_beacons; 2837b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 num_recvd_beacons; 2838ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 2839b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2840f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill 2841b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 2842b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (11) 2843b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Rx Calibration Commands: 2844b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 2845f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * With the uCode used for open source drivers, most Tx calibration (except 2846f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * for Tx Power) and most Rx calibration is done by uCode during the 2847f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * "initialize" phase of uCode boot. Driver must calibrate only: 2848f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2849f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 1) Tx power (depends on temperature), described elsewhere 2850f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2) Receiver gain balance (optimize MIMO, and detect disconnected antennas) 2851f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3) Receiver sensitivity (to optimize signal detection) 2852f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2853b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 2854b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 2855f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill/** 2856f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * SENSITIVITY_CMD = 0xa8 (command, has simple generic response) 2857f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2858f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * This command sets up the Rx signal detector for a sensitivity level that 2859f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * is high enough to lock onto all signals within the associated network, 2860f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * but low enough to ignore signals that are below a certain threshold, so as 2861f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * not to have too many "false alarms". False alarms are signals that the 2862f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Rx DSP tries to lock onto, but then discards after determining that they 2863f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * are noise. 2864f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2865f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * The optimum number of false alarms is between 5 and 50 per 200 TUs 2866f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (200 * 1024 uSecs, i.e. 204.8 milliseconds) of actual Rx time (i.e. 2867f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * time listening, not transmitting). Driver must adjust sensitivity so that 2868f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * the ratio of actual false alarms to actual Rx time falls within this range. 2869f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2870f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * While associated, uCode delivers STATISTICS_NOTIFICATIONs after each 2871f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * received beacon. These provide information to the driver to analyze the 2872f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * sensitivity. Don't analyze statistics that come in from scanning, or any 2873f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * other non-associated-network source. Pertinent statistics include: 2874f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2875f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * From "general" statistics (struct statistics_rx_non_phy): 2876f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2877f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (beacon_energy_[abc] & 0x0FF00) >> 8 (unsigned, higher value is lower level) 2878f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Measure of energy of desired signal. Used for establishing a level 2879f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * below which the device does not detect signals. 2880f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2881f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (beacon_silence_rssi_[abc] & 0x0FF00) >> 8 (unsigned, units in dB) 2882f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Measure of background noise in silent period after beacon. 2883f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2884f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * channel_load 2885f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * uSecs of actual Rx time during beacon period (varies according to 2886f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * how much time was spent transmitting). 2887f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2888f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * From "cck" and "ofdm" statistics (struct statistics_rx_phy), separately: 2889f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2890f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * false_alarm_cnt 2891f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Signal locks abandoned early (before phy-level header). 2892f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2893f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * plcp_err 2894f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Signal locks abandoned late (during phy-level header). 2895f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2896f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * NOTE: Both false_alarm_cnt and plcp_err increment monotonically from 2897f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * beacon to beacon, i.e. each value is an accumulation of all errors 2898f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * before and including the latest beacon. Values will wrap around to 0 2899f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * after counting up to 2^32 - 1. Driver must differentiate vs. 2900f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * previous beacon's values to determine # false alarms in the current 2901f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * beacon period. 2902f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2903f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Total number of false alarms = false_alarms + plcp_errs 2904f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2905f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * For OFDM, adjust the following table entries in struct iwl_sensitivity_cmd 2906f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (notice that the start points for OFDM are at or close to settings for 2907f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * maximum sensitivity): 2908f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2909f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * START / MIN / MAX 2910f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * HD_AUTO_CORR32_X1_TH_ADD_MIN_INDEX 90 / 85 / 120 2911f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_INDEX 170 / 170 / 210 2912f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * HD_AUTO_CORR32_X4_TH_ADD_MIN_INDEX 105 / 105 / 140 2913f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_INDEX 220 / 220 / 270 2914f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2915f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * If actual rate of OFDM false alarms (+ plcp_errors) is too high 2916f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (greater than 50 for each 204.8 msecs listening), reduce sensitivity 2917f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * by *adding* 1 to all 4 of the table entries above, up to the max for 2918f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * each entry. Conversely, if false alarm rate is too low (less than 5 2919f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * for each 204.8 msecs listening), *subtract* 1 from each entry to 2920f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * increase sensitivity. 2921f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2922f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * For CCK sensitivity, keep track of the following: 2923f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2924f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 1). 20-beacon history of maximum background noise, indicated by 2925f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (beacon_silence_rssi_[abc] & 0x0FF00), units in dB, across the 2926f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3 receivers. For any given beacon, the "silence reference" is 2927f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * the maximum of last 60 samples (20 beacons * 3 receivers). 2928f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2929f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2). 10-beacon history of strongest signal level, as indicated 2930f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * by (beacon_energy_[abc] & 0x0FF00) >> 8, across the 3 receivers, 2931f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * i.e. the strength of the signal through the best receiver at the 2932f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * moment. These measurements are "upside down", with lower values 2933f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * for stronger signals, so max energy will be *minimum* value. 2934f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2935f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Then for any given beacon, the driver must determine the *weakest* 2936f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * of the strongest signals; this is the minimum level that needs to be 2937f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * successfully detected, when using the best receiver at the moment. 2938f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * "Max cck energy" is the maximum (higher value means lower energy!) 2939f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * of the last 10 minima. Once this is determined, driver must add 2940f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * a little margin by adding "6" to it. 2941f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2942f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3). Number of consecutive beacon periods with too few false alarms. 2943f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Reset this to 0 at the first beacon period that falls within the 2944f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * "good" range (5 to 50 false alarms per 204.8 milliseconds rx). 2945f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2946f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Then, adjust the following CCK table entries in struct iwl_sensitivity_cmd 2947f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (notice that the start points for CCK are at maximum sensitivity): 2948f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2949f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * START / MIN / MAX 2950f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX 125 / 125 / 200 2951f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX 200 / 200 / 400 2952f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * HD_MIN_ENERGY_CCK_DET_INDEX 100 / 0 / 100 2953f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2954f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * If actual rate of CCK false alarms (+ plcp_errors) is too high 2955f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (greater than 50 for each 204.8 msecs listening), method for reducing 2956f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * sensitivity is: 2957f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2958f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 1) *Add* 3 to value in HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX, 2959f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * up to max 400. 2960f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2961f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2) If current value in HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX is < 160, 2962f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * sensitivity has been reduced a significant amount; bring it up to 2963f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * a moderate 161. Otherwise, *add* 3, up to max 200. 2964f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2965f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3) a) If current value in HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX is > 160, 2966f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * sensitivity has been reduced only a moderate or small amount; 2967f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * *subtract* 2 from value in HD_MIN_ENERGY_CCK_DET_INDEX, 2968f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * down to min 0. Otherwise (if gain has been significantly reduced), 2969f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * don't change the HD_MIN_ENERGY_CCK_DET_INDEX value. 2970f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2971f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * b) Save a snapshot of the "silence reference". 2972f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2973f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * If actual rate of CCK false alarms (+ plcp_errors) is too low 2974f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (less than 5 for each 204.8 msecs listening), method for increasing 2975f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * sensitivity is used only if: 2976f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2977f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 1a) Previous beacon did not have too many false alarms 2978f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 1b) AND difference between previous "silence reference" and current 2979f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * "silence reference" (prev - current) is 2 or more, 2980f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * OR 2) 100 or more consecutive beacon periods have had rate of 2981f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * less than 5 false alarms per 204.8 milliseconds rx time. 2982f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2983f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Method for increasing sensitivity: 2984f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2985f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 1) *Subtract* 3 from value in HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX, 2986f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * down to min 125. 2987f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2988f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2) *Subtract* 3 from value in HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX, 2989f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * down to min 200. 2990f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2991f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3) *Add* 2 to value in HD_MIN_ENERGY_CCK_DET_INDEX, up to max 100. 2992f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2993f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * If actual rate of CCK false alarms (+ plcp_errors) is within good range 2994f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (between 5 and 50 for each 204.8 msecs listening): 2995f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2996f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 1) Save a snapshot of the silence reference. 2997f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2998f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2) If previous beacon had too many CCK false alarms (+ plcp_errors), 2999f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * give some extra margin to energy threshold by *subtracting* 8 3000f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * from value in HD_MIN_ENERGY_CCK_DET_INDEX. 3001f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3002f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * For all cases (too few, too many, good range), make sure that the CCK 3003f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * detection threshold (energy) is below the energy level for robust 3004f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * detection over the past 10 beacon periods, the "Max cck energy". 3005f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Lower values mean higher energy; this means making sure that the value 3006f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * in HD_MIN_ENERGY_CCK_DET_INDEX is at or *above* "Max cck energy". 3007f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3008f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill */ 3009f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill 3010f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill/* 3011f0832f137c21d130998a0f97f97ac01a2d97210bEmmanuel Grumbach * Table entries in SENSITIVITY_CMD (struct iwl_sensitivity_cmd) 3012f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill */ 3013f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill#define HD_TABLE_SIZE (11) /* number of entries */ 3014f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill#define HD_MIN_ENERGY_CCK_DET_INDEX (0) /* table indexes */ 3015f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill#define HD_MIN_ENERGY_OFDM_DET_INDEX (1) 3016f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill#define HD_AUTO_CORR32_X1_TH_ADD_MIN_INDEX (2) 3017f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill#define HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_INDEX (3) 3018f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill#define HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX (4) 3019f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill#define HD_AUTO_CORR32_X4_TH_ADD_MIN_INDEX (5) 3020f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill#define HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_INDEX (6) 3021f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill#define HD_BARKER_CORR_TH_ADD_MIN_INDEX (7) 3022f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill#define HD_BARKER_CORR_TH_ADD_MIN_MRC_INDEX (8) 3023f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill#define HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX (9) 3024f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill#define HD_OFDM_ENERGY_TH_IN_INDEX (10) 3025f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill 3026c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy/* 3027c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy * Additional table entries in enhance SENSITIVITY_CMD 3028c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy */ 3029c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define HD_INA_NON_SQUARE_DET_OFDM_INDEX (11) 3030c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define HD_INA_NON_SQUARE_DET_CCK_INDEX (12) 3031c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define HD_CORR_11_INSTEAD_OF_CORR_9_EN_INDEX (13) 3032c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define HD_OFDM_NON_SQUARE_DET_SLOPE_MRC_INDEX (14) 3033c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define HD_OFDM_NON_SQUARE_DET_INTERCEPT_MRC_INDEX (15) 3034c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define HD_OFDM_NON_SQUARE_DET_SLOPE_INDEX (16) 3035c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define HD_OFDM_NON_SQUARE_DET_INTERCEPT_INDEX (17) 3036c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define HD_CCK_NON_SQUARE_DET_SLOPE_MRC_INDEX (18) 3037c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define HD_CCK_NON_SQUARE_DET_INTERCEPT_MRC_INDEX (19) 3038c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define HD_CCK_NON_SQUARE_DET_SLOPE_INDEX (20) 3039c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define HD_CCK_NON_SQUARE_DET_INTERCEPT_INDEX (21) 3040c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define HD_RESERVED (22) 3041c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy 3042c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy/* number of entries for enhanced tbl */ 3043c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define ENHANCE_HD_TABLE_SIZE (23) 3044c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy 3045c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy/* number of additional entries for enhanced tbl */ 3046c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy#define ENHANCE_HD_TABLE_ENTRIES (ENHANCE_HD_TABLE_SIZE - HD_TABLE_SIZE) 3047c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy 3048ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_INA_NON_SQUARE_DET_OFDM_DATA_V1 cpu_to_le16(0) 3049ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_INA_NON_SQUARE_DET_CCK_DATA_V1 cpu_to_le16(0) 3050ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_CORR_11_INSTEAD_OF_CORR_9_EN_DATA_V1 cpu_to_le16(0) 3051ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_OFDM_NON_SQUARE_DET_SLOPE_MRC_DATA_V1 cpu_to_le16(668) 3052ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_OFDM_NON_SQUARE_DET_INTERCEPT_MRC_DATA_V1 cpu_to_le16(4) 3053ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_OFDM_NON_SQUARE_DET_SLOPE_DATA_V1 cpu_to_le16(486) 3054ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_OFDM_NON_SQUARE_DET_INTERCEPT_DATA_V1 cpu_to_le16(37) 3055ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_CCK_NON_SQUARE_DET_SLOPE_MRC_DATA_V1 cpu_to_le16(853) 3056ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_CCK_NON_SQUARE_DET_INTERCEPT_MRC_DATA_V1 cpu_to_le16(4) 3057ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_CCK_NON_SQUARE_DET_SLOPE_DATA_V1 cpu_to_le16(476) 3058ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_CCK_NON_SQUARE_DET_INTERCEPT_DATA_V1 cpu_to_le16(99) 3059ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy 3060ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_INA_NON_SQUARE_DET_OFDM_DATA_V2 cpu_to_le16(1) 3061ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_INA_NON_SQUARE_DET_CCK_DATA_V2 cpu_to_le16(1) 3062ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_CORR_11_INSTEAD_OF_CORR_9_EN_DATA_V2 cpu_to_le16(1) 3063ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_OFDM_NON_SQUARE_DET_SLOPE_MRC_DATA_V2 cpu_to_le16(600) 3064ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_OFDM_NON_SQUARE_DET_INTERCEPT_MRC_DATA_V2 cpu_to_le16(40) 3065ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_OFDM_NON_SQUARE_DET_SLOPE_DATA_V2 cpu_to_le16(486) 3066ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_OFDM_NON_SQUARE_DET_INTERCEPT_DATA_V2 cpu_to_le16(45) 3067ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_CCK_NON_SQUARE_DET_SLOPE_MRC_DATA_V2 cpu_to_le16(853) 3068ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_CCK_NON_SQUARE_DET_INTERCEPT_MRC_DATA_V2 cpu_to_le16(60) 3069ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_CCK_NON_SQUARE_DET_SLOPE_DATA_V2 cpu_to_le16(476) 3070ae7f9a740b4ac5a64306abc47a440b794c5b827aWey-Yi Guy#define HD_CCK_NON_SQUARE_DET_INTERCEPT_DATA_V2 cpu_to_le16(99) 3071c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy 3072c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy 3073f0832f137c21d130998a0f97f97ac01a2d97210bEmmanuel Grumbach/* Control field in struct iwl_sensitivity_cmd */ 307451e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define SENSITIVITY_CMD_CONTROL_DEFAULT_TABLE cpu_to_le16(0) 307551e9bf5d795b8e01e54391f1790974c7b166d286Harvey Harrison#define SENSITIVITY_CMD_CONTROL_WORK_TABLE cpu_to_le16(1) 3076b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 3077f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill/** 3078f0832f137c21d130998a0f97f97ac01a2d97210bEmmanuel Grumbach * struct iwl_sensitivity_cmd 3079f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * @control: (1) updates working table, (0) updates default table 3080f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * @table: energy threshold values, use HD_* as index into table 3081f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3082f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Always use "1" in "control" to update uCode's working table and DSP. 3083f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill */ 3084f0832f137c21d130998a0f97f97ac01a2d97210bEmmanuel Grumbachstruct iwl_sensitivity_cmd { 3085f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill __le16 control; /* always use "1" */ 3086f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill __le16 table[HD_TABLE_SIZE]; /* use HD_* as index */ 3087ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 3088b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 3089c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy/* 3090c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy * 3091c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy */ 3092c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guystruct iwl_enhance_sensitivity_cmd { 3093c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy __le16 control; /* always use "1" */ 3094c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy __le16 enhance_table[ENHANCE_HD_TABLE_SIZE]; /* use HD_* as index */ 30950e954099b7910524b7fae831fbf2933bd25cb6d0John W. Linville} __packed; 3096c8312facd99b4cd05998fe3440926b667a896c9eWey-Yi Guy 3097f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill 3098f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill/** 3099f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * REPLY_PHY_CALIBRATION_CMD = 0xb0 (command, has simple generic response) 3100f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3101767d055d6a85435bf1d5e63a5097402a5399cfdcWey-Yi Guy * This command sets the relative gains of agn device's 3 radio receiver chains. 3102f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3103f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * After the first association, driver should accumulate signal and noise 3104f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * statistics from the STATISTICS_NOTIFICATIONs that follow the first 20 3105f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * beacons from the associated network (don't collect statistics that come 3106f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * in from scanning, or any other non-network source). 3107f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3108f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * DISCONNECTED ANTENNA: 3109f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3110f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Driver should determine which antennas are actually connected, by comparing 3111f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * average beacon signal levels for the 3 Rx chains. Accumulate (add) the 3112f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * following values over 20 beacons, one accumulator for each of the chains 3113f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * a/b/c, from struct statistics_rx_non_phy: 3114f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3115f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * beacon_rssi_[abc] & 0x0FF (unsigned, units in dB) 3116f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3117f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Find the strongest signal from among a/b/c. Compare the other two to the 3118f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * strongest. If any signal is more than 15 dB (times 20, unless you 3119f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * divide the accumulated values by 20) below the strongest, the driver 3120f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * considers that antenna to be disconnected, and should not try to use that 3121f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * antenna/chain for Rx or Tx. If both A and B seem to be disconnected, 3122f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * driver should declare the stronger one as connected, and attempt to use it 3123f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (A and B are the only 2 Tx chains!). 3124f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3125f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3126f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * RX BALANCE: 3127f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3128f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Driver should balance the 3 receivers (but just the ones that are connected 3129f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * to antennas, see above) for gain, by comparing the average signal levels 3130f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * detected during the silence after each beacon (background noise). 3131f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Accumulate (add) the following values over 20 beacons, one accumulator for 3132f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * each of the chains a/b/c, from struct statistics_rx_non_phy: 3133f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3134f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * beacon_silence_rssi_[abc] & 0x0FF (unsigned, units in dB) 3135f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3136f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * Find the weakest background noise level from among a/b/c. This Rx chain 3137f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * will be the reference, with 0 gain adjustment. Attenuate other channels by 3138f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * finding noise difference: 3139f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3140f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (accum_noise[i] - accum_noise[reference]) / 30 3141f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3142f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * The "30" adjusts the dB in the 20 accumulated samples to units of 1.5 dB. 3143f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * For use in diff_gain_[abc] fields of struct iwl_calibration_cmd, the 3144f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * driver should limit the difference results to a range of 0-3 (0-4.5 dB), 3145f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * and set bit 2 to indicate "reduce gain". The value for the reference 3146f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * (weakest) chain should be "0". 3147f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 3148f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * diff_gain_[abc] bit fields: 3149f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 2: (1) reduce gain, (0) increase gain 3150f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill * 1-0: amount of gain, units of 1.5 dB 3151f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill */ 3152f7d09d7c453f197d802c50172b27170a43e1a816Ben M Cahill 3153f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winkler/* Phy calibration command for series */ 3154642454cc0774e0774bc1ccb4292d6dc0abd06d20Shanyu Zhao/* The default calibrate table size if not specified by firmware */ 3155642454cc0774e0774bc1ccb4292d6dc0abd06d20Shanyu Zhao#define IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE 18 315633fd503346ad86bd7470a0f8c4c3080393d14233Emmanuel Grumbachenum { 3157f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winkler IWL_PHY_CALIBRATE_DC_CMD = 8, 3158f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winkler IWL_PHY_CALIBRATE_LO_CMD = 9, 3159f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winkler IWL_PHY_CALIBRATE_TX_IQ_CMD = 11, 3160f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winkler IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD = 15, 3161f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winkler IWL_PHY_CALIBRATE_BASE_BAND_CMD = 16, 3162f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winkler IWL_PHY_CALIBRATE_TX_IQ_PERD_CMD = 17, 3163bf53f939e02c0e818df93ab130fedc0e4ba95796Shanyu Zhao IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD = 18, 3164bf53f939e02c0e818df93ab130fedc0e4ba95796Shanyu Zhao IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE = 19, 316533fd503346ad86bd7470a0f8c4c3080393d14233Emmanuel Grumbach}; 316633fd503346ad86bd7470a0f8c4c3080393d14233Emmanuel Grumbach 31676a822d060c439bb700f2369767105f49135b94f8Wey-Yi Guy#define IWL_MAX_PHY_CALIBRATE_TBL_SIZE (253) 3168f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winkler 31696d6a1afdc591e3f3ee66c39206923def43044ab6Shanyu Zhao/* This enum defines the bitmap of various calibrations to enable in both 31706d6a1afdc591e3f3ee66c39206923def43044ab6Shanyu Zhao * init ucode and runtime ucode through CALIBRATION_CFG_CMD. 31716d6a1afdc591e3f3ee66c39206923def43044ab6Shanyu Zhao */ 31726d6a1afdc591e3f3ee66c39206923def43044ab6Shanyu Zhaoenum iwl_ucode_calib_cfg { 317345d50024a766ef757f3ef7ca7d4f8fb38c5a79f0Wey-Yi Guy IWL_CALIB_CFG_RX_BB_IDX = BIT(0), 317445d50024a766ef757f3ef7ca7d4f8fb38c5a79f0Wey-Yi Guy IWL_CALIB_CFG_DC_IDX = BIT(1), 317545d50024a766ef757f3ef7ca7d4f8fb38c5a79f0Wey-Yi Guy IWL_CALIB_CFG_LO_IDX = BIT(2), 317645d50024a766ef757f3ef7ca7d4f8fb38c5a79f0Wey-Yi Guy IWL_CALIB_CFG_TX_IQ_IDX = BIT(3), 317745d50024a766ef757f3ef7ca7d4f8fb38c5a79f0Wey-Yi Guy IWL_CALIB_CFG_RX_IQ_IDX = BIT(4), 317845d50024a766ef757f3ef7ca7d4f8fb38c5a79f0Wey-Yi Guy IWL_CALIB_CFG_NOISE_IDX = BIT(5), 317945d50024a766ef757f3ef7ca7d4f8fb38c5a79f0Wey-Yi Guy IWL_CALIB_CFG_CRYSTAL_IDX = BIT(6), 318045d50024a766ef757f3ef7ca7d4f8fb38c5a79f0Wey-Yi Guy IWL_CALIB_CFG_TEMPERATURE_IDX = BIT(7), 318145d50024a766ef757f3ef7ca7d4f8fb38c5a79f0Wey-Yi Guy IWL_CALIB_CFG_PAPD_IDX = BIT(8), 318245d50024a766ef757f3ef7ca7d4f8fb38c5a79f0Wey-Yi Guy IWL_CALIB_CFG_SENSITIVITY_IDX = BIT(9), 318345d50024a766ef757f3ef7ca7d4f8fb38c5a79f0Wey-Yi Guy IWL_CALIB_CFG_TX_PWR_IDX = BIT(10), 31846d6a1afdc591e3f3ee66c39206923def43044ab6Shanyu Zhao}; 31856d6a1afdc591e3f3ee66c39206923def43044ab6Shanyu Zhao 3186ad3f71244c93412087ae93aabce39c4a9fb12891Wey-Yi Guy#define IWL_CALIB_INIT_CFG_ALL cpu_to_le32(IWL_CALIB_CFG_RX_BB_IDX | \ 3187ad3f71244c93412087ae93aabce39c4a9fb12891Wey-Yi Guy IWL_CALIB_CFG_DC_IDX | \ 3188ad3f71244c93412087ae93aabce39c4a9fb12891Wey-Yi Guy IWL_CALIB_CFG_LO_IDX | \ 3189ad3f71244c93412087ae93aabce39c4a9fb12891Wey-Yi Guy IWL_CALIB_CFG_TX_IQ_IDX | \ 3190ad3f71244c93412087ae93aabce39c4a9fb12891Wey-Yi Guy IWL_CALIB_CFG_RX_IQ_IDX | \ 3191a944aa9dee00c1f696768bcf4a99e6b1d308351aWey-Yi Guy IWL_CALIB_CFG_CRYSTAL_IDX) 3192ad3f71244c93412087ae93aabce39c4a9fb12891Wey-Yi Guy 3193af4dc88c56559c1ebf53628ddcc18dde23924e33Wey-Yi Guy#define IWL_CALIB_RT_CFG_ALL cpu_to_le32(IWL_CALIB_CFG_RX_BB_IDX | \ 3194af4dc88c56559c1ebf53628ddcc18dde23924e33Wey-Yi Guy IWL_CALIB_CFG_DC_IDX | \ 3195af4dc88c56559c1ebf53628ddcc18dde23924e33Wey-Yi Guy IWL_CALIB_CFG_LO_IDX | \ 3196af4dc88c56559c1ebf53628ddcc18dde23924e33Wey-Yi Guy IWL_CALIB_CFG_TX_IQ_IDX | \ 3197af4dc88c56559c1ebf53628ddcc18dde23924e33Wey-Yi Guy IWL_CALIB_CFG_RX_IQ_IDX | \ 3198af4dc88c56559c1ebf53628ddcc18dde23924e33Wey-Yi Guy IWL_CALIB_CFG_TEMPERATURE_IDX | \ 3199af4dc88c56559c1ebf53628ddcc18dde23924e33Wey-Yi Guy IWL_CALIB_CFG_PAPD_IDX | \ 3200af4dc88c56559c1ebf53628ddcc18dde23924e33Wey-Yi Guy IWL_CALIB_CFG_TX_PWR_IDX | \ 3201af4dc88c56559c1ebf53628ddcc18dde23924e33Wey-Yi Guy IWL_CALIB_CFG_CRYSTAL_IDX) 3202af4dc88c56559c1ebf53628ddcc18dde23924e33Wey-Yi Guy 3203ad3f71244c93412087ae93aabce39c4a9fb12891Wey-Yi Guy#define IWL_CALIB_CFG_FLAG_SEND_COMPLETE_NTFY_MSK cpu_to_le32(BIT(0)) 32046d6a1afdc591e3f3ee66c39206923def43044ab6Shanyu Zhao 32057c616cba240cd0d579c996be3f3603456acfb0adTomas Winklerstruct iwl_calib_cfg_elmnt_s { 32067c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler __le32 is_enable; 32077c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler __le32 start; 32087c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler __le32 send_res; 32097c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler __le32 apply_res; 32107c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler __le32 reserved; 3211ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 32127c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler 32137c616cba240cd0d579c996be3f3603456acfb0adTomas Winklerstruct iwl_calib_cfg_status_s { 32147c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler struct iwl_calib_cfg_elmnt_s once; 32157c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler struct iwl_calib_cfg_elmnt_s perd; 32167c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler __le32 flags; 3217ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 32187c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler 3219f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winklerstruct iwl_calib_cfg_cmd { 32207c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler struct iwl_calib_cfg_status_s ucd_calib_cfg; 32217c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler struct iwl_calib_cfg_status_s drv_calib_cfg; 32227c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler __le32 reserved1; 3223ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 32247c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler 3225f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winklerstruct iwl_calib_hdr { 32267c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler u8 op_code; 32277c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler u8 first_group; 32287c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler u8 groups_num; 32297c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler u8 data_valid; 3230ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 32317c616cba240cd0d579c996be3f3603456acfb0adTomas Winkler 3232f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winklerstruct iwl_calib_cmd { 3233f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winkler struct iwl_calib_hdr hdr; 3234be5d56ed885a2897ec813eab4a8055d495816e9aTomas Winkler u8 data[0]; 3235ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 3236be5d56ed885a2897ec813eab4a8055d495816e9aTomas Winkler 32370d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winklerstruct iwl_calib_xtal_freq_cmd { 32380d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winkler struct iwl_calib_hdr hdr; 32390d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winkler u8 cap_pin1; 32400d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winkler u8 cap_pin2; 32410d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winkler u8 pad[2]; 3242ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 324333fd503346ad86bd7470a0f8c4c3080393d14233Emmanuel Grumbach 32442e27799621f9b6dc69d9fac5e365cb867eac539cWey-Yi Guy#define DEFAULT_RADIO_SENSOR_OFFSET cpu_to_le16(2700) 3245bf53f939e02c0e818df93ab130fedc0e4ba95796Shanyu Zhaostruct iwl_calib_temperature_offset_cmd { 3246bf53f939e02c0e818df93ab130fedc0e4ba95796Shanyu Zhao struct iwl_calib_hdr hdr; 32472e27799621f9b6dc69d9fac5e365cb867eac539cWey-Yi Guy __le16 radio_sensor_offset; 32482e27799621f9b6dc69d9fac5e365cb867eac539cWey-Yi Guy __le16 reserved; 3249bf53f939e02c0e818df93ab130fedc0e4ba95796Shanyu Zhao} __packed; 3250bf53f939e02c0e818df93ab130fedc0e4ba95796Shanyu Zhao 3251c6f30347a79502cc81e8ec55248b569b3a90ba2aWey-Yi Guystruct iwl_calib_temperature_offset_v2_cmd { 3252c6f30347a79502cc81e8ec55248b569b3a90ba2aWey-Yi Guy struct iwl_calib_hdr hdr; 3253c6f30347a79502cc81e8ec55248b569b3a90ba2aWey-Yi Guy __le16 radio_sensor_offset_high; 3254c6f30347a79502cc81e8ec55248b569b3a90ba2aWey-Yi Guy __le16 radio_sensor_offset_low; 3255c6f30347a79502cc81e8ec55248b569b3a90ba2aWey-Yi Guy __le16 burntVoltageRef; 3256c6f30347a79502cc81e8ec55248b569b3a90ba2aWey-Yi Guy __le16 reserved; 3257c6f30347a79502cc81e8ec55248b569b3a90ba2aWey-Yi Guy} __packed; 3258c6f30347a79502cc81e8ec55248b569b3a90ba2aWey-Yi Guy 32590d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winkler/* IWL_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD */ 32600d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winklerstruct iwl_calib_chain_noise_reset_cmd { 32610d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winkler struct iwl_calib_hdr hdr; 32620d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winkler u8 data[0]; 32630d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winkler}; 32640d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winkler 32650d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winkler/* IWL_PHY_CALIBRATE_CHAIN_NOISE_GAIN_CMD */ 3266f69f42a6bbefb311ccb1626fdb61f723160afbfdTomas Winklerstruct iwl_calib_chain_noise_gain_cmd { 32670d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winkler struct iwl_calib_hdr hdr; 326833fd503346ad86bd7470a0f8c4c3080393d14233Emmanuel Grumbach u8 delta_gain_1; 326933fd503346ad86bd7470a0f8c4c3080393d14233Emmanuel Grumbach u8 delta_gain_2; 32700d950d84d9d16f7d4edf380a238c5b534ff00d11Tomas Winkler u8 pad[2]; 3271ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 327233fd503346ad86bd7470a0f8c4c3080393d14233Emmanuel Grumbach 3273b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 3274b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (12) 3275b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Miscellaneous Commands: 3276b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 3277b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 3278b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 3279b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/* 3280b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * LEDs Command & Response 3281b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * REPLY_LEDS_CMD = 0x48 (command, has simple generic response) 3282b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 3283b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * For each of 3 possible LEDs (Activity/Link/Tech, selected by "id" field), 3284b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * this command turns it on or off, or sets up a periodic blinking cycle. 3285b481de9ca074528fe8c429604e2777db8b89806aZhu Yi */ 3286ec1a746042ea4c1c93065185897d6e8d3e7de894Tomas Winklerstruct iwl_led_cmd { 3287b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 interval; /* "interval" in uSec */ 3288b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 id; /* 1: Activity, 2: Link, 3: Tech */ 3289b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 off; /* # intervals off while blinking; 3290b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * "0", with >0 "on" value, turns LED on */ 3291b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 on; /* # intervals on while blinking; 3292b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * "0", regardless of "off", turns LED off */ 3293b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 reserved; 3294ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 3295b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 32969636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky/* 3297fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * station priority table entries 3298fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * also used as potential "events" value for both 3299fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * COEX_MEDIUM_NOTIFICATION and COEX_EVENT_CMD 33009636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky */ 33011933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy 33021933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy/* 33031933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy * COEX events entry flag masks 33041933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy * RP - Requested Priority 33051933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy * WP - Win Medium Priority: priority assigned when the contention has been won 33061933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy */ 33071933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG (0x1) 33081933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG (0x2) 33091933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_EVT_FLAG_DELAY_MEDIUM_FREE_NTFY_FLG (0x4) 33101933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy 33111933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_UNASSOC_IDLE_RP 4 33121933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_UNASSOC_MANUAL_SCAN_RP 4 33131933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_UNASSOC_AUTO_SCAN_RP 4 33141933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_CALIBRATION_RP 4 33151933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_PERIODIC_CALIBRATION_RP 4 33161933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_CONNECTION_ESTAB_RP 4 33171933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_ASSOCIATED_IDLE_RP 4 33181933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_ASSOC_MANUAL_SCAN_RP 4 33191933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_ASSOC_AUTO_SCAN_RP 4 33201933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_ASSOC_ACTIVE_LEVEL_RP 4 33211933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_RF_ON_RP 6 33221933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_RF_OFF_RP 4 33231933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_STAND_ALONE_DEBUG_RP 6 33241933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_IPAN_ASSOC_LEVEL_RP 4 33251933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_RSRVD1_RP 4 33261933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_RSRVD2_RP 4 33271933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy 33281933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_UNASSOC_IDLE_WP 3 33291933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_UNASSOC_MANUAL_SCAN_WP 3 33301933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_UNASSOC_AUTO_SCAN_WP 3 33311933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_CALIBRATION_WP 3 33321933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_PERIODIC_CALIBRATION_WP 3 33331933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_CONNECTION_ESTAB_WP 3 33341933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_ASSOCIATED_IDLE_WP 3 33351933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_ASSOC_MANUAL_SCAN_WP 3 33361933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_ASSOC_AUTO_SCAN_WP 3 33371933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_ASSOC_ACTIVE_LEVEL_WP 3 33381933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_RF_ON_WP 3 33391933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_RF_OFF_WP 3 33401933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_STAND_ALONE_DEBUG_WP 6 33411933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_IPAN_ASSOC_LEVEL_WP 3 33421933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_RSRVD1_WP 3 33431933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_RSRVD2_WP 3 33441933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy 33451933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_UNASSOC_IDLE_FLAGS 0 33461933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_UNASSOC_MANUAL_SCAN_FLAGS \ 33471933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ 33481933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG) 33491933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_UNASSOC_AUTO_SCAN_FLAGS \ 33501933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ 33511933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG) 33521933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CALIBRATION_FLAGS \ 33531933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ 33541933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG) 33551933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_PERIODIC_CALIBRATION_FLAGS 0 33561933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy/* 33571933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy * COEX_CONNECTION_ESTAB: 33581933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy * we need DELAY_MEDIUM_FREE_NTFY to let WiMAX disconnect from network. 33591933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy */ 33601933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CONNECTION_ESTAB_FLAGS \ 33611933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ 33621933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG | \ 33631933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy COEX_EVT_FLAG_DELAY_MEDIUM_FREE_NTFY_FLG) 33641933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_ASSOCIATED_IDLE_FLAGS 0 33651933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_ASSOC_MANUAL_SCAN_FLAGS \ 33661933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ 33671933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG) 33681933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_ASSOC_AUTO_SCAN_FLAGS \ 33691933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ 33701933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG) 33711933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_ASSOC_ACTIVE_LEVEL_FLAGS 0 33721933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_RF_ON_FLAGS 0 33731933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_RF_OFF_FLAGS 0 33741933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_STAND_ALONE_DEBUG_FLAGS \ 33751933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ 33761933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG) 33771933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_IPAN_ASSOC_LEVEL_FLAGS \ 33781933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ 33791933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG | \ 33801933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy COEX_EVT_FLAG_DELAY_MEDIUM_FREE_NTFY_FLG) 33811933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_RSRVD1_FLAGS 0 33821933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_RSRVD2_FLAGS 0 33831933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy/* 33841933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy * COEX_CU_RF_ON is the event wrapping all radio ownership. 33851933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy * We need DELAY_MEDIUM_FREE_NTFY to let WiMAX disconnect from network. 33861933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy */ 33871933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy#define COEX_CU_RF_ON_FLAGS \ 33881933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ 33891933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG | \ 33901933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy COEX_EVT_FLAG_DELAY_MEDIUM_FREE_NTFY_FLG) 33911933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy 33921933ac4d9377ed44caba45abe1531ec1bc14bb63Wey-Yi Guy 33939636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunskyenum { 3394fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy /* un-association part */ 33959636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_UNASSOC_IDLE = 0, 33969636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_UNASSOC_MANUAL_SCAN = 1, 33979636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_UNASSOC_AUTO_SCAN = 2, 3398fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy /* calibration */ 33999636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_CALIBRATION = 3, 34009636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_PERIODIC_CALIBRATION = 4, 3401fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy /* connection */ 34029636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_CONNECTION_ESTAB = 5, 3403fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy /* association part */ 34049636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_ASSOCIATED_IDLE = 6, 34059636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_ASSOC_MANUAL_SCAN = 7, 34069636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_ASSOC_AUTO_SCAN = 8, 34079636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_ASSOC_ACTIVE_LEVEL = 9, 3408fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy /* RF ON/OFF */ 34099636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_RF_ON = 10, 34109636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_RF_OFF = 11, 34119636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_STAND_ALONE_DEBUG = 12, 3412fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy /* IPAN */ 34139636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_IPAN_ASSOC_LEVEL = 13, 3414fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy /* reserved */ 34159636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_RSRVD1 = 14, 34169636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_RSRVD2 = 15, 34179636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky COEX_NUM_OF_EVENTS = 16 34189636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky}; 34199636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky 3420fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy/* 3421fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * Coexistence WIFI/WIMAX Command 3422fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * COEX_PRIORITY_TABLE_CMD = 0x5a 3423fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * 3424fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy */ 34259636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunskystruct iwl_wimax_coex_event_entry { 34269636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky u8 request_prio; 34279636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky u8 win_medium_prio; 34289636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky u8 reserved; 34299636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky u8 flags; 3430ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 34319636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky 34329636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky/* COEX flag masks */ 34339636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky 3434a96a27f97f2bbfc1fca54bc3c0b0d41484152740Tomas Winkler/* Station table is valid */ 34359636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky#define COEX_FLAGS_STA_TABLE_VALID_MSK (0x1) 3436a96a27f97f2bbfc1fca54bc3c0b0d41484152740Tomas Winkler/* UnMask wake up src at unassociated sleep */ 34379636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky#define COEX_FLAGS_UNASSOC_WA_UNMASK_MSK (0x4) 3438a96a27f97f2bbfc1fca54bc3c0b0d41484152740Tomas Winkler/* UnMask wake up src at associated sleep */ 34399636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky#define COEX_FLAGS_ASSOC_WA_UNMASK_MSK (0x8) 34409636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky/* Enable CoEx feature. */ 34419636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky#define COEX_FLAGS_COEX_ENABLE_MSK (0x80) 34429636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky 34439636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunskystruct iwl_wimax_coex_cmd { 34449636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky u8 flags; 34459636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky u8 reserved[3]; 34469636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky struct iwl_wimax_coex_event_entry sta_prio[COEX_NUM_OF_EVENTS]; 3447ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 34489636e583d2c641f8cb32d0681f5052b2885edd79Ron Rindjunsky 3449fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy/* 3450fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * Coexistence MEDIUM NOTIFICATION 3451fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * COEX_MEDIUM_NOTIFICATION = 0x5b 3452fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * 3453fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * notification from uCode to host to indicate medium changes 3454fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * 3455fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy */ 3456fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy/* 3457fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * status field 3458fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * bit 0 - 2: medium status 3459fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * bit 3: medium change indication 3460fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * bit 4 - 31: reserved 3461fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy */ 3462fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy/* status option values, (0 - 2 bits) */ 3463fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy#define COEX_MEDIUM_BUSY (0x0) /* radio belongs to WiMAX */ 3464fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy#define COEX_MEDIUM_ACTIVE (0x1) /* radio belongs to WiFi */ 3465fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy#define COEX_MEDIUM_PRE_RELEASE (0x2) /* received radio release */ 3466fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy#define COEX_MEDIUM_MSK (0x7) 3467fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy 3468fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy/* send notification status (1 bit) */ 3469fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy#define COEX_MEDIUM_CHANGED (0x8) 3470fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy#define COEX_MEDIUM_CHANGED_MSK (0x8) 3471fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy#define COEX_MEDIUM_SHIFT (3) 3472fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy 3473fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guystruct iwl_coex_medium_notification { 3474fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy __le32 status; 3475fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy __le32 events; 3476ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 3477fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy 3478fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy/* 3479fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * Coexistence EVENT Command 3480fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * COEX_EVENT_CMD = 0x5c 3481fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * 3482fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy * send from host to uCode for coex event request. 3483fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy */ 3484fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy/* flags options */ 3485fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy#define COEX_EVENT_REQUEST_MSK (0x1) 3486fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy 3487fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guystruct iwl_coex_event_cmd { 3488fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy u8 flags; 3489fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy u8 event; 3490fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy __le16 reserved; 3491ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 3492fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy 3493fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guystruct iwl_coex_event_resp { 3494fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy __le32 status; 3495ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 3496fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy 3497fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy 3498b481de9ca074528fe8c429604e2777db8b89806aZhu Yi/****************************************************************************** 34990288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg * Bluetooth Coexistence commands 35000288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg * 35010288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg *****************************************************************************/ 35020288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg 35030288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg/* 35040288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg * BT Status notification 3505fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy * REPLY_BT_COEX_PROFILE_NOTIF = 0xce 35060288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg */ 35070288d237fff4cbe54879e3c3433ae5782874f98cJohannes Bergenum iwl_bt_coex_profile_traffic_load { 35080288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg IWL_BT_COEX_TRAFFIC_LOAD_NONE = 0, 35090288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg IWL_BT_COEX_TRAFFIC_LOAD_LOW = 1, 35100288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg IWL_BT_COEX_TRAFFIC_LOAD_HIGH = 2, 35110288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS = 3, 35120288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg/* 35130288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg * There are no more even though below is a u8, the 35140288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg * indication from the BT device only has two bits. 35150288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg */ 35160288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg}; 35170288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg 35186013270a030e370400e459922176c467a6c19293Wey-Yi Guy#define BT_SESSION_ACTIVITY_1_UART_MSG 0x1 35196013270a030e370400e459922176c467a6c19293Wey-Yi Guy#define BT_SESSION_ACTIVITY_2_UART_MSG 0x2 35206013270a030e370400e459922176c467a6c19293Wey-Yi Guy 3521d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy/* BT UART message - Share Part (BT -> WiFi) */ 3522fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME1MSGTYPE_POS (0) 3523fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME1MSGTYPE_MSK \ 3524fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x7 << BT_UART_MSG_FRAME1MSGTYPE_POS) 3525fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME1SSN_POS (3) 3526fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME1SSN_MSK \ 3527fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME1SSN_POS) 3528fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME1UPDATEREQ_POS (5) 3529fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME1UPDATEREQ_MSK \ 3530fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x1 << BT_UART_MSG_FRAME1UPDATEREQ_POS) 3531fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME1RESERVED_POS (6) 3532fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME1RESERVED_MSK \ 3533fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME1RESERVED_POS) 3534fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy 3535fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME2OPENCONNECTIONS_POS (0) 3536fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME2OPENCONNECTIONS_MSK \ 3537fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME2OPENCONNECTIONS_POS) 3538fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME2TRAFFICLOAD_POS (2) 3539fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME2TRAFFICLOAD_MSK \ 3540fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME2TRAFFICLOAD_POS) 3541fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME2CHLSEQN_POS (4) 3542fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME2CHLSEQN_MSK \ 3543fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x1 << BT_UART_MSG_FRAME2CHLSEQN_POS) 3544fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME2INBAND_POS (5) 3545fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME2INBAND_MSK \ 3546fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x1 << BT_UART_MSG_FRAME2INBAND_POS) 3547fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME2RESERVED_POS (6) 3548fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME2RESERVED_MSK \ 3549fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME2RESERVED_POS) 3550fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy 3551fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3SCOESCO_POS (0) 3552fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3SCOESCO_MSK \ 3553fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x1 << BT_UART_MSG_FRAME3SCOESCO_POS) 3554fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3SNIFF_POS (1) 3555fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3SNIFF_MSK \ 3556fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x1 << BT_UART_MSG_FRAME3SNIFF_POS) 3557fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3A2DP_POS (2) 3558fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3A2DP_MSK \ 3559fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x1 << BT_UART_MSG_FRAME3A2DP_POS) 3560fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3ACL_POS (3) 3561fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3ACL_MSK \ 3562fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x1 << BT_UART_MSG_FRAME3ACL_POS) 3563fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3MASTER_POS (4) 3564fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3MASTER_MSK \ 3565fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x1 << BT_UART_MSG_FRAME3MASTER_POS) 3566fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3OBEX_POS (5) 3567fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3OBEX_MSK \ 3568fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x1 << BT_UART_MSG_FRAME3OBEX_POS) 3569fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3RESERVED_POS (6) 3570fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME3RESERVED_MSK \ 3571fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME3RESERVED_POS) 3572fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy 3573fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME4IDLEDURATION_POS (0) 3574fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME4IDLEDURATION_MSK \ 3575fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3F << BT_UART_MSG_FRAME4IDLEDURATION_POS) 3576fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME4RESERVED_POS (6) 3577fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME4RESERVED_MSK \ 3578fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME4RESERVED_POS) 3579fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy 3580fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME5TXACTIVITY_POS (0) 3581fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME5TXACTIVITY_MSK \ 3582fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME5TXACTIVITY_POS) 3583fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME5RXACTIVITY_POS (2) 3584fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME5RXACTIVITY_MSK \ 3585fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME5RXACTIVITY_POS) 3586fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME5ESCORETRANSMIT_POS (4) 3587fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME5ESCORETRANSMIT_MSK \ 3588fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME5ESCORETRANSMIT_POS) 3589fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME5RESERVED_POS (6) 3590fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME5RESERVED_MSK \ 3591fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME5RESERVED_POS) 3592fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy 3593fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME6SNIFFINTERVAL_POS (0) 3594fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME6SNIFFINTERVAL_MSK \ 3595fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x1F << BT_UART_MSG_FRAME6SNIFFINTERVAL_POS) 3596fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME6DISCOVERABLE_POS (5) 3597fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME6DISCOVERABLE_MSK \ 3598fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x1 << BT_UART_MSG_FRAME6DISCOVERABLE_POS) 3599fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME6RESERVED_POS (6) 3600fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME6RESERVED_MSK \ 3601fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME6RESERVED_POS) 3602fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy 3603fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME7SNIFFACTIVITY_POS (0) 3604fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME7SNIFFACTIVITY_MSK \ 3605fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x7 << BT_UART_MSG_FRAME7SNIFFACTIVITY_POS) 3606399f66fda08675e3e231ac6df9c59ea831441f4bWey-Yi Guy#define BT_UART_MSG_FRAME7PAGE_POS (3) 3607399f66fda08675e3e231ac6df9c59ea831441f4bWey-Yi Guy#define BT_UART_MSG_FRAME7PAGE_MSK \ 3608399f66fda08675e3e231ac6df9c59ea831441f4bWey-Yi Guy (0x1 << BT_UART_MSG_FRAME7PAGE_POS) 3609399f66fda08675e3e231ac6df9c59ea831441f4bWey-Yi Guy#define BT_UART_MSG_FRAME7INQUIRY_POS (4) 3610399f66fda08675e3e231ac6df9c59ea831441f4bWey-Yi Guy#define BT_UART_MSG_FRAME7INQUIRY_MSK \ 3611399f66fda08675e3e231ac6df9c59ea831441f4bWey-Yi Guy (0x1 << BT_UART_MSG_FRAME7INQUIRY_POS) 3612fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME7CONNECTABLE_POS (5) 3613fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME7CONNECTABLE_MSK \ 3614fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x1 << BT_UART_MSG_FRAME7CONNECTABLE_POS) 3615fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME7RESERVED_POS (6) 3616fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy#define BT_UART_MSG_FRAME7RESERVED_MSK \ 3617fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy (0x3 << BT_UART_MSG_FRAME7RESERVED_POS) 3618fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy 3619d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy/* BT Session Activity 2 UART message (BT -> WiFi) */ 3620d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME1RESERVED1_POS (5) 3621d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME1RESERVED1_MSK \ 3622d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x1<<BT_UART_MSG_2_FRAME1RESERVED1_POS) 3623d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME1RESERVED2_POS (6) 3624d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME1RESERVED2_MSK \ 3625d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x3<<BT_UART_MSG_2_FRAME1RESERVED2_POS) 3626d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy 3627d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME2AGGTRAFFICLOAD_POS (0) 3628d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME2AGGTRAFFICLOAD_MSK \ 3629d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x3F<<BT_UART_MSG_2_FRAME2AGGTRAFFICLOAD_POS) 3630d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME2RESERVED_POS (6) 3631d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME2RESERVED_MSK \ 3632d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x3<<BT_UART_MSG_2_FRAME2RESERVED_POS) 3633d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy 3634d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME3BRLASTTXPOWER_POS (0) 3635d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME3BRLASTTXPOWER_MSK \ 3636d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0xF<<BT_UART_MSG_2_FRAME3BRLASTTXPOWER_POS) 3637d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME3INQPAGESRMODE_POS (4) 3638d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME3INQPAGESRMODE_MSK \ 3639d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x1<<BT_UART_MSG_2_FRAME3INQPAGESRMODE_POS) 3640d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME3LEMASTER_POS (5) 3641d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME3LEMASTER_MSK \ 3642d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x1<<BT_UART_MSG_2_FRAME3LEMASTER_POS) 3643d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME3RESERVED_POS (6) 3644d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME3RESERVED_MSK \ 3645d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x3<<BT_UART_MSG_2_FRAME3RESERVED_POS) 3646d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy 3647d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME4LELASTTXPOWER_POS (0) 3648d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME4LELASTTXPOWER_MSK \ 3649d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0xF<<BT_UART_MSG_2_FRAME4LELASTTXPOWER_POS) 3650d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME4NUMLECONN_POS (4) 3651d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME4NUMLECONN_MSK \ 3652d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x3<<BT_UART_MSG_2_FRAME4NUMLECONN_POS) 3653d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME4RESERVED_POS (6) 3654d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME4RESERVED_MSK \ 3655d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x3<<BT_UART_MSG_2_FRAME4RESERVED_POS) 3656d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy 3657d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME5BTMINRSSI_POS (0) 3658d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME5BTMINRSSI_MSK \ 3659d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0xF<<BT_UART_MSG_2_FRAME5BTMINRSSI_POS) 3660d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME5LESCANINITMODE_POS (4) 3661d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME5LESCANINITMODE_MSK \ 3662d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x1<<BT_UART_MSG_2_FRAME5LESCANINITMODE_POS) 3663d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME5LEADVERMODE_POS (5) 3664d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME5LEADVERMODE_MSK \ 3665d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x1<<BT_UART_MSG_2_FRAME5LEADVERMODE_POS) 3666d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME5RESERVED_POS (6) 3667d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME5RESERVED_MSK \ 3668d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x3<<BT_UART_MSG_2_FRAME5RESERVED_POS) 3669d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy 3670d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME6LECONNINTERVAL_POS (0) 3671d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME6LECONNINTERVAL_MSK \ 3672d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x1F<<BT_UART_MSG_2_FRAME6LECONNINTERVAL_POS) 3673d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME6RFU_POS (5) 3674d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME6RFU_MSK \ 3675d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x1<<BT_UART_MSG_2_FRAME6RFU_POS) 3676d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME6RESERVED_POS (6) 3677d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME6RESERVED_MSK \ 3678d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x3<<BT_UART_MSG_2_FRAME6RESERVED_POS) 3679d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy 3680d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME7LECONNSLAVELAT_POS (0) 3681d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME7LECONNSLAVELAT_MSK \ 3682d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x7<<BT_UART_MSG_2_FRAME7LECONNSLAVELAT_POS) 3683d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME7LEPROFILE1_POS (3) 3684d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME7LEPROFILE1_MSK \ 3685d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x1<<BT_UART_MSG_2_FRAME7LEPROFILE1_POS) 3686d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME7LEPROFILE2_POS (4) 3687d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME7LEPROFILE2_MSK \ 3688d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x1<<BT_UART_MSG_2_FRAME7LEPROFILE2_POS) 3689d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME7LEPROFILEOTHER_POS (5) 3690d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME7LEPROFILEOTHER_MSK \ 3691d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x1<<BT_UART_MSG_2_FRAME7LEPROFILEOTHER_POS) 3692d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME7RESERVED_POS (6) 3693d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy#define BT_UART_MSG_2_FRAME7RESERVED_MSK \ 3694d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy (0x3<<BT_UART_MSG_2_FRAME7RESERVED_POS) 3695d7220f0d4f7a7e84470916a3da8113a51f480514Wey-Yi Guy 3696fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy 3697fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guystruct iwl_bt_uart_msg { 3698fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy u8 header; 3699fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy u8 frame1; 3700fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy u8 frame2; 3701fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy u8 frame3; 3702fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy u8 frame4; 3703fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy u8 frame5; 3704fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy u8 frame6; 3705fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy u8 frame7; 3706fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy} __attribute__((packed)); 3707fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy 37080288d237fff4cbe54879e3c3433ae5782874f98cJohannes Bergstruct iwl_bt_coex_profile_notif { 3709fbba94104fb44d2f984e767cd8ac1edd80cb03d5Wey-Yi Guy struct iwl_bt_uart_msg last_bt_uart_msg; 37100288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg u8 bt_status; /* 0 - off, 1 - on */ 37110288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg u8 bt_traffic_load; /* 0 .. 3? */ 37120288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg u8 bt_ci_compliance; /* 0 - not complied, 1 - complied */ 37130288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg u8 reserved; 37140288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg} __attribute__((packed)); 37150288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg 3716aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy#define IWL_BT_COEX_PRIO_TBL_SHARED_ANTENNA_POS 0 3717aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy#define IWL_BT_COEX_PRIO_TBL_SHARED_ANTENNA_MSK 0x1 3718aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy#define IWL_BT_COEX_PRIO_TBL_PRIO_POS 1 3719aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy#define IWL_BT_COEX_PRIO_TBL_PRIO_MASK 0x0e 3720aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy#define IWL_BT_COEX_PRIO_TBL_RESERVED_POS 4 3721aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy#define IWL_BT_COEX_PRIO_TBL_RESERVED_MASK 0xf0 3722aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy#define IWL_BT_COEX_PRIO_TBL_PRIO_SHIFT 1 37230288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg 37240288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg/* 37250288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg * BT Coexistence Priority table 37260288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg * REPLY_BT_COEX_PRIO_TABLE = 0xcc 37270288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg */ 3728aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guyenum bt_coex_prio_table_events { 3729aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_INIT_CALIB1 = 0, 3730aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_INIT_CALIB2 = 1, 3731aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_LOW1 = 2, 3732aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_LOW2 = 3, /* DC calib */ 3733aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_HIGH1 = 4, 3734aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_HIGH2 = 5, 3735aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_DTIM = 6, 3736aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_SCAN52 = 7, 3737aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_SCAN24 = 8, 3738aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_RESERVED0 = 9, 3739aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_RESERVED1 = 10, 3740aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_RESERVED2 = 11, 3741aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_RESERVED3 = 12, 3742aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_RESERVED4 = 13, 3743aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_RESERVED5 = 14, 3744aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_RESERVED6 = 15, 3745aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy /* BT_COEX_PRIO_TBL_EVT_MAX should always be last */ 3746aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_EVT_MAX, 3747aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy}; 3748aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy 3749aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guyenum bt_coex_prio_table_priorities { 3750aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_DISABLED = 0, 3751aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_PRIO_LOW = 1, 3752aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_PRIO_HIGH = 2, 3753aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_PRIO_BYPASS = 3, 3754aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_PRIO_COEX_OFF = 4, 3755aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_PRIO_COEX_ON = 5, 3756aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_PRIO_RSRVD1 = 6, 3757aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_PRIO_RSRVD2 = 7, 3758aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy BT_COEX_PRIO_TBL_MAX, 3759aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy}; 3760aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy 37610288d237fff4cbe54879e3c3433ae5782874f98cJohannes Bergstruct iwl_bt_coex_prio_table_cmd { 3762aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy u8 prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX]; 37630288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg} __attribute__((packed)); 37640288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg 3765aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy#define IWL_BT_COEX_ENV_CLOSE 0 3766aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy#define IWL_BT_COEX_ENV_OPEN 1 37670288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg/* 37680288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg * BT Protection Envelope 37690288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg * REPLY_BT_COEX_PROT_ENV = 0xcd 37700288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg */ 37710288d237fff4cbe54879e3c3433ae5782874f98cJohannes Bergstruct iwl_bt_coex_prot_env_cmd { 3772aeb4a2eec2b1d2ac6507e9cec2aecc46fdba8741Wey-Yi Guy u8 action; /* 0 = closed, 1 = open */ 37730288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg u8 type; /* 0 .. 15 */ 37740288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg u8 reserved[2]; 37750288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg} __attribute__((packed)); 37760288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg 3777c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg/* 3778560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg * REPLY_D3_CONFIG 3779560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg */ 3780560124095f467c9920c25fa215ab1397dc37d0d6Johannes Bergenum iwlagn_d3_wakeup_filters { 3781560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg IWLAGN_D3_WAKEUP_RFKILL = BIT(0), 3782560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg IWLAGN_D3_WAKEUP_SYSASSERT = BIT(1), 3783560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg}; 3784560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg 3785560124095f467c9920c25fa215ab1397dc37d0d6Johannes Bergstruct iwlagn_d3_config_cmd { 3786560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg __le32 min_sleep_time; 3787560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg __le32 wakeup_flags; 3788560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg} __packed; 3789560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg 3790560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg/* 3791c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg * REPLY_WOWLAN_PATTERNS 3792c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg */ 3793c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg#define IWLAGN_WOWLAN_MIN_PATTERN_LEN 16 3794c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg#define IWLAGN_WOWLAN_MAX_PATTERN_LEN 128 3795c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3796c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergstruct iwlagn_wowlan_pattern { 3797c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg u8 mask[IWLAGN_WOWLAN_MAX_PATTERN_LEN / 8]; 3798c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg u8 pattern[IWLAGN_WOWLAN_MAX_PATTERN_LEN]; 3799c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg u8 mask_size; 3800c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg u8 pattern_size; 3801c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le16 reserved; 3802c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg} __packed; 3803c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3804c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg#define IWLAGN_WOWLAN_MAX_PATTERNS 20 3805c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3806c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergstruct iwlagn_wowlan_patterns_cmd { 3807c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le32 n_patterns; 3808c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct iwlagn_wowlan_pattern patterns[]; 3809c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg} __packed; 3810c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3811c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg/* 3812c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg * REPLY_WOWLAN_WAKEUP_FILTER 3813c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg */ 3814c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergenum iwlagn_wowlan_wakeup_filters { 3815c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg IWLAGN_WOWLAN_WAKEUP_MAGIC_PACKET = BIT(0), 3816c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg IWLAGN_WOWLAN_WAKEUP_PATTERN_MATCH = BIT(1), 3817c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg IWLAGN_WOWLAN_WAKEUP_BEACON_MISS = BIT(2), 3818c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg IWLAGN_WOWLAN_WAKEUP_LINK_CHANGE = BIT(3), 3819c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg IWLAGN_WOWLAN_WAKEUP_GTK_REKEY_FAIL = BIT(4), 3820560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg IWLAGN_WOWLAN_WAKEUP_EAP_IDENT_REQ = BIT(5), 3821560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg IWLAGN_WOWLAN_WAKEUP_4WAY_HANDSHAKE = BIT(6), 3822560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg IWLAGN_WOWLAN_WAKEUP_ALWAYS = BIT(7), 3823560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg IWLAGN_WOWLAN_WAKEUP_ENABLE_NET_DETECT = BIT(8), 3824c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg}; 3825c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3826c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergstruct iwlagn_wowlan_wakeup_filter_cmd { 3827c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le32 enabled; 3828c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le16 non_qos_seq; 3829560124095f467c9920c25fa215ab1397dc37d0d6Johannes Berg __le16 reserved; 3830c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le16 qos_seq[8]; 3831c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg}; 3832c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3833c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg/* 3834c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg * REPLY_WOWLAN_TSC_RSC_PARAMS 3835c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg */ 3836c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg#define IWLAGN_NUM_RSC 16 3837c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3838c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergstruct tkip_sc { 3839c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le16 iv16; 3840c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le16 pad; 3841c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le32 iv32; 3842c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg} __packed; 3843c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3844c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergstruct iwlagn_tkip_rsc_tsc { 3845c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct tkip_sc unicast_rsc[IWLAGN_NUM_RSC]; 3846c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct tkip_sc multicast_rsc[IWLAGN_NUM_RSC]; 3847c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct tkip_sc tsc; 3848c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg} __packed; 3849c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3850c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergstruct aes_sc { 3851c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le64 pn; 3852c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg} __packed; 3853c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3854c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergstruct iwlagn_aes_rsc_tsc { 3855c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct aes_sc unicast_rsc[IWLAGN_NUM_RSC]; 3856c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct aes_sc multicast_rsc[IWLAGN_NUM_RSC]; 3857c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct aes_sc tsc; 3858c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg} __packed; 3859c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3860c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergunion iwlagn_all_tsc_rsc { 3861c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct iwlagn_tkip_rsc_tsc tkip; 3862c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct iwlagn_aes_rsc_tsc aes; 3863c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg}; 3864c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3865c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergstruct iwlagn_wowlan_rsc_tsc_params_cmd { 3866c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg union iwlagn_all_tsc_rsc all_tsc_rsc; 3867c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg} __packed; 3868c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3869c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg/* 3870c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg * REPLY_WOWLAN_TKIP_PARAMS 3871c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg */ 3872c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg#define IWLAGN_MIC_KEY_SIZE 8 3873c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg#define IWLAGN_P1K_SIZE 5 3874c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergstruct iwlagn_mic_keys { 3875c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg u8 tx[IWLAGN_MIC_KEY_SIZE]; 3876c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg u8 rx_unicast[IWLAGN_MIC_KEY_SIZE]; 3877c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg u8 rx_mcast[IWLAGN_MIC_KEY_SIZE]; 3878c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg} __packed; 3879c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3880c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergstruct iwlagn_p1k_cache { 3881c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le16 p1k[IWLAGN_P1K_SIZE]; 3882c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg} __packed; 3883c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3884c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg#define IWLAGN_NUM_RX_P1K_CACHE 2 3885c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3886c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergstruct iwlagn_wowlan_tkip_params_cmd { 3887c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct iwlagn_mic_keys mic_keys; 3888c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct iwlagn_p1k_cache tx; 3889c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct iwlagn_p1k_cache rx_uni[IWLAGN_NUM_RX_P1K_CACHE]; 3890c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg struct iwlagn_p1k_cache rx_multi[IWLAGN_NUM_RX_P1K_CACHE]; 3891c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg} __packed; 3892c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3893c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg/* 3894c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg * REPLY_WOWLAN_KEK_KCK_MATERIAL 3895c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg */ 3896c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3897c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg#define IWLAGN_KCK_MAX_SIZE 32 3898c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg#define IWLAGN_KEK_MAX_SIZE 32 3899c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 3900c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Bergstruct iwlagn_wowlan_kek_kck_material_cmd { 3901c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg u8 kck[IWLAGN_KCK_MAX_SIZE]; 3902c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg u8 kek[IWLAGN_KEK_MAX_SIZE]; 3903c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le16 kck_len; 3904c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le16 kek_len; 3905c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg __le64 replay_ctr; 3906c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg} __packed; 3907c8ac61cf6e53fefb3b439fc58390fb65d2730e63Johannes Berg 39080288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg/****************************************************************************** 3909b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * (13) 3910b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * Union of all expected notifications/responses: 3911b481de9ca074528fe8c429604e2777db8b89806aZhu Yi * 3912b481de9ca074528fe8c429604e2777db8b89806aZhu Yi *****************************************************************************/ 3913dda61a4482661d71034cc132d1f474f19ce34a4dEmmanuel Grumbach#define FH_RSCSR_FRAME_SIZE_MSK (0x00003FFF) /* bits 0-13 */ 3914b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 3915db11d6343aa14ab61258bfad9178042d4be49333Tomas Winklerstruct iwl_rx_packet { 39162f301227a1ede57504694e1f64839839f5737cacZhu Yi /* 39172f301227a1ede57504694e1f64839839f5737cacZhu Yi * The first 4 bytes of the RX frame header contain both the RX frame 39182f301227a1ede57504694e1f64839839f5737cacZhu Yi * size and some flags. 39192f301227a1ede57504694e1f64839839f5737cacZhu Yi * Bit fields: 39202f301227a1ede57504694e1f64839839f5737cacZhu Yi * 31: flag flush RB request 39212f301227a1ede57504694e1f64839839f5737cacZhu Yi * 30: flag ignore TC (terminal counter) request 39222f301227a1ede57504694e1f64839839f5737cacZhu Yi * 29: flag fast IRQ request 39232f301227a1ede57504694e1f64839839f5737cacZhu Yi * 28-14: Reserved 39242f301227a1ede57504694e1f64839839f5737cacZhu Yi * 13-00: RX frame size 39252f301227a1ede57504694e1f64839839f5737cacZhu Yi */ 3926396887a2b2ad1ef5e5526fec34dec582baf39b81Daniel C Halperin __le32 len_n_flags; 3927857485c0c46ceee5c658c1761bba4d9a5ddf433fTomas Winkler struct iwl_cmd_header hdr; 3928b481de9ca074528fe8c429604e2777db8b89806aZhu Yi union { 3929885ba202cabd90b8ade1fe59185dc96ed4d69e02Tomas Winkler struct iwl_alive_resp alive_frame; 39302aa6ab86bc475a115f56645591d2413981846509Tomas Winkler struct iwl_spectrum_notification spectrum_notif; 39312aa6ab86bc475a115f56645591d2413981846509Tomas Winkler struct iwl_csa_notification csa_notif; 3932885ba202cabd90b8ade1fe59185dc96ed4d69e02Tomas Winkler struct iwl_error_resp err_resp; 39332aa6ab86bc475a115f56645591d2413981846509Tomas Winkler struct iwl_card_state_notif card_state_notif; 39347a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler struct iwl_add_sta_resp add_sta; 39357a999bf0c5eb19b20ac6ab0f21f6e5013400fa51Tomas Winkler struct iwl_rem_sta_resp rem_sta; 39362aa6ab86bc475a115f56645591d2413981846509Tomas Winkler struct iwl_sleep_notification sleep_notif; 39372aa6ab86bc475a115f56645591d2413981846509Tomas Winkler struct iwl_spectrum_resp spectrum; 39388f91aecb4cdc2d786df8941e827b9dff3c10a4e4Emmanuel Grumbach struct iwl_notif_statistics stats; 39397980fba54ec42f7c206b2bb469baeb3a0a2e8a93Wey-Yi Guy struct iwl_bt_notif_statistics stats_bt; 3940653fa4a07525e4cd9e7b90e6fc1f792119910636Emmanuel Grumbach struct iwl_compressed_ba_resp compressed_ba; 39412aa6ab86bc475a115f56645591d2413981846509Tomas Winkler struct iwl_missed_beacon_notif missed_beacon; 3942fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy struct iwl_coex_medium_notification coex_medium_notif; 3943fe1bcbfda77bf6fa3bbad8bf26b9e9ab23fbe345Wey-Yi Guy struct iwl_coex_event_resp coex_event; 39440288d237fff4cbe54879e3c3433ae5782874f98cJohannes Berg struct iwl_bt_coex_profile_notif bt_coex_profile_notif; 3945b481de9ca074528fe8c429604e2777db8b89806aZhu Yi __le32 status; 3946b481de9ca074528fe8c429604e2777db8b89806aZhu Yi u8 raw[0]; 3947b481de9ca074528fe8c429604e2777db8b89806aZhu Yi } u; 3948ba2d3587912f82d1ab4367975b1df460db60fb1eEric Dumazet} __packed; 3949b481de9ca074528fe8c429604e2777db8b89806aZhu Yi 3950a3139c5956702c9ff957ac9fe2d902de355b063eSamuel Ortizint iwl_agn_check_rxon_cmd(struct iwl_priv *priv); 39518f5c87dcf6d1a5e6d7ffe642cfd4debb5ccbec49Winkler, Tomas 3952946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg/* 3953946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * REPLY_WIPAN_PARAMS = 0xb2 (Commands and Notification) 3954946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg */ 3955946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg 3956940739196c78576590dd155c1b9d8a705cea2af1Johannes Berg/* 3957940739196c78576590dd155c1b9d8a705cea2af1Johannes Berg * Minimum slot time in TU 3958940739196c78576590dd155c1b9d8a705cea2af1Johannes Berg */ 3959940739196c78576590dd155c1b9d8a705cea2af1Johannes Berg#define IWL_MIN_SLOT_TIME 20 3960940739196c78576590dd155c1b9d8a705cea2af1Johannes Berg 3961946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg/** 3962946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * struct iwl_wipan_slot 3963946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * @width: Time in TU 3964946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * @type: 3965946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * 0 - BSS 3966946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * 1 - PAN 3967946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg */ 3968946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Bergstruct iwl_wipan_slot { 3969946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg __le16 width; 3970946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg u8 type; 3971946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg u8 reserved; 3972946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg} __packed; 3973946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg 3974946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg#define IWL_WIPAN_PARAMS_FLG_LEAVE_CHANNEL_CTS BIT(1) /* reserved */ 3975946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg#define IWL_WIPAN_PARAMS_FLG_LEAVE_CHANNEL_QUIET BIT(2) /* reserved */ 3976946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg#define IWL_WIPAN_PARAMS_FLG_SLOTTED_MODE BIT(3) /* reserved */ 3977946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg#define IWL_WIPAN_PARAMS_FLG_FILTER_BEACON_NOTIF BIT(4) 3978946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg#define IWL_WIPAN_PARAMS_FLG_FULL_SLOTTED_MODE BIT(5) 3979946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg 3980946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg/** 3981946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * struct iwl_wipan_params_cmd 3982946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * @flags: 3983946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * bit0: reserved 3984946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * bit1: CP leave channel with CTS 3985946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * bit2: CP leave channel qith Quiet 3986946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * bit3: slotted mode 3987946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * 1 - work in slotted mode 3988946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * 0 - work in non slotted mode 3989946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * bit4: filter beacon notification 3990946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * bit5: full tx slotted mode. if this flag is set, 3991946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * uCode will perform leaving channel methods in context switch 3992946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * also when working in same channel mode 3993946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * @num_slots: 1 - 10 3994946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg */ 3995946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Bergstruct iwl_wipan_params_cmd { 3996946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg __le16 flags; 3997946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg u8 reserved; 3998946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg u8 num_slots; 3999946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg struct iwl_wipan_slot slots[10]; 4000946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg} __packed; 4001946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg 4002946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg/* 4003946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * REPLY_WIPAN_P2P_CHANNEL_SWITCH = 0xb9 4004946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * 4005946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * TODO: Figure out what this is used for, 4006946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * it can only switch between 2.4 GHz 4007946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * channels!! 4008946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg */ 4009946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg 4010946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Bergstruct iwl_wipan_p2p_channel_switch_cmd { 4011946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg __le16 channel; 4012946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg __le16 reserved; 4013946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg}; 4014946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg 4015946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg/* 4016946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * REPLY_WIPAN_NOA_NOTIFICATION = 0xbc 4017946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * 4018946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * This is used by the device to notify us of the 4019946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * NoA schedule it determined so we can forward it 4020946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * to userspace for inclusion in probe responses. 4021946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * 4022946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * In beacons, the NoA schedule is simply appended 4023946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg * to the frame we give the device. 4024946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg */ 4025946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg 4026946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Bergstruct iwl_wipan_noa_descriptor { 4027946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg u8 count; 4028946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg __le32 duration; 4029946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg __le32 interval; 4030946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg __le32 starttime; 4031946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg} __packed; 4032946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg 4033946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Bergstruct iwl_wipan_noa_attribute { 4034946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg u8 id; 4035946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg __le16 length; 4036946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg u8 index; 4037946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg u8 ct_window; 4038946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg struct iwl_wipan_noa_descriptor descr0, descr1; 4039946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg u8 reserved; 4040946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg} __packed; 4041946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg 4042946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Bergstruct iwl_wipan_noa_notification { 4043946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg u32 noa_active; 4044946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg struct iwl_wipan_noa_attribute noa_attribute; 4045946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg} __packed; 4046946ba30d61d47ee634a39d27b4d067b6418eaa08Johannes Berg 40476a63578ddf6148927a80c07a73b40ccc8f3ac8e2Emmanuel Grumbach#endif /* __iwl_commands_h__ */ 4048