Commit 8a08048a authored by Juuso Oikarinen's avatar Juuso Oikarinen Committed by John W. Linville

wl1271: Move default FW config struct away from stack

Move the default FW config into a module global static variable, instead
of being a stack variable.
Signed-off-by: default avatarJuuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: default avatarLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 47fab7d5
...@@ -46,289 +46,282 @@ ...@@ -46,289 +46,282 @@
#include "wl1271_cmd.h" #include "wl1271_cmd.h"
#include "wl1271_boot.h" #include "wl1271_boot.h"
static void wl1271_conf_init(struct wl1271 *wl) static struct conf_drv_settings default_conf = {
{ .sg = {
struct conf_drv_settings conf = { .per_threshold = 7500,
.sg = { .max_scan_compensation_time = 120000,
.per_threshold = 7500, .nfs_sample_interval = 400,
.max_scan_compensation_time = 120000, .load_ratio = 50,
.nfs_sample_interval = 400, .auto_ps_mode = 0,
.load_ratio = 50, .probe_req_compensation = 170,
.auto_ps_mode = 0, .scan_window_compensation = 50,
.probe_req_compensation = 170, .antenna_config = 0,
.scan_window_compensation = 50, .beacon_miss_threshold = 60,
.antenna_config = 0, .rate_adaptation_threshold = CONF_HW_BIT_RATE_12MBPS,
.beacon_miss_threshold = 60, .rate_adaptation_snr = 0
.rate_adaptation_threshold = CONF_HW_BIT_RATE_12MBPS, },
.rate_adaptation_snr = 0 .rx = {
}, .rx_msdu_life_time = 512000,
.rx = { .packet_detection_threshold = 0,
.rx_msdu_life_time = 512000, .ps_poll_timeout = 15,
.packet_detection_threshold = 0, .upsd_timeout = 15,
.ps_poll_timeout = 15, .rts_threshold = 2347,
.upsd_timeout = 15, .rx_cca_threshold = 0xFFEF,
.rts_threshold = 2347, .irq_blk_threshold = 0,
.rx_cca_threshold = 0xFFEF, .irq_pkt_threshold = USHORT_MAX,
.irq_blk_threshold = 0, .irq_timeout = 5,
.irq_pkt_threshold = USHORT_MAX, .queue_type = CONF_RX_QUEUE_TYPE_LOW_PRIORITY,
.irq_timeout = 5, },
.queue_type = CONF_RX_QUEUE_TYPE_LOW_PRIORITY, .tx = {
.tx_energy_detection = 0,
.rc_conf = {
.enabled_rates = CONF_TX_RATE_MASK_UNSPECIFIED,
.short_retry_limit = 10,
.long_retry_limit = 10,
.aflags = 0
}, },
.tx = { .ac_conf_count = 4,
.tx_energy_detection = 0, .ac_conf = {
.rc_conf = { [0] = {
.enabled_rates = .ac = CONF_TX_AC_BE,
CONF_TX_RATE_MASK_UNSPECIFIED, .cw_min = 15,
.short_retry_limit = 10, .cw_max = 63,
.long_retry_limit = 10, .aifsn = 3,
.aflags = 0 .tx_op_limit = 0,
},
[1] = {
.ac = CONF_TX_AC_BK,
.cw_min = 15,
.cw_max = 63,
.aifsn = 7,
.tx_op_limit = 0,
}, },
.ac_conf_count = 4, [2] = {
.ac_conf = { .ac = CONF_TX_AC_VI,
[0] = { .cw_min = 15,
.ac = CONF_TX_AC_BE, .cw_max = 63,
.cw_min = 15, .aifsn = CONF_TX_AIFS_PIFS,
.cw_max = 63, .tx_op_limit = 3008,
.aifsn = 3,
.tx_op_limit = 0,
},
[1] = {
.ac = CONF_TX_AC_BK,
.cw_min = 15,
.cw_max = 63,
.aifsn = 7,
.tx_op_limit = 0,
},
[2] = {
.ac = CONF_TX_AC_VI,
.cw_min = 15,
.cw_max = 63,
.aifsn = CONF_TX_AIFS_PIFS,
.tx_op_limit = 3008,
},
[3] = {
.ac = CONF_TX_AC_VO,
.cw_min = 15,
.cw_max = 63,
.aifsn = CONF_TX_AIFS_PIFS,
.tx_op_limit = 1504,
},
}, },
.tid_conf_count = 7, [3] = {
.tid_conf = { .ac = CONF_TX_AC_VO,
[0] = { .cw_min = 15,
.queue_id = 0, .cw_max = 63,
.channel_type = CONF_CHANNEL_TYPE_DCF, .aifsn = CONF_TX_AIFS_PIFS,
.tsid = CONF_TX_AC_BE, .tx_op_limit = 1504,
.ps_scheme = CONF_PS_SCHEME_LEGACY,
.ack_policy = CONF_ACK_POLICY_LEGACY,
.apsd_conf = {0, 0},
},
[1] = {
.queue_id = 1,
.channel_type = CONF_CHANNEL_TYPE_DCF,
.tsid = CONF_TX_AC_BE,
.ps_scheme = CONF_PS_SCHEME_LEGACY,
.ack_policy = CONF_ACK_POLICY_LEGACY,
.apsd_conf = {0, 0},
},
[2] = {
.queue_id = 2,
.channel_type = CONF_CHANNEL_TYPE_DCF,
.tsid = CONF_TX_AC_BE,
.ps_scheme = CONF_PS_SCHEME_LEGACY,
.ack_policy = CONF_ACK_POLICY_LEGACY,
.apsd_conf = {0, 0},
},
[3] = {
.queue_id = 3,
.channel_type = CONF_CHANNEL_TYPE_DCF,
.tsid = CONF_TX_AC_BE,
.ps_scheme = CONF_PS_SCHEME_LEGACY,
.ack_policy = CONF_ACK_POLICY_LEGACY,
.apsd_conf = {0, 0},
},
[4] = {
.queue_id = 4,
.channel_type = CONF_CHANNEL_TYPE_DCF,
.tsid = CONF_TX_AC_BE,
.ps_scheme = CONF_PS_SCHEME_LEGACY,
.ack_policy = CONF_ACK_POLICY_LEGACY,
.apsd_conf = {0, 0},
},
[5] = {
.queue_id = 5,
.channel_type = CONF_CHANNEL_TYPE_DCF,
.tsid = CONF_TX_AC_BE,
.ps_scheme = CONF_PS_SCHEME_LEGACY,
.ack_policy = CONF_ACK_POLICY_LEGACY,
.apsd_conf = {0, 0},
},
[6] = {
.queue_id = 6,
.channel_type = CONF_CHANNEL_TYPE_DCF,
.tsid = CONF_TX_AC_BE,
.ps_scheme = CONF_PS_SCHEME_LEGACY,
.ack_policy = CONF_ACK_POLICY_LEGACY,
.apsd_conf = {0, 0},
}
}, },
.frag_threshold = IEEE80211_MAX_FRAG_THRESHOLD,
.tx_compl_timeout = 5,
.tx_compl_threshold = 5
}, },
.conn = { .tid_conf_count = 7,
.wake_up_event = CONF_WAKE_UP_EVENT_DTIM, .tid_conf = {
.listen_interval = 0, [0] = {
.bcn_filt_mode = CONF_BCN_FILT_MODE_ENABLED, .queue_id = 0,
.bcn_filt_ie_count = 1, .channel_type = CONF_CHANNEL_TYPE_DCF,
.bcn_filt_ie = { .tsid = CONF_TX_AC_BE,
[0] = { .ps_scheme = CONF_PS_SCHEME_LEGACY,
.ie = WLAN_EID_CHANNEL_SWITCH, .ack_policy = CONF_ACK_POLICY_LEGACY,
.rule = .apsd_conf = {0, 0},
CONF_BCN_RULE_PASS_ON_APPEARANCE, },
} [1] = {
.queue_id = 1,
.channel_type = CONF_CHANNEL_TYPE_DCF,
.tsid = CONF_TX_AC_BE,
.ps_scheme = CONF_PS_SCHEME_LEGACY,
.ack_policy = CONF_ACK_POLICY_LEGACY,
.apsd_conf = {0, 0},
}, },
.synch_fail_thold = 5, [2] = {
.bss_lose_timeout = 100, .queue_id = 2,
.beacon_rx_timeout = 10000, .channel_type = CONF_CHANNEL_TYPE_DCF,
.broadcast_timeout = 20000, .tsid = CONF_TX_AC_BE,
.rx_broadcast_in_ps = 1, .ps_scheme = CONF_PS_SCHEME_LEGACY,
.ps_poll_threshold = 4, .ack_policy = CONF_ACK_POLICY_LEGACY,
.sig_trigger_count = 2, .apsd_conf = {0, 0},
.sig_trigger = {
[0] = {
.threshold = -75,
.pacing = 500,
.metric = CONF_TRIG_METRIC_RSSI_BEACON,
.type = CONF_TRIG_EVENT_TYPE_EDGE,
.direction = CONF_TRIG_EVENT_DIR_LOW,
.hysteresis = 2,
.index = 0,
.enable = 1
},
[1] = {
.threshold = -75,
.pacing = 500,
.metric = CONF_TRIG_METRIC_RSSI_BEACON,
.type = CONF_TRIG_EVENT_TYPE_EDGE,
.direction = CONF_TRIG_EVENT_DIR_HIGH,
.hysteresis = 2,
.index = 1,
.enable = 1
}
}, },
.sig_weights = { [3] = {
.rssi_bcn_avg_weight = 10, .queue_id = 3,
.rssi_pkt_avg_weight = 10, .channel_type = CONF_CHANNEL_TYPE_DCF,
.snr_bcn_avg_weight = 10, .tsid = CONF_TX_AC_BE,
.snr_pkt_avg_weight = 10 .ps_scheme = CONF_PS_SCHEME_LEGACY,
.ack_policy = CONF_ACK_POLICY_LEGACY,
.apsd_conf = {0, 0},
},
[4] = {
.queue_id = 4,
.channel_type = CONF_CHANNEL_TYPE_DCF,
.tsid = CONF_TX_AC_BE,
.ps_scheme = CONF_PS_SCHEME_LEGACY,
.ack_policy = CONF_ACK_POLICY_LEGACY,
.apsd_conf = {0, 0},
},
[5] = {
.queue_id = 5,
.channel_type = CONF_CHANNEL_TYPE_DCF,
.tsid = CONF_TX_AC_BE,
.ps_scheme = CONF_PS_SCHEME_LEGACY,
.ack_policy = CONF_ACK_POLICY_LEGACY,
.apsd_conf = {0, 0},
},
[6] = {
.queue_id = 6,
.channel_type = CONF_CHANNEL_TYPE_DCF,
.tsid = CONF_TX_AC_BE,
.ps_scheme = CONF_PS_SCHEME_LEGACY,
.ack_policy = CONF_ACK_POLICY_LEGACY,
.apsd_conf = {0, 0},
} }
}, },
.init = { .frag_threshold = IEEE80211_MAX_FRAG_THRESHOLD,
.sr_err_tbl = { .tx_compl_timeout = 5,
[0] = { .tx_compl_threshold = 5
.len = 7, },
.upper_limit = 0x03, .conn = {
.values = { .wake_up_event = CONF_WAKE_UP_EVENT_DTIM,
0x18, 0x10, 0x05, 0xfb, .listen_interval = 0,
0xf0, 0xe8, 0x00 } .bcn_filt_mode = CONF_BCN_FILT_MODE_ENABLED,
}, .bcn_filt_ie_count = 1,
[1] = { .bcn_filt_ie = {
.len = 7, [0] = {
.upper_limit = 0x03, .ie = WLAN_EID_CHANNEL_SWITCH,
.values = { .rule = CONF_BCN_RULE_PASS_ON_APPEARANCE,
0x18, 0x10, 0x05, 0xf6, }
0xf0, 0xe8, 0x00 } },
}, .synch_fail_thold = 5,
[2] = { .bss_lose_timeout = 100,
.len = 7, .beacon_rx_timeout = 10000,
.upper_limit = 0x03, .broadcast_timeout = 20000,
.values = { .rx_broadcast_in_ps = 1,
0x18, 0x10, 0x05, 0xfb, .ps_poll_threshold = 4,
0xf0, 0xe8, 0x00 } .sig_trigger_count = 2,
} .sig_trigger = {
[0] = {
.threshold = -75,
.pacing = 500,
.metric = CONF_TRIG_METRIC_RSSI_BEACON,
.type = CONF_TRIG_EVENT_TYPE_EDGE,
.direction = CONF_TRIG_EVENT_DIR_LOW,
.hysteresis = 2,
.index = 0,
.enable = 1
}, },
.sr_enable = 1, [1] = {
.genparam = { .threshold = -75,
/* .pacing = 500,
* FIXME: The correct value CONF_REF_CLK_38_4_E .metric = CONF_TRIG_METRIC_RSSI_BEACON,
* causes the firmware to crash on boot. .type = CONF_TRIG_EVENT_TYPE_EDGE,
* The value 5 apparently is an .direction = CONF_TRIG_EVENT_DIR_HIGH,
* unnoficial XTAL configuration of the .hysteresis = 2,
* same frequency, which appears to work. .index = 1,
*/ .enable = 1
.ref_clk = 5, }
.settling_time = 5, },
.clk_valid_on_wakeup = 0, .sig_weights = {
.dc2dcmode = 0, .rssi_bcn_avg_weight = 10,
.single_dual_band = 0, .rssi_pkt_avg_weight = 10,
.tx_bip_fem_autodetect = 0, .snr_bcn_avg_weight = 10,
.tx_bip_fem_manufacturer = 1, .snr_pkt_avg_weight = 10
.settings = 1, }
},
.init = {
.sr_err_tbl = {
[0] = {
.len = 7,
.upper_limit = 0x03,
.values = {
0x18, 0x10, 0x05, 0xfb, 0xf0, 0xe8,
0x00 }
},
[1] = {
.len = 7,
.upper_limit = 0x03,
.values = {
0x18, 0x10, 0x05, 0xf6, 0xf0, 0xe8,
0x00 }
}, },
.radioparam = { [2] = {
/* FIXME: 5GHz values unset! */ .len = 7,
.rx_trace_loss = 10, .upper_limit = 0x03,
.tx_trace_loss = 10, .values = {
.rx_rssi_and_proc_compens = { 0x18, 0x10, 0x05, 0xfb, 0xf0, 0xe8,
0xec, 0xf6, 0x00, 0x0c, 0x18, 0xf8, 0x00 }
0xfc, 0x00, 0x08, 0x10, 0xf0, 0xf8,
0x00, 0x0a, 0x14 },
.rx_trace_loss_5 = {
0, 0, 0, 0, 0, 0, 0 },
.tx_trace_loss_5 = {
0, 0, 0, 0, 0, 0, 0 },
.rx_rssi_and_proc_compens_5 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00 },
.tx_ref_pd_voltage = 0x24e,
.tx_ref_power = 0x78,
.tx_offset_db = 0x0,
.tx_rate_limits_normal = {
0x1e, 0x1f, 0x22, 0x24, 0x28, 0x29 },
.tx_rate_limits_degraded = {
0x1b, 0x1c, 0x1e, 0x20, 0x24, 0x25 },
.tx_channel_limits_11b = {
0x22, 0x50, 0x50, 0x50, 0x50, 0x50,
0x50, 0x50, 0x50, 0x50, 0x22, 0x50,
0x22, 0x50 },
.tx_channel_limits_ofdm = {
0x20, 0x50, 0x50, 0x50, 0x50, 0x50,
0x50, 0x50, 0x50, 0x50, 0x20, 0x50,
0x20, 0x50 },
.tx_pdv_rate_offsets = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
.tx_ibias = {
0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x27 },
.rx_fem_insertion_loss = 0x14,
.tx_ref_pd_voltage_5 = {
0, 0, 0, 0, 0, 0, 0 },
.tx_ref_power_5 = {
0, 0, 0, 0, 0, 0, 0 },
.tx_offset_db_5 = {
0, 0, 0, 0, 0, 0, 0 },
.tx_rate_limits_normal_5 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
.tx_rate_limits_degraded_5 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
.tx_channel_limits_ofdm_5 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00},
.tx_pdv_rate_offsets_5 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
.tx_ibias_5 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
.rx_fem_insertion_loss_5 = {
0, 0, 0, 0, 0, 0, 0 }
} }
},
.sr_enable = 1,
.genparam = {
/*
* FIXME: The correct value CONF_REF_CLK_38_4_E
* causes the firmware to crash on boot.
* The value 5 apparently is an
* unnoficial XTAL configuration of the
* same frequency, which appears to work.
*/
.ref_clk = 5,
.settling_time = 5,
.clk_valid_on_wakeup = 0,
.dc2dcmode = 0,
.single_dual_band = 0,
.tx_bip_fem_autodetect = 0,
.tx_bip_fem_manufacturer = 1,
.settings = 1,
},
.radioparam = {
/* FIXME: 5GHz values unset! */
.rx_trace_loss = 10,
.tx_trace_loss = 10,
.rx_rssi_and_proc_compens = {
0xec, 0xf6, 0x00, 0x0c, 0x18, 0xf8,
0xfc, 0x00, 0x08, 0x10, 0xf0, 0xf8,
0x00, 0x0a, 0x14 },
.rx_trace_loss_5 = { 0, 0, 0, 0, 0, 0, 0 },
.tx_trace_loss_5 = { 0, 0, 0, 0, 0, 0, 0 },
.rx_rssi_and_proc_compens_5 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00 },
.tx_ref_pd_voltage = 0x24e,
.tx_ref_power = 0x78,
.tx_offset_db = 0x0,
.tx_rate_limits_normal = {
0x1e, 0x1f, 0x22, 0x24, 0x28, 0x29 },
.tx_rate_limits_degraded = {
0x1b, 0x1c, 0x1e, 0x20, 0x24, 0x25 },
.tx_channel_limits_11b = {
0x22, 0x50, 0x50, 0x50, 0x50, 0x50,
0x50, 0x50, 0x50, 0x50, 0x22, 0x50,
0x22, 0x50 },
.tx_channel_limits_ofdm = {
0x20, 0x50, 0x50, 0x50, 0x50, 0x50,
0x50, 0x50, 0x50, 0x50, 0x20, 0x50,
0x20, 0x50 },
.tx_pdv_rate_offsets = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
.tx_ibias = {
0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x27 },
.rx_fem_insertion_loss = 0x14,
.tx_ref_pd_voltage_5 = { 0, 0, 0, 0, 0, 0, 0 },
.tx_ref_power_5 = { 0, 0, 0, 0, 0, 0, 0 },
.tx_offset_db_5 = {0, 0, 0, 0, 0, 0, 0 },
.tx_rate_limits_normal_5 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
.tx_rate_limits_degraded_5 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
.tx_channel_limits_ofdm_5 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00},
.tx_pdv_rate_offsets_5 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
.tx_ibias_5 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
.rx_fem_insertion_loss_5 = { 0, 0, 0, 0, 0, 0, 0 }
} }
}; }
};
static void wl1271_conf_init(struct wl1271 *wl)
{
/* /*
* This function applies the default configuration to the driver. This * This function applies the default configuration to the driver. This
...@@ -341,7 +334,7 @@ static void wl1271_conf_init(struct wl1271 *wl) ...@@ -341,7 +334,7 @@ static void wl1271_conf_init(struct wl1271 *wl)
*/ */
/* apply driver default configuration */ /* apply driver default configuration */
memcpy(&wl->conf, &conf, sizeof(conf)); memcpy(&wl->conf, &default_conf, sizeof(default_conf));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment