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

Commit dce1ebab authored by John W. Linville's avatar John W. Linville
Browse files
parents 33b44342 8d3c1fd8
Loading
Loading
Loading
Loading
+13 −3
Original line number Original line Diff line number Diff line
@@ -333,11 +333,11 @@ static struct wlcore_conf wl12xx_conf = {
		.always                        = 0,
		.always                        = 0,
	},
	},
	.fwlog = {
	.fwlog = {
		.mode                         = WL12XX_FWLOG_ON_DEMAND,
		.mode                         = WL12XX_FWLOG_CONTINUOUS,
		.mem_blocks                   = 2,
		.mem_blocks                   = 2,
		.severity                     = 0,
		.severity                     = 0,
		.timestamp                    = WL12XX_FWLOG_TIMESTAMP_DISABLED,
		.timestamp                    = WL12XX_FWLOG_TIMESTAMP_DISABLED,
		.output                       = WL12XX_FWLOG_OUTPUT_HOST,
		.output                       = WL12XX_FWLOG_OUTPUT_DBG_PINS,
		.threshold                    = 0,
		.threshold                    = 0,
	},
	},
	.rate = {
	.rate = {
@@ -717,6 +717,9 @@ static int wl12xx_identify_chip(struct wl1271 *wl)
		goto out;
		goto out;
	}
	}


	wl->fw_mem_block_size = 256;
	wl->fwlog_end = 0x2000000;

	/* common settings */
	/* common settings */
	wl->scan_templ_id_2_4 = CMD_TEMPL_APP_PROBE_REQ_2_4_LEGACY;
	wl->scan_templ_id_2_4 = CMD_TEMPL_APP_PROBE_REQ_2_4_LEGACY;
	wl->scan_templ_id_5 = CMD_TEMPL_APP_PROBE_REQ_5_LEGACY;
	wl->scan_templ_id_5 = CMD_TEMPL_APP_PROBE_REQ_5_LEGACY;
@@ -1262,9 +1265,10 @@ static int wl12xx_boot(struct wl1271 *wl)
		BA_SESSION_RX_CONSTRAINT_EVENT_ID |
		BA_SESSION_RX_CONSTRAINT_EVENT_ID |
		REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID |
		REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID |
		INACTIVE_STA_EVENT_ID |
		INACTIVE_STA_EVENT_ID |
		MAX_TX_RETRY_EVENT_ID |
		CHANNEL_SWITCH_COMPLETE_EVENT_ID;
		CHANNEL_SWITCH_COMPLETE_EVENT_ID;


	wl->ap_event_mask = MAX_TX_RETRY_EVENT_ID;

	ret = wlcore_boot_run_firmware(wl);
	ret = wlcore_boot_run_firmware(wl);
	if (ret < 0)
	if (ret < 0)
		goto out;
		goto out;
@@ -1648,6 +1652,11 @@ static bool wl12xx_lnk_low_prio(struct wl1271 *wl, u8 hlid,
	return true;
	return true;
}
}


static u32 wl12xx_convert_hwaddr(struct wl1271 *wl, u32 hwaddr)
{
	return hwaddr << 5;
}

static int wl12xx_setup(struct wl1271 *wl);
static int wl12xx_setup(struct wl1271 *wl);


static struct wlcore_ops wl12xx_ops = {
static struct wlcore_ops wl12xx_ops = {
@@ -1684,6 +1693,7 @@ static struct wlcore_ops wl12xx_ops = {
	.channel_switch		= wl12xx_cmd_channel_switch,
	.channel_switch		= wl12xx_cmd_channel_switch,
	.pre_pkt_send		= NULL,
	.pre_pkt_send		= NULL,
	.set_peer_cap		= wl12xx_set_peer_cap,
	.set_peer_cap		= wl12xx_set_peer_cap,
	.convert_hwaddr		= wl12xx_convert_hwaddr,
	.lnk_high_prio		= wl12xx_lnk_high_prio,
	.lnk_high_prio		= wl12xx_lnk_high_prio,
	.lnk_low_prio		= wl12xx_lnk_low_prio,
	.lnk_low_prio		= wl12xx_lnk_low_prio,
};
};
+21 −11
Original line number Original line Diff line number Diff line
@@ -456,11 +456,11 @@ static struct wlcore_conf wl18xx_conf = {
		.always                        = 0,
		.always                        = 0,
	},
	},
	.fwlog = {
	.fwlog = {
		.mode                         = WL12XX_FWLOG_ON_DEMAND,
		.mode                         = WL12XX_FWLOG_CONTINUOUS,
		.mem_blocks                   = 2,
		.mem_blocks                   = 2,
		.severity                     = 0,
		.severity                     = 0,
		.timestamp                    = WL12XX_FWLOG_TIMESTAMP_DISABLED,
		.timestamp                    = WL12XX_FWLOG_TIMESTAMP_DISABLED,
		.output                       = WL12XX_FWLOG_OUTPUT_HOST,
		.output                       = WL12XX_FWLOG_OUTPUT_DBG_PINS,
		.threshold                    = 0,
		.threshold                    = 0,
	},
	},
	.rate = {
	.rate = {
@@ -505,7 +505,7 @@ static struct wlcore_conf wl18xx_conf = {


static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
	.ht = {
	.ht = {
		.mode				= HT_MODE_DEFAULT,
		.mode				= HT_MODE_WIDE,
	},
	},
	.phy = {
	.phy = {
		.phy_standalone			= 0x00,
		.phy_standalone			= 0x00,
@@ -516,7 +516,7 @@ static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
		.auto_detect			= 0x00,
		.auto_detect			= 0x00,
		.dedicated_fem			= FEM_NONE,
		.dedicated_fem			= FEM_NONE,
		.low_band_component		= COMPONENT_3_WAY_SWITCH,
		.low_band_component		= COMPONENT_3_WAY_SWITCH,
		.low_band_component_type	= 0x04,
		.low_band_component_type	= 0x05,
		.high_band_component		= COMPONENT_2_WAY_SWITCH,
		.high_band_component		= COMPONENT_2_WAY_SWITCH,
		.high_band_component_type	= 0x09,
		.high_band_component_type	= 0x09,
		.tcxo_ldo_voltage		= 0x00,
		.tcxo_ldo_voltage		= 0x00,
@@ -556,15 +556,15 @@ static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
		.per_chan_pwr_limit_arr_11p	= { 0xff, 0xff, 0xff, 0xff,
		.per_chan_pwr_limit_arr_11p	= { 0xff, 0xff, 0xff, 0xff,
						    0xff, 0xff, 0xff },
						    0xff, 0xff, 0xff },
		.psat				= 0,
		.psat				= 0,
		.low_power_val			= 0x08,
		.med_power_val			= 0x12,
		.high_power_val			= 0x18,
		.low_power_val_2nd		= 0x05,
		.med_power_val_2nd		= 0x0a,
		.high_power_val_2nd		= 0x14,
		.external_pa_dc2dc		= 0,
		.external_pa_dc2dc		= 0,
		.number_of_assembled_ant2_4	= 2,
		.number_of_assembled_ant2_4	= 2,
		.number_of_assembled_ant5	= 1,
		.number_of_assembled_ant5	= 1,
		.low_power_val			= 0xff,
		.med_power_val			= 0xff,
		.high_power_val			= 0xff,
		.low_power_val_2nd		= 0xff,
		.med_power_val_2nd		= 0xff,
		.high_power_val_2nd		= 0xff,
		.tx_rf_margin			= 1,
		.tx_rf_margin			= 1,
	},
	},
};
};
@@ -686,6 +686,9 @@ static int wl18xx_identify_chip(struct wl1271 *wl)
		goto out;
		goto out;
	}
	}


	wl->fw_mem_block_size = 272;
	wl->fwlog_end = 0x40000000;

	wl->scan_templ_id_2_4 = CMD_TEMPL_CFG_PROBE_REQ_2_4;
	wl->scan_templ_id_2_4 = CMD_TEMPL_CFG_PROBE_REQ_2_4;
	wl->scan_templ_id_5 = CMD_TEMPL_CFG_PROBE_REQ_5;
	wl->scan_templ_id_5 = CMD_TEMPL_CFG_PROBE_REQ_5;
	wl->sched_scan_templ_id_2_4 = CMD_TEMPL_PROBE_REQ_2_4_PERIODIC;
	wl->sched_scan_templ_id_2_4 = CMD_TEMPL_PROBE_REQ_2_4_PERIODIC;
@@ -988,10 +991,11 @@ static int wl18xx_boot(struct wl1271 *wl)
		BA_SESSION_RX_CONSTRAINT_EVENT_ID |
		BA_SESSION_RX_CONSTRAINT_EVENT_ID |
		REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID |
		REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID |
		INACTIVE_STA_EVENT_ID |
		INACTIVE_STA_EVENT_ID |
		MAX_TX_FAILURE_EVENT_ID |
		CHANNEL_SWITCH_COMPLETE_EVENT_ID |
		CHANNEL_SWITCH_COMPLETE_EVENT_ID |
		DFS_CHANNELS_CONFIG_COMPLETE_EVENT;
		DFS_CHANNELS_CONFIG_COMPLETE_EVENT;


	wl->ap_event_mask = MAX_TX_FAILURE_EVENT_ID;

	ret = wlcore_boot_run_firmware(wl);
	ret = wlcore_boot_run_firmware(wl);
	if (ret < 0)
	if (ret < 0)
		goto out;
		goto out;
@@ -1604,6 +1608,11 @@ static bool wl18xx_lnk_low_prio(struct wl1271 *wl, u8 hlid,
	return lnk->allocated_pkts < thold;
	return lnk->allocated_pkts < thold;
}
}


static u32 wl18xx_convert_hwaddr(struct wl1271 *wl, u32 hwaddr)
{
	return hwaddr & ~0x80000000;
}

static int wl18xx_setup(struct wl1271 *wl);
static int wl18xx_setup(struct wl1271 *wl);


static struct wlcore_ops wl18xx_ops = {
static struct wlcore_ops wl18xx_ops = {
@@ -1641,6 +1650,7 @@ static struct wlcore_ops wl18xx_ops = {
	.pre_pkt_send	= wl18xx_pre_pkt_send,
	.pre_pkt_send	= wl18xx_pre_pkt_send,
	.sta_rc_update	= wl18xx_sta_rc_update,
	.sta_rc_update	= wl18xx_sta_rc_update,
	.set_peer_cap	= wl18xx_set_peer_cap,
	.set_peer_cap	= wl18xx_set_peer_cap,
	.convert_hwaddr = wl18xx_convert_hwaddr,
	.lnk_high_prio	= wl18xx_lnk_high_prio,
	.lnk_high_prio	= wl18xx_lnk_high_prio,
	.lnk_low_prio	= wl18xx_lnk_low_prio,
	.lnk_low_prio	= wl18xx_lnk_low_prio,
};
};
+6 −4
Original line number Original line Diff line number Diff line
@@ -162,7 +162,8 @@ int wl1271_acx_mem_map(struct wl1271 *wl, struct acx_header *mem_map,


	wl1271_debug(DEBUG_ACX, "acx mem map");
	wl1271_debug(DEBUG_ACX, "acx mem map");


	ret = wl1271_cmd_interrogate(wl, ACX_MEM_MAP, mem_map, len);
	ret = wl1271_cmd_interrogate(wl, ACX_MEM_MAP, mem_map,
				     sizeof(struct acx_header), len);
	if (ret < 0)
	if (ret < 0)
		return ret;
		return ret;


@@ -722,6 +723,7 @@ int wl1271_acx_statistics(struct wl1271 *wl, void *stats)
	wl1271_debug(DEBUG_ACX, "acx statistics");
	wl1271_debug(DEBUG_ACX, "acx statistics");


	ret = wl1271_cmd_interrogate(wl, ACX_STATISTICS, stats,
	ret = wl1271_cmd_interrogate(wl, ACX_STATISTICS, stats,
				     sizeof(struct acx_header),
				     wl->stats.fw_stats_len);
				     wl->stats.fw_stats_len);
	if (ret < 0) {
	if (ret < 0) {
		wl1271_warning("acx statistics failed: %d", ret);
		wl1271_warning("acx statistics failed: %d", ret);
@@ -1470,8 +1472,8 @@ int wl12xx_acx_tsf_info(struct wl1271 *wl, struct wl12xx_vif *wlvif,


	tsf_info->role_id = wlvif->role_id;
	tsf_info->role_id = wlvif->role_id;


	ret = wl1271_cmd_interrogate(wl, ACX_TSF_INFO,
	ret = wl1271_cmd_interrogate(wl, ACX_TSF_INFO, tsf_info,
				     tsf_info, sizeof(*tsf_info));
				sizeof(struct acx_header), sizeof(*tsf_info));
	if (ret < 0) {
	if (ret < 0) {
		wl1271_warning("acx tsf info interrogate failed");
		wl1271_warning("acx tsf info interrogate failed");
		goto out;
		goto out;
@@ -1752,7 +1754,7 @@ int wlcore_acx_average_rssi(struct wl1271 *wl, struct wl12xx_vif *wlvif,


	acx->role_id = wlvif->role_id;
	acx->role_id = wlvif->role_id;
	ret = wl1271_cmd_interrogate(wl, ACX_ROAMING_STATISTICS_TBL,
	ret = wl1271_cmd_interrogate(wl, ACX_ROAMING_STATISTICS_TBL,
				     acx, sizeof(*acx));
				     acx, sizeof(*acx), sizeof(*acx));
	if (ret	< 0) {
	if (ret	< 0) {
		wl1271_warning("acx roaming statistics failed: %d", ret);
		wl1271_warning("acx roaming statistics failed: %d", ret);
		ret = -ENOMEM;
		ret = -ENOMEM;
+7 −5
Original line number Original line Diff line number Diff line
@@ -60,7 +60,8 @@ static int __wlcore_cmd_send(struct wl1271 *wl, u16 id, void *buf,
	u16 status;
	u16 status;
	u16 poll_count = 0;
	u16 poll_count = 0;


	if (WARN_ON(unlikely(wl->state == WLCORE_STATE_RESTARTING)))
	if (WARN_ON(wl->state == WLCORE_STATE_RESTARTING &&
		    id != CMD_STOP_FWLOGGER))
		return -EIO;
		return -EIO;


	cmd = buf;
	cmd = buf;
@@ -845,7 +846,8 @@ EXPORT_SYMBOL_GPL(wl1271_cmd_test);
 * @buf: buffer for the response, including all headers, must work with dma
 * @buf: buffer for the response, including all headers, must work with dma
 * @len: length of buf
 * @len: length of buf
 */
 */
int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len)
int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf,
			   size_t cmd_len, size_t res_len)
{
{
	struct acx_header *acx = buf;
	struct acx_header *acx = buf;
	int ret;
	int ret;
@@ -854,10 +856,10 @@ int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len)


	acx->id = cpu_to_le16(id);
	acx->id = cpu_to_le16(id);


	/* payload length, does not include any headers */
	/* response payload length, does not include any headers */
	acx->len = cpu_to_le16(len - sizeof(*acx));
	acx->len = cpu_to_le16(res_len - sizeof(*acx));


	ret = wl1271_cmd_send(wl, CMD_INTERROGATE, acx, sizeof(*acx), len);
	ret = wl1271_cmd_send(wl, CMD_INTERROGATE, acx, cmd_len, res_len);
	if (ret < 0)
	if (ret < 0)
		wl1271_error("INTERROGATE command failed");
		wl1271_error("INTERROGATE command failed");


+2 −1
Original line number Original line Diff line number Diff line
@@ -45,7 +45,8 @@ int wl12xx_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif,
		     enum ieee80211_band band, int channel);
		     enum ieee80211_band band, int channel);
int wl12xx_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif);
int wl12xx_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif);
int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len);
int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf,
			   size_t cmd_len, size_t res_len);
int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
int wlcore_cmd_configure_failsafe(struct wl1271 *wl, u16 id, void *buf,
int wlcore_cmd_configure_failsafe(struct wl1271 *wl, u16 id, void *buf,
				  size_t len, unsigned long valid_rets);
				  size_t len, unsigned long valid_rets);
Loading