aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFranky Lin <frankyl@broadcom.com>2011-11-22 20:21:52 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-28 14:43:41 -0500
commit8d169aa00d0356f915e84dbdf6c9be381cce34a4 (patch)
treee27b44c9551a5541143e634e2a5d27de3a8007d9 /drivers
parent655713be2cf1a69990eb510f3641e9ef05648f51 (diff)
brcm80211: fmac: move busstate to struct brcmf_bus
busstate keeps track of the bus (USB/SDIO) status and is used by both generic layer and bus layer. Move it to brcmf_bus helps to clean up the interface. This patch is part of fullmac bus interface refactoring. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Alwin Beukers <alwin@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')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd.h6
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c2
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c18
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c42
4 files changed, 37 insertions, 31 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
index a557971044bc..a104b74e0004 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
@@ -574,6 +574,7 @@ struct brcmf_dcmd {
574struct brcmf_bus { 574struct brcmf_bus {
575 u8 type; /* bus type */ 575 u8 type; /* bus type */
576 void *bus_priv; /* pointer to bus private structure */ 576 void *bus_priv; /* pointer to bus private structure */
577 enum brcmf_bus_state state;
577}; 578};
578 579
579/* Forward decls for struct brcmf_pub (see below) */ 580/* Forward decls for struct brcmf_pub (see below) */
@@ -586,6 +587,7 @@ struct brcmf_cfg80211_dev; /* cfg80211 device info */
586struct brcmf_pub { 587struct brcmf_pub {
587 /* Linkage ponters */ 588 /* Linkage ponters */
588 struct brcmf_sdio *bus; 589 struct brcmf_sdio *bus;
590 struct brcmf_bus *bus_if;
589 struct brcmf_proto *prot; 591 struct brcmf_proto *prot;
590 struct brcmf_info *info; 592 struct brcmf_info *info;
591 struct brcmf_cfg80211_dev *config; 593 struct brcmf_cfg80211_dev *config;
@@ -593,7 +595,6 @@ struct brcmf_pub {
593 /* Internal brcmf items */ 595 /* Internal brcmf items */
594 bool up; /* Driver up/down (to OS) */ 596 bool up; /* Driver up/down (to OS) */
595 bool txoff; /* Transmit flow-controlled */ 597 bool txoff; /* Transmit flow-controlled */
596 enum brcmf_bus_state busstate;
597 uint hdrlen; /* Total BRCMF header length (proto + bus) */ 598 uint hdrlen; /* Total BRCMF header length (proto + bus) */
598 uint maxctl; /* Max size rxctl request from proto to bus */ 599 uint maxctl; /* Max size rxctl request from proto to bus */
599 uint rxsz; /* Rx buffer size bus module should use */ 600 uint rxsz; /* Rx buffer size bus module should use */
@@ -661,7 +662,6 @@ struct brcmf_pub {
661 662
662 u8 country_code[BRCM_CNTRY_BUF_SZ]; 663 u8 country_code[BRCM_CNTRY_BUF_SZ];
663 char eventmask[BRCMF_EVENTING_MASK_LEN]; 664 char eventmask[BRCMF_EVENTING_MASK_LEN];
664
665}; 665};
666 666
667struct brcmf_if_event { 667struct brcmf_if_event {
@@ -687,7 +687,7 @@ extern uint brcmf_c_mkiovar(char *name, char *data, uint datalen,
687 * bus_hdrlen specifies required headroom for bus module header. 687 * bus_hdrlen specifies required headroom for bus module header.
688 */ 688 */
689extern struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus, 689extern struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus,
690 uint bus_hdrlen); 690 uint bus_hdrlen, struct device *dev);
691extern int brcmf_net_attach(struct brcmf_pub *drvr, int idx); 691extern int brcmf_net_attach(struct brcmf_pub *drvr, int idx);
692extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev); 692extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
693 693
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c
index e34c5c3d1d55..8e46bc64ca5f 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c
@@ -280,7 +280,7 @@ brcmf_proto_dcmd(struct brcmf_pub *drvr, int ifidx, struct brcmf_dcmd *dcmd,
280 struct brcmf_proto *prot = drvr->prot; 280 struct brcmf_proto *prot = drvr->prot;
281 int ret = -1; 281 int ret = -1;
282 282
283 if (drvr->busstate == BRCMF_BUS_DOWN) { 283 if (drvr->bus_if->state == BRCMF_BUS_DOWN) {
284 brcmf_dbg(ERROR, "bus is down. we have nothing to do.\n"); 284 brcmf_dbg(ERROR, "bus is down. we have nothing to do.\n");
285 return ret; 285 return ret;
286 } 286 }
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index e8f7f78f52cc..c13b30f6d220 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -292,7 +292,7 @@ int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx, struct sk_buff *pktbuf)
292 struct brcmf_info *drvr_priv = drvr->info; 292 struct brcmf_info *drvr_priv = drvr->info;
293 293
294 /* Reject if down */ 294 /* Reject if down */
295 if (!drvr->up || (drvr->busstate == BRCMF_BUS_DOWN)) 295 if (!drvr->up || (drvr->bus_if->state == BRCMF_BUS_DOWN))
296 return -ENODEV; 296 return -ENODEV;
297 297
298 /* Update multicast statistic */ 298 /* Update multicast statistic */
@@ -322,9 +322,11 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
322 brcmf_dbg(TRACE, "Enter\n"); 322 brcmf_dbg(TRACE, "Enter\n");
323 323
324 /* Reject if down */ 324 /* Reject if down */
325 if (!drvr_priv->pub.up || (drvr_priv->pub.busstate == BRCMF_BUS_DOWN)) { 325 if (!drvr_priv->pub.up ||
326 brcmf_dbg(ERROR, "xmit rejected pub.up=%d busstate=%d\n", 326 (drvr_priv->pub.bus_if->state == BRCMF_BUS_DOWN)) {
327 drvr_priv->pub.up, drvr_priv->pub.busstate); 327 brcmf_dbg(ERROR, "xmit rejected pub.up=%d state=%d\n",
328 drvr_priv->pub.up,
329 drvr_priv->pub.bus_if->state);
328 netif_stop_queue(ndev); 330 netif_stop_queue(ndev);
329 return -ENODEV; 331 return -ENODEV;
330 } 332 }
@@ -761,7 +763,7 @@ s32 brcmf_exec_dcmd(struct net_device *ndev, u32 cmd, void *arg, u32 len)
761 buflen = min_t(uint, dcmd.len, BRCMF_DCMD_MAXLEN); 763 buflen = min_t(uint, dcmd.len, BRCMF_DCMD_MAXLEN);
762 764
763 /* send to dongle (must be up, and wl) */ 765 /* send to dongle (must be up, and wl) */
764 if ((drvr_priv->pub.busstate != BRCMF_BUS_DATA)) { 766 if ((drvr_priv->pub.bus_if->state != BRCMF_BUS_DATA)) {
765 brcmf_dbg(ERROR, "DONGLE_DOWN\n"); 767 brcmf_dbg(ERROR, "DONGLE_DOWN\n");
766 err = -EIO; 768 err = -EIO;
767 goto done; 769 goto done;
@@ -940,7 +942,8 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
940 } 942 }
941} 943}
942 944
943struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus, uint bus_hdrlen) 945struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus, uint bus_hdrlen,
946 struct device *dev)
944{ 947{
945 struct brcmf_info *drvr_priv = NULL; 948 struct brcmf_info *drvr_priv = NULL;
946 949
@@ -959,6 +962,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus, uint bus_hdrlen)
959 /* Link to bus module */ 962 /* Link to bus module */
960 drvr_priv->pub.bus = bus; 963 drvr_priv->pub.bus = bus;
961 drvr_priv->pub.hdrlen = bus_hdrlen; 964 drvr_priv->pub.hdrlen = bus_hdrlen;
965 drvr_priv->pub.bus_if = dev_get_drvdata(dev);
962 966
963 /* Attach and link in the protocol */ 967 /* Attach and link in the protocol */
964 if (brcmf_proto_attach(&drvr_priv->pub) != 0) { 968 if (brcmf_proto_attach(&drvr_priv->pub) != 0) {
@@ -995,7 +999,7 @@ int brcmf_bus_start(struct brcmf_pub *drvr)
995 } 999 }
996 1000
997 /* If bus is not ready, can't come up */ 1001 /* If bus is not ready, can't come up */
998 if (drvr_priv->pub.busstate != BRCMF_BUS_DATA) { 1002 if (drvr_priv->pub.bus_if->state != BRCMF_BUS_DATA) {
999 brcmf_dbg(ERROR, "failed bus is not ready\n"); 1003 brcmf_dbg(ERROR, "failed bus is not ready\n");
1000 return -ENODEV; 1004 return -ENODEV;
1001 } 1005 }
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index 9ab906a91c48..7c8b5f77042c 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -1068,7 +1068,7 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_sdio *bus, bool abort, bool rtx)
1068 1068
1069 /* If we can't reach the device, signal failure */ 1069 /* If we can't reach the device, signal failure */
1070 if (err || brcmf_sdcard_regfail(bus->sdiodev)) 1070 if (err || brcmf_sdcard_regfail(bus->sdiodev))
1071 bus->drvr->busstate = BRCMF_BUS_DOWN; 1071 bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
1072} 1072}
1073 1073
1074/* copy a buffer into a pkt buffer chain */ 1074/* copy a buffer into a pkt buffer chain */
@@ -1714,7 +1714,8 @@ brcmf_sdbrcm_readframes(struct brcmf_sdio *bus, uint maxframes, bool *finished)
1714 *finished = false; 1714 *finished = false;
1715 1715
1716 for (rxseq = bus->rx_seq, rxleft = maxframes; 1716 for (rxseq = bus->rx_seq, rxleft = maxframes;
1717 !bus->rxskip && rxleft && bus->drvr->busstate != BRCMF_BUS_DOWN; 1717 !bus->rxskip && rxleft &&
1718 bus->drvr->bus_if->state != BRCMF_BUS_DOWN;
1718 rxseq++, rxleft--) { 1719 rxseq++, rxleft--) {
1719 1720
1720 /* Handle glomming separately */ 1721 /* Handle glomming separately */
@@ -2286,7 +2287,7 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_sdio *bus, uint maxframes)
2286 } 2287 }
2287 2288
2288 /* Deflow-control stack if needed */ 2289 /* Deflow-control stack if needed */
2289 if (drvr->up && (drvr->busstate == BRCMF_BUS_DATA) && 2290 if (drvr->up && (drvr->bus_if->state == BRCMF_BUS_DATA) &&
2290 drvr->txoff && (pktq_len(&bus->txq) < TXLOW)) 2291 drvr->txoff && (pktq_len(&bus->txq) < TXLOW))
2291 brcmf_txflowcontrol(drvr, 0, OFF); 2292 brcmf_txflowcontrol(drvr, 0, OFF);
2292 2293
@@ -2321,7 +2322,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
2321 SBSDIO_DEVICE_CTL, &err); 2322 SBSDIO_DEVICE_CTL, &err);
2322 if (err) { 2323 if (err) {
2323 brcmf_dbg(ERROR, "error reading DEVCTL: %d\n", err); 2324 brcmf_dbg(ERROR, "error reading DEVCTL: %d\n", err);
2324 bus->drvr->busstate = BRCMF_BUS_DOWN; 2325 bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
2325 } 2326 }
2326#endif /* BCMDBG */ 2327#endif /* BCMDBG */
2327 2328
@@ -2331,7 +2332,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
2331 if (err) { 2332 if (err) {
2332 brcmf_dbg(ERROR, "error reading CSR: %d\n", 2333 brcmf_dbg(ERROR, "error reading CSR: %d\n",
2333 err); 2334 err);
2334 bus->drvr->busstate = BRCMF_BUS_DOWN; 2335 bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
2335 } 2336 }
2336 2337
2337 brcmf_dbg(INFO, "DPC: PENDING, devctl 0x%02x clkctl 0x%02x\n", 2338 brcmf_dbg(INFO, "DPC: PENDING, devctl 0x%02x clkctl 0x%02x\n",
@@ -2344,7 +2345,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
2344 if (err) { 2345 if (err) {
2345 brcmf_dbg(ERROR, "error reading DEVCTL: %d\n", 2346 brcmf_dbg(ERROR, "error reading DEVCTL: %d\n",
2346 err); 2347 err);
2347 bus->drvr->busstate = BRCMF_BUS_DOWN; 2348 bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
2348 } 2349 }
2349 devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY; 2350 devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
2350 brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_1, 2351 brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_1,
@@ -2352,7 +2353,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
2352 if (err) { 2353 if (err) {
2353 brcmf_dbg(ERROR, "error writing DEVCTL: %d\n", 2354 brcmf_dbg(ERROR, "error writing DEVCTL: %d\n",
2354 err); 2355 err);
2355 bus->drvr->busstate = BRCMF_BUS_DOWN; 2356 bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
2356 } 2357 }
2357 bus->clkstate = CLK_AVAIL; 2358 bus->clkstate = CLK_AVAIL;
2358 } else { 2359 } else {
@@ -2508,11 +2509,11 @@ clkwait:
2508 else await next interrupt */ 2509 else await next interrupt */
2509 /* On failed register access, all bets are off: 2510 /* On failed register access, all bets are off:
2510 no resched or interrupts */ 2511 no resched or interrupts */
2511 if ((bus->drvr->busstate == BRCMF_BUS_DOWN) || 2512 if ((bus->drvr->bus_if->state == BRCMF_BUS_DOWN) ||
2512 brcmf_sdcard_regfail(bus->sdiodev)) { 2513 brcmf_sdcard_regfail(bus->sdiodev)) {
2513 brcmf_dbg(ERROR, "failed backplane access over SDIO, halting operation %d\n", 2514 brcmf_dbg(ERROR, "failed backplane access over SDIO, halting operation %d\n",
2514 brcmf_sdcard_regfail(bus->sdiodev)); 2515 brcmf_sdcard_regfail(bus->sdiodev));
2515 bus->drvr->busstate = BRCMF_BUS_DOWN; 2516 bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
2516 bus->intstatus = 0; 2517 bus->intstatus = 0;
2517 } else if (bus->clkstate == CLK_PENDING) { 2518 } else if (bus->clkstate == CLK_PENDING) {
2518 brcmf_dbg(INFO, "rescheduled due to CLK_PENDING awaiting I_CHIPACTIVE interrupt\n"); 2519 brcmf_dbg(INFO, "rescheduled due to CLK_PENDING awaiting I_CHIPACTIVE interrupt\n");
@@ -2549,7 +2550,7 @@ static int brcmf_sdbrcm_dpc_thread(void *data)
2549 if (!wait_for_completion_interruptible(&bus->dpc_wait)) { 2550 if (!wait_for_completion_interruptible(&bus->dpc_wait)) {
2550 /* Call bus dpc unless it indicated down 2551 /* Call bus dpc unless it indicated down
2551 (then clean stop) */ 2552 (then clean stop) */
2552 if (bus->drvr->busstate != BRCMF_BUS_DOWN) { 2553 if (bus->drvr->bus_if->state != BRCMF_BUS_DOWN) {
2553 if (brcmf_sdbrcm_dpc(bus)) 2554 if (brcmf_sdbrcm_dpc(bus))
2554 complete(&bus->dpc_wait); 2555 complete(&bus->dpc_wait);
2555 } else { 2556 } else {
@@ -3111,7 +3112,7 @@ static int brcmf_sdbrcm_download_state(struct brcmf_sdio *bus, bool enter)
3111 /* Allow HT Clock now that the ARM is running. */ 3112 /* Allow HT Clock now that the ARM is running. */
3112 bus->alp_only = false; 3113 bus->alp_only = false;
3113 3114
3114 bus->drvr->busstate = BRCMF_BUS_LOAD; 3115 bus->drvr->bus_if->state = BRCMF_BUS_LOAD;
3115 } 3116 }
3116fail: 3117fail:
3117 return bcmerror; 3118 return bcmerror;
@@ -3354,7 +3355,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_sdio *bus)
3354 bus->hostintmask = 0; 3355 bus->hostintmask = 0;
3355 3356
3356 /* Change our idea of bus state */ 3357 /* Change our idea of bus state */
3357 bus->drvr->busstate = BRCMF_BUS_DOWN; 3358 bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
3358 3359
3359 /* Force clocks on backplane to be sure F2 interrupt propagates */ 3360 /* Force clocks on backplane to be sure F2 interrupt propagates */
3360 saveclk = brcmf_sdcard_cfg_read(bus->sdiodev, SDIO_FUNC_1, 3361 saveclk = brcmf_sdcard_cfg_read(bus->sdiodev, SDIO_FUNC_1,
@@ -3410,7 +3411,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr)
3410 brcmf_dbg(TRACE, "Enter\n"); 3411 brcmf_dbg(TRACE, "Enter\n");
3411 3412
3412 /* try to download image and nvram to the dongle */ 3413 /* try to download image and nvram to the dongle */
3413 if (drvr->busstate == BRCMF_BUS_DOWN) { 3414 if (drvr->bus_if->state == BRCMF_BUS_DOWN) {
3414 if (!(brcmf_sdbrcm_download_firmware(bus))) 3415 if (!(brcmf_sdbrcm_download_firmware(bus)))
3415 return -1; 3416 return -1;
3416 } 3417 }
@@ -3476,7 +3477,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr)
3476 SBSDIO_WATERMARK, 8, &err); 3477 SBSDIO_WATERMARK, 8, &err);
3477 3478
3478 /* Set bus state according to enable result */ 3479 /* Set bus state according to enable result */
3479 drvr->busstate = BRCMF_BUS_DATA; 3480 drvr->bus_if->state = BRCMF_BUS_DATA;
3480 } 3481 }
3481 3482
3482 else { 3483 else {
@@ -3491,7 +3492,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr)
3491 SBSDIO_FUNC1_CHIPCLKCSR, saveclk, &err); 3492 SBSDIO_FUNC1_CHIPCLKCSR, saveclk, &err);
3492 3493
3493 /* If we didn't come up, turn off backplane clock */ 3494 /* If we didn't come up, turn off backplane clock */
3494 if (drvr->busstate != BRCMF_BUS_DATA) 3495 if (drvr->bus_if->state != BRCMF_BUS_DATA)
3495 brcmf_sdbrcm_clkctl(bus, CLK_NONE, false); 3496 brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
3496 3497
3497exit: 3498exit:
@@ -3511,7 +3512,7 @@ void brcmf_sdbrcm_isr(void *arg)
3511 return; 3512 return;
3512 } 3513 }
3513 3514
3514 if (bus->drvr->busstate == BRCMF_BUS_DOWN) { 3515 if (bus->drvr->bus_if->state == BRCMF_BUS_DOWN) {
3515 brcmf_dbg(ERROR, "bus is down. we have nothing to do\n"); 3516 brcmf_dbg(ERROR, "bus is down. we have nothing to do\n");
3516 return; 3517 return;
3517 } 3518 }
@@ -3585,7 +3586,8 @@ static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *drvr)
3585 } 3586 }
3586#ifdef BCMDBG 3587#ifdef BCMDBG
3587 /* Poll for console output periodically */ 3588 /* Poll for console output periodically */
3588 if (drvr->busstate == BRCMF_BUS_DATA && bus->console_interval != 0) { 3589 if (drvr->bus_if->state == BRCMF_BUS_DATA &&
3590 bus->console_interval != 0) {
3589 bus->console.count += BRCMF_WD_POLL_MS; 3591 bus->console.count += BRCMF_WD_POLL_MS;
3590 if (bus->console.count >= bus->console_interval) { 3592 if (bus->console.count >= bus->console_interval) {
3591 bus->console.count -= bus->console_interval; 3593 bus->console.count -= bus->console_interval;
@@ -3764,7 +3766,7 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_sdio *bus)
3764 brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_0, SDIO_CCCR_IOEx, 3766 brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_0, SDIO_CCCR_IOEx,
3765 SDIO_FUNC_ENABLE_1, NULL); 3767 SDIO_FUNC_ENABLE_1, NULL);
3766 3768
3767 bus->drvr->busstate = BRCMF_BUS_DOWN; 3769 bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
3768 bus->sleeping = false; 3770 bus->sleeping = false;
3769 bus->rxflow = false; 3771 bus->rxflow = false;
3770 3772
@@ -3924,7 +3926,7 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
3924 } 3926 }
3925 3927
3926 /* Attach to the brcmf/OS/network interface */ 3928 /* Attach to the brcmf/OS/network interface */
3927 bus->drvr = brcmf_attach(bus, SDPCM_RESERVE); 3929 bus->drvr = brcmf_attach(bus, SDPCM_RESERVE, bus->sdiodev->dev);
3928 if (!bus->drvr) { 3930 if (!bus->drvr) {
3929 brcmf_dbg(ERROR, "brcmf_attach failed\n"); 3931 brcmf_dbg(ERROR, "brcmf_attach failed\n");
3930 goto fail; 3932 goto fail;
@@ -4003,7 +4005,7 @@ brcmf_sdbrcm_wd_timer(struct brcmf_sdio *bus, uint wdtick)
4003 } 4005 }
4004 4006
4005 /* don't start the wd until fw is loaded */ 4007 /* don't start the wd until fw is loaded */
4006 if (bus->drvr->busstate == BRCMF_BUS_DOWN) 4008 if (bus->drvr->bus_if->state == BRCMF_BUS_DOWN)
4007 return; 4009 return;
4008 4010
4009 if (wdtick) { 4011 if (wdtick) {