aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
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')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c116
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c97
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c47
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h18
4 files changed, 201 insertions, 77 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
index 89ff94da556a..9c27870a62c6 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -222,19 +222,12 @@ bool brcmf_sdcard_regfail(struct brcmf_sdio_dev *sdiodev)
222 return sdiodev->regfail; 222 return sdiodev->regfail;
223} 223}
224 224
225int 225static int brcmf_sdcard_recv_prepare(struct brcmf_sdio_dev *sdiodev, uint fn,
226brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn, 226 uint flags, uint width, u32 *addr)
227 uint flags,
228 u8 *buf, uint nbytes, struct sk_buff *pkt)
229{ 227{
230 int status; 228 uint bar0 = *addr & ~SBSDIO_SB_OFT_ADDR_MASK;
231 uint incr_fix;
232 uint width;
233 uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
234 int err = 0; 229 int err = 0;
235 230
236 brcmf_dbg(INFO, "fun = %d, addr = 0x%x, size = %d\n", fn, addr, nbytes);
237
238 /* Async not implemented yet */ 231 /* Async not implemented yet */
239 if (flags & SDIO_REQ_ASYNC) 232 if (flags & SDIO_REQ_ASYNC)
240 return -ENOTSUPP; 233 return -ENOTSUPP;
@@ -247,29 +240,114 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
247 sdiodev->sbwad = bar0; 240 sdiodev->sbwad = bar0;
248 } 241 }
249 242
250 addr &= SBSDIO_SB_OFT_ADDR_MASK; 243 *addr &= SBSDIO_SB_OFT_ADDR_MASK;
244
245 if (width == 4)
246 *addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
247
248 return 0;
249}
250
251int
252brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
253 uint flags, u8 *buf, uint nbytes)
254{
255 struct sk_buff *mypkt;
256 int err;
257
258 mypkt = brcmu_pkt_buf_get_skb(nbytes);
259 if (!mypkt) {
260 brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len %d\n",
261 nbytes);
262 return -EIO;
263 }
264
265 err = brcmf_sdcard_recv_pkt(sdiodev, addr, fn, flags, mypkt);
266 if (!err)
267 memcpy(buf, mypkt->data, nbytes);
268
269 brcmu_pkt_buf_free_skb(mypkt);
270 return err;
271}
272
273int
274brcmf_sdcard_recv_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
275 uint flags, struct sk_buff *pkt)
276{
277 uint incr_fix;
278 uint width;
279 int err = 0;
280
281 brcmf_dbg(INFO, "fun = %d, addr = 0x%x, size = %d\n",
282 fn, addr, pkt->len);
283
284 width = (flags & SDIO_REQ_4BYTE) ? 4 : 2;
285 err = brcmf_sdcard_recv_prepare(sdiodev, fn, flags, width, &addr);
286 if (err)
287 return err;
251 288
252 incr_fix = (flags & SDIO_REQ_FIXED) ? SDIOH_DATA_FIX : SDIOH_DATA_INC; 289 incr_fix = (flags & SDIO_REQ_FIXED) ? SDIOH_DATA_FIX : SDIOH_DATA_INC;
290 err = brcmf_sdioh_request_buffer(sdiodev, incr_fix, SDIOH_READ,
291 fn, addr, width, 0, NULL, pkt);
292
293 return err;
294}
295
296int brcmf_sdcard_recv_chain(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
297 uint flags, struct sk_buff_head *pktq)
298{
299 uint incr_fix;
300 uint width;
301 int err = 0;
302
303 brcmf_dbg(INFO, "fun = %d, addr = 0x%x, size = %d\n",
304 fn, addr, pktq->qlen);
305
253 width = (flags & SDIO_REQ_4BYTE) ? 4 : 2; 306 width = (flags & SDIO_REQ_4BYTE) ? 4 : 2;
254 if (width == 4) 307 err = brcmf_sdcard_recv_prepare(sdiodev, fn, flags, width, &addr);
255 addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; 308 if (err)
309 return err;
256 310
257 status = brcmf_sdioh_request_buffer(sdiodev, incr_fix, SDIOH_READ, 311 incr_fix = (flags & SDIO_REQ_FIXED) ? SDIOH_DATA_FIX : SDIOH_DATA_INC;
258 fn, addr, width, nbytes, buf, pkt); 312 err = brcmf_sdioh_request_chain(sdiodev, incr_fix, SDIOH_READ, fn, addr,
313 pktq);
259 314
260 return status; 315 return err;
261} 316}
262 317
263int 318int
264brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn, 319brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
265 uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt) 320 uint flags, u8 *buf, uint nbytes)
321{
322 struct sk_buff *mypkt;
323 int err;
324
325 mypkt = brcmu_pkt_buf_get_skb(nbytes);
326 if (!mypkt) {
327 brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed: len %d\n",
328 nbytes);
329 return -EIO;
330 }
331
332 memcpy(mypkt->data, buf, nbytes);
333 err = brcmf_sdcard_send_pkt(sdiodev, addr, fn, flags, mypkt);
334
335 brcmu_pkt_buf_free_skb(mypkt);
336 return err;
337
338}
339
340int
341brcmf_sdcard_send_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
342 uint flags, struct sk_buff *pkt)
266{ 343{
267 uint incr_fix; 344 uint incr_fix;
268 uint width; 345 uint width;
269 uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK; 346 uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
270 int err = 0; 347 int err = 0;
271 348
272 brcmf_dbg(INFO, "fun = %d, addr = 0x%x, size = %d\n", fn, addr, nbytes); 349 brcmf_dbg(INFO, "fun = %d, addr = 0x%x, size = %d\n",
350 fn, addr, pkt->len);
273 351
274 /* Async not implemented yet */ 352 /* Async not implemented yet */
275 if (flags & SDIO_REQ_ASYNC) 353 if (flags & SDIO_REQ_ASYNC)
@@ -291,7 +369,7 @@ brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
291 addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; 369 addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
292 370
293 return brcmf_sdioh_request_buffer(sdiodev, incr_fix, SDIOH_WRITE, fn, 371 return brcmf_sdioh_request_buffer(sdiodev, incr_fix, SDIOH_WRITE, fn,
294 addr, width, nbytes, buf, pkt); 372 addr, width, 0, NULL, pkt);
295} 373}
296 374
297int brcmf_sdcard_rwdata(struct brcmf_sdio_dev *sdiodev, uint rw, u32 addr, 375int brcmf_sdcard_rwdata(struct brcmf_sdio_dev *sdiodev, uint rw, u32 addr,
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index bbaeb2d5c93a..4e75c191c290 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -204,16 +204,79 @@ int brcmf_sdioh_request_word(struct brcmf_sdio_dev *sdiodev,
204 return err_ret; 204 return err_ret;
205} 205}
206 206
207/* precondition: host controller is claimed */
208static int
209brcmf_sdioh_request_data(struct brcmf_sdio_dev *sdiodev, uint write, bool fifo,
210 uint func, uint addr, struct sk_buff *pkt, uint pktlen)
211{
212 int err_ret = 0;
213
214 if ((write) && (!fifo)) {
215 err_ret = sdio_memcpy_toio(sdiodev->func[func], addr,
216 ((u8 *) (pkt->data)), pktlen);
217 } else if (write) {
218 err_ret = sdio_memcpy_toio(sdiodev->func[func], addr,
219 ((u8 *) (pkt->data)), pktlen);
220 } else if (fifo) {
221 err_ret = sdio_readsb(sdiodev->func[func],
222 ((u8 *) (pkt->data)), addr, pktlen);
223 } else {
224 err_ret = sdio_memcpy_fromio(sdiodev->func[func],
225 ((u8 *) (pkt->data)),
226 addr, pktlen);
227 }
228
229 return err_ret;
230}
231
207static int 232static int
208brcmf_sdioh_request_packet(struct brcmf_sdio_dev *sdiodev, uint fix_inc, 233brcmf_sdioh_request_packet(struct brcmf_sdio_dev *sdiodev, uint fix_inc,
209 uint write, uint func, uint addr, 234 uint write, uint func, uint addr,
210 struct sk_buff *pkt) 235 struct sk_buff *pkt)
211{ 236{
212 bool fifo = (fix_inc == SDIOH_DATA_FIX); 237 bool fifo = (fix_inc == SDIOH_DATA_FIX);
238 int err_ret = 0;
239 uint pkt_len = pkt->len;
240
241 brcmf_dbg(TRACE, "Enter\n");
242
243 brcmf_pm_resume_wait(sdiodev, &sdiodev->request_packet_wait);
244 if (brcmf_pm_resume_error(sdiodev))
245 return -EIO;
246
247 /* Claim host controller */
248 sdio_claim_host(sdiodev->func[func]);
249
250 pkt_len += 3;
251 pkt_len &= 0xFFFFFFFC;
252
253 err_ret = brcmf_sdioh_request_data(sdiodev, write, fifo, func,
254 addr, pkt, pkt_len);
255 if (err_ret) {
256 brcmf_dbg(ERROR, "%s FAILED %p, addr=0x%05x, pkt_len=%d, ERR=0x%08x\n",
257 write ? "TX" : "RX", pkt, addr, pkt_len, err_ret);
258 } else {
259 brcmf_dbg(TRACE, "%s xfr'd %p, addr=0x%05x, len=%d\n",
260 write ? "TX" : "RX", pkt, addr, pkt_len);
261 }
262
263 /* Release host controller */
264 sdio_release_host(sdiodev->func[func]);
265
266 brcmf_dbg(TRACE, "Exit\n");
267 return err_ret;
268}
269
270int
271brcmf_sdioh_request_chain(struct brcmf_sdio_dev *sdiodev, uint fix_inc,
272 uint write, uint func, uint addr,
273 struct sk_buff_head *pktq)
274{
275 bool fifo = (fix_inc == SDIOH_DATA_FIX);
213 u32 SGCount = 0; 276 u32 SGCount = 0;
214 int err_ret = 0; 277 int err_ret = 0;
215 278
216 struct sk_buff *pnext; 279 struct sk_buff *pkt;
217 280
218 brcmf_dbg(TRACE, "Enter\n"); 281 brcmf_dbg(TRACE, "Enter\n");
219 282
@@ -223,43 +286,27 @@ brcmf_sdioh_request_packet(struct brcmf_sdio_dev *sdiodev, uint fix_inc,
223 286
224 /* Claim host controller */ 287 /* Claim host controller */
225 sdio_claim_host(sdiodev->func[func]); 288 sdio_claim_host(sdiodev->func[func]);
226 for (pnext = pkt; pnext; pnext = pnext->next) { 289
227 uint pkt_len = pnext->len; 290 skb_queue_walk(pktq, pkt) {
291 uint pkt_len = pkt->len;
228 pkt_len += 3; 292 pkt_len += 3;
229 pkt_len &= 0xFFFFFFFC; 293 pkt_len &= 0xFFFFFFFC;
230 294
231 if ((write) && (!fifo)) { 295 err_ret = brcmf_sdioh_request_data(sdiodev, write, fifo, func,
232 err_ret = sdio_memcpy_toio(sdiodev->func[func], addr, 296 addr, pkt, pkt_len);
233 ((u8 *) (pnext->data)),
234 pkt_len);
235 } else if (write) {
236 err_ret = sdio_memcpy_toio(sdiodev->func[func], addr,
237 ((u8 *) (pnext->data)),
238 pkt_len);
239 } else if (fifo) {
240 err_ret = sdio_readsb(sdiodev->func[func],
241 ((u8 *) (pnext->data)),
242 addr, pkt_len);
243 } else {
244 err_ret = sdio_memcpy_fromio(sdiodev->func[func],
245 ((u8 *) (pnext->data)),
246 addr, pkt_len);
247 }
248
249 if (err_ret) { 297 if (err_ret) {
250 brcmf_dbg(ERROR, "%s FAILED %p[%d], addr=0x%05x, pkt_len=%d, ERR=0x%08x\n", 298 brcmf_dbg(ERROR, "%s FAILED %p[%d], addr=0x%05x, pkt_len=%d, ERR=0x%08x\n",
251 write ? "TX" : "RX", pnext, SGCount, addr, 299 write ? "TX" : "RX", pkt, SGCount, addr,
252 pkt_len, err_ret); 300 pkt_len, err_ret);
253 } else { 301 } else {
254 brcmf_dbg(TRACE, "%s xfr'd %p[%d], addr=0x%05x, len=%d\n", 302 brcmf_dbg(TRACE, "%s xfr'd %p[%d], addr=0x%05x, len=%d\n",
255 write ? "TX" : "RX", pnext, SGCount, addr, 303 write ? "TX" : "RX", pkt, SGCount, addr,
256 pkt_len); 304 pkt_len);
257 } 305 }
258
259 if (!fifo) 306 if (!fifo)
260 addr += pkt_len; 307 addr += pkt_len;
261 SGCount++;
262 308
309 SGCount++;
263 } 310 }
264 311
265 /* Release host controller */ 312 /* Release host controller */
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 */
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h b/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
index 726fa8981113..85694ac2f420 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h
@@ -182,11 +182,21 @@ extern bool brcmf_sdcard_regfail(struct brcmf_sdio_dev *sdiodev);
182 * NOTE: Async operation is not currently supported. 182 * NOTE: Async operation is not currently supported.
183 */ 183 */
184extern int 184extern int
185brcmf_sdcard_send_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
186 uint flags, struct sk_buff *pkt);
187extern int
185brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn, 188brcmf_sdcard_send_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
186 uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt); 189 uint flags, u8 *buf, uint nbytes);
190
191extern int
192brcmf_sdcard_recv_pkt(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
193 uint flags, struct sk_buff *pkt);
187extern int 194extern int
188brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn, 195brcmf_sdcard_recv_buf(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
189 uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt); 196 uint flags, u8 *buf, uint nbytes);
197extern int
198brcmf_sdcard_recv_chain(struct brcmf_sdio_dev *sdiodev, u32 addr, uint fn,
199 uint flags, struct sk_buff_head *pktq);
190 200
191/* Flags bits */ 201/* Flags bits */
192 202
@@ -240,6 +250,10 @@ brcmf_sdioh_request_buffer(struct brcmf_sdio_dev *sdiodev,
240 uint fix_inc, uint rw, uint fnc_num, 250 uint fix_inc, uint rw, uint fnc_num,
241 u32 addr, uint regwidth, 251 u32 addr, uint regwidth,
242 u32 buflen, u8 *buffer, struct sk_buff *pkt); 252 u32 buflen, u8 *buffer, struct sk_buff *pkt);
253extern int
254brcmf_sdioh_request_chain(struct brcmf_sdio_dev *sdiodev, uint fix_inc,
255 uint write, uint func, uint addr,
256 struct sk_buff_head *pktq);
243 257
244/* Watchdog timer interface for pm ops */ 258/* Watchdog timer interface for pm ops */
245extern void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev, 259extern void brcmf_sdio_wdtmr_enable(struct brcmf_sdio_dev *sdiodev,