if_iwm - Add basic powermanagement support via ifconfig wlan0 powersave.
[dragonfly.git] / sys / dev / netif / iwm / if_iwm_constants.h
1 /*-
2  * Based on BSD-licensed source modules in the Linux iwlwifi driver,
3  * which were used as the reference documentation for this implementation.
4  *
5  ******************************************************************************
6  *
7  * This file is provided under a dual BSD/GPLv2 license.  When using or
8  * redistributing this file, you may do so under either license.
9  *
10  * GPL LICENSE SUMMARY
11  *
12  * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved.
13  * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
14  * Copyright(c) 2015        Intel Deutschland GmbH
15  *
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of version 2 of the GNU General Public License as
18  * published by the Free Software Foundation.
19  *
20  * This program is distributed in the hope that it will be useful, but
21  * WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23  * General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
28  * USA
29  *
30  * The full GNU General Public License is included in this distribution
31  * in the file called COPYING.
32  *
33  * Contact Information:
34  *  Intel Linux Wireless <linuxwifi@intel.com>
35  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
36  *
37  * BSD LICENSE
38  *
39  * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved.
40  * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
41  * Copyright(c) 2015        Intel Deutschland GmbH
42  * All rights reserved.
43  *
44  * Redistribution and use in source and binary forms, with or without
45  * modification, are permitted provided that the following conditions
46  * are met:
47  *
48  *  * Redistributions of source code must retain the above copyright
49  *    notice, this list of conditions and the following disclaimer.
50  *  * Redistributions in binary form must reproduce the above copyright
51  *    notice, this list of conditions and the following disclaimer in
52  *    the documentation and/or other materials provided with the
53  *    distribution.
54  *  * Neither the name Intel Corporation nor the names of its
55  *    contributors may be used to endorse or promote products derived
56  *    from this software without specific prior written permission.
57  *
58  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
59  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
60  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
61  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
62  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
63  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
64  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
65  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
66  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
67  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
68  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
69  *
70  *****************************************************************************/
71 #ifndef __IF_IWM_CONSTANTS_H
72 #define __IF_IWM_CONSTANTS_H
73
74 /* <netproto/802_11/ieee80211_var.h> */
75
76 #define IWM_MVM_DEFAULT_PS_TX_DATA_TIMEOUT      (100 * 1000)
77 #define IWM_MVM_DEFAULT_PS_RX_DATA_TIMEOUT      (100 * 1000)
78 #define IWM_MVM_WOWLAN_PS_TX_DATA_TIMEOUT       (10 * 1000)
79 #define IWM_MVM_WOWLAN_PS_RX_DATA_TIMEOUT       (10 * 1000)
80 #define IWM_MVM_SHORT_PS_TX_DATA_TIMEOUT        (2 * 1024) /* defined in TU */
81 #define IWM_MVM_SHORT_PS_RX_DATA_TIMEOUT        (40 * 1024) /* defined in TU */
82 #define IWM_MVM_P2P_LOWLATENCY_PS_ENABLE        0
83 #define IWM_MVM_UAPSD_RX_DATA_TIMEOUT           (50 * 1000)
84 #define IWM_MVM_UAPSD_TX_DATA_TIMEOUT           (50 * 1000)
85 #ifdef notyet
86 /* XXX Find corresponding values from net80211 */
87 #define IWM_MVM_UAPSD_QUEUES            (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\
88                                          IEEE80211_WMM_IE_STA_QOSINFO_AC_VI |\
89                                          IEEE80211_WMM_IE_STA_QOSINFO_AC_BK |\
90                                          IEEE80211_WMM_IE_STA_QOSINFO_AC_BE)
91 #endif
92 #define IWM_MVM_PS_HEAVY_TX_THLD_PACKETS        20
93 #define IWM_MVM_PS_HEAVY_RX_THLD_PACKETS        8
94 #define IWM_MVM_PS_SNOOZE_HEAVY_TX_THLD_PACKETS 30
95 #define IWM_MVM_PS_SNOOZE_HEAVY_RX_THLD_PACKETS 20
96 #define IWM_MVM_PS_HEAVY_TX_THLD_PERCENT        50
97 #define IWM_MVM_PS_HEAVY_RX_THLD_PERCENT        50
98 #define IWM_MVM_PS_SNOOZE_INTERVAL              25
99 #define IWM_MVM_PS_SNOOZE_WINDOW                50
100 #define IWM_MVM_WOWLAN_PS_SNOOZE_WINDOW         25
101 #define IWM_MVM_LOWLAT_QUOTA_MIN_PERCENT        64
102 #define IWM_MVM_BT_COEX_EN_RED_TXP_THRESH       62
103 #define IWM_MVM_BT_COEX_DIS_RED_TXP_THRESH      65
104 #define IWM_MVM_BT_COEX_SYNC2SCO                1
105 #define IWM_MVM_BT_COEX_CORUNNING               0
106 #define IWM_MVM_BT_COEX_MPLUT                   1
107 #define IWM_MVM_BT_COEX_RRC                     1
108 #define IWM_MVM_BT_COEX_TTC                     1
109 #define IWM_MVM_BT_COEX_MPLUT_REG0              0x22002200
110 #define IWM_MVM_BT_COEX_MPLUT_REG1              0x11118451
111 #define IWM_MVM_BT_COEX_ANTENNA_COUPLING_THRS   30
112 #define IWM_MVM_FW_MCAST_FILTER_PASS_ALL        0
113 #define IWM_MVM_FW_BCAST_FILTER_PASS_ALL        0
114 #define IWM_MVM_QUOTA_THRESHOLD                 4
115 #define IWM_MVM_RS_RSSI_BASED_INIT_RATE         0
116 #define IWM_MVM_RS_80_20_FAR_RANGE_TWEAK        1
117 #define IWM_MVM_TOF_IS_RESPONDER                0
118 #define IWM_MVM_SW_TX_CSUM_OFFLOAD              0
119 #define IWM_MVM_HW_CSUM_DISABLE                 0
120 #define IWM_MVM_COLLECT_FW_ERR_DUMP             1
121 #define IWM_MVM_RS_NUM_TRY_BEFORE_ANT_TOGGLE    1
122 #define IWM_MVM_RS_HT_VHT_RETRIES_PER_RATE      2
123 #define IWM_MVM_RS_HT_VHT_RETRIES_PER_RATE_TW   1
124 #define IWM_MVM_RS_INITIAL_MIMO_NUM_RATES       3
125 #define IWM_MVM_RS_INITIAL_SISO_NUM_RATES       3
126 #define IWM_MVM_RS_INITIAL_LEGACY_NUM_RATES     2
127 #define IWM_MVM_RS_INITIAL_LEGACY_RETRIES       2
128 #define IWM_MVM_RS_SECONDARY_LEGACY_RETRIES     1
129 #define IWM_MVM_RS_SECONDARY_LEGACY_NUM_RATES   16
130 #define IWM_MVM_RS_SECONDARY_SISO_NUM_RATES     3
131 #define IWM_MVM_RS_SECONDARY_SISO_RETRIES       1
132 #define IWM_MVM_RS_RATE_MIN_FAILURE_TH          3
133 #define IWM_MVM_RS_RATE_MIN_SUCCESS_TH          8
134 #define IWM_MVM_RS_STAY_IN_COLUMN_TIMEOUT       5       /* Seconds */
135 #define IWM_MVM_RS_IDLE_TIMEOUT                 5       /* Seconds */
136 #define IWM_MVM_RS_MISSED_RATE_MAX              15
137 #define IWM_MVM_RS_LEGACY_FAILURE_LIMIT         160
138 #define IWM_MVM_RS_LEGACY_SUCCESS_LIMIT         480
139 #define IWM_MVM_RS_LEGACY_TABLE_COUNT           160
140 #define IWM_MVM_RS_NON_LEGACY_FAILURE_LIMIT     400
141 #define IWM_MVM_RS_NON_LEGACY_SUCCESS_LIMIT     4500
142 #define IWM_MVM_RS_NON_LEGACY_TABLE_COUNT       1500
143 #define IWM_MVM_RS_SR_FORCE_DECREASE            15      /* percent */
144 #define IWM_MVM_RS_SR_NO_DECREASE               85      /* percent */
145 #define IWM_MVM_RS_AGG_TIME_LIMIT               4000    /* 4 msecs. valid 100-8000 */
146 #define IWM_MVM_RS_AGG_DISABLE_START            3
147 #define IWM_MVM_RS_TPC_SR_FORCE_INCREASE        75      /* percent */
148 #define IWM_MVM_RS_TPC_SR_NO_INCREASE           85      /* percent */
149 #define IWM_MVM_RS_TPC_TX_POWER_STEP            3
150
151 #endif /* __IF_IWM_CONSTANTS_H */