xref: /freebsd/sys/dev/iwm/if_iwm_config.h (revision 1809534a1aee5f09392d95f909a6d2355e6818d1)
16c2c3bd8SAdrian Chadd /*-
26c2c3bd8SAdrian Chadd  * Based on BSD-licensed source modules in the Linux iwlwifi driver,
36c2c3bd8SAdrian Chadd  * which were used as the reference documentation for this implementation.
46c2c3bd8SAdrian Chadd  *
56c2c3bd8SAdrian Chadd  ******************************************************************************
66c2c3bd8SAdrian Chadd  *
76c2c3bd8SAdrian Chadd  * This file is provided under a dual BSD/GPLv2 license.  When using or
86c2c3bd8SAdrian Chadd  * redistributing this file, you may do so under either license.
96c2c3bd8SAdrian Chadd  *
106c2c3bd8SAdrian Chadd  * GPL LICENSE SUMMARY
116c2c3bd8SAdrian Chadd  *
126c2c3bd8SAdrian Chadd  * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
136c2c3bd8SAdrian Chadd  * Copyright (C) 2016 Intel Deutschland GmbH
146c2c3bd8SAdrian Chadd  *
156c2c3bd8SAdrian Chadd  * This program is free software; you can redistribute it and/or modify
166c2c3bd8SAdrian Chadd  * it under the terms of version 2 of the GNU General Public License as
176c2c3bd8SAdrian Chadd  * published by the Free Software Foundation.
186c2c3bd8SAdrian Chadd  *
196c2c3bd8SAdrian Chadd  * This program is distributed in the hope that it will be useful, but
206c2c3bd8SAdrian Chadd  * WITHOUT ANY WARRANTY; without even the implied warranty of
216c2c3bd8SAdrian Chadd  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
226c2c3bd8SAdrian Chadd  * General Public License for more details.
236c2c3bd8SAdrian Chadd  *
246c2c3bd8SAdrian Chadd  * You should have received a copy of the GNU General Public License
256c2c3bd8SAdrian Chadd  * along with this program; if not, write to the Free Software
266c2c3bd8SAdrian Chadd  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
276c2c3bd8SAdrian Chadd  * USA
286c2c3bd8SAdrian Chadd  *
296c2c3bd8SAdrian Chadd  * The full GNU General Public License is included in this distribution
306c2c3bd8SAdrian Chadd  * in the file called COPYING.
316c2c3bd8SAdrian Chadd  *
326c2c3bd8SAdrian Chadd  * Contact Information:
336c2c3bd8SAdrian Chadd  *  Intel Linux Wireless <linuxwifi@intel.com>
346c2c3bd8SAdrian Chadd  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
356c2c3bd8SAdrian Chadd  *
366c2c3bd8SAdrian Chadd  * BSD LICENSE
376c2c3bd8SAdrian Chadd  *
386c2c3bd8SAdrian Chadd  * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
396c2c3bd8SAdrian Chadd  * Copyright (C) 2016 Intel Deutschland GmbH
406c2c3bd8SAdrian Chadd  * All rights reserved.
416c2c3bd8SAdrian Chadd  *
426c2c3bd8SAdrian Chadd  * Redistribution and use in source and binary forms, with or without
436c2c3bd8SAdrian Chadd  * modification, are permitted provided that the following conditions
446c2c3bd8SAdrian Chadd  * are met:
456c2c3bd8SAdrian Chadd  *
466c2c3bd8SAdrian Chadd  *  * Redistributions of source code must retain the above copyright
476c2c3bd8SAdrian Chadd  *    notice, this list of conditions and the following disclaimer.
486c2c3bd8SAdrian Chadd  *  * Redistributions in binary form must reproduce the above copyright
496c2c3bd8SAdrian Chadd  *    notice, this list of conditions and the following disclaimer in
506c2c3bd8SAdrian Chadd  *    the documentation and/or other materials provided with the
516c2c3bd8SAdrian Chadd  *    distribution.
526c2c3bd8SAdrian Chadd  *  * Neither the name Intel Corporation nor the names of its
536c2c3bd8SAdrian Chadd  *    contributors may be used to endorse or promote products derived
546c2c3bd8SAdrian Chadd  *    from this software without specific prior written permission.
556c2c3bd8SAdrian Chadd  *
566c2c3bd8SAdrian Chadd  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
576c2c3bd8SAdrian Chadd  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
586c2c3bd8SAdrian Chadd  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
596c2c3bd8SAdrian Chadd  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
606c2c3bd8SAdrian Chadd  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
616c2c3bd8SAdrian Chadd  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
626c2c3bd8SAdrian Chadd  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
636c2c3bd8SAdrian Chadd  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
646c2c3bd8SAdrian Chadd  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
656c2c3bd8SAdrian Chadd  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
666c2c3bd8SAdrian Chadd  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
676c2c3bd8SAdrian Chadd  *
686c2c3bd8SAdrian Chadd  *****************************************************************************/
696c2c3bd8SAdrian Chadd 
706c2c3bd8SAdrian Chadd /*
716c2c3bd8SAdrian Chadd  * $FreeBSD$
726c2c3bd8SAdrian Chadd  */
736c2c3bd8SAdrian Chadd 
746c2c3bd8SAdrian Chadd #ifndef __IWM_CONFIG_H__
756c2c3bd8SAdrian Chadd #define __IWM_CONFIG_H__
766c2c3bd8SAdrian Chadd 
776c2c3bd8SAdrian Chadd enum iwm_device_family {
786c2c3bd8SAdrian Chadd 	IWM_DEVICE_FAMILY_UNDEFINED,
796c2c3bd8SAdrian Chadd 	IWM_DEVICE_FAMILY_7000,
806c2c3bd8SAdrian Chadd 	IWM_DEVICE_FAMILY_8000,
813bf2d5ddSMark Johnston 	IWM_DEVICE_FAMILY_9000,
826c2c3bd8SAdrian Chadd };
836c2c3bd8SAdrian Chadd 
84ef217a34SKyle Evans #define IWM_DEFAULT_MAX_TX_POWER	22
85ef217a34SKyle Evans 
866c2c3bd8SAdrian Chadd /* Antenna presence definitions */
876c2c3bd8SAdrian Chadd #define	IWM_ANT_NONE	0x0
886c2c3bd8SAdrian Chadd #define	IWM_ANT_A	(1 << 0)
896c2c3bd8SAdrian Chadd #define	IWM_ANT_B	(1 << 1)
906c2c3bd8SAdrian Chadd #define IWM_ANT_C	(1 << 2)
916c2c3bd8SAdrian Chadd #define	IWM_ANT_AB	(IWM_ANT_A | IWM_ANT_B)
926c2c3bd8SAdrian Chadd #define	IWM_ANT_AC	(IWM_ANT_A | IWM_ANT_C)
936c2c3bd8SAdrian Chadd #define IWM_ANT_BC	(IWM_ANT_B | IWM_ANT_C)
946c2c3bd8SAdrian Chadd #define IWM_ANT_ABC	(IWM_ANT_A | IWM_ANT_B | IWM_ANT_C)
956c2c3bd8SAdrian Chadd 
966c2c3bd8SAdrian Chadd static inline uint8_t num_of_ant(uint8_t mask)
976c2c3bd8SAdrian Chadd {
986c2c3bd8SAdrian Chadd 	return  !!((mask) & IWM_ANT_A) +
996c2c3bd8SAdrian Chadd 		!!((mask) & IWM_ANT_B) +
1006c2c3bd8SAdrian Chadd 		!!((mask) & IWM_ANT_C);
1016c2c3bd8SAdrian Chadd }
1026c2c3bd8SAdrian Chadd 
1036c2c3bd8SAdrian Chadd /* lower blocks contain EEPROM image and calibration data */
1046c2c3bd8SAdrian Chadd #define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000	(16 * 512 * sizeof(uint16_t)) /* 16 KB */
1056c2c3bd8SAdrian Chadd #define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000	(32 * 512 * sizeof(uint16_t)) /* 32 KB */
1066c2c3bd8SAdrian Chadd #define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_9000	IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000
1076c2c3bd8SAdrian Chadd 
10858952690SAndriy Voskoboinyk 
10958952690SAndriy Voskoboinyk /**
11058952690SAndriy Voskoboinyk  * enum iwl_nvm_type - nvm formats
11158952690SAndriy Voskoboinyk  * @IWM_NVM: the regular format
11258952690SAndriy Voskoboinyk  * @IWM_NVM_EXT: extended NVM format
11358952690SAndriy Voskoboinyk  * @IWM_NVM_SDP: NVM format used by 3168 series
11458952690SAndriy Voskoboinyk  */
11558952690SAndriy Voskoboinyk enum iwm_nvm_type {
11658952690SAndriy Voskoboinyk 	IWM_NVM,
11758952690SAndriy Voskoboinyk 	IWM_NVM_EXT,
11858952690SAndriy Voskoboinyk 	IWM_NVM_SDP,
11958952690SAndriy Voskoboinyk };
12058952690SAndriy Voskoboinyk 
1216c2c3bd8SAdrian Chadd /**
1226c2c3bd8SAdrian Chadd  * struct iwm_cfg
1236c2c3bd8SAdrian Chadd  * @name: Official name of the device
1246c2c3bd8SAdrian Chadd  * @fw_name: Firmware filename.
1256c2c3bd8SAdrian Chadd  * @host_interrupt_operation_mode: device needs host interrupt operation
1266c2c3bd8SAdrian Chadd  *      mode set
1276c2c3bd8SAdrian Chadd  * @nvm_hw_section_num: the ID of the HW NVM section
1286c2c3bd8SAdrian Chadd  * @apmg_wake_up_wa: should the MAC access REQ be asserted when a command
1296c2c3bd8SAdrian Chadd  *      is in flight. This is due to a HW bug in 7260, 3160 and 7265.
13058952690SAndriy Voskoboinyk  * @nvm_type: see &enum iwl_nvm_type
1316c2c3bd8SAdrian Chadd  */
1326c2c3bd8SAdrian Chadd struct iwm_cfg {
1336c2c3bd8SAdrian Chadd 	const char *name;
1346c2c3bd8SAdrian Chadd 	const char *fw_name;
1356c2c3bd8SAdrian Chadd 	uint16_t eeprom_size;
1366c2c3bd8SAdrian Chadd 	enum iwm_device_family device_family;
1376c2c3bd8SAdrian Chadd 	int host_interrupt_operation_mode;
138*1809534aSMark Johnston 	int mqrx_supported;
139*1809534aSMark Johnston 	int integrated;
1406c2c3bd8SAdrian Chadd 	uint8_t nvm_hw_section_num;
1416c2c3bd8SAdrian Chadd 	int apmg_wake_up_wa;
14258952690SAndriy Voskoboinyk 	enum iwm_nvm_type nvm_type;
1436c2c3bd8SAdrian Chadd };
1446c2c3bd8SAdrian Chadd 
1456c2c3bd8SAdrian Chadd /*
1466c2c3bd8SAdrian Chadd  * This list declares the config structures for all devices.
1476c2c3bd8SAdrian Chadd  */
1486c2c3bd8SAdrian Chadd extern const struct iwm_cfg iwm7260_cfg;
1496c2c3bd8SAdrian Chadd extern const struct iwm_cfg iwm3160_cfg;
1506c2c3bd8SAdrian Chadd extern const struct iwm_cfg iwm3165_cfg;
1516472fa9aSEitan Adler extern const struct iwm_cfg iwm3168_cfg;
1526c2c3bd8SAdrian Chadd extern const struct iwm_cfg iwm7265_cfg;
1536c2c3bd8SAdrian Chadd extern const struct iwm_cfg iwm7265d_cfg;
1546c2c3bd8SAdrian Chadd extern const struct iwm_cfg iwm8260_cfg;
155851ca706SGeorge V. Neville-Neil extern const struct iwm_cfg iwm8265_cfg;
1565b3b7a2dSMark Johnston extern const struct iwm_cfg iwm9560_cfg;
1575b3b7a2dSMark Johnston extern const struct iwm_cfg iwm9260_cfg;
1586c2c3bd8SAdrian Chadd 
1596c2c3bd8SAdrian Chadd #endif /* __IWM_CONFIG_H__ */
160