xref: /illumos-gate/usr/src/uts/common/io/iwp/iwp_calibration.h (revision 67d1a47ad0082689ff0f6a8396a511767fff2f96)
122a84b8dSQuaker Fang /*
2*67d1a47aSQuaker Fang  * Sun elects to have this file available under and governed by the BSD license
3*67d1a47aSQuaker Fang  * (see below for full license text).  However, the following notice
4*67d1a47aSQuaker Fang  * accompanied the original version of this file:
522a84b8dSQuaker Fang  */
622a84b8dSQuaker Fang 
722a84b8dSQuaker Fang /*
822a84b8dSQuaker Fang  * Copyright (c) 2009, Intel Corporation
922a84b8dSQuaker Fang  * All rights reserved.
1022a84b8dSQuaker Fang  */
1122a84b8dSQuaker Fang 
1222a84b8dSQuaker Fang /*
1322a84b8dSQuaker Fang  * This file is provided under a dual BSD/GPLv2 license.  When using or
1422a84b8dSQuaker Fang  * redistributing this file, you may do so under either license.
1522a84b8dSQuaker Fang  *
1622a84b8dSQuaker Fang  * GPL LICENSE SUMMARY
1722a84b8dSQuaker Fang  *
1822a84b8dSQuaker Fang  * Copyright(c) 2005 - 2009 Intel Corporation. All rights reserved.
1922a84b8dSQuaker Fang  *
2022a84b8dSQuaker Fang  * This program is free software; you can redistribute it and/or modify
2122a84b8dSQuaker Fang  * it under the terms of version 2 of the GNU General Public License as
2222a84b8dSQuaker Fang  * published by the Free Software Foundation.
2322a84b8dSQuaker Fang  *
2422a84b8dSQuaker Fang  * This program is distributed in the hope that it will be useful, but
2522a84b8dSQuaker Fang  * WITHOUT ANY WARRANTY; without even the implied warranty of
2622a84b8dSQuaker Fang  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2722a84b8dSQuaker Fang  * General Public License for more details.
2822a84b8dSQuaker Fang  *
2922a84b8dSQuaker Fang  * You should have received a copy of the GNU General Public License
3022a84b8dSQuaker Fang  * along with this program; if not, write to the Free Software
3122a84b8dSQuaker Fang  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
3222a84b8dSQuaker Fang  * USA
3322a84b8dSQuaker Fang  *
3422a84b8dSQuaker Fang  * The full GNU General Public License is included in this distribution
3522a84b8dSQuaker Fang  * in the file called LICENSE.GPL.
3622a84b8dSQuaker Fang  *
3722a84b8dSQuaker Fang  * Contact Information:
3822a84b8dSQuaker Fang  * James P. Ketrenos <ipw2100-admin@linux.intel.com>
3922a84b8dSQuaker Fang  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
4022a84b8dSQuaker Fang  *
4122a84b8dSQuaker Fang  * BSD LICENSE
4222a84b8dSQuaker Fang  *
4322a84b8dSQuaker Fang  * Copyright(c) 2005 - 2009 Intel Corporation. All rights reserved.
4422a84b8dSQuaker Fang  * All rights reserved.
4522a84b8dSQuaker Fang  *
4622a84b8dSQuaker Fang  * Redistribution and use in source and binary forms, with or without
4722a84b8dSQuaker Fang  * modification, are permitted provided that the following conditions
4822a84b8dSQuaker Fang  * are met:
4922a84b8dSQuaker Fang  *
5022a84b8dSQuaker Fang  *  * Redistributions of source code must retain the above copyright
5122a84b8dSQuaker Fang  *    notice, this list of conditions and the following disclaimer.
5222a84b8dSQuaker Fang  *  * Redistributions in binary form must reproduce the above copyright
5322a84b8dSQuaker Fang  *    notice, this list of conditions and the following disclaimer in
5422a84b8dSQuaker Fang  *    the documentation and/or other materials provided with the
5522a84b8dSQuaker Fang  *    distribution.
5622a84b8dSQuaker Fang  *  * Neither the name Intel Corporation nor the names of its
5722a84b8dSQuaker Fang  *    contributors may be used to endorse or promote products derived
5822a84b8dSQuaker Fang  *    from this software without specific prior written permission.
5922a84b8dSQuaker Fang  *
6022a84b8dSQuaker Fang  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6122a84b8dSQuaker Fang  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6222a84b8dSQuaker Fang  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6322a84b8dSQuaker Fang  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
6422a84b8dSQuaker Fang  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
6522a84b8dSQuaker Fang  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
6622a84b8dSQuaker Fang  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
6722a84b8dSQuaker Fang  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
6822a84b8dSQuaker Fang  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6922a84b8dSQuaker Fang  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
7022a84b8dSQuaker Fang  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7122a84b8dSQuaker Fang  */
7222a84b8dSQuaker Fang 
7322a84b8dSQuaker Fang 
7422a84b8dSQuaker Fang #ifndef _IWP_CALIBRATION_H
7522a84b8dSQuaker Fang #define	_IWP_CALIBRATION_H
7622a84b8dSQuaker Fang 
7722a84b8dSQuaker Fang #define	EEP_TX_POWER_TX_CHAINS	(3)
7822a84b8dSQuaker Fang #define	EEP_RXIQ_CAL_CHANNELS	(7)
7922a84b8dSQuaker Fang #define	EEP_CAL_CHANNEL_GROUP	(7)
8022a84b8dSQuaker Fang #define	EEP_RXIQ_DRIVER_MODES	(12)
8122a84b8dSQuaker Fang 
8222a84b8dSQuaker Fang struct	tx_pow_calib_hdr {
8322a84b8dSQuaker Fang 	uint8_t		calib_version;
8422a84b8dSQuaker Fang 	uint8_t		pa_type;
8522a84b8dSQuaker Fang 	uint16_t	voltage_reading;
8622a84b8dSQuaker Fang };
8722a84b8dSQuaker Fang 
8822a84b8dSQuaker Fang struct	iwp_eep_txpower_sample {
8922a84b8dSQuaker Fang 	uint8_t	gain_index;	/* index to power setup table */
9022a84b8dSQuaker Fang 	int8_t	power;		/* power level for this channel group */
9122a84b8dSQuaker Fang 	uint8_t	v_det;		/* PA output voltage */
9222a84b8dSQuaker Fang 	uint8_t	temp_reading;
9322a84b8dSQuaker Fang };
9422a84b8dSQuaker Fang 
9522a84b8dSQuaker Fang struct	iwp_eep_txpower_cal {
9622a84b8dSQuaker Fang 	struct	iwp_eep_txpower_sample	samples[6];	/* 6 power level */
9722a84b8dSQuaker Fang 	/* highest power possible by hardware in this band */
9822a84b8dSQuaker Fang 	uint8_t	saturation_power;
9922a84b8dSQuaker Fang 	/* "representative" channel number in this band */
10022a84b8dSQuaker Fang 	uint8_t	group_channel;
10122a84b8dSQuaker Fang 	int8_t	t_pa_det;
10222a84b8dSQuaker Fang 	int8_t	t_actual_power;
10322a84b8dSQuaker Fang };
10422a84b8dSQuaker Fang 
10522a84b8dSQuaker Fang struct	rx_iq_cal {
10622a84b8dSQuaker Fang 	int16_t	ars;
10722a84b8dSQuaker Fang 	int16_t	arc;
10822a84b8dSQuaker Fang };
10922a84b8dSQuaker Fang 
11022a84b8dSQuaker Fang struct	iwp_eep_calibration {
11122a84b8dSQuaker Fang 	struct	tx_pow_calib_hdr tx_pow_calib_hdr;
11222a84b8dSQuaker Fang 	struct	iwp_eep_txpower_cal txpow_group
11322a84b8dSQuaker Fang 		[EEP_TX_POWER_TX_CHAINS][EEP_CAL_CHANNEL_GROUP];
11422a84b8dSQuaker Fang 	uint16_t	xtal_calib[2];
11522a84b8dSQuaker Fang 	int16_t		temp_calib_temp;
11622a84b8dSQuaker Fang 	int16_t		temp_calib_volt;
11722a84b8dSQuaker Fang 	uint8_t		rx_iBB_filter;
11822a84b8dSQuaker Fang 	uint8_t		reserved;
11922a84b8dSQuaker Fang 	struct	rx_iq_cal rx_iq_cal
12022a84b8dSQuaker Fang 		[EEP_RXIQ_CAL_CHANNELS][EEP_RXIQ_DRIVER_MODES];
12122a84b8dSQuaker Fang };
12222a84b8dSQuaker Fang 
12322a84b8dSQuaker Fang #endif /* _IWP_CALIBRATION_H */
124