aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.c34
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_init.c7
2 files changed, 14 insertions, 27 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 0666328ce9ab..46e5ea48651b 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -74,6 +74,15 @@ int wl1271_cmd_send(struct wl1271 *wl, u16 id, void *buf, size_t len)
74 intr = wl1271_spi_read32(wl, ACX_REG_INTERRUPT_NO_CLEAR); 74 intr = wl1271_spi_read32(wl, ACX_REG_INTERRUPT_NO_CLEAR);
75 } 75 }
76 76
77 /* read back the status code of the command */
78 wl1271_spi_read(wl, wl->cmd_box_addr, cmd,
79 sizeof(struct wl1271_cmd_header), false);
80
81 if (cmd->status != CMD_STATUS_SUCCESS) {
82 wl1271_error("command execute failure %d", cmd->status);
83 ret = -EIO;
84 }
85
77 wl1271_spi_write32(wl, ACX_REG_INTERRUPT_ACK, 86 wl1271_spi_write32(wl, ACX_REG_INTERRUPT_ACK,
78 WL1271_ACX_INTR_CMD_COMPLETE); 87 WL1271_ACX_INTR_CMD_COMPLETE);
79 88
@@ -306,7 +315,6 @@ int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer)
306 315
307 if (answer) { 316 if (answer) {
308 struct wl1271_command *cmd_answer; 317 struct wl1271_command *cmd_answer;
309 u16 status;
310 318
311 /* 319 /*
312 * The test command got in, we can read the answer. 320 * The test command got in, we can read the answer.
@@ -316,10 +324,6 @@ int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer)
316 wl1271_spi_read(wl, wl->cmd_box_addr, buf, buf_len, false); 324 wl1271_spi_read(wl, wl->cmd_box_addr, buf, buf_len, false);
317 325
318 cmd_answer = buf; 326 cmd_answer = buf;
319 status = le16_to_cpu(cmd_answer->header.status);
320
321 if (status != CMD_STATUS_SUCCESS)
322 wl1271_error("TEST command answer error: %d", status);
323 } 327 }
324 328
325 return 0; 329 return 0;
@@ -354,11 +358,6 @@ int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len)
354 /* the interrogate command got in, we can read the answer */ 358 /* the interrogate command got in, we can read the answer */
355 wl1271_spi_read(wl, wl->cmd_box_addr, buf, len, false); 359 wl1271_spi_read(wl, wl->cmd_box_addr, buf, len, false);
356 360
357 acx = buf;
358 if (le16_to_cpu(acx->cmd.status) != CMD_STATUS_SUCCESS)
359 wl1271_error("INTERROGATE command error: %d",
360 le16_to_cpu(acx->cmd.status));
361
362out: 361out:
363 return ret; 362 return ret;
364} 363}
@@ -507,11 +506,6 @@ int wl1271_cmd_read_memory(struct wl1271 *wl, u32 addr, void *answer,
507 506
508 /* the read command got in, we can now read the answer */ 507 /* the read command got in, we can now read the answer */
509 wl1271_spi_read(wl, wl->cmd_box_addr, cmd, sizeof(*cmd), false); 508 wl1271_spi_read(wl, wl->cmd_box_addr, cmd, sizeof(*cmd), false);
510
511 if (le16_to_cpu(cmd->header.status) != CMD_STATUS_SUCCESS)
512 wl1271_error("error in read command result: %d",
513 le16_to_cpu(cmd->header.status));
514
515 memcpy(answer, cmd->value, len); 509 memcpy(answer, cmd->value, len);
516 510
517out: 511out:
@@ -639,17 +633,7 @@ int wl1271_cmd_scan(struct wl1271 *wl, u8 *ssid, size_t len,
639 ret = wl1271_cmd_send(wl, CMD_SCAN, params, sizeof(*params)); 633 ret = wl1271_cmd_send(wl, CMD_SCAN, params, sizeof(*params));
640 if (ret < 0) { 634 if (ret < 0) {
641 wl1271_error("SCAN failed"); 635 wl1271_error("SCAN failed");
642 goto out;
643 }
644
645 wl1271_spi_read(wl, wl->cmd_box_addr, params, sizeof(*params),
646 false);
647
648 if (le16_to_cpu(params->header.status) != CMD_STATUS_SUCCESS) {
649 wl1271_error("Scan command error: %d",
650 le16_to_cpu(params->header.status));
651 wl->scanning = false; 636 wl->scanning = false;
652 ret = -EIO;
653 goto out; 637 goto out;
654 } 638 }
655 639
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c
index 417b4152feb1..7c2017f480ea 100644
--- a/drivers/net/wireless/wl12xx/wl1271_init.c
+++ b/drivers/net/wireless/wl12xx/wl1271_init.c
@@ -303,12 +303,15 @@ int wl1271_hw_init(struct wl1271 *wl)
303{ 303{
304 int ret; 304 int ret;
305 305
306 /* FIXME: the following parameter setting functions return error
307 * codes - the reason is so far unknown. The -EIO is therefore
308 * ignored for the time being. */
306 ret = wl1271_init_general_parms(wl); 309 ret = wl1271_init_general_parms(wl);
307 if (ret < 0) 310 if (ret < 0 && ret != -EIO)
308 return ret; 311 return ret;
309 312
310 ret = wl1271_init_radio_parms(wl); 313 ret = wl1271_init_radio_parms(wl);
311 if (ret < 0) 314 if (ret < 0 && ret != -EIO)
312 return ret; 315 return ret;
313 316
314 /* Template settings */ 317 /* Template settings */