Commit 1e6f676f authored by Ian Molton's avatar Ian Molton Committed by Kalle Valo

brcmfmac: Register sizes on hardware are not dependent on compiler types

The 4 IO functions in this patch are incorrect as they use compiler types
to determine how many bytes to send to the hardware.
Signed-off-by: default avatarIan Molton <ian@mnementh.co.uk>
Signed-off-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 1fd3ae12
...@@ -264,7 +264,7 @@ static int brcmf_sdiod_request_data(struct brcmf_sdio_dev *sdiodev, u8 fn, ...@@ -264,7 +264,7 @@ static int brcmf_sdiod_request_data(struct brcmf_sdio_dev *sdiodev, u8 fn,
func = sdiodev->func[fn]; func = sdiodev->func[fn];
switch (regsz) { switch (regsz) {
case sizeof(u8): case 1:
if (write) { if (write) {
if (fn) if (fn)
sdio_writeb(func, *(u8 *)data, addr, &ret); sdio_writeb(func, *(u8 *)data, addr, &ret);
...@@ -278,13 +278,13 @@ static int brcmf_sdiod_request_data(struct brcmf_sdio_dev *sdiodev, u8 fn, ...@@ -278,13 +278,13 @@ static int brcmf_sdiod_request_data(struct brcmf_sdio_dev *sdiodev, u8 fn,
*(u8 *)data = sdio_f0_readb(func, addr, &ret); *(u8 *)data = sdio_f0_readb(func, addr, &ret);
} }
break; break;
case sizeof(u16): case 2:
if (write) if (write)
sdio_writew(func, *(u16 *)data, addr, &ret); sdio_writew(func, *(u16 *)data, addr, &ret);
else else
*(u16 *)data = sdio_readw(func, addr, &ret); *(u16 *)data = sdio_readw(func, addr, &ret);
break; break;
case sizeof(u32): case 4:
if (write) if (write)
sdio_writel(func, *(u32 *)data, addr, &ret); sdio_writel(func, *(u32 *)data, addr, &ret);
else else
...@@ -368,7 +368,7 @@ brcmf_sdiod_set_sbaddr_window(struct brcmf_sdio_dev *sdiodev, u32 address) ...@@ -368,7 +368,7 @@ brcmf_sdiod_set_sbaddr_window(struct brcmf_sdio_dev *sdiodev, u32 address)
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
err = brcmf_sdiod_regrw_helper(sdiodev, err = brcmf_sdiod_regrw_helper(sdiodev,
SBSDIO_FUNC1_SBADDRLOW + i, SBSDIO_FUNC1_SBADDRLOW + i,
sizeof(u8), &addr[i], true); 1, &addr[i], true);
if (err) { if (err) {
brcmf_err("failed at addr: 0x%0x\n", brcmf_err("failed at addr: 0x%0x\n",
SBSDIO_FUNC1_SBADDRLOW + i); SBSDIO_FUNC1_SBADDRLOW + i);
...@@ -407,7 +407,7 @@ u8 brcmf_sdiod_regrb(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret) ...@@ -407,7 +407,7 @@ u8 brcmf_sdiod_regrb(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret)
int retval; int retval;
brcmf_dbg(SDIO, "addr:0x%08x\n", addr); brcmf_dbg(SDIO, "addr:0x%08x\n", addr);
retval = brcmf_sdiod_regrw_helper(sdiodev, addr, sizeof(data), &data, retval = brcmf_sdiod_regrw_helper(sdiodev, addr, 1, &data,
false); false);
brcmf_dbg(SDIO, "data:0x%02x\n", data); brcmf_dbg(SDIO, "data:0x%02x\n", data);
...@@ -423,10 +423,10 @@ u32 brcmf_sdiod_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret) ...@@ -423,10 +423,10 @@ u32 brcmf_sdiod_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret)
int retval; int retval;
brcmf_dbg(SDIO, "addr:0x%08x\n", addr); brcmf_dbg(SDIO, "addr:0x%08x\n", addr);
retval = brcmf_sdiod_addrprep(sdiodev, sizeof(data), &addr); retval = brcmf_sdiod_addrprep(sdiodev, 4, &addr);
if (retval) if (retval)
goto done; goto done;
retval = brcmf_sdiod_regrw_helper(sdiodev, addr, sizeof(data), &data, retval = brcmf_sdiod_regrw_helper(sdiodev, addr, 4, &data,
false); false);
brcmf_dbg(SDIO, "data:0x%08x\n", data); brcmf_dbg(SDIO, "data:0x%08x\n", data);
...@@ -443,7 +443,7 @@ void brcmf_sdiod_regwb(struct brcmf_sdio_dev *sdiodev, u32 addr, ...@@ -443,7 +443,7 @@ void brcmf_sdiod_regwb(struct brcmf_sdio_dev *sdiodev, u32 addr,
int retval; int retval;
brcmf_dbg(SDIO, "addr:0x%08x, data:0x%02x\n", addr, data); brcmf_dbg(SDIO, "addr:0x%08x, data:0x%02x\n", addr, data);
retval = brcmf_sdiod_regrw_helper(sdiodev, addr, sizeof(data), &data, retval = brcmf_sdiod_regrw_helper(sdiodev, addr, 1, &data,
true); true);
if (ret) if (ret)
*ret = retval; *ret = retval;
...@@ -455,10 +455,10 @@ void brcmf_sdiod_regwl(struct brcmf_sdio_dev *sdiodev, u32 addr, ...@@ -455,10 +455,10 @@ void brcmf_sdiod_regwl(struct brcmf_sdio_dev *sdiodev, u32 addr,
int retval; int retval;
brcmf_dbg(SDIO, "addr:0x%08x, data:0x%08x\n", addr, data); brcmf_dbg(SDIO, "addr:0x%08x, data:0x%08x\n", addr, data);
retval = brcmf_sdiod_addrprep(sdiodev, sizeof(data), &addr); retval = brcmf_sdiod_addrprep(sdiodev, 4, &addr);
if (retval) if (retval)
goto done; goto done;
retval = brcmf_sdiod_regrw_helper(sdiodev, addr, sizeof(data), &data, retval = brcmf_sdiod_regrw_helper(sdiodev, addr, 4, &data,
true); true);
done: done:
...@@ -876,7 +876,7 @@ int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, uint fn) ...@@ -876,7 +876,7 @@ int brcmf_sdiod_abort(struct brcmf_sdio_dev *sdiodev, uint fn)
/* issue abort cmd52 command through F0 */ /* issue abort cmd52 command through F0 */
brcmf_sdiod_request_data(sdiodev, SDIO_FUNC_0, SDIO_CCCR_ABORT, brcmf_sdiod_request_data(sdiodev, SDIO_FUNC_0, SDIO_CCCR_ABORT,
sizeof(t_func), &t_func, true); 1, &t_func, true);
brcmf_dbg(SDIO, "Exit\n"); brcmf_dbg(SDIO, "Exit\n");
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment