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

Commit 045b9b5f authored by Ido Yariv's avatar Ido Yariv Committed by Luciano Coelho
Browse files

wlcore: Propagate errors from wl1271_read



Propagate errors from wl1271_read and request for recovery when
appropriate.
Also rename prefixes of wlcore functions which their prototypes had to
be changed.

Signed-off-by: default avatarIdo Yariv <ido@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 8b7c0fc3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1162,13 +1162,13 @@ static u32 wl12xx_get_rx_packet_len(struct wl1271 *wl, void *rx_data,
	return data_len - sizeof(*desc) - desc->pad_len;
}

static void wl12xx_tx_delayed_compl(struct wl1271 *wl)
static int wl12xx_tx_delayed_compl(struct wl1271 *wl)
{
	if (wl->fw_status_1->tx_results_counter ==
	    (wl->tx_results_count & 0xff))
		return;
		return 0;

	wl1271_tx_complete(wl);
	return wlcore_tx_complete(wl);
}

static int wl12xx_hw_init(struct wl1271 *wl)
+3 −1
Original line number Diff line number Diff line
@@ -87,7 +87,9 @@ static int wlcore_boot_static_data(struct wl1271 *wl)
		goto out;
	}

	wl1271_read(wl, wl->cmd_box_addr, static_data, len, false);
	ret = wlcore_read(wl, wl->cmd_box_addr, static_data, len, false);
	if (ret < 0)
		goto out_free;

	ret = wlcore_boot_parse_fw_ver(wl, static_data);
	if (ret < 0)
+15 −5
Original line number Diff line number Diff line
@@ -95,7 +95,10 @@ int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len,
	/* read back the status code of the command */
	if (res_len == 0)
		res_len = sizeof(struct wl1271_cmd_header);
	wl1271_read(wl, wl->cmd_box_addr, cmd, res_len, false);

	ret = wlcore_read(wl, wl->cmd_box_addr, cmd, res_len, false);
	if (ret < 0)
		goto fail;

	status = le16_to_cpu(cmd->status);
	if (status != CMD_STATUS_SUCCESS) {
@@ -141,11 +144,18 @@ static int wl1271_cmd_wait_for_event_or_timeout(struct wl1271 *wl, u32 mask)
		msleep(1);

		/* read from both event fields */
		wl1271_read(wl, wl->mbox_ptr[0], events_vector,
		ret = wlcore_read(wl, wl->mbox_ptr[0], events_vector,
				  sizeof(*events_vector), false);
		if (ret < 0)
			goto out;

		event = *events_vector & mask;
		wl1271_read(wl, wl->mbox_ptr[1], events_vector,

		ret = wlcore_read(wl, wl->mbox_ptr[1], events_vector,
				  sizeof(*events_vector), false);
		if (ret < 0)
			goto out;

		event |= *events_vector & mask;
	} while (!event);

+4 −2
Original line number Diff line number Diff line
@@ -301,8 +301,10 @@ int wl1271_event_handle(struct wl1271 *wl, u8 mbox_num)
		return -EINVAL;

	/* first we read the mbox descriptor */
	wl1271_read(wl, wl->mbox_ptr[mbox_num], wl->mbox,
	ret = wlcore_read(wl, wl->mbox_ptr[mbox_num], wl->mbox,
			  sizeof(*wl->mbox), false);
	if (ret < 0)
		return ret;

	/* process the descriptor */
	ret = wl1271_event_process(wl);
+4 −2
Original line number Diff line number Diff line
@@ -81,10 +81,12 @@ wlcore_hw_get_rx_packet_len(struct wl1271 *wl, void *rx_data, u32 data_len)
	return wl->ops->get_rx_packet_len(wl, rx_data, data_len);
}

static inline void wlcore_hw_tx_delayed_compl(struct wl1271 *wl)
static inline int wlcore_hw_tx_delayed_compl(struct wl1271 *wl)
{
	if (wl->ops->tx_delayed_compl)
		wl->ops->tx_delayed_compl(wl);
		return wl->ops->tx_delayed_compl(wl);

	return 0;
}

static inline void wlcore_hw_tx_immediate_compl(struct wl1271 *wl)
Loading