Skip to content

Commit

Permalink
wl1271: Add structure for firmware configuration values
Browse files Browse the repository at this point in the history
In order to make the firmware configuration more manageable, collect
hardcoded configuration values into one data structure, and set default values
there.

Add the SoftGemini BT/WLAN coex paramters into the config structure.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Juuso Oikarinen authored and John W. Linville committed Oct 27, 2009
1 parent 2cc8d4d commit 2b60100
Show file tree
Hide file tree
Showing 8 changed files with 274 additions and 224 deletions.
5 changes: 5 additions & 0 deletions drivers/net/wireless/wl12xx/wl1271.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include <linux/bitops.h>
#include <net/mac80211.h>

#include "wl1271_conf.h"

#define DRIVER_NAME "wl1271"
#define DRIVER_PREFIX DRIVER_NAME ": "

Expand Down Expand Up @@ -420,6 +422,9 @@ struct wl1271 {

/* Used for a workaround to send disconnect before rejoining */
bool joined;

/* Current chipset configuration */
struct conf_drv_settings conf;
};

int wl1271_plt_start(struct wl1271 *wl);
Expand Down
40 changes: 12 additions & 28 deletions drivers/net/wireless/wl12xx/wl1271_acx.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ int wl1271_acx_sg_enable(struct wl1271 *wl)
int wl1271_acx_sg_cfg(struct wl1271 *wl)
{
struct acx_bt_wlan_coex_param *param;
struct conf_sg_settings *c = &wl->conf.sg;
int ret;

wl1271_debug(DEBUG_ACX, "acx sg cfg");
Expand All @@ -520,34 +521,17 @@ int wl1271_acx_sg_cfg(struct wl1271 *wl)
}

/* BT-WLAN coext parameters */
param->min_rate = RATE_INDEX_24MBPS;
param->bt_hp_max_time = PTA_BT_HP_MAXTIME_DEF;
param->wlan_hp_max_time = PTA_WLAN_HP_MAX_TIME_DEF;
param->sense_disable_timer = PTA_SENSE_DISABLE_TIMER_DEF;
param->rx_time_bt_hp = PTA_PROTECTIVE_RX_TIME_DEF;
param->tx_time_bt_hp = PTA_PROTECTIVE_TX_TIME_DEF;
param->rx_time_bt_hp_fast = PTA_PROTECTIVE_RX_TIME_FAST_DEF;
param->tx_time_bt_hp_fast = PTA_PROTECTIVE_TX_TIME_FAST_DEF;
param->wlan_cycle_fast = PTA_CYCLE_TIME_FAST_DEF;
param->bt_anti_starvation_period = PTA_ANTI_STARVE_PERIOD_DEF;
param->next_bt_lp_packet = PTA_TIMEOUT_NEXT_BT_LP_PACKET_DEF;
param->wake_up_beacon = PTA_TIME_BEFORE_BEACON_DEF;
param->hp_dm_max_guard_time = PTA_HPDM_MAX_TIME_DEF;
param->next_wlan_packet = PTA_TIME_OUT_NEXT_WLAN_DEF;
param->antenna_type = PTA_ANTENNA_TYPE_DEF;
param->signal_type = PTA_SIGNALING_TYPE_DEF;
param->afh_leverage_on = PTA_AFH_LEVERAGE_ON_DEF;
param->quiet_cycle_num = PTA_NUMBER_QUIET_CYCLE_DEF;
param->max_cts = PTA_MAX_NUM_CTS_DEF;
param->wlan_packets_num = PTA_NUMBER_OF_WLAN_PACKETS_DEF;
param->bt_packets_num = PTA_NUMBER_OF_BT_PACKETS_DEF;
param->missed_rx_avalanche = PTA_RX_FOR_AVALANCHE_DEF;
param->wlan_elp_hp = PTA_ELP_HP_DEF;
param->bt_anti_starvation_cycles = PTA_ANTI_STARVE_NUM_CYCLE_DEF;
param->ack_mode_dual_ant = PTA_ACK_MODE_DEF;
param->pa_sd_enable = PTA_ALLOW_PA_SD_DEF;
param->pta_auto_mode_enable = PTA_AUTO_MODE_NO_CTS_DEF;
param->bt_hp_respected_num = PTA_BT_HP_RESPECTED_DEF;
param->per_threshold = c->per_threshold;
param->max_scan_compensation_time = c->max_scan_compensation_time;
param->nfs_sample_interval = c->nfs_sample_interval;
param->load_ratio = c->load_ratio;
param->auto_ps_mode = c->auto_ps_mode;
param->probe_req_compensation = c->probe_req_compensation;
param->scan_window_compensation = c->scan_window_compensation;
param->antenna_config = c->antenna_config;
param->beacon_miss_threshold = c->beacon_miss_threshold;
param->rate_adaptation_threshold = c->rate_adaptation_threshold;
param->rate_adaptation_snr = c->rate_adaptation_snr;

ret = wl1271_cmd_configure(wl, ACX_SG_CFG, param, sizeof(*param));
if (ret < 0) {
Expand Down
136 changes: 16 additions & 120 deletions drivers/net/wireless/wl12xx/wl1271_acx.h
Original file line number Diff line number Diff line change
Expand Up @@ -496,126 +496,18 @@ struct acx_smart_reflex_config_params {
struct acx_bt_wlan_coex_param {
struct acx_header header;

/*
* The minimum rate of a received WLAN packet in the STA,
* during protective mode, of which a new BT-HP request
* during this Rx will always be respected and gain the antenna.
*/
u32 min_rate;

/* Max time the BT HP will be respected. */
u16 bt_hp_max_time;

/* Max time the WLAN HP will be respected. */
u16 wlan_hp_max_time;

/*
* The time between the last BT activity
* and the moment when the sense mode returns
* to SENSE_INACTIVE.
*/
u16 sense_disable_timer;

/* Time before the next BT HP instance */
u16 rx_time_bt_hp;
u16 tx_time_bt_hp;

/* range: 10-20000 default: 1500 */
u16 rx_time_bt_hp_fast;
u16 tx_time_bt_hp_fast;

/* range: 2000-65535 default: 8700 */
u16 wlan_cycle_fast;

/* range: 0 - 15000 (Msec) default: 1000 */
u16 bt_anti_starvation_period;

/* range 400-10000(Usec) default: 3000 */
u16 next_bt_lp_packet;

/* Deafult: worst case for BT DH5 traffic */
u16 wake_up_beacon;

/* range: 0-50000(Usec) default: 1050 */
u16 hp_dm_max_guard_time;

/*
* This is to prevent both BT & WLAN antenna
* starvation.
* Range: 100-50000(Usec) default:2550
*/
u16 next_wlan_packet;

/* 0 -> shared antenna */
u8 antenna_type;

/*
* 0 -> TI legacy
* 1 -> Palau
*/
u8 signal_type;

/*
* BT AFH status
* 0 -> no AFH
* 1 -> from dedicated GPIO
* 2 -> AFH on (from host)
*/
u8 afh_leverage_on;

/*
* The number of cycles during which no
* TX will be sent after 1 cycle of RX
* transaction in protective mode
*/
u8 quiet_cycle_num;

/*
* The maximum number of CTSs that will
* be sent for receiving RX packet in
* protective mode
*/
u8 max_cts;

/*
* The number of WLAN packets
* transferred in common mode before
* switching to BT.
*/
u8 wlan_packets_num;

/*
* The number of BT packets
* transferred in common mode before
* switching to WLAN.
*/
u8 bt_packets_num;

/* range: 1-255 default: 5 */
u8 missed_rx_avalanche;

/* range: 0-1 default: 1 */
u8 wlan_elp_hp;

/* range: 0 - 15 default: 4 */
u8 bt_anti_starvation_cycles;

u8 ack_mode_dual_ant;

/*
* Allow PA_SD assertion/de-assertion
* during enabled BT activity.
*/
u8 pa_sd_enable;

/*
* Enable/Disable PTA in auto mode:
* Support Both Active & P.S modes
*/
u8 pta_auto_mode_enable;

/* range: 0 - 20 default: 1 */
u8 bt_hp_respected_num;
u32 per_threshold;
u32 max_scan_compensation_time;
u16 nfs_sample_interval;
u8 load_ratio;
u8 auto_ps_mode;
u8 probe_req_compensation;
u8 scan_window_compensation;
u8 antenna_config;
u8 beacon_miss_threshold;
u32 rate_adaptation_threshold;
s8 rate_adaptation_snr;
u8 padding[3];
} __attribute__ ((packed));

#define CCA_THRSH_ENABLE_ENERGY_D 0x140A
Expand Down Expand Up @@ -690,6 +582,10 @@ struct acx_event_mask {
#define SCAN_TRIGGERED BIT(2)
#define SCAN_PRIORITY_HIGH BIT(3)

/* When set, disable HW encryption */
#define DF_ENCRYPTION_DISABLE 0x01
#define DF_SNIFF_MODE_ENABLE 0x80

struct acx_feature_config {
struct acx_header header;

Expand Down
6 changes: 3 additions & 3 deletions drivers/net/wireless/wl12xx/wl1271_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ int wl1271_cmd_join(struct wl1271 *wl)
join->rx_config_options = 0;
join->rx_filter_options = WL1271_DEFAULT_RX_FILTER;

join->basic_rate_set = RATE_MASK_1MBPS | RATE_MASK_2MBPS |
RATE_MASK_5_5MBPS | RATE_MASK_11MBPS;
join->basic_rate_set = CONF_HW_BIT_RATE_1MBPS | CONF_HW_BIT_RATE_2MBPS |
CONF_HW_BIT_RATE_5_5MBPS | CONF_HW_BIT_RATE_11MBPS;

join->beacon_interval = WL1271_DEFAULT_BEACON_INT;
join->dtim_interval = WL1271_DEFAULT_DTIM_PERIOD;
Expand Down Expand Up @@ -538,7 +538,7 @@ int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len,

params->params.num_channels = num_channels;
params->params.num_probe_requests = probe_requests;
params->params.tx_rate = cpu_to_le32(RATE_MASK_2MBPS);
params->params.tx_rate = cpu_to_le32(CONF_HW_BIT_RATE_2MBPS);
params->params.tid_trigger = 0;
params->params.scan_tag = WL1271_SCAN_DEFAULT_TAG;

Expand Down
5 changes: 0 additions & 5 deletions drivers/net/wireless/wl12xx/wl1271_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,6 @@ struct wl1271_cmd_ps_params {
#define NUM_ACCESS_CATEGORIES_COPY 4
#define MAX_KEY_SIZE 32

/* When set, disable HW encryption */
#define DF_ENCRYPTION_DISABLE 0x01
/* When set, disable HW decryption */
#define DF_SNIFF_MODE_ENABLE 0x80

enum wl1271_cmd_key_action {
KEY_ADD_OR_REPLACE = 1,
KEY_REMOVE = 2,
Expand Down
Loading

0 comments on commit 2b60100

Please sign in to comment.