blob: 6e21ceee76a62e072218ccbea9c0ce980150d126 [file] [log] [blame]
Luciano Coelhof5fc0f82009-08-06 16:25:28 +03001/*
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
29int wl1271_hw_init_power_auth(struct wl1271 *wl);
30int 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
36struct 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
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030051struct wl1271_radio_parms {
52 u8 id;
53 u8 padding[3];
54
55 /* Static radio parameters */
56 /* 2.4GHz */
57 u8 rx_trace_loss;
58 u8 tx_trace_loss;
Juuso Oikarinen47fab7d2009-10-13 12:47:43 +030059 s8 rx_rssi_and_proc_compens[CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030060
61 /* 5GHz */
Juuso Oikarinen47fab7d2009-10-13 12:47:43 +030062 u8 rx_trace_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
63 u8 tx_trace_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
64 s8 rx_rssi_and_proc_compens_5[CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030065
66 /* Dynamic radio parameters */
67 /* 2.4GHz */
Luciano Coelhod0f63b22009-10-15 10:33:29 +030068 __le16 tx_ref_pd_voltage;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030069 s8 tx_ref_power;
70 s8 tx_offset_db;
71
Juuso Oikarinen47fab7d2009-10-13 12:47:43 +030072 s8 tx_rate_limits_normal[CONF_NUMBER_OF_RATE_GROUPS];
73 s8 tx_rate_limits_degraded[CONF_NUMBER_OF_RATE_GROUPS];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030074
Juuso Oikarinen47fab7d2009-10-13 12:47:43 +030075 s8 tx_channel_limits_11b[CONF_NUMBER_OF_CHANNELS_2_4];
76 s8 tx_channel_limits_ofdm[CONF_NUMBER_OF_CHANNELS_2_4];
77 s8 tx_pdv_rate_offsets[CONF_NUMBER_OF_RATE_GROUPS];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030078
Juuso Oikarinen47fab7d2009-10-13 12:47:43 +030079 u8 tx_ibias[CONF_NUMBER_OF_RATE_GROUPS];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030080 u8 rx_fem_insertion_loss;
81
82 u8 padding2;
83
84 /* 5GHz */
Luciano Coelhod0f63b22009-10-15 10:33:29 +030085 __le16 tx_ref_pd_voltage_5[CONF_NUMBER_OF_SUB_BANDS_5];
Juuso Oikarinen47fab7d2009-10-13 12:47:43 +030086 s8 tx_ref_power_5[CONF_NUMBER_OF_SUB_BANDS_5];
87 s8 tx_offset_db_5[CONF_NUMBER_OF_SUB_BANDS_5];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030088
Juuso Oikarinen47fab7d2009-10-13 12:47:43 +030089 s8 tx_rate_limits_normal_5[CONF_NUMBER_OF_RATE_GROUPS];
90 s8 tx_rate_limits_degraded_5[CONF_NUMBER_OF_RATE_GROUPS];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030091
Juuso Oikarinen47fab7d2009-10-13 12:47:43 +030092 s8 tx_channel_limits_ofdm_5[CONF_NUMBER_OF_CHANNELS_5];
93 s8 tx_pdv_rate_offsets_5[CONF_NUMBER_OF_RATE_GROUPS];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030094
95 /* FIXME: this is inconsistent with the types for 2.4GHz */
Juuso Oikarinen47fab7d2009-10-13 12:47:43 +030096 s8 tx_ibias_5[CONF_NUMBER_OF_RATE_GROUPS];
97 s8 rx_fem_insertion_loss_5[CONF_NUMBER_OF_SUB_BANDS_5];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030098
99 u8 padding3[2];
100} __attribute__ ((packed));
101
102#endif