127d11320SImre Vadász /*-
227d11320SImre Vadász * Based on BSD-licensed source modules in the Linux iwlwifi driver,
327d11320SImre Vadász * which were used as the reference documentation for this implementation.
427d11320SImre Vadász *
527d11320SImre Vadász ******************************************************************************
627d11320SImre Vadász *
727d11320SImre Vadász * This file is provided under a dual BSD/GPLv2 license. When using or
827d11320SImre Vadász * redistributing this file, you may do so under either license.
927d11320SImre Vadász *
1027d11320SImre Vadász * GPL LICENSE SUMMARY
1127d11320SImre Vadász *
1227d11320SImre Vadász * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
1327d11320SImre Vadász * Copyright (C) 2016 Intel Deutschland GmbH
1427d11320SImre Vadász *
1527d11320SImre Vadász * This program is free software; you can redistribute it and/or modify
1627d11320SImre Vadász * it under the terms of version 2 of the GNU General Public License as
1727d11320SImre Vadász * published by the Free Software Foundation.
1827d11320SImre Vadász *
1927d11320SImre Vadász * This program is distributed in the hope that it will be useful, but
2027d11320SImre Vadász * WITHOUT ANY WARRANTY; without even the implied warranty of
2127d11320SImre Vadász * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2227d11320SImre Vadász * General Public License for more details.
2327d11320SImre Vadász *
2427d11320SImre Vadász * You should have received a copy of the GNU General Public License
2527d11320SImre Vadász * along with this program; if not, write to the Free Software
2627d11320SImre Vadász * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
2727d11320SImre Vadász * USA
2827d11320SImre Vadász *
2927d11320SImre Vadász * The full GNU General Public License is included in this distribution
3027d11320SImre Vadász * in the file called COPYING.
3127d11320SImre Vadász *
3227d11320SImre Vadász * Contact Information:
3327d11320SImre Vadász * Intel Linux Wireless <linuxwifi@intel.com>
3427d11320SImre Vadász * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
3527d11320SImre Vadász *
3627d11320SImre Vadász * BSD LICENSE
3727d11320SImre Vadász *
3827d11320SImre Vadász * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
3927d11320SImre Vadász * Copyright (C) 2016 Intel Deutschland GmbH
4027d11320SImre Vadász * All rights reserved.
4127d11320SImre Vadász *
4227d11320SImre Vadász * Redistribution and use in source and binary forms, with or without
4327d11320SImre Vadász * modification, are permitted provided that the following conditions
4427d11320SImre Vadász * are met:
4527d11320SImre Vadász *
4627d11320SImre Vadász * * Redistributions of source code must retain the above copyright
4727d11320SImre Vadász * notice, this list of conditions and the following disclaimer.
4827d11320SImre Vadász * * Redistributions in binary form must reproduce the above copyright
4927d11320SImre Vadász * notice, this list of conditions and the following disclaimer in
5027d11320SImre Vadász * the documentation and/or other materials provided with the
5127d11320SImre Vadász * distribution.
5227d11320SImre Vadász * * Neither the name Intel Corporation nor the names of its
5327d11320SImre Vadász * contributors may be used to endorse or promote products derived
5427d11320SImre Vadász * from this software without specific prior written permission.
5527d11320SImre Vadász *
5627d11320SImre Vadász * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5727d11320SImre Vadász * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5827d11320SImre Vadász * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
5927d11320SImre Vadász * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
6027d11320SImre Vadász * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
6127d11320SImre Vadász * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
6227d11320SImre Vadász * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
6327d11320SImre Vadász * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
6427d11320SImre Vadász * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6527d11320SImre Vadász * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
6627d11320SImre Vadász * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6727d11320SImre Vadász *
6827d11320SImre Vadász *****************************************************************************/
69*6acbba79SMatthew Dillon
70*6acbba79SMatthew Dillon /*
71*6acbba79SMatthew Dillon */
72*6acbba79SMatthew Dillon
7327d11320SImre Vadász #ifndef __IWM_CONFIG_H__
7427d11320SImre Vadász #define __IWM_CONFIG_H__
7527d11320SImre Vadász
7627d11320SImre Vadász enum iwm_device_family {
7727d11320SImre Vadász IWM_DEVICE_FAMILY_UNDEFINED,
7827d11320SImre Vadász IWM_DEVICE_FAMILY_7000,
7927d11320SImre Vadász IWM_DEVICE_FAMILY_8000,
80*6acbba79SMatthew Dillon IWM_DEVICE_FAMILY_9000,
8127d11320SImre Vadász };
8227d11320SImre Vadász
83fd4f9de8SImre Vadász #define IWM_DEFAULT_MAX_TX_POWER 22
84fd4f9de8SImre Vadász
8527d11320SImre Vadász /* Antenna presence definitions */
8627d11320SImre Vadász #define IWM_ANT_NONE 0x0
8727d11320SImre Vadász #define IWM_ANT_A (1 << 0)
8827d11320SImre Vadász #define IWM_ANT_B (1 << 1)
8927d11320SImre Vadász #define IWM_ANT_C (1 << 2)
9027d11320SImre Vadász #define IWM_ANT_AB (IWM_ANT_A | IWM_ANT_B)
9127d11320SImre Vadász #define IWM_ANT_AC (IWM_ANT_A | IWM_ANT_C)
9227d11320SImre Vadász #define IWM_ANT_BC (IWM_ANT_B | IWM_ANT_C)
9327d11320SImre Vadász #define IWM_ANT_ABC (IWM_ANT_A | IWM_ANT_B | IWM_ANT_C)
9427d11320SImre Vadász
num_of_ant(uint8_t mask)9527d11320SImre Vadász static inline uint8_t num_of_ant(uint8_t mask)
9627d11320SImre Vadász {
9727d11320SImre Vadász return !!((mask) & IWM_ANT_A) +
9827d11320SImre Vadász !!((mask) & IWM_ANT_B) +
9927d11320SImre Vadász !!((mask) & IWM_ANT_C);
10027d11320SImre Vadász }
10127d11320SImre Vadász
10227d11320SImre Vadász /* lower blocks contain EEPROM image and calibration data */
10327d11320SImre Vadász #define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(uint16_t)) /* 16 KB */
10427d11320SImre Vadász #define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) /* 32 KB */
10527d11320SImre Vadász #define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_9000 IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000
10627d11320SImre Vadász
107*6acbba79SMatthew Dillon
108*6acbba79SMatthew Dillon /**
109*6acbba79SMatthew Dillon * enum iwl_nvm_type - nvm formats
110*6acbba79SMatthew Dillon * @IWM_NVM: the regular format
111*6acbba79SMatthew Dillon * @IWM_NVM_EXT: extended NVM format
112*6acbba79SMatthew Dillon * @IWM_NVM_SDP: NVM format used by 3168 series
113*6acbba79SMatthew Dillon */
114*6acbba79SMatthew Dillon enum iwm_nvm_type {
115*6acbba79SMatthew Dillon IWM_NVM,
116*6acbba79SMatthew Dillon IWM_NVM_EXT,
117*6acbba79SMatthew Dillon IWM_NVM_SDP,
118*6acbba79SMatthew Dillon };
119*6acbba79SMatthew Dillon
12027d11320SImre Vadász /**
12127d11320SImre Vadász * struct iwm_cfg
12227d11320SImre Vadász * @name: Official name of the device
12327d11320SImre Vadász * @fw_name: Firmware filename.
12427d11320SImre Vadász * @host_interrupt_operation_mode: device needs host interrupt operation
12527d11320SImre Vadász * mode set
12627d11320SImre Vadász * @nvm_hw_section_num: the ID of the HW NVM section
12727d11320SImre Vadász * @apmg_wake_up_wa: should the MAC access REQ be asserted when a command
12827d11320SImre Vadász * is in flight. This is due to a HW bug in 7260, 3160 and 7265.
129*6acbba79SMatthew Dillon * @nvm_type: see &enum iwl_nvm_type
13027d11320SImre Vadász */
13127d11320SImre Vadász struct iwm_cfg {
13227d11320SImre Vadász const char *name;
13327d11320SImre Vadász const char *fw_name;
13427d11320SImre Vadász uint16_t eeprom_size;
13527d11320SImre Vadász enum iwm_device_family device_family;
13627d11320SImre Vadász int host_interrupt_operation_mode;
137*6acbba79SMatthew Dillon int mqrx_supported;
138*6acbba79SMatthew Dillon int integrated;
13927d11320SImre Vadász uint8_t nvm_hw_section_num;
14027d11320SImre Vadász int apmg_wake_up_wa;
141*6acbba79SMatthew Dillon enum iwm_nvm_type nvm_type;
14227d11320SImre Vadász };
14327d11320SImre Vadász
14427d11320SImre Vadász /*
14527d11320SImre Vadász * This list declares the config structures for all devices.
14627d11320SImre Vadász */
14727d11320SImre Vadász extern const struct iwm_cfg iwm7260_cfg;
14827d11320SImre Vadász extern const struct iwm_cfg iwm3160_cfg;
14927d11320SImre Vadász extern const struct iwm_cfg iwm3165_cfg;
1500ce37bc4SImre Vadász extern const struct iwm_cfg iwm3168_cfg;
15127d11320SImre Vadász extern const struct iwm_cfg iwm7265_cfg;
15227d11320SImre Vadász extern const struct iwm_cfg iwm7265d_cfg;
15327d11320SImre Vadász extern const struct iwm_cfg iwm8260_cfg;
1540ce37bc4SImre Vadász extern const struct iwm_cfg iwm8265_cfg;
155*6acbba79SMatthew Dillon extern const struct iwm_cfg iwm9560_cfg;
156*6acbba79SMatthew Dillon extern const struct iwm_cfg iwm9260_cfg;
15727d11320SImre Vadász
15827d11320SImre Vadász #endif /* __IWM_CONFIG_H__ */
159