Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268641
b: refs/heads/master
c: 9f3697f
h: refs/heads/master
i:
  268639: 443bbf6
v: v3
  • Loading branch information
Roland Vossen authored and Greg Kroah-Hartman committed Oct 3, 2011
1 parent 52861ca commit b263dcf
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 42 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 800c2b675099813fcc0d210aa5ccb7ae8bab50a0
refs/heads/master: 9f3697f950a85028ade4b67d475c08a899722cba
85 changes: 44 additions & 41 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2960,6 +2960,48 @@ static int brcmf_sdbrcm_readconsole(struct brcmf_bus *bus)
}
#endif /* BCMDBG */

static int brcmf_tx_frame(struct brcmf_bus *bus, u8 *frame, u16 len)
{
int i;
int ret;

bus->ctrl_frame_stat = false;
ret = brcmf_sdbrcm_send_buf(bus, bus->sdiodev->sbwad,
SDIO_FUNC_2, F2SYNC, frame, len, NULL);

if (ret < 0) {
/* On failure, abort the command and terminate the frame */
brcmf_dbg(INFO, "sdio error %d, abort command and terminate frame\n",
ret);
bus->tx_sderrs++;

brcmf_sdcard_abort(bus->sdiodev, SDIO_FUNC_2);

brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_1,
SBSDIO_FUNC1_FRAMECTRL,
SFC_WF_TERM, NULL);
bus->f1regdata++;

for (i = 0; i < 3; i++) {
u8 hi, lo;
hi = brcmf_sdcard_cfg_read(bus->sdiodev, SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCHI,
NULL);
lo = brcmf_sdcard_cfg_read(bus->sdiodev, SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCLO,
NULL);
bus->f1regdata += 2;
if (hi == 0 && lo == 0)
break;
}
return ret;
}

bus->tx_seq = (bus->tx_seq + 1) % SDPCM_SEQUENCE_WRAP;

return ret;
}

int
brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
{
Expand All @@ -2969,7 +3011,6 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
uint retries = 0;
u8 doff = 0;
int ret = -1;
int i;

brcmf_dbg(TRACE, "Enter\n");

Expand Down Expand Up @@ -3060,46 +3101,8 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
#endif

do {
bus->ctrl_frame_stat = false;
ret = brcmf_sdbrcm_send_buf(bus, bus->sdiodev->sbwad,
SDIO_FUNC_2, F2SYNC, frame, len, NULL);

if (ret < 0) {
/* On failure, abort the command and
terminate the frame */
brcmf_dbg(INFO, "sdio error %d, abort command and terminate frame\n",
ret);
bus->tx_sderrs++;

brcmf_sdcard_abort(bus->sdiodev, SDIO_FUNC_2);

brcmf_sdcard_cfg_write(bus->sdiodev,
SDIO_FUNC_1,
SBSDIO_FUNC1_FRAMECTRL,
SFC_WF_TERM, NULL);
bus->f1regdata++;

for (i = 0; i < 3; i++) {
u8 hi, lo;
hi = brcmf_sdcard_cfg_read(bus->sdiodev,
SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCHI,
NULL);
lo = brcmf_sdcard_cfg_read(bus->sdiodev,
SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCLO,
NULL);
bus->f1regdata += 2;
if ((hi == 0) && (lo == 0))
break;
}

}
if (ret == 0)
bus->tx_seq =
(bus->tx_seq + 1) % SDPCM_SEQUENCE_WRAP;

} while ((ret < 0) && retries++ < TXRETRIES);
ret = brcmf_tx_frame(bus, frame, len);
} while (ret < 0 && retries++ < TXRETRIES);
}

if ((bus->idletime == BRCMF_IDLE_IMMEDIATE) && !bus->dpc_sched) {
Expand Down

0 comments on commit b263dcf

Please sign in to comment.