aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-07-05 10:30:58 -0400
committerLuciano Coelho <coelho@ti.com>2012-07-18 08:08:21 -0400
commit45777c49ec376f5325e9ebbca85ee3e71697b0d2 (patch)
tree024711175b2af6210385ec7eed817134625aaaa1 /drivers/net/wireless
parent097b0e1bf18a00195cd89bb13565ddbc9b0df942 (diff)
wl18xx: alloc conf.phy memory to ensure alignemnt
We get DMA alignment trouble if the beginning of the conf.phy struct is not aligned to 4 bytes. Use kmemdup to ensure alignment. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index b378b34c4a6a..8bb21b6458b8 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -772,16 +772,24 @@ out:
772static int wl18xx_set_mac_and_phy(struct wl1271 *wl) 772static int wl18xx_set_mac_and_phy(struct wl1271 *wl)
773{ 773{
774 struct wl18xx_priv *priv = wl->priv; 774 struct wl18xx_priv *priv = wl->priv;
775 struct wl18xx_mac_and_phy_params *params;
775 int ret; 776 int ret;
776 777
778 params = kmemdup(&priv->conf.phy, sizeof(*params), GFP_KERNEL);
779 if (!params) {
780 ret = -ENOMEM;
781 goto out;
782 }
783
777 ret = wlcore_set_partition(wl, &wl->ptable[PART_PHY_INIT]); 784 ret = wlcore_set_partition(wl, &wl->ptable[PART_PHY_INIT]);
778 if (ret < 0) 785 if (ret < 0)
779 goto out; 786 goto out;
780 787
781 ret = wlcore_write(wl, WL18XX_PHY_INIT_MEM_ADDR, (u8 *)&priv->conf.phy, 788 ret = wlcore_write(wl, WL18XX_PHY_INIT_MEM_ADDR, params,
782 sizeof(struct wl18xx_mac_and_phy_params), false); 789 sizeof(*params), false);
783 790
784out: 791out:
792 kfree(params);
785 return ret; 793 return ret;
786} 794}
787 795