xref: /onnv-gate/usr/src/uts/common/io/iwp/iwp_calibration.h (revision 11193:b54c6739cd88)
110893SQuaker.Fang@Sun.COM /*
2*11193SQuaker.Fang@Sun.COM  * Sun elects to have this file available under and governed by the BSD license
3*11193SQuaker.Fang@Sun.COM  * (see below for full license text).  However, the following notice
4*11193SQuaker.Fang@Sun.COM  * accompanied the original version of this file:
510893SQuaker.Fang@Sun.COM  */
610893SQuaker.Fang@Sun.COM 
710893SQuaker.Fang@Sun.COM /*
810893SQuaker.Fang@Sun.COM  * Copyright (c) 2009, Intel Corporation
910893SQuaker.Fang@Sun.COM  * All rights reserved.
1010893SQuaker.Fang@Sun.COM  */
1110893SQuaker.Fang@Sun.COM 
1210893SQuaker.Fang@Sun.COM /*
1310893SQuaker.Fang@Sun.COM  * This file is provided under a dual BSD/GPLv2 license.  When using or
1410893SQuaker.Fang@Sun.COM  * redistributing this file, you may do so under either license.
1510893SQuaker.Fang@Sun.COM  *
1610893SQuaker.Fang@Sun.COM  * GPL LICENSE SUMMARY
1710893SQuaker.Fang@Sun.COM  *
1810893SQuaker.Fang@Sun.COM  * Copyright(c) 2005 - 2009 Intel Corporation. All rights reserved.
1910893SQuaker.Fang@Sun.COM  *
2010893SQuaker.Fang@Sun.COM  * This program is free software; you can redistribute it and/or modify
2110893SQuaker.Fang@Sun.COM  * it under the terms of version 2 of the GNU General Public License as
2210893SQuaker.Fang@Sun.COM  * published by the Free Software Foundation.
2310893SQuaker.Fang@Sun.COM  *
2410893SQuaker.Fang@Sun.COM  * This program is distributed in the hope that it will be useful, but
2510893SQuaker.Fang@Sun.COM  * WITHOUT ANY WARRANTY; without even the implied warranty of
2610893SQuaker.Fang@Sun.COM  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2710893SQuaker.Fang@Sun.COM  * General Public License for more details.
2810893SQuaker.Fang@Sun.COM  *
2910893SQuaker.Fang@Sun.COM  * You should have received a copy of the GNU General Public License
3010893SQuaker.Fang@Sun.COM  * along with this program; if not, write to the Free Software
3110893SQuaker.Fang@Sun.COM  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
3210893SQuaker.Fang@Sun.COM  * USA
3310893SQuaker.Fang@Sun.COM  *
3410893SQuaker.Fang@Sun.COM  * The full GNU General Public License is included in this distribution
3510893SQuaker.Fang@Sun.COM  * in the file called LICENSE.GPL.
3610893SQuaker.Fang@Sun.COM  *
3710893SQuaker.Fang@Sun.COM  * Contact Information:
3810893SQuaker.Fang@Sun.COM  * James P. Ketrenos <ipw2100-admin@linux.intel.com>
3910893SQuaker.Fang@Sun.COM  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
4010893SQuaker.Fang@Sun.COM  *
4110893SQuaker.Fang@Sun.COM  * BSD LICENSE
4210893SQuaker.Fang@Sun.COM  *
4310893SQuaker.Fang@Sun.COM  * Copyright(c) 2005 - 2009 Intel Corporation. All rights reserved.
4410893SQuaker.Fang@Sun.COM  * All rights reserved.
4510893SQuaker.Fang@Sun.COM  *
4610893SQuaker.Fang@Sun.COM  * Redistribution and use in source and binary forms, with or without
4710893SQuaker.Fang@Sun.COM  * modification, are permitted provided that the following conditions
4810893SQuaker.Fang@Sun.COM  * are met:
4910893SQuaker.Fang@Sun.COM  *
5010893SQuaker.Fang@Sun.COM  *  * Redistributions of source code must retain the above copyright
5110893SQuaker.Fang@Sun.COM  *    notice, this list of conditions and the following disclaimer.
5210893SQuaker.Fang@Sun.COM  *  * Redistributions in binary form must reproduce the above copyright
5310893SQuaker.Fang@Sun.COM  *    notice, this list of conditions and the following disclaimer in
5410893SQuaker.Fang@Sun.COM  *    the documentation and/or other materials provided with the
5510893SQuaker.Fang@Sun.COM  *    distribution.
5610893SQuaker.Fang@Sun.COM  *  * Neither the name Intel Corporation nor the names of its
5710893SQuaker.Fang@Sun.COM  *    contributors may be used to endorse or promote products derived
5810893SQuaker.Fang@Sun.COM  *    from this software without specific prior written permission.
5910893SQuaker.Fang@Sun.COM  *
6010893SQuaker.Fang@Sun.COM  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6110893SQuaker.Fang@Sun.COM  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6210893SQuaker.Fang@Sun.COM  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6310893SQuaker.Fang@Sun.COM  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
6410893SQuaker.Fang@Sun.COM  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
6510893SQuaker.Fang@Sun.COM  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
6610893SQuaker.Fang@Sun.COM  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
6710893SQuaker.Fang@Sun.COM  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
6810893SQuaker.Fang@Sun.COM  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6910893SQuaker.Fang@Sun.COM  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7010893SQuaker.Fang@Sun.COM  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7110893SQuaker.Fang@Sun.COM  */
7210893SQuaker.Fang@Sun.COM 
7310893SQuaker.Fang@Sun.COM 
7410893SQuaker.Fang@Sun.COM #ifndef _IWP_CALIBRATION_H
7510893SQuaker.Fang@Sun.COM #define	_IWP_CALIBRATION_H
7610893SQuaker.Fang@Sun.COM 
7710893SQuaker.Fang@Sun.COM #define	EEP_TX_POWER_TX_CHAINS	(3)
7810893SQuaker.Fang@Sun.COM #define	EEP_RXIQ_CAL_CHANNELS	(7)
7910893SQuaker.Fang@Sun.COM #define	EEP_CAL_CHANNEL_GROUP	(7)
8010893SQuaker.Fang@Sun.COM #define	EEP_RXIQ_DRIVER_MODES	(12)
8110893SQuaker.Fang@Sun.COM 
8210893SQuaker.Fang@Sun.COM struct	tx_pow_calib_hdr {
8310893SQuaker.Fang@Sun.COM 	uint8_t		calib_version;
8410893SQuaker.Fang@Sun.COM 	uint8_t		pa_type;
8510893SQuaker.Fang@Sun.COM 	uint16_t	voltage_reading;
8610893SQuaker.Fang@Sun.COM };
8710893SQuaker.Fang@Sun.COM 
8810893SQuaker.Fang@Sun.COM struct	iwp_eep_txpower_sample {
8910893SQuaker.Fang@Sun.COM 	uint8_t	gain_index;	/* index to power setup table */
9010893SQuaker.Fang@Sun.COM 	int8_t	power;		/* power level for this channel group */
9110893SQuaker.Fang@Sun.COM 	uint8_t	v_det;		/* PA output voltage */
9210893SQuaker.Fang@Sun.COM 	uint8_t	temp_reading;
9310893SQuaker.Fang@Sun.COM };
9410893SQuaker.Fang@Sun.COM 
9510893SQuaker.Fang@Sun.COM struct	iwp_eep_txpower_cal {
9610893SQuaker.Fang@Sun.COM 	struct	iwp_eep_txpower_sample	samples[6];	/* 6 power level */
9710893SQuaker.Fang@Sun.COM 	/* highest power possible by hardware in this band */
9810893SQuaker.Fang@Sun.COM 	uint8_t	saturation_power;
9910893SQuaker.Fang@Sun.COM 	/* "representative" channel number in this band */
10010893SQuaker.Fang@Sun.COM 	uint8_t	group_channel;
10110893SQuaker.Fang@Sun.COM 	int8_t	t_pa_det;
10210893SQuaker.Fang@Sun.COM 	int8_t	t_actual_power;
10310893SQuaker.Fang@Sun.COM };
10410893SQuaker.Fang@Sun.COM 
10510893SQuaker.Fang@Sun.COM struct	rx_iq_cal {
10610893SQuaker.Fang@Sun.COM 	int16_t	ars;
10710893SQuaker.Fang@Sun.COM 	int16_t	arc;
10810893SQuaker.Fang@Sun.COM };
10910893SQuaker.Fang@Sun.COM 
11010893SQuaker.Fang@Sun.COM struct	iwp_eep_calibration {
11110893SQuaker.Fang@Sun.COM 	struct	tx_pow_calib_hdr tx_pow_calib_hdr;
11210893SQuaker.Fang@Sun.COM 	struct	iwp_eep_txpower_cal txpow_group
11310893SQuaker.Fang@Sun.COM 		[EEP_TX_POWER_TX_CHAINS][EEP_CAL_CHANNEL_GROUP];
11410893SQuaker.Fang@Sun.COM 	uint16_t	xtal_calib[2];
11510893SQuaker.Fang@Sun.COM 	int16_t		temp_calib_temp;
11610893SQuaker.Fang@Sun.COM 	int16_t		temp_calib_volt;
11710893SQuaker.Fang@Sun.COM 	uint8_t		rx_iBB_filter;
11810893SQuaker.Fang@Sun.COM 	uint8_t		reserved;
11910893SQuaker.Fang@Sun.COM 	struct	rx_iq_cal rx_iq_cal
12010893SQuaker.Fang@Sun.COM 		[EEP_RXIQ_CAL_CHANNELS][EEP_RXIQ_DRIVER_MODES];
12110893SQuaker.Fang@Sun.COM };
12210893SQuaker.Fang@Sun.COM 
12310893SQuaker.Fang@Sun.COM #endif /* _IWP_CALIBRATION_H */
124