aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2011-11-22 20:21:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-28 14:43:28 -0500
commit5adfeb632c52a6c15e98fa6465bdade6fff915d9 (patch)
tree3e1284a88a535fedf1933dff75f1b09f344bdf18 /drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
parent3030794fcae9b07d62a9ff7649a413dff0c88e01 (diff)
brcm80211: fmac: separate receiving skb chain from other receive path
In the receive path the buffer used to store the receive data from the device can be a chain of sk_buff. It has been separated to allow the use of skb queues. Reported-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Signed-off-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.c47
1 files changed, 16 insertions, 31 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index 10b9247ec539..a9b8272d1b17 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -1228,17 +1228,14 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
1228 * packet and and copy into the chain. 1228 * packet and and copy into the chain.
1229 */ 1229 */
1230 if (usechain) { 1230 if (usechain) {
1231 errcode = brcmf_sdcard_recv_buf(bus->sdiodev, 1231 errcode = brcmf_sdcard_recv_chain(bus->sdiodev,
1232 bus->sdiodev->sbwad, 1232 bus->sdiodev->sbwad,
1233 SDIO_FUNC_2, 1233 SDIO_FUNC_2, F2SYNC, &bus->glom);
1234 F2SYNC, (u8 *) pfirst->data, dlen,
1235 pfirst);
1236 } else if (bus->dataptr) { 1234 } else if (bus->dataptr) {
1237 errcode = brcmf_sdcard_recv_buf(bus->sdiodev, 1235 errcode = brcmf_sdcard_recv_buf(bus->sdiodev,
1238 bus->sdiodev->sbwad, 1236 bus->sdiodev->sbwad,
1239 SDIO_FUNC_2, 1237 SDIO_FUNC_2, F2SYNC,
1240 F2SYNC, bus->dataptr, dlen, 1238 bus->dataptr, dlen);
1241 NULL);
1242 sublen = (u16) brcmf_sdbrcm_glom_from_buf(bus, dlen); 1239 sublen = (u16) brcmf_sdbrcm_glom_from_buf(bus, dlen);
1243 if (sublen != dlen) { 1240 if (sublen != dlen) {
1244 brcmf_dbg(ERROR, "FAILED TO COPY, dlen %d sublen %d\n", 1241 brcmf_dbg(ERROR, "FAILED TO COPY, dlen %d sublen %d\n",
@@ -1560,8 +1557,7 @@ brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)
1560 sdret = brcmf_sdcard_recv_buf(bus->sdiodev, 1557 sdret = brcmf_sdcard_recv_buf(bus->sdiodev,
1561 bus->sdiodev->sbwad, 1558 bus->sdiodev->sbwad,
1562 SDIO_FUNC_2, 1559 SDIO_FUNC_2,
1563 F2SYNC, (bus->rxctl + BRCMF_FIRSTREAD), rdlen, 1560 F2SYNC, (bus->rxctl + BRCMF_FIRSTREAD), rdlen);
1564 NULL);
1565 bus->f2rxdata++; 1561 bus->f2rxdata++;
1566 1562
1567 /* Control frame failures need retransmission */ 1563 /* Control frame failures need retransmission */
@@ -1617,9 +1613,8 @@ brcmf_alloc_pkt_and_read(struct brcmf_bus *bus, u16 rdlen,
1617 pkt_align(*pkt, rdlen, BRCMF_SDALIGN); 1613 pkt_align(*pkt, rdlen, BRCMF_SDALIGN);
1618 *rxbuf = (u8 *) ((*pkt)->data); 1614 *rxbuf = (u8 *) ((*pkt)->data);
1619 /* Read the entire frame */ 1615 /* Read the entire frame */
1620 sdret = brcmf_sdcard_recv_buf(bus->sdiodev, bus->sdiodev->sbwad, 1616 sdret = brcmf_sdcard_recv_pkt(bus->sdiodev, bus->sdiodev->sbwad,
1621 SDIO_FUNC_2, F2SYNC, 1617 SDIO_FUNC_2, F2SYNC, *pkt);
1622 *rxbuf, rdlen, *pkt);
1623 bus->f2rxdata++; 1618 bus->f2rxdata++;
1624 1619
1625 if (sdret < 0) { 1620 if (sdret < 0) {
@@ -1847,7 +1842,7 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
1847 /* Read frame header (hardware and software) */ 1842 /* Read frame header (hardware and software) */
1848 sdret = brcmf_sdcard_recv_buf(bus->sdiodev, bus->sdiodev->sbwad, 1843 sdret = brcmf_sdcard_recv_buf(bus->sdiodev, bus->sdiodev->sbwad,
1849 SDIO_FUNC_2, F2SYNC, bus->rxhdr, 1844 SDIO_FUNC_2, F2SYNC, bus->rxhdr,
1850 BRCMF_FIRSTREAD, NULL); 1845 BRCMF_FIRSTREAD);
1851 bus->f2rxhdrs++; 1846 bus->f2rxhdrs++;
1852 1847
1853 if (sdret < 0) { 1848 if (sdret < 0) {
@@ -1996,9 +1991,8 @@ brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
1996 pkt_align(pkt, rdlen, BRCMF_SDALIGN); 1991 pkt_align(pkt, rdlen, BRCMF_SDALIGN);
1997 1992
1998 /* Read the remaining frame data */ 1993 /* Read the remaining frame data */
1999 sdret = brcmf_sdcard_recv_buf(bus->sdiodev, bus->sdiodev->sbwad, 1994 sdret = brcmf_sdcard_recv_pkt(bus->sdiodev, bus->sdiodev->sbwad,
2000 SDIO_FUNC_2, F2SYNC, ((u8 *) (pkt->data)), 1995 SDIO_FUNC_2, F2SYNC, pkt);
2001 rdlen, pkt);
2002 bus->f2rxdata++; 1996 bus->f2rxdata++;
2003 1997
2004 if (sdret < 0) { 1998 if (sdret < 0) {
@@ -2085,14 +2079,6 @@ deliver:
2085 return rxcount; 2079 return rxcount;
2086} 2080}
2087 2081
2088static int
2089brcmf_sdbrcm_send_buf(struct brcmf_bus *bus, u32 addr, uint fn, uint flags,
2090 u8 *buf, uint nbytes, struct sk_buff *pkt)
2091{
2092 return brcmf_sdcard_send_buf
2093 (bus->sdiodev, addr, fn, flags, buf, nbytes, pkt);
2094}
2095
2096static void 2082static void
2097brcmf_sdbrcm_wait_for_event(struct brcmf_bus *bus, bool *lockvar) 2083brcmf_sdbrcm_wait_for_event(struct brcmf_bus *bus, bool *lockvar)
2098{ 2084{
@@ -2202,9 +2188,8 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt,
2202 if (len & (ALIGNMENT - 1)) 2188 if (len & (ALIGNMENT - 1))
2203 len = roundup(len, ALIGNMENT); 2189 len = roundup(len, ALIGNMENT);
2204 2190
2205 ret = brcmf_sdbrcm_send_buf(bus, bus->sdiodev->sbwad, 2191 ret = brcmf_sdcard_send_pkt(bus->sdiodev, bus->sdiodev->sbwad,
2206 SDIO_FUNC_2, F2SYNC, frame, 2192 SDIO_FUNC_2, F2SYNC, pkt);
2207 len, pkt);
2208 bus->f2txdata++; 2193 bus->f2txdata++;
2209 2194
2210 if (ret < 0) { 2195 if (ret < 0) {
@@ -2467,9 +2452,9 @@ clkwait:
2467 (bus->clkstate == CLK_AVAIL)) { 2452 (bus->clkstate == CLK_AVAIL)) {
2468 int ret, i; 2453 int ret, i;
2469 2454
2470 ret = brcmf_sdbrcm_send_buf(bus, bus->sdiodev->sbwad, 2455 ret = brcmf_sdcard_send_buf(bus->sdiodev, bus->sdiodev->sbwad,
2471 SDIO_FUNC_2, F2SYNC, (u8 *) bus->ctrl_frame_buf, 2456 SDIO_FUNC_2, F2SYNC, (u8 *) bus->ctrl_frame_buf,
2472 (u32) bus->ctrl_frame_len, NULL); 2457 (u32) bus->ctrl_frame_len);
2473 2458
2474 if (ret < 0) { 2459 if (ret < 0) {
2475 /* On failure, abort the command and 2460 /* On failure, abort the command and
@@ -2772,8 +2757,8 @@ static int brcmf_tx_frame(struct brcmf_bus *bus, u8 *frame, u16 len)
2772 int ret; 2757 int ret;
2773 2758
2774 bus->ctrl_frame_stat = false; 2759 bus->ctrl_frame_stat = false;
2775 ret = brcmf_sdbrcm_send_buf(bus, bus->sdiodev->sbwad, 2760 ret = brcmf_sdcard_send_buf(bus->sdiodev, bus->sdiodev->sbwad,
2776 SDIO_FUNC_2, F2SYNC, frame, len, NULL); 2761 SDIO_FUNC_2, F2SYNC, frame, len);
2777 2762
2778 if (ret < 0) { 2763 if (ret < 0) {
2779 /* On failure, abort the command and terminate the frame */ 2764 /* On failure, abort the command and terminate the frame */