aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wl18xx
diff options
context:
space:
mode:
authorIdo Yariv <ido@wizery.com>2012-06-18 06:21:55 -0400
committerLuciano Coelho <coelho@ti.com>2012-06-22 03:46:34 -0400
commiteb96f841b9563ba34969be25615548635728faf5 (patch)
tree32964c51498fd4b5683813a8f76b91b170175c77 /drivers/net/wireless/ti/wl18xx
parent045b9b5f4172b2b21af0b9bf5e6dda51146d51a4 (diff)
wlcore: Propagate errors from wl1271_write
Propagate errors from wl1271_write and request for recovery when appropriate. Also rename prefixes of wlcore functions which their prototypes had to be changed. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wl18xx')
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index 271ff81da922..974a6ff11f6d 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -720,10 +720,11 @@ static void wl18xx_pre_upload(struct wl1271 *wl)
720 tmp = wl1271_read32(wl, WL18XX_SCR_PAD2); 720 tmp = wl1271_read32(wl, WL18XX_SCR_PAD2);
721} 721}
722 722
723static void wl18xx_set_mac_and_phy(struct wl1271 *wl) 723static int wl18xx_set_mac_and_phy(struct wl1271 *wl)
724{ 724{
725 struct wl18xx_priv *priv = wl->priv; 725 struct wl18xx_priv *priv = wl->priv;
726 size_t len; 726 size_t len;
727 int ret;
727 728
728 /* the parameters struct is smaller for PG1 */ 729 /* the parameters struct is smaller for PG1 */
729 if (wl->chip.id == CHIP_ID_185x_PG10) 730 if (wl->chip.id == CHIP_ID_185x_PG10)
@@ -732,8 +733,10 @@ static void wl18xx_set_mac_and_phy(struct wl1271 *wl)
732 len = sizeof(struct wl18xx_mac_and_phy_params); 733 len = sizeof(struct wl18xx_mac_and_phy_params);
733 734
734 wlcore_set_partition(wl, &wl->ptable[PART_PHY_INIT]); 735 wlcore_set_partition(wl, &wl->ptable[PART_PHY_INIT]);
735 wl1271_write(wl, WL18XX_PHY_INIT_MEM_ADDR, (u8 *)&priv->conf.phy, len, 736 ret = wlcore_write(wl, WL18XX_PHY_INIT_MEM_ADDR, (u8 *)&priv->conf.phy,
736 false); 737 len, false);
738
739 return ret;
737} 740}
738 741
739static void wl18xx_enable_interrupts(struct wl1271 *wl) 742static void wl18xx_enable_interrupts(struct wl1271 *wl)
@@ -769,7 +772,9 @@ static int wl18xx_boot(struct wl1271 *wl)
769 if (ret < 0) 772 if (ret < 0)
770 goto out; 773 goto out;
771 774
772 wl18xx_set_mac_and_phy(wl); 775 ret = wl18xx_set_mac_and_phy(wl);
776 if (ret < 0)
777 goto out;
773 778
774 ret = wlcore_boot_run_firmware(wl); 779 ret = wlcore_boot_run_firmware(wl);
775 if (ret < 0) 780 if (ret < 0)
@@ -781,7 +786,7 @@ out:
781 return ret; 786 return ret;
782} 787}
783 788
784static void wl18xx_trigger_cmd(struct wl1271 *wl, int cmd_box_addr, 789static int wl18xx_trigger_cmd(struct wl1271 *wl, int cmd_box_addr,
785 void *buf, size_t len) 790 void *buf, size_t len)
786{ 791{
787 struct wl18xx_priv *priv = wl->priv; 792 struct wl18xx_priv *priv = wl->priv;
@@ -789,8 +794,8 @@ static void wl18xx_trigger_cmd(struct wl1271 *wl, int cmd_box_addr,
789 memcpy(priv->cmd_buf, buf, len); 794 memcpy(priv->cmd_buf, buf, len);
790 memset(priv->cmd_buf + len, 0, WL18XX_CMD_MAX_SIZE - len); 795 memset(priv->cmd_buf + len, 0, WL18XX_CMD_MAX_SIZE - len);
791 796
792 wl1271_write(wl, cmd_box_addr, priv->cmd_buf, WL18XX_CMD_MAX_SIZE, 797 return wlcore_write(wl, cmd_box_addr, priv->cmd_buf,
793 false); 798 WL18XX_CMD_MAX_SIZE, false);
794} 799}
795 800
796static void wl18xx_ack_event(struct wl1271 *wl) 801static void wl18xx_ack_event(struct wl1271 *wl)