Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+264 −271
Original line number Original line Diff line number Diff line
@@ -46,9 +46,7 @@
#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 = {
{
	struct conf_drv_settings conf = {
	.sg = {
	.sg = {
		.per_threshold               = 7500,
		.per_threshold               = 7500,
		.max_scan_compensation_time  = 120000,
		.max_scan_compensation_time  = 120000,
@@ -77,8 +75,7 @@ static void wl1271_conf_init(struct wl1271 *wl)
	.tx = {
	.tx = {
		.tx_energy_detection         = 0,
		.tx_energy_detection         = 0,
		.rc_conf                     = {
		.rc_conf                     = {
				.enabled_rates      =
			.enabled_rates       = CONF_TX_RATE_MASK_UNSPECIFIED,
				CONF_TX_RATE_MASK_UNSPECIFIED,
			.short_retry_limit   = 10,
			.short_retry_limit   = 10,
			.long_retry_limit    = 10,
			.long_retry_limit    = 10,
			.aflags              = 0
			.aflags              = 0
@@ -185,8 +182,7 @@ static void wl1271_conf_init(struct wl1271 *wl)
		.bcn_filt_ie = {
		.bcn_filt_ie = {
			[0] = {
			[0] = {
				.ie          = WLAN_EID_CHANNEL_SWITCH,
				.ie          = WLAN_EID_CHANNEL_SWITCH,
					.rule       =
				.rule        = CONF_BCN_RULE_PASS_ON_APPEARANCE,
					CONF_BCN_RULE_PASS_ON_APPEARANCE,
			}
			}
		},
		},
		.synch_fail_thold            = 5,
		.synch_fail_thold            = 5,
@@ -231,22 +227,22 @@ static void wl1271_conf_init(struct wl1271 *wl)
				.len         = 7,
				.len         = 7,
				.upper_limit = 0x03,
				.upper_limit = 0x03,
				.values      = {
				.values      = {
						0x18, 0x10, 0x05, 0xfb,
					0x18, 0x10, 0x05, 0xfb, 0xf0, 0xe8,
						0xf0, 0xe8, 0x00 }
					0x00 }
			},
			},
			[1] = {
			[1] = {
				.len         = 7,
				.len         = 7,
				.upper_limit = 0x03,
				.upper_limit = 0x03,
				.values      = {
				.values      = {
						0x18, 0x10, 0x05, 0xf6,
					0x18, 0x10, 0x05, 0xf6, 0xf0, 0xe8,
						0xf0, 0xe8, 0x00 }
					0x00 }
			},
			},
			[2] = {
			[2] = {
				.len         = 7,
				.len         = 7,
				.upper_limit = 0x03,
				.upper_limit = 0x03,
				.values      = {
				.values      = {
						0x18, 0x10, 0x05, 0xfb,
					0x18, 0x10, 0x05, 0xfb, 0xf0, 0xe8,
						0xf0, 0xe8, 0x00 }
					0x00 }
			}
			}
		},
		},
		.sr_enable                   = 1,
		.sr_enable                   = 1,
@@ -275,10 +271,8 @@ static void wl1271_conf_init(struct wl1271 *wl)
				0xec, 0xf6, 0x00, 0x0c, 0x18, 0xf8,
				0xec, 0xf6, 0x00, 0x0c, 0x18, 0xf8,
				0xfc, 0x00, 0x08, 0x10, 0xf0, 0xf8,
				0xfc, 0x00, 0x08, 0x10, 0xf0, 0xf8,
				0x00, 0x0a, 0x14 },
				0x00, 0x0a, 0x14 },
				.rx_trace_loss_5     = {
			.rx_trace_loss_5     = { 0, 0, 0, 0, 0, 0, 0 },
					0, 0, 0, 0, 0, 0, 0 },
			.tx_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 = {
			.rx_rssi_and_proc_compens_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,
@@ -303,12 +297,9 @@ static void wl1271_conf_init(struct wl1271 *wl)
			.tx_ibias            = {
			.tx_ibias            = {
				0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x27 },
				0x1a, 0x1a, 0x1a, 0x1a, 0x1a, 0x27 },
			.rx_fem_insertion_loss = 0x14,
			.rx_fem_insertion_loss = 0x14,
				.tx_ref_pd_voltage_5 = {
			.tx_ref_pd_voltage_5 = { 0, 0, 0, 0, 0, 0, 0 },
					0, 0, 0, 0, 0, 0, 0 },
			.tx_ref_power_5      = { 0, 0, 0, 0, 0, 0, 0 },
				.tx_ref_power_5      = {
			.tx_offset_db_5      = {0, 0, 0, 0, 0, 0, 0 },
					0, 0, 0, 0, 0, 0, 0 },
				.tx_offset_db_5      = {
					0, 0, 0, 0, 0, 0, 0 },
			.tx_rate_limits_normal_5 = {
			.tx_rate_limits_normal_5 = {
				0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
				0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
			.tx_rate_limits_degraded_5 = {
			.tx_rate_limits_degraded_5 = {
@@ -324,12 +315,14 @@ static void wl1271_conf_init(struct wl1271 *wl)
				0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
				0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
			.tx_ibias_5          = {
			.tx_ibias_5          = {
				0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
				0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
				.rx_fem_insertion_loss_5 = {
			.rx_fem_insertion_loss_5 = { 0, 0, 0, 0, 0, 0, 0 }
					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
	 * function is invoked upon driver load (spi probe.)
	 * function is invoked upon driver load (spi probe.)
@@ -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));
}
}