aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2011-11-30 08:02:47 -0500
committerLuciano Coelho <coelho@ti.com>2012-04-12 01:43:58 -0400
commit4263c5f27c0403ad750c4f2509e5396e630b6e6e (patch)
tree339e2bb42b5b90f0490466d68409070ce59d2526
parentd203e59c4b56d56916a804ebeb04b0e6d92adf4c (diff)
wlcore: remove some unnecessary event mailbox address reads
We were reading the even mailbox address three times, which was completely unnecessary and complicated things regarding partition selection. Remove the unnecessry reads and set the address for mailbox 1 and 2 after the first read. Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r--drivers/net/wireless/ti/wlcore/boot.c18
-rw-r--r--drivers/net/wireless/ti/wlcore/event.c9
-rw-r--r--drivers/net/wireless/ti/wlcore/event.h1
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore.h1
4 files changed, 12 insertions, 17 deletions
diff --git a/drivers/net/wireless/ti/wlcore/boot.c b/drivers/net/wireless/ti/wlcore/boot.c
index 9520073cab55..3cb75db39b9e 100644
--- a/drivers/net/wireless/ti/wlcore/boot.c
+++ b/drivers/net/wireless/ti/wlcore/boot.c
@@ -399,14 +399,19 @@ int wlcore_boot_run_firmware(struct wl1271 *wl)
399 /* get hardware config command mail box */ 399 /* get hardware config command mail box */
400 wl->cmd_box_addr = wlcore_read_reg(wl, REG_COMMAND_MAILBOX_PTR); 400 wl->cmd_box_addr = wlcore_read_reg(wl, REG_COMMAND_MAILBOX_PTR);
401 401
402 wl1271_debug(DEBUG_MAILBOX, "cmd_box_addr 0x%x", wl->cmd_box_addr);
403
402 /* get hardware config event mail box */ 404 /* get hardware config event mail box */
403 wl->event_box_addr = wlcore_read_reg(wl, REG_EVENT_MAILBOX_PTR); 405 wl->mbox_ptr[0] = wlcore_read_reg(wl, REG_EVENT_MAILBOX_PTR);
406 wl->mbox_ptr[1] = wl->mbox_ptr[0] + sizeof(struct event_mailbox);
404 407
405 /* set the working partition to its "running" mode offset */ 408 wl1271_debug(DEBUG_MAILBOX, "MBOX ptrs: 0x%x 0x%x",
406 wlcore_set_partition(wl, &wl->ptable[PART_WORK]); 409 wl->mbox_ptr[0], wl->mbox_ptr[1]);
407 410
408 wl1271_debug(DEBUG_MAILBOX, "cmd_box_addr 0x%x event_box_addr 0x%x", 411 /*
409 wl->cmd_box_addr, wl->event_box_addr); 412 * TODO: wl12xx used to set the partition here, but it seems
413 * that it can be done later. Make sure this is okay.
414 */
410 415
411 wl1271_boot_fw_version(wl); 416 wl1271_boot_fw_version(wl);
412 417
@@ -438,7 +443,8 @@ int wlcore_boot_run_firmware(struct wl1271 *wl)
438 return ret; 443 return ret;
439 } 444 }
440 445
441 wl1271_event_mbox_config(wl); 446 /* set the working partition to its "running" mode offset */
447 wlcore_set_partition(wl, &wl->ptable[PART_WORK]);
442 448
443 /* firmware startup completed */ 449 /* firmware startup completed */
444 return 0; 450 return 0;
diff --git a/drivers/net/wireless/ti/wlcore/event.c b/drivers/net/wireless/ti/wlcore/event.c
index e3f572cbdf9a..292632ddf890 100644
--- a/drivers/net/wireless/ti/wlcore/event.c
+++ b/drivers/net/wireless/ti/wlcore/event.c
@@ -278,15 +278,6 @@ int wl1271_event_unmask(struct wl1271 *wl)
278 return 0; 278 return 0;
279} 279}
280 280
281void wl1271_event_mbox_config(struct wl1271 *wl)
282{
283 wl->mbox_ptr[0] = wlcore_read_reg(wl, REG_EVENT_MAILBOX_PTR);
284 wl->mbox_ptr[1] = wl->mbox_ptr[0] + sizeof(struct event_mailbox);
285
286 wl1271_debug(DEBUG_EVENT, "MBOX ptrs: 0x%x 0x%x",
287 wl->mbox_ptr[0], wl->mbox_ptr[1]);
288}
289
290int wl1271_event_handle(struct wl1271 *wl, u8 mbox_num) 281int wl1271_event_handle(struct wl1271 *wl, u8 mbox_num)
291{ 282{
292 int ret; 283 int ret;
diff --git a/drivers/net/wireless/ti/wlcore/event.h b/drivers/net/wireless/ti/wlcore/event.h
index 8acba0d43976..8adf18d6c58f 100644
--- a/drivers/net/wireless/ti/wlcore/event.h
+++ b/drivers/net/wireless/ti/wlcore/event.h
@@ -135,7 +135,6 @@ struct event_mailbox {
135struct wl1271; 135struct wl1271;
136 136
137int wl1271_event_unmask(struct wl1271 *wl); 137int wl1271_event_unmask(struct wl1271 *wl);
138void wl1271_event_mbox_config(struct wl1271 *wl);
139int wl1271_event_handle(struct wl1271 *wl, u8 mbox); 138int wl1271_event_handle(struct wl1271 *wl, u8 mbox);
140 139
141#endif 140#endif
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index 5f5dadbf9092..984dda731344 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -111,7 +111,6 @@ struct wl1271 {
111 struct wl1271_chip chip; 111 struct wl1271_chip chip;
112 112
113 int cmd_box_addr; 113 int cmd_box_addr;
114 int event_box_addr;
115 114
116 u8 *fw; 115 u8 *fw;
117 size_t fw_len; 116 size_t fw_len;