Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[pandora-kernel.git] / drivers / net / wireless / wl12xx / wl1271_init.h
1 /*
2  * This file is part of wl1271
3  *
4  * Copyright (C) 2009 Nokia Corporation
5  *
6  * Contact: Luciano Coelho <luciano.coelho@nokia.com>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * version 2 as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA
21  *
22  */
23
24 #ifndef __WL1271_INIT_H__
25 #define __WL1271_INIT_H__
26
27 #include "wl1271.h"
28
29 int wl1271_hw_init_power_auth(struct wl1271 *wl);
30 int wl1271_hw_init(struct wl1271 *wl);
31
32 /* These are not really a TEST_CMD, but the ref driver uses them as such */
33 #define TEST_CMD_INI_FILE_RADIO_PARAM   0x19
34 #define TEST_CMD_INI_FILE_GENERAL_PARAM 0x1E
35
36 struct wl1271_general_parms {
37         u8 id;
38         u8 padding[3];
39
40         u8 ref_clk;
41         u8 settling_time;
42         u8 clk_valid_on_wakeup;
43         u8 dc2dcmode;
44         u8 single_dual_band;
45
46         u8 tx_bip_fem_autodetect;
47         u8 tx_bip_fem_manufacturer;
48         u8 settings;
49 } __attribute__ ((packed));
50
51 enum ref_clk_enum {
52         REF_CLK_19_2_E,
53         REF_CLK_26_E,
54         REF_CLK_38_4_E,
55         REF_CLK_52_E
56 };
57
58 #define RSSI_AND_PROCESS_COMPENSATION_SIZE 15
59 #define NUMBER_OF_SUB_BANDS_5  7
60 #define NUMBER_OF_RATE_GROUPS  6
61 #define NUMBER_OF_CHANNELS_2_4 14
62 #define NUMBER_OF_CHANNELS_5   35
63
64 struct wl1271_radio_parms {
65         u8 id;
66         u8 padding[3];
67
68         /* Static radio parameters */
69         /* 2.4GHz */
70         u8 rx_trace_loss;
71         u8 tx_trace_loss;
72         s8 rx_rssi_and_proc_compens[RSSI_AND_PROCESS_COMPENSATION_SIZE];
73
74         /* 5GHz */
75         u8 rx_trace_loss_5[NUMBER_OF_SUB_BANDS_5];
76         u8 tx_trace_loss_5[NUMBER_OF_SUB_BANDS_5];
77         s8 rx_rssi_and_proc_compens_5[RSSI_AND_PROCESS_COMPENSATION_SIZE];
78
79         /* Dynamic radio parameters */
80         /* 2.4GHz */
81         s16 tx_ref_pd_voltage;
82         s8  tx_ref_power;
83         s8  tx_offset_db;
84
85         s8  tx_rate_limits_normal[NUMBER_OF_RATE_GROUPS];
86         s8  tx_rate_limits_degraded[NUMBER_OF_RATE_GROUPS];
87
88         s8  tx_channel_limits_11b[NUMBER_OF_CHANNELS_2_4];
89         s8  tx_channel_limits_ofdm[NUMBER_OF_CHANNELS_2_4];
90         s8  tx_pdv_rate_offsets[NUMBER_OF_RATE_GROUPS];
91
92         u8  tx_ibias[NUMBER_OF_RATE_GROUPS];
93         u8  rx_fem_insertion_loss;
94
95         u8 padding2;
96
97         /* 5GHz */
98         s16 tx_ref_pd_voltage_5[NUMBER_OF_SUB_BANDS_5];
99         s8  tx_ref_power_5[NUMBER_OF_SUB_BANDS_5];
100         s8  tx_offset_db_5[NUMBER_OF_SUB_BANDS_5];
101
102         s8  tx_rate_limits_normal_5[NUMBER_OF_RATE_GROUPS];
103         s8  tx_rate_limits_degraded_5[NUMBER_OF_RATE_GROUPS];
104
105         s8  tx_channel_limits_ofdm_5[NUMBER_OF_CHANNELS_5];
106         s8  tx_pdv_rate_offsets_5[NUMBER_OF_RATE_GROUPS];
107
108         /* FIXME: this is inconsistent with the types for 2.4GHz */
109         s8  tx_ibias_5[NUMBER_OF_RATE_GROUPS];
110         s8  rx_fem_insertion_loss_5[NUMBER_OF_SUB_BANDS_5];
111
112         u8 padding3[2];
113 } __attribute__ ((packed));
114
115 #endif