1*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 2*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 3*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Use is subject to license terms. 4*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 5*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 6*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 7*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Copyright (c) 2008, Intel Corporation 8*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * All rights reserved. 9*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 10*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 11*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 12*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Sun elects to have this file available under and governed by the BSD 13*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * license (see below for full license text). However, the following 14*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * notice accompanied the original version of this file: 15*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 16*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 17*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 18*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * This file is provided under a dual BSD/GPLv2 license. When using or 19*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * redistributing this file, you may do so under either license. 20*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 21*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * GPL LICENSE SUMMARY 22*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 23*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved. 24*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 25*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * This program is free software; you can redistribute it and/or modify 26*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * it under the terms of version 2 of the GNU Geeral Public License as 27*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * published by the Free Software Foundation. 28*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 29*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * This program is distributed in the hope that it will be useful, but 30*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * WITHOUT ANY WARRANTY; without even the implied warranty of 31*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 32*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * General Public License for more details. 33*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 34*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * You should have received a copy of the GNU General Public License 35*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * along with this program; if not, write to the Free Software 36*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, 37*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * USA 38*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 39*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * The full GNU General Public License is included in this distribution 40*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * in the file called LICENSE.GPL. 41*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 42*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Contact Information: 43*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * James P. Ketrenos <ipw2100-admin@linux.intel.com> 44*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 45*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 46*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * BSD LICENSE 47*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 48*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved. 49*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * All rights reserved. 50*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 51*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Redistribution and use in source and binary forms, with or without 52*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * modification, are permitted provided that the following conditions 53*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * are met: 54*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 55*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * * Redistributions of source code must retain the above copyright 56*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * notice, this list of conditions and the following disclaimer. 57*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * * Redistributions in binary form must reproduce the above copyright 58*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * notice, this list of conditions and the following disclaimer in 59*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * the documentation and/or other materials provided with the 60*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * distribution. 61*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * * Neither the name Intel Corporation nor the names of its 62*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * contributors may be used to endorse or promote products derived 63*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * from this software without specific prior written permission. 64*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 65*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 66*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 67*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 68*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 69*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 70*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 71*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 72*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 73*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 74*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 75*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 76*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 77*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 78*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 79*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #ifndef _IWK_CALIBRATION_H_ 80*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define _IWK_CALIBRATION_H_ 81*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 82*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 83*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Most Tx and Rx calibration is done by uCode during the initialization 84*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * phase of uCode boot. Driver must calibrate only: 85*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 86*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1) Tx power (depends on temperature) 87*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2) Receiver gain balance (and detect disconnected antennas) 88*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 3) Receiver sensitivity (to optimize signal detection) 89*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 90*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 91*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* START TEMPERATURE */ 92*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 93*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 94*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 4965 temperature calculation. 95*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 96*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * The driver must calculate the device temperature before calculating 97*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * a txpower setting (amplifier gain is temperature dependent). The 98*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * calculation uses 4 measurements, 3 of which (R1, R2, R3) are calibration 99*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * values used for the life of the driver, and one of which (R4) is the 100*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * real-time temperature indicator. 101*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 102*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * uCode provides all 4 values to the driver via the "initialize alive" 103*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * notification (see struct iwk_init_alive_resp). After the runtime uCode 104*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * image loads, uCode updates the R4 value via statistics notifications 105*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (see STATISTICS_NOTIFICATION), which occur after each received beacon 106*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * when associated, or can be requested via REPLY_STATISTICS_CMD. 107*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 108*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * NOTE: uCode provides the R4 value as a 23-bit signed value. Driver 109*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * must sign-extend to 32 bits before applying formula below. 110*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 111*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Formula: 112*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 113*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * degrees Kelvin = ((97 * 259 * (R4 - R2) / (R3 - R1)) / 100) + 8 114*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 115*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * NOTE: The basic formula is 259 * (R4-R2) / (R3-R1). The 97/100 is 116*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * an additional correction, which should be centered around 0 degrees 117*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Celsius (273 degrees Kelvin). The 8 (3 percent of 273) compensates for 118*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * centering the 97/100 correction around 0 degrees K. 119*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 120*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Add 273 to Kelvin value to find degrees Celsius, for comparing current 121*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * temperature with factory-measured temperatures when calculating txpower 122*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * settings. 123*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 124*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 125*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* END TEMPERATURE */ 126*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 127*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* START TXPOWER */ 128*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 129*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 130*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 4965 txpower calculations rely on information from three sources: 131*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 132*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1) EEPROM 133*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2) "initialize" alive notification 134*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 3) statistics notifications 135*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 136*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * EEPROM data consists of: 137*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 138*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1) Regulatory information (max txpower and channel usage flags) is provided 139*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * separately for each channel that can possibly supported by 4965. 140*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 40 MHz wide (.11n fat) channels are listed separately from 20 MHz 141*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (legacy) channels. 142*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 143*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * See struct iwk_eep_channel for format, and struct iwk_eep for 144*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * locations in EEPROM. 145*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 146*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2) Factory txpower calibration information is provided separately for 147*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * sub-bands of contiguous channels. 2.4GHz has just one sub-band, 148*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * but 5 GHz has several sub-bands. 149*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 150*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * In addition, per-band (2.4 and 5 Ghz) saturation txpowers are provided. 151*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 152*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * See struct iwk_eep_calib_info (and the tree of structures contained 153*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * within it) for format, and struct iwk_eep for locations in EEPROM. 154*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 155*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * "Initialization alive" notification (see struct iwk_init_alive_resp) 156*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * consists of: 157*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 158*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1) Temperature calculation parameters. 159*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 160*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2) Power supply voltage measurement. 161*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 162*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 3) Tx gain compensation to balance 2 transmitters for MIMO use. 163*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 164*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Statistics notifications deliver: 165*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 166*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1) Current values for temperature param R4. 167*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 168*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 169*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 170*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * To calculate a txpower setting for a given desired target txpower, channel, 171*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * modulation bit rate, and transmitter chain (4965 has 2 transmitters to 172*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * support MIMO and transmit diversity), driver must do the following: 173*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 174*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1) Compare desired txpower vs. (EEPROM) regulatory limit for this channel. 175*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Do not exceed regulatory limit; reduce target txpower if necessary. 176*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 177*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * If setting up txpowers for MIMO rates (rate indexes 8-15, 24-31), 178*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2 transmitters will be used simultaneously; driver must reduce the 179*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * regulatory limit by 3 dB (half-power) for each transmitter, so the 180*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * combined total output of the 2 transmitters is within regulatory limits. 181*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 182*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 183*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2) Compare target txpower vs. (EEPROM) saturation txpower *reduced by 184*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * backoff for this bit rate*. Do not exceed (saturation - backoff[rate]); 185*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * reduce target txpower if necessary. 186*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 187*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Backoff values below are in 1/2 dB units (equivalent to steps in 188*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * txpower gain tables): 189*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 190*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * OFDM 6 - 36 MBit: 10 steps (5 dB) 191*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * OFDM 48 MBit: 15 steps (7.5 dB) 192*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * OFDM 54 MBit: 17 steps (8.5 dB) 193*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * OFDM 60 MBit: 20 steps (10 dB) 194*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * CCK all rates: 10 steps (5 dB) 195*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 196*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Backoff values apply to saturation txpower on a per-transmitter basis; 197*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * when using MIMO (2 transmitters), each transmitter uses the same 198*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * saturation level provided in EEPROM, and the same backoff values; 199*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * no reduction (such as with regulatory txpower limits) is required. 200*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 201*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Saturation and Backoff values apply equally to 20 Mhz (legacy) channel 202*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * widths and 40 Mhz (.11n fat) channel widths; there is no separate 203*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * factory measurement for fat channels. 204*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 205*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * The result of this step is the final target txpower. The rest of 206*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * the steps figure out the proper settings for the device. 207*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 208*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 209*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 3) Determine (EEPROM) calibration subband for the target channel, by 210*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * comparing against first and last channels in each subband 211*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (see struct iwk_eep_calib_subband_info). 212*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 213*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 214*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 4) Linearly interpolate (EEPROM) factory calibration measurement sets, 215*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * referencing the 2 factory-measured (sample) channels within the subband. 216*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 217*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Interpolation is based on difference between target channel's frequency 218*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * and the sample channels' frequencies. Since channel numbers are based 219*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * on frequency (5 MHz between each channel number), this is equivalent 220*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * to interpolating based on channel number differences. 221*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 222*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Note that the sample channels may or may not be the channels at the 223*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * edges of the subband. The target channel may be "outside" of the 224*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * span of the sampled channels. 225*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 226*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Driver may choose the pair (for 2 Tx chains) of measurements (see 227*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * struct iwk_eep_calib_channel_info) for which the actual measured 228*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * txpower comes closest to the desired txpower. Usually, though, 229*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * the middle set of measurements is closest to the regulatory limits, 230*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * and is therefore a good choice for all txpower calculations. 231*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 232*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Driver should interpolate both members of the chosen measurement pair, 233*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * i.e. for both Tx chains (radio transmitters), unless the driver knows 234*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * that only one of the chains will be used (e.g. only one tx antenna 235*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * connected, but this should be unusual). 236*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 237*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Driver should interpolate factory values for temperature, gain table 238*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * index, and actual power. The power amplifier detector values are 239*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * not used by the driver. 240*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 241*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * If the target channel happens to be one of the sample channels, the 242*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * results should agree with the sample channel's measurements! 243*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 244*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 245*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 5) Find difference between desired txpower and (interpolated) 246*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * factory-measured txpower. Using (interpolated) factory gain table index 247*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * as a starting point, adjust this index lower to increase txpower, 248*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * or higher to decrease txpower, until the target txpower is reached. 249*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Each step in the gain table is 1/2 dB. 250*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 251*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * For example, if factory measured txpower is 16 dBm, and target txpower 252*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * is 13 dBm, add 6 steps to the factory gain index to reduce txpower 253*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * by 3 dB. 254*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 255*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 256*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 6) Find difference between current device temperature and (interpolated) 257*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * factory-measured temperature for sub-band. Factory values are in 258*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * degrees Celsius. To calculate current temperature, see comments for 259*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * "4965 temperature calculation". 260*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 261*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * If current temperature is higher than factory temperature, driver must 262*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * increase gain (lower gain table index), and vice versa. 263*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 264*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Temperature affects gain differently for different channels: 265*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 266*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2.4 GHz all channels: 3.5 degrees per half-dB step 267*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 5 GHz channels 34-43: 4.5 degrees per half-dB step 268*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 5 GHz channels >= 44: 4.0 degrees per half-dB step 269*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 270*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * NOTE: Temperature can increase rapidly when transmitting, especially 271*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * with heavy traffic at high txpowers. Driver should update 272*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * temperature calculations often under these conditions to 273*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * maintain strong txpower in the face of rising temperature. 274*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 275*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 276*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 7) Find difference between current power supply voltage indicator 277*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (from "initialize alive") and factory-measured power supply voltage 278*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * indicator (EEPROM). 279*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 280*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * If the current voltage is higher (indicator is lower) than factory 281*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * voltage, gain should be reduced (gain table index increased) by: 282*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 283*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (eeprom - current) / 7 284*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 285*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * If the current voltage is lower (indicator is higher) than factory 286*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * voltage, gain should be increased (gain table index decreased) by: 287*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 288*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2 * (current - eeprom) / 7 289*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 290*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * If number of index steps in either direction turns out to be > 2, 291*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * something is wrong ... just use 0. 292*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 293*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * NOTE: Voltage compensation is independent of band/channel. 294*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 295*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * NOTE: "Initialize" uCode measures current voltage, which is assumed 296*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * to be constant after this initial measurement. Voltage 297*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * compensation for txpower (number of steps in gain table) 298*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * may be calculated once and used until the next uCode bootload. 299*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 300*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 301*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 8) If setting up txpowers for MIMO rates (rate indexes 8-15, 24-31), 302*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * adjust txpower for each transmitter chain, so txpower is balanced 303*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * between the two chains. There are 5 pairs of tx_atten[group][chain] 304*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * values in "initialize alive", one pair for each of 5 channel ranges: 305*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 306*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Group 0: 5 GHz channel 34-43 307*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Group 1: 5 GHz channel 44-70 308*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Group 2: 5 GHz channel 71-124 309*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Group 3: 5 GHz channel 125-200 310*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Group 4: 2.4 GHz all channels 311*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 312*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Add the tx_atten[group][chain] value to the index for the target chain. 313*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * The values are signed, but are in pairs of 0 and a non-negative number, 314*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * so as to reduce gain (if necessary) of the "hotter" channel. This 315*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * avoids any need to double-check for regulatory compliance after 316*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * this step. 317*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 318*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 319*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 9) If setting up for a CCK rate, lower the gain by adding a CCK compensation 320*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * value to the index: 321*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 322*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Hardware rev B: 9 steps (4.5 dB) 323*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Hardware rev C: 5 steps (2.5 dB) 324*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 325*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Hardware rev for 4965 can be determined by reading CSR_HW_REV_WA_REG, 326*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * bits [3:2], 1 = B, 2 = C. 327*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 328*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * NOTE: This compensation is in addition to any saturation backoff that 329*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * might have been applied in an earlier step. 330*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 331*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 332*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 10) Select the gain table, based on band (2.4 vs 5 GHz). 333*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 334*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Limit the adjusted index to stay within the table! 335*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 336*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 337*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 11) Read gain table entries for DSP and radio gain, place into appropriate 338*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * location(s) in command. 339*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 340*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 341*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* Temperature calibration offset is 3% 0C in Kelvin */ 342*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define TEMPERATURE_CALIB_KELVIN_OFFSET 8 343*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define TEMPERATURE_CALIB_A_VAL 259 344*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 345*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define KELVIN_TO_CELSIUS(x) ((x)-273) 346*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define CELSIUS_TO_KELVIN(x) ((x)+273) 347*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 348*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* First and last channels of all groups */ 349*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define CALIB_IWK_TX_ATTEN_GR1_FCH 34 350*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define CALIB_IWK_TX_ATTEN_GR1_LCH 43 351*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define CALIB_IWK_TX_ATTEN_GR2_FCH 44 352*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define CALIB_IWK_TX_ATTEN_GR2_LCH 70 353*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define CALIB_IWK_TX_ATTEN_GR3_FCH 71 354*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define CALIB_IWK_TX_ATTEN_GR3_LCH 124 355*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define CALIB_IWK_TX_ATTEN_GR4_FCH 125 356*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define CALIB_IWK_TX_ATTEN_GR4_LCH 200 357*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define CALIB_IWK_TX_ATTEN_GR5_FCH 1 358*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define CALIB_IWK_TX_ATTEN_GR5_LCH 20 359*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 360*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* Limit range of txpower output target to be between these values */ 361*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm = 1 milliwatt */ 362*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_TX_POWER_TARGET_POWER_MAX (16) /* 16 dBm */ 363*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 364*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define TX_POWER_IWK_ILLEGAL_VOLTAGE (-10000) 365*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 366*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 367*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 4965 power supply voltage compensation 368*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 369*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define TX_POWER_IWK_VOLTAGE_CODES_PER_03V (7) 370*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 371*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* Limit range of calculated temperature to be between these Kelvin values */ 372*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_TX_POWER_TEMPERATURE_MIN (263) 373*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_TX_POWER_TEMPERATURE_MAX (410) 374*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 375*cdc64593Sxinghua wen - Sun Microsystems - Beijing China union iwk_tx_power_dual_stream { 376*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct { 377*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint8_t radio_tx_gain[2]; 378*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint8_t dsp_predis_atten[2]; 379*cdc64593Sxinghua wen - Sun Microsystems - Beijing China } s; 380*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t dw; 381*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 382*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 383*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define POWER_TABLE_NUM_ENTRIES (33) 384*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define POWER_TABLE_CCK_ENTRY (32) 385*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 386*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 387*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * When MIMO is used (2 transmitters operating simultaneously), driver should 388*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * limit each transmitter to deliver a max of 3 dB below the regulatory limit 389*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * for the device. That is, half power for each transmitter, so total power 390*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * is within regulatory limits. 391*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 392*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * The value "6" represents number of steps in gain table to reduce power. 393*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Each step is 1/2 dB. 394*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 395*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_TX_POWER_MIMO_REGULATORY_COMPENSATION (6) 396*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 397*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 398*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * CCK gain compensation. 399*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 400*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * When calculating txpowers for CCK, after making sure that the target power 401*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * is within regulatory and saturation limits, driver must additionally 402*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * back off gain by adding these values to the gain table index. 403*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 404*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_TX_POWER_CCK_COMPENSATION_C_STEP (5) 405*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 406*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 407*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Gain tables. 408*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 409*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * The following tables contain pair of values for setting txpower, i.e. 410*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * gain settings for the output of the device's digital signal processor (DSP), 411*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * and for the analog gain structure of the transmitter. 412*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 413*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Each entry in the gain tables represents a step of 1/2 dB. Note that these 414*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * are *relative* steps, not indications of absolute output power. Output 415*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * power varies with temperature, voltage, and channel frequency, and also 416*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * requires consideration of average power (to satisfy regulatory constraints), 417*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * and peak power (to avoid distortion of the output signal). 418*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 419*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Each entry contains two values: 420*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1) DSP gain (or sometimes called DSP attenuation). This is a fine-grained 421*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * linear value that multiplies the output of the digital signal processor, 422*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * before being sent to the analog radio. 423*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2) Radio gain. This sets the analog gain of the radio Tx path. 424*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * It is a coarser setting, and behaves in a logarithmic (dB) fashion. 425*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 426*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * EEPROM contains factory calibration data for txpower. This maps actual 427*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * measured txpower levels to gain settings in the "well known" tables 428*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * below ("well-known" means here that both factory calibration *and* the 429*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * driver work with the same table). 430*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 431*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * There are separate tables for 2.4 GHz and 5 GHz bands. The 5 GHz table 432*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * has an extension (into negative indexes), in case the driver needs to 433*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * boost power setting for high device temperatures (higher than would be 434*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * present during factory calibration). A 5 Ghz EEPROM index of "40" 435*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * corresponds to the 49th entry in the table used by the driver. 436*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 437*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define MIN_TX_GAIN_INDEX (0) /* highest gain, lowest idx, 2.4 */ 438*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define MIN_TX_GAIN_INDEX_52GHZ_EXT (-9) /* highest gain, lowest idx, 5 */ 439*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 440*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct gain_entry { 441*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint8_t dsp; 442*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint8_t radio; 443*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 444*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 445*cdc64593Sxinghua wen - Sun Microsystems - Beijing China static const struct gain_entry gains_table[2][108] = { 446*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 5.2GHz power gain index table */ 447*cdc64593Sxinghua wen - Sun Microsystems - Beijing China { 448*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {123, 0x3F}, /* highest txpower */ 449*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {117, 0x3F}, 450*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3F}, 451*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3F}, 452*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3F}, 453*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3E}, 454*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3E}, 455*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3E}, 456*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3D}, 457*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3D}, 458*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3D}, 459*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3C}, 460*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3C}, 461*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3C}, 462*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3B}, 463*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3B}, 464*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3B}, 465*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3A}, 466*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3A}, 467*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3A}, 468*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x39}, 469*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x39}, 470*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x39}, 471*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x38}, 472*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x38}, 473*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x38}, 474*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x37}, 475*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x37}, 476*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x37}, 477*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x36}, 478*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x36}, 479*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x36}, 480*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x35}, 481*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x35}, 482*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x35}, 483*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x34}, 484*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x34}, 485*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x34}, 486*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x33}, 487*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x33}, 488*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x33}, 489*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x32}, 490*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x32}, 491*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x32}, 492*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x31}, 493*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x31}, 494*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x31}, 495*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x30}, 496*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x30}, 497*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x30}, 498*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x25}, 499*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x25}, 500*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x25}, 501*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x24}, 502*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x24}, 503*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x24}, 504*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x23}, 505*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x23}, 506*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x23}, 507*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x22}, 508*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x18}, 509*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x18}, 510*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x17}, 511*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x17}, 512*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x17}, 513*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x16}, 514*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x16}, 515*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x16}, 516*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x15}, 517*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x15}, 518*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x15}, 519*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x14}, 520*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x14}, 521*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x14}, 522*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x13}, 523*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x13}, 524*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x13}, 525*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x12}, 526*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x08}, 527*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x08}, 528*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x07}, 529*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x07}, 530*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x07}, 531*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x06}, 532*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x06}, 533*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x06}, 534*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x05}, 535*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x05}, 536*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x05}, 537*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x04}, 538*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x04}, 539*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x04}, 540*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x03}, 541*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x03}, 542*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x03}, 543*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x02}, 544*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x02}, 545*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x02}, 546*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x01}, 547*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x01}, 548*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x01}, 549*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x00}, 550*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x00}, 551*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x00}, 552*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {93, 0x00}, 553*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {88, 0x00}, 554*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {83, 0x00}, 555*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {78, 0x00}, 556*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }, 557*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 2.4GHz power gain index table */ 558*cdc64593Sxinghua wen - Sun Microsystems - Beijing China { 559*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3f}, /* highest txpower */ 560*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3f}, 561*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3f}, 562*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3e}, 563*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3e}, 564*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3e}, 565*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3d}, 566*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3d}, 567*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3d}, 568*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3c}, 569*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3c}, 570*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3c}, 571*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3b}, 572*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3b}, 573*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3b}, 574*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3a}, 575*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3a}, 576*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3a}, 577*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x39}, 578*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x39}, 579*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x39}, 580*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x38}, 581*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x38}, 582*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x38}, 583*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x37}, 584*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x37}, 585*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x37}, 586*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x36}, 587*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x36}, 588*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x36}, 589*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x35}, 590*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x35}, 591*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x35}, 592*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x34}, 593*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x34}, 594*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x34}, 595*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x33}, 596*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x33}, 597*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x33}, 598*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x32}, 599*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x32}, 600*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x32}, 601*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x31}, 602*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x31}, 603*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x31}, 604*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x30}, 605*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x30}, 606*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x30}, 607*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x6}, 608*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x6}, 609*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x6}, 610*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x5}, 611*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x5}, 612*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x5}, 613*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x4}, 614*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x4}, 615*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x4}, 616*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x3}, 617*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x3}, 618*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x3}, 619*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x2}, 620*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x2}, 621*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x2}, 622*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x1}, 623*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x1}, 624*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x1}, 625*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {110, 0x0}, 626*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {104, 0x0}, 627*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {98, 0x0}, 628*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {97, 0}, 629*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {96, 0}, 630*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {95, 0}, 631*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {94, 0}, 632*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {93, 0}, 633*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {92, 0}, 634*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {91, 0}, 635*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {90, 0}, 636*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {89, 0}, 637*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {88, 0}, 638*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {87, 0}, 639*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {86, 0}, 640*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {85, 0}, 641*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {84, 0}, 642*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {83, 0}, 643*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {82, 0}, 644*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {81, 0}, 645*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {80, 0}, 646*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {79, 0}, 647*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {78, 0}, 648*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {77, 0}, 649*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {76, 0}, 650*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {75, 0}, 651*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {74, 0}, 652*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {73, 0}, 653*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {72, 0}, 654*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {71, 0}, 655*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {70, 0}, 656*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {69, 0}, 657*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {68, 0}, 658*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {67, 0}, 659*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {66, 0}, 660*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {65, 0}, 661*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {64, 0}, 662*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {63, 0}, 663*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {62, 0}, 664*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {61, 0}, 665*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {60, 0}, 666*cdc64593Sxinghua wen - Sun Microsystems - Beijing China {59, 0}, 667*cdc64593Sxinghua wen - Sun Microsystems - Beijing China } 668*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 669*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 670*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* END TXPOWER */ 671*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 672*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_div { 673*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t tx_on_a; 674*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t tx_on_b; 675*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t exec_time; 676*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t probe_time; 677*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t reserved1; 678*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t reserved2; 679*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 680*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 681*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_dbg { 682*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t burst_check; 683*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t burst_count; 684*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t reserved[4]; 685*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 686*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 687*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 688*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_general { 689*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t temperature; 690*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t temperature_m; 691*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_dbg dbg; 692*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t sleep_time; 693*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t slots_out; 694*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t slots_idle; 695*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t ttl_timestamp; 696*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_div div; 697*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t rx_enable_counter; 698*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t reserved1; 699*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t reserved2; 700*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t reserved3; 701*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 702*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 703*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 704*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_tx_non_phy_agg { 705*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t ba_timeout; 706*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t ba_reschedule_frames; 707*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t scd_query_agg_frame_cnt; 708*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t scd_query_no_agg; 709*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t scd_query_agg; 710*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t scd_query_mismatch; 711*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t frame_not_ready; 712*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t underrun; 713*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t bt_prio_kill; 714*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t rx_ba_rsp_cnt; 715*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t reserved2; 716*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t reserved3; 717*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 718*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 719*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 720*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_tx { 721*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t preamble_cnt; 722*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t rx_detected_cnt; 723*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t bt_prio_defer_cnt; 724*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t bt_prio_kill_cnt; 725*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t few_bytes_cnt; 726*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t cts_timeout; 727*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t ack_timeout; 728*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t expected_ack_cnt; 729*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t actual_ack_cnt; 730*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t dump_msdu_cnt; 731*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t burst_abort_next_frame_mismatch_cnt; 732*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t burst_abort_missing_next_frame_cnt; 733*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t cts_timeout_collision; 734*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t ack_or_ba_timeout_collision; 735*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_tx_non_phy_agg agg; 736*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 737*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 738*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 739*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_rx_ht_phy { 740*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t plcp_err; 741*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t overrun_err; 742*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t early_overrun_err; 743*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t crc32_good; 744*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t crc32_err; 745*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t mh_format_err; 746*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t agg_crc32_good; 747*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t agg_mpdu_cnt; 748*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t agg_cnt; 749*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t reserved2; 750*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 751*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 752*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_rx_non_phy { 753*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t bogus_cts; /* CTS received when not expecting CTS */ 754*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t bogus_ack; /* ACK received when not expecting ACK */ 755*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t non_bssid_frames; /* number of frames with BSSID that */ 756*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* doesn't belong to the STA BSSID */ 757*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t filtered_frames; /* count frames that were dumped in the */ 758*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* filtering process */ 759*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t non_channel_beacons; /* beacons with our bss id but not on */ 760*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* our serving channel */ 761*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t channel_beacons; /* beacons with our bss id and in our */ 762*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* serving channel */ 763*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t num_missed_bcon; /* number of missed beacons */ 764*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t adc_rx_saturation_time; /* count in 0.8us units the time */ 765*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* the ADC was in saturation */ 766*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t ina_detection_search_time; /* total time (in 0.8us) */ 767*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* searched for INA */ 768*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t beacon_silence_rssi_a; /* RSSI silence after beacon frame */ 769*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t beacon_silence_rssi_b; /* RSSI silence after beacon frame */ 770*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t beacon_silence_rssi_c; /* RSSI silence after beacon frame */ 771*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t interference_data_flag; /* flag for interference data */ 772*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* availability. 1 when data is */ 773*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* available. */ 774*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t channel_load; /* counts RX Enable time */ 775*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t dsp_false_alarms; /* DSP false alarm (both OFDM */ 776*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* and CCK) counter */ 777*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t beacon_rssi_a; 778*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t beacon_rssi_b; 779*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t beacon_rssi_c; 780*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t beacon_energy_a; 781*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t beacon_energy_b; 782*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t beacon_energy_c; 783*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 784*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 785*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_rx_phy { 786*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t ina_cnt; 787*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t fina_cnt; 788*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t plcp_err; 789*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t crc32_err; 790*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t overrun_err; 791*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t early_overrun_err; 792*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t crc32_good; 793*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t false_alarm_cnt; 794*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t fina_sync_err_cnt; 795*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t sfd_timeout; 796*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t fina_timeout; 797*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t unresponded_rts; 798*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t rxe_frame_limit_overrun; 799*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t sent_ack_cnt; 800*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t sent_cts_cnt; 801*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t sent_ba_rsp_cnt; 802*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t dsp_self_kill; 803*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t mh_format_err; 804*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t re_acq_main_rssi_sum; 805*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t reserved3; 806*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 807*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 808*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_rx { 809*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_rx_phy ofdm; 810*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_rx_phy cck; 811*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_rx_non_phy general; 812*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_rx_ht_phy ofdm_ht; 813*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 814*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 815*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct iwk_notif_statistics { 816*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t flag; 817*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_rx rx; 818*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_tx tx; 819*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct statistics_general general; 820*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 821*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 822*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* START Receiver gain balance */ 823*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 824*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 825*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * REPLY_PHY_CALIBRATION_CMD = 0xb0 (command, has simple generic response) 826*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 827*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * This command sets the relative gains of 4965's 3 radio receiver chains. 828*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 829*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * After the first association, driver should accumulate signal and noise 830*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * statistics from the STATISTICS_NOTIFICATIONs that follow the first 20 831*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * beacons from the associated network (don't collect statistics that come 832*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * in from scanning, or any other non-network source). 833*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 834*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * DISCONNECTED ANTENNA: 835*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 836*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Driver should determine which antennas are actually connected, by comparing 837*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * average beacon signal levels for the 3 Rx chains. Accumulate (add) the 838*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * following values over 20 beacons, one accumulator for each of the chains 839*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * a/b/c, from struct statistics_rx_non_phy: 840*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 841*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * beacon_rssi_[abc] & 0x0FF (unsigned, units in dB) 842*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 843*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Find the strongest signal from among a/b/c. Compare the other two to the 844*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * strongest. If any signal is more than 15 dB (times 20, unless you 845*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * divide the accumulated values by 20) below the strongest, the driver 846*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * considers that antenna to be disconnected, and should not try to use that 847*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * antenna/chain for Rx or Tx. If both A and B seem to be disconnected, 848*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * driver should declare the stronger one as connected, and attempt to use it 849*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (A and B are the only 2 Tx chains!). 850*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 851*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 852*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * RX BALANCE: 853*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 854*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Driver should balance the 3 receivers (but just the ones that are connected 855*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * to antennas, see above) for gain, by comparing the average signal levels 856*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * detected during the silence after each beacon (background noise). 857*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Accumulate (add) the following values over 20 beacons, one accumulator for 858*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * each of the chains a/b/c, from struct statistics_rx_non_phy: 859*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 860*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * beacon_silence_rssi_[abc] & 0x0FF (unsigned, units in dB) 861*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 862*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Find the weakest background noise level from among a/b/c. This Rx chain 863*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * will be the reference, with 0 gain adjustment. Attenuate other channels by 864*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * finding noise difference: 865*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 866*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (accum_noise[i] - accum_noise[reference]) / 30 867*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 868*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * The "30" adjusts the dB in the 20 accumulated samples to units of 1.5 dB. 869*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * For use in diff_gain_[abc] fields of struct iwk_calibration_cmd, the 870*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * driver should limit the difference results to a range of 0-3 (0-4.5 dB), 871*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * and set bit 2 to indicate "reduce gain". The value for the reference 872*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (weakest) chain should be "0". 873*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 874*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * diff_gain_[abc] bit fields: 875*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2: (1) reduce gain, (0) increase gain 876*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1-0: amount of gain, units of 1.5 dB 877*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 878*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 879*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define RX_CHAINS_NUM (3) 880*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define CHAIN_GAIN_DIFF_INIT_VAL (4) 881*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 882*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_GAIN_DIFF_ALIVE (0) 883*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_GAIN_DIFF_ACCUMULATE (1) 884*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_GAIN_DIFF_CALIBRATED (2) 885*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 886*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define INTERFERENCE_DATA_AVAILABLE (1) 887*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define BEACON_NUM_20 (20) 888*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define MAX_ALLOWED_DIFF (15) 889*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 890*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct iwk_rx_gain_diff { 891*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint8_t state; 892*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint16_t beacon_count; 893*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint8_t gain_diff_send; 894*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t beacon_stren_a; 895*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t beacon_stren_b; 896*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t beacon_stren_c; 897*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t noise_stren_a; 898*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t noise_stren_b; 899*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t noise_stren_c; 900*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint8_t disconnect_chain[RX_CHAINS_NUM]; 901*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint8_t connected_chains; 902*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint8_t gain_diff_chain[RX_CHAINS_NUM]; 903*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 904*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 905*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* END Receiver gain balance */ 906*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 907*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* START Receiver sensitivity */ 908*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 909*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* 910*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * SENSITIVITY_CMD = 0xa8 911*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 912*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * This command sets up the Rx signal detector for a sensitivity level that 913*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * is high enough to lock onto all signals within the associated network, 914*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * but low enough to ignore signals that are below a certain threshold, so as 915*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * not to have too many "false alarms". False alarms are signals that the 916*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Rx DSP tries to lock onto, but then discards after determining that they 917*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * are noise. 918*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 919*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * The optimum number of false alarms is between 5 and 50 per 200 TUs 920*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (200 * 1024 uSecs, i.e. 204.8 milliseconds) of actual Rx time (i.e. 921*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * time listening, not transmitting). Driver must adjust sensitivity so that 922*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * the ratio of actual false alarms to actual Rx time falls within this range. 923*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 924*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * While associated, uCode delivers STATISTICS_NOTIFICATIONs after each 925*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * received beacon. These provide information to the driver to analyze the 926*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * sensitivity. Don't analyze statistics that come in from scanning, or any 927*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * other non-associated-network source. Pertinent statistics include: 928*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 929*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * From "general" statistics (struct statistics_rx_non_phy): 930*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 931*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (beacon_energy_[abc] & 0x0FF00) >> 8 (unsigned, higher value is lower level) 932*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Measure of energy of desired signal. Used for establishing a level 933*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * below which the device does not detect signals. 934*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 935*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (beacon_silence_rssi_[abc] & 0x0FF00) >> 8 (unsigned, units in dB) 936*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Measure of background noise in silent period after beacon. 937*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 938*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * channel_load 939*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * uSecs of actual Rx time during beacon period (varies according to 940*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * how much time was spent transmitting). 941*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 942*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * From "cck" and "ofdm" statistics (struct statistics_rx_phy), separately: 943*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 944*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * false_alarm_cnt 945*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Signal locks abandoned early (before phy-level header). 946*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 947*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * plcp_err 948*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Signal locks abandoned late (during phy-level header). 949*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 950*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * NOTE: Both false_alarm_cnt and plcp_err increment monotonically from 951*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * beacon to beacon, i.e. each value is an accumulation of all errors 952*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * before and including the latest beacon. Values will wrap around to 0 953*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * after counting up to 2^32 - 1. Driver must differentiate vs. 954*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * previous beacon's values to determine # false alarms in the current 955*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * beacon period. 956*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 957*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Total number of false alarms = false_alarms + plcp_errs 958*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 959*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * For OFDM, adjust the following table entries in struct iwk_rx_sensitivity_cmd 960*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (notice that the start points for OFDM are at or close to settings for 961*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * maximum sensitivity): 962*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 963*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * START / MIN / MAX 964*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * HD_AUTO_CORR32_X1_TH_ADD_MIN_INDEX 90 / 85 / 120 965*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * HD_AUTO_CORR32_X1_TH_ADD_MIN_MRC_INDEX 170 / 170 / 210 966*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * HD_AUTO_CORR32_X4_TH_ADD_MIN_INDEX 105 / 105 / 140 967*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * HD_AUTO_CORR32_X4_TH_ADD_MIN_MRC_INDEX 220 / 220 / 270 968*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 969*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * If actual rate of OFDM false alarms (+ plcp_errors) is too high 970*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (greater than 50 for each 204.8 msecs listening), reduce sensitivity 971*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * by *adding* 1 to all 4 of the table entries above, up to the max for 972*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * each entry. Conversely, if false alarm rate is too low (less than 5 973*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * for each 204.8 msecs listening), *subtract* 1 from each entry to 974*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * increase sensitivity. 975*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 976*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * For CCK sensitivity, keep track of the following: 977*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 978*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1). 20-beacon history of maximum background noise, indicated by 979*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (beacon_silence_rssi_[abc] & 0x0FF00), units in dB, across the 980*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 3 receivers. For any given beacon, the "silence reference" is 981*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * the maximum of last 60 samples (20 beacons * 3 receivers). 982*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 983*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2). 10-beacon history of strongest signal level, as indicated 984*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * by (beacon_energy_[abc] & 0x0FF00) >> 8, across the 3 receivers, 985*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * i.e. the strength of the signal through the best receiver at the 986*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * moment. These measurements are "upside down", with lower values 987*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * for stronger signals, so max energy will be *minimum* value. 988*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 989*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Then for any given beacon, the driver must determine the *weakest* 990*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * of the strongest signals; this is the minimum level that needs to be 991*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * successfully detected, when using the best receiver at the moment. 992*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * "Max cck energy" is the maximum (higher value means lower energy!) 993*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * of the last 10 minima. Once this is determined, driver must add 994*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * a little margin by adding "6" to it. 995*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 996*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 3). Number of consecutive beacon periods with too few false alarms. 997*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Reset this to 0 at the first beacon period that falls within the 998*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * "good" range (5 to 50 false alarms per 204.8 milliseconds rx). 999*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1000*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Then, adjust the following CCK table entries in struct iwk_rx_sensitivity_cmd 1001*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (notice that the start points for CCK are at maximum sensitivity): 1002*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1003*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * START / MIN / MAX 1004*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX 125 / 125 / 200 1005*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX 200 / 200 / 400 1006*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * HD_MIN_ENERGY_CCK_DET_INDEX 100 / 0 / 100 1007*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1008*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * If actual rate of CCK false alarms (+ plcp_errors) is too high 1009*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (greater than 50 for each 204.8 msecs listening), method for reducing 1010*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * sensitivity is: 1011*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1012*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1) *Add* 3 to value in HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX, 1013*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * up to max 400. 1014*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1015*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2) If current value in HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX is < 160, 1016*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * sensitivity has been reduced a significant amount; bring it up to 1017*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * a moderate 161. Otherwise, *add* 3, up to max 200. 1018*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1019*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 3) a) If current value in HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX is > 160, 1020*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * sensitivity has been reduced only a moderate or small amount; 1021*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * *subtract* 2 from value in HD_MIN_ENERGY_CCK_DET_INDEX, 1022*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * down to min 0. Otherwise (if gain has been significantly reduced), 1023*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * don't change the HD_MIN_ENERGY_CCK_DET_INDEX value. 1024*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1025*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * b) Save a snapshot of the "silence reference". 1026*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1027*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * If actual rate of CCK false alarms (+ plcp_errors) is too low 1028*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (less than 5 for each 204.8 msecs listening), method for increasing 1029*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * sensitivity is used only if: 1030*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1031*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1a) Previous beacon did not have too many false alarms 1032*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1b) AND difference between previous "silence reference" and current 1033*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * "silence reference" (prev - current) is 2 or more, 1034*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * OR 2) 100 or more consecutive beacon periods have had rate of 1035*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * less than 5 false alarms per 204.8 milliseconds rx time. 1036*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1037*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Method for increasing sensitivity: 1038*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1039*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1) *Subtract* 3 from value in HD_AUTO_CORR40_X4_TH_ADD_MIN_INDEX, 1040*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * down to min 125. 1041*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1042*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2) *Subtract* 3 from value in HD_AUTO_CORR40_X4_TH_ADD_MIN_MRC_INDEX, 1043*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * down to min 200. 1044*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1045*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 3) *Add* 2 to value in HD_MIN_ENERGY_CCK_DET_INDEX, up to max 100. 1046*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1047*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * If actual rate of CCK false alarms (+ plcp_errors) is within good range 1048*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * (between 5 and 50 for each 204.8 msecs listening): 1049*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1050*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1) Save a snapshot of the silence reference. 1051*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1052*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 2) If previous beacon had too many CCK false alarms (+ plcp_errors), 1053*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * give some extra margin to energy threshold by *subtracting* 8 1054*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * from value in HD_MIN_ENERGY_CCK_DET_INDEX. 1055*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1056*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * For all cases (too few, too many, good range), make sure that the CCK 1057*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * detection threshold (energy) is below the energy level for robust 1058*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * detection over the past 10 beacon periods, the "Max cck energy". 1059*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Lower values mean higher energy; this means making sure that the value 1060*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * in HD_MIN_ENERGY_CCK_DET_INDEX is at or *above* "Max cck energy". 1061*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1062*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * Driver should set the following entries to fixed values: 1063*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * 1064*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * HD_MIN_ENERGY_OFDM_DET_INDEX 100 1065*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * HD_BARKER_CORR_TH_ADD_MIN_INDEX 190 1066*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * HD_BARKER_CORR_TH_ADD_MIN_MRC_INDEX 390 1067*cdc64593Sxinghua wen - Sun Microsystems - Beijing China * HD_OFDM_ENERGY_TH_IN_INDEX 62 1068*cdc64593Sxinghua wen - Sun Microsystems - Beijing China */ 1069*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 1070*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_SENSITIVITY_CALIB_ALLOW_MSK (1 << 0) 1071*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_SENSITIVITY_OFDM_UPDATE_MSK (1 << 1) 1072*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_SENSITIVITY_CCK_UPDATE_MSK (1 << 2) 1073*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 1074*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define MIN_ENERGY_CCK_DET_IDX (0) 1075*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define MIN_ENERGY_OFDM_DET_IDX (1) 1076*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define AUTO_CORR32_X1_TH_ADD_MIN_IDX (2) 1077*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define AUTO_CORR32_X1_TH_ADD_MIN_MRC_IDX (3) 1078*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define AUTO_CORR40_X4_TH_ADD_MIN_MRC_IDX (4) 1079*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define AUTO_CORR32_X4_TH_ADD_MIN_IDX (5) 1080*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define AUTO_CORR32_X4_TH_ADD_MIN_MRC_IDX (6) 1081*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define BARKER_CORR_TH_ADD_MIN_IDX (7) 1082*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define BARKER_CORR_TH_ADD_MIN_MRC_IDX (8) 1083*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define AUTO_CORR40_X4_TH_ADD_MIN_IDX (9) 1084*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define PTAM_ENERGY_TH_IDX (10) 1085*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 1086*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_GOOD_RANGE_FALSE_ALARM (0) 1087*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_TOO_MANY_FALSE_ALARM (1) 1088*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_TOO_FEW_FALSE_ALARM (2) 1089*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 1090*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_SENSITIVITY_CONTROL_DEFAULT_TABLE (0) 1091*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #define IWK_SENSITIVITY_CONTROL_WORK_TABLE (1) 1092*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 1093*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct iwk_rx_sensitivity_cmd { 1094*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint16_t control; 1095*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint16_t table[11]; 1096*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 1097*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 1098*cdc64593Sxinghua wen - Sun Microsystems - Beijing China struct iwk_rx_sensitivity { 1099*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint16_t auto_corr_ofdm_x4; 1100*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint16_t auto_corr_mrc_ofdm_x4; 1101*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint16_t auto_corr_ofdm_x1; 1102*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint16_t auto_corr_mrc_ofdm_x1; 1103*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 1104*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint16_t auto_corr_cck_x4; 1105*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint16_t auto_corr_mrc_cck_x4; 1106*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint16_t min_energy_det_cck; 1107*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 1108*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint16_t flags; 1109*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 1110*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t last_bad_plcp_cnt_ofdm; 1111*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t last_false_alarm_cnt_ofdm; 1112*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t last_bad_plcp_cnt_cck; 1113*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t last_false_alarm_cnt_cck; 1114*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 1115*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t cck_curr_state; 1116*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t cck_prev_state; 1117*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t cck_beacon_min[10]; 1118*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t cck_beacon_idx; 1119*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint8_t cck_noise_max[20]; 1120*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t cck_noise_ref; 1121*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t cck_noise_idx; 1122*cdc64593Sxinghua wen - Sun Microsystems - Beijing China int32_t cck_noise_diff; 1123*cdc64593Sxinghua wen - Sun Microsystems - Beijing China uint32_t cck_no_false_alarm_num; 1124*cdc64593Sxinghua wen - Sun Microsystems - Beijing China }; 1125*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 1126*cdc64593Sxinghua wen - Sun Microsystems - Beijing China /* END Receiver sensitivity */ 1127*cdc64593Sxinghua wen - Sun Microsystems - Beijing China 1128*cdc64593Sxinghua wen - Sun Microsystems - Beijing China #endif /* _IWK_CALIBRATION_H_ */ 1129