diff options
author | Franky Lin <frankyl@broadcom.com> | 2012-05-04 21:27:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-05-15 17:27:58 -0400 |
commit | 5c15c23a7be8b5c353d8e90ecf5bbd578c040a8a (patch) | |
tree | 843980c62f5df5e8c4782ad14c2ace4401505091 /drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |
parent | 586927505019573312e8478bd644ad1e9fc46432 (diff) |
brcmfmac: remove function brcmf_sdcard_regfail
The new interface brcmf_sdio_regr/w provides result of access
attempts. It is no longer necessary to use dedicated variable
and function to provide enquiry for failure.
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c index 5338f57620b4..1dbf2be478c8 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |||
@@ -1026,9 +1026,9 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_sdio *bus, bool abort, bool rtx) | |||
1026 | /* Wait until the packet has been flushed (device/FIFO stable) */ | 1026 | /* Wait until the packet has been flushed (device/FIFO stable) */ |
1027 | for (lastrbc = retries = 0xffff; retries > 0; retries--) { | 1027 | for (lastrbc = retries = 0xffff; retries > 0; retries--) { |
1028 | hi = brcmf_sdio_regrb(bus->sdiodev, | 1028 | hi = brcmf_sdio_regrb(bus->sdiodev, |
1029 | SBSDIO_FUNC1_RFRAMEBCHI, NULL); | 1029 | SBSDIO_FUNC1_RFRAMEBCHI, &err); |
1030 | lo = brcmf_sdio_regrb(bus->sdiodev, | 1030 | lo = brcmf_sdio_regrb(bus->sdiodev, |
1031 | SBSDIO_FUNC1_RFRAMEBCLO, NULL); | 1031 | SBSDIO_FUNC1_RFRAMEBCLO, &err); |
1032 | bus->f1regdata += 2; | 1032 | bus->f1regdata += 2; |
1033 | 1033 | ||
1034 | if ((hi == 0) && (lo == 0)) | 1034 | if ((hi == 0) && (lo == 0)) |
@@ -1060,7 +1060,7 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_sdio *bus, bool abort, bool rtx) | |||
1060 | bus->nextlen = 0; | 1060 | bus->nextlen = 0; |
1061 | 1061 | ||
1062 | /* If we can't reach the device, signal failure */ | 1062 | /* If we can't reach the device, signal failure */ |
1063 | if (err || brcmf_sdcard_regfail(bus->sdiodev)) | 1063 | if (err) |
1064 | bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; | 1064 | bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; |
1065 | } | 1065 | } |
1066 | 1066 | ||
@@ -2221,10 +2221,11 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_sdio *bus, uint maxframes) | |||
2221 | /* In poll mode, need to check for other events */ | 2221 | /* In poll mode, need to check for other events */ |
2222 | if (!bus->intr && cnt) { | 2222 | if (!bus->intr && cnt) { |
2223 | /* Check device status, signal pending interrupt */ | 2223 | /* Check device status, signal pending interrupt */ |
2224 | r_sdreg32(bus, &intstatus, | 2224 | ret = r_sdreg32(bus, &intstatus, |
2225 | offsetof(struct sdpcmd_regs, intstatus)); | 2225 | offsetof(struct sdpcmd_regs, |
2226 | intstatus)); | ||
2226 | bus->f2txdata++; | 2227 | bus->f2txdata++; |
2227 | if (brcmf_sdcard_regfail(bus->sdiodev)) | 2228 | if (ret != 0) |
2228 | break; | 2229 | break; |
2229 | if (intstatus & bus->hostintmask) | 2230 | if (intstatus & bus->hostintmask) |
2230 | bus->ipend = true; | 2231 | bus->ipend = true; |
@@ -2347,6 +2348,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus) | |||
2347 | uint framecnt = 0; /* Temporary counter of tx/rx frames */ | 2348 | uint framecnt = 0; /* Temporary counter of tx/rx frames */ |
2348 | bool rxdone = true; /* Flag for no more read data */ | 2349 | bool rxdone = true; /* Flag for no more read data */ |
2349 | bool resched = false; /* Flag indicating resched wanted */ | 2350 | bool resched = false; /* Flag indicating resched wanted */ |
2351 | int err; | ||
2350 | 2352 | ||
2351 | brcmf_dbg(TRACE, "Enter\n"); | 2353 | brcmf_dbg(TRACE, "Enter\n"); |
2352 | 2354 | ||
@@ -2357,7 +2359,6 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus) | |||
2357 | 2359 | ||
2358 | /* If waiting for HTAVAIL, check status */ | 2360 | /* If waiting for HTAVAIL, check status */ |
2359 | if (bus->clkstate == CLK_PENDING) { | 2361 | if (bus->clkstate == CLK_PENDING) { |
2360 | int err; | ||
2361 | u8 clkctl, devctl = 0; | 2362 | u8 clkctl, devctl = 0; |
2362 | 2363 | ||
2363 | #ifdef DEBUG | 2364 | #ifdef DEBUG |
@@ -2414,16 +2415,17 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus) | |||
2414 | /* Pending interrupt indicates new device status */ | 2415 | /* Pending interrupt indicates new device status */ |
2415 | if (bus->ipend) { | 2416 | if (bus->ipend) { |
2416 | bus->ipend = false; | 2417 | bus->ipend = false; |
2417 | r_sdreg32(bus, &newstatus, | 2418 | err = r_sdreg32(bus, &newstatus, |
2418 | offsetof(struct sdpcmd_regs, intstatus)); | 2419 | offsetof(struct sdpcmd_regs, intstatus)); |
2419 | bus->f1regdata++; | 2420 | bus->f1regdata++; |
2420 | if (brcmf_sdcard_regfail(bus->sdiodev)) | 2421 | if (err != 0) |
2421 | newstatus = 0; | 2422 | newstatus = 0; |
2422 | newstatus &= bus->hostintmask; | 2423 | newstatus &= bus->hostintmask; |
2423 | bus->fcstate = !!(newstatus & I_HMB_FC_STATE); | 2424 | bus->fcstate = !!(newstatus & I_HMB_FC_STATE); |
2424 | if (newstatus) { | 2425 | if (newstatus) { |
2425 | w_sdreg32(bus, newstatus, | 2426 | err = w_sdreg32(bus, newstatus, |
2426 | offsetof(struct sdpcmd_regs, intstatus)); | 2427 | offsetof(struct sdpcmd_regs, |
2428 | intstatus)); | ||
2427 | bus->f1regdata++; | 2429 | bus->f1regdata++; |
2428 | } | 2430 | } |
2429 | } | 2431 | } |
@@ -2438,11 +2440,11 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus) | |||
2438 | */ | 2440 | */ |
2439 | if (intstatus & I_HMB_FC_CHANGE) { | 2441 | if (intstatus & I_HMB_FC_CHANGE) { |
2440 | intstatus &= ~I_HMB_FC_CHANGE; | 2442 | intstatus &= ~I_HMB_FC_CHANGE; |
2441 | w_sdreg32(bus, I_HMB_FC_CHANGE, | 2443 | err = w_sdreg32(bus, I_HMB_FC_CHANGE, |
2442 | offsetof(struct sdpcmd_regs, intstatus)); | 2444 | offsetof(struct sdpcmd_regs, intstatus)); |
2443 | 2445 | ||
2444 | r_sdreg32(bus, &newstatus, | 2446 | err = r_sdreg32(bus, &newstatus, |
2445 | offsetof(struct sdpcmd_regs, intstatus)); | 2447 | offsetof(struct sdpcmd_regs, intstatus)); |
2446 | bus->f1regdata += 2; | 2448 | bus->f1regdata += 2; |
2447 | bus->fcstate = | 2449 | bus->fcstate = |
2448 | !!(newstatus & (I_HMB_FC_STATE | I_HMB_FC_CHANGE)); | 2450 | !!(newstatus & (I_HMB_FC_STATE | I_HMB_FC_CHANGE)); |
@@ -2513,17 +2515,17 @@ clkwait: | |||
2513 | brcmf_sdcard_abort(bus->sdiodev, SDIO_FUNC_2); | 2515 | brcmf_sdcard_abort(bus->sdiodev, SDIO_FUNC_2); |
2514 | 2516 | ||
2515 | brcmf_sdio_regwb(bus->sdiodev, SBSDIO_FUNC1_FRAMECTRL, | 2517 | brcmf_sdio_regwb(bus->sdiodev, SBSDIO_FUNC1_FRAMECTRL, |
2516 | SFC_WF_TERM, NULL); | 2518 | SFC_WF_TERM, &err); |
2517 | bus->f1regdata++; | 2519 | bus->f1regdata++; |
2518 | 2520 | ||
2519 | for (i = 0; i < 3; i++) { | 2521 | for (i = 0; i < 3; i++) { |
2520 | u8 hi, lo; | 2522 | u8 hi, lo; |
2521 | hi = brcmf_sdio_regrb(bus->sdiodev, | 2523 | hi = brcmf_sdio_regrb(bus->sdiodev, |
2522 | SBSDIO_FUNC1_WFRAMEBCHI, | 2524 | SBSDIO_FUNC1_WFRAMEBCHI, |
2523 | NULL); | 2525 | &err); |
2524 | lo = brcmf_sdio_regrb(bus->sdiodev, | 2526 | lo = brcmf_sdio_regrb(bus->sdiodev, |
2525 | SBSDIO_FUNC1_WFRAMEBCLO, | 2527 | SBSDIO_FUNC1_WFRAMEBCLO, |
2526 | NULL); | 2528 | &err); |
2527 | bus->f1regdata += 2; | 2529 | bus->f1regdata += 2; |
2528 | if ((hi == 0) && (lo == 0)) | 2530 | if ((hi == 0) && (lo == 0)) |
2529 | break; | 2531 | break; |
@@ -2550,10 +2552,8 @@ clkwait: | |||
2550 | else await next interrupt */ | 2552 | else await next interrupt */ |
2551 | /* On failed register access, all bets are off: | 2553 | /* On failed register access, all bets are off: |
2552 | no resched or interrupts */ | 2554 | no resched or interrupts */ |
2553 | if ((bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) || | 2555 | if ((bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) || (err != 0)) { |
2554 | brcmf_sdcard_regfail(bus->sdiodev)) { | 2556 | brcmf_dbg(ERROR, "failed backplane access over SDIO, halting operation\n"); |
2555 | brcmf_dbg(ERROR, "failed backplane access over SDIO, halting operation %d\n", | ||
2556 | brcmf_sdcard_regfail(bus->sdiodev)); | ||
2557 | bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; | 2557 | bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; |
2558 | bus->intstatus = 0; | 2558 | bus->intstatus = 0; |
2559 | } else if (bus->clkstate == CLK_PENDING) { | 2559 | } else if (bus->clkstate == CLK_PENDING) { |