aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
diff options
context:
space:
mode:
authorFranky Lin <frankyl@broadcom.com>2011-11-22 20:21:50 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-28 14:43:39 -0500
commite92eedf4e080fc0bd98e892cb9d31d2163ae8b29 (patch)
tree7b78f36f5ff8594efaae0e8c725e07f99d0746d7 /drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
parent4175b88bd22022a60de175f94fdb303bed087eb9 (diff)
brcm80211: fmac: rename structure brcmf_bus to brcmf_sdio
Rename sdio bus structure brcmf_bus to brcmf_sdio for preparation of USB bus support. This patch is part of the 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/net/wireless/brcm80211/brcmfmac/dhd_sdio.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c120
1 files changed, 60 insertions, 60 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index f01da6a5b040..9ab906a91c48 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -449,7 +449,7 @@ struct sdpcm_shared_le {
449 449
450/* misc chip info needed by some of the routines */ 450/* misc chip info needed by some of the routines */
451/* Private data for SDIO bus interaction */ 451/* Private data for SDIO bus interaction */
452struct brcmf_bus { 452struct brcmf_sdio {
453 struct brcmf_pub *drvr; 453 struct brcmf_pub *drvr;
454 454
455 struct brcmf_sdio_dev *sdiodev; /* sdio device handler */ 455 struct brcmf_sdio_dev *sdiodev; /* sdio device handler */
@@ -604,7 +604,7 @@ static void pkt_align(struct sk_buff *p, int len, int align)
604} 604}
605 605
606/* To check if there's window offered */ 606/* To check if there's window offered */
607static bool data_ok(struct brcmf_bus *bus) 607static bool data_ok(struct brcmf_sdio *bus)
608{ 608{
609 return (u8)(bus->tx_max - bus->tx_seq) != 0 && 609 return (u8)(bus->tx_max - bus->tx_seq) != 0 &&
610 ((u8)(bus->tx_max - bus->tx_seq) & 0x80) == 0; 610 ((u8)(bus->tx_max - bus->tx_seq) & 0x80) == 0;
@@ -615,7 +615,7 @@ static bool data_ok(struct brcmf_bus *bus)
615 * adresses on the 32 bit backplane bus. 615 * adresses on the 32 bit backplane bus.
616 */ 616 */
617static void 617static void
618r_sdreg32(struct brcmf_bus *bus, u32 *regvar, u32 reg_offset, u32 *retryvar) 618r_sdreg32(struct brcmf_sdio *bus, u32 *regvar, u32 reg_offset, u32 *retryvar)
619{ 619{
620 u8 idx = brcmf_sdio_chip_getinfidx(bus->ci, BCMA_CORE_SDIO_DEV); 620 u8 idx = brcmf_sdio_chip_getinfidx(bus->ci, BCMA_CORE_SDIO_DEV);
621 *retryvar = 0; 621 *retryvar = 0;
@@ -635,7 +635,7 @@ r_sdreg32(struct brcmf_bus *bus, u32 *regvar, u32 reg_offset, u32 *retryvar)
635} 635}
636 636
637static void 637static void
638w_sdreg32(struct brcmf_bus *bus, u32 regval, u32 reg_offset, u32 *retryvar) 638w_sdreg32(struct brcmf_sdio *bus, u32 regval, u32 reg_offset, u32 *retryvar)
639{ 639{
640 u8 idx = brcmf_sdio_chip_getinfidx(bus->ci, BCMA_CORE_SDIO_DEV); 640 u8 idx = brcmf_sdio_chip_getinfidx(bus->ci, BCMA_CORE_SDIO_DEV);
641 *retryvar = 0; 641 *retryvar = 0;
@@ -660,14 +660,14 @@ w_sdreg32(struct brcmf_bus *bus, u32 regval, u32 reg_offset, u32 *retryvar)
660/* Packet free applicable unconditionally for sdio and sdspi. 660/* Packet free applicable unconditionally for sdio and sdspi.
661 * Conditional if bufpool was present for gspi bus. 661 * Conditional if bufpool was present for gspi bus.
662 */ 662 */
663static void brcmf_sdbrcm_pktfree2(struct brcmf_bus *bus, struct sk_buff *pkt) 663static void brcmf_sdbrcm_pktfree2(struct brcmf_sdio *bus, struct sk_buff *pkt)
664{ 664{
665 if (bus->usebufpool) 665 if (bus->usebufpool)
666 brcmu_pkt_buf_free_skb(pkt); 666 brcmu_pkt_buf_free_skb(pkt);
667} 667}
668 668
669/* Turn backplane clock on or off */ 669/* Turn backplane clock on or off */
670static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok) 670static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
671{ 671{
672 int err; 672 int err;
673 u8 clkctl, clkreq, devctl; 673 u8 clkctl, clkreq, devctl;
@@ -788,7 +788,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
788} 788}
789 789
790/* Change idle/active SD state */ 790/* Change idle/active SD state */
791static int brcmf_sdbrcm_sdclk(struct brcmf_bus *bus, bool on) 791static int brcmf_sdbrcm_sdclk(struct brcmf_sdio *bus, bool on)
792{ 792{
793 brcmf_dbg(TRACE, "Enter\n"); 793 brcmf_dbg(TRACE, "Enter\n");
794 794
@@ -801,7 +801,7 @@ static int brcmf_sdbrcm_sdclk(struct brcmf_bus *bus, bool on)
801} 801}
802 802
803/* Transition SD and backplane clock readiness */ 803/* Transition SD and backplane clock readiness */
804static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok) 804static int brcmf_sdbrcm_clkctl(struct brcmf_sdio *bus, uint target, bool pendok)
805{ 805{
806#ifdef BCMDBG 806#ifdef BCMDBG
807 uint oldstate = bus->clkstate; 807 uint oldstate = bus->clkstate;
@@ -857,7 +857,7 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
857 return 0; 857 return 0;
858} 858}
859 859
860static int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep) 860static int brcmf_sdbrcm_bussleep(struct brcmf_sdio *bus, bool sleep)
861{ 861{
862 uint retries = 0; 862 uint retries = 0;
863 863
@@ -929,13 +929,13 @@ static int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
929 return 0; 929 return 0;
930} 930}
931 931
932static void bus_wake(struct brcmf_bus *bus) 932static void bus_wake(struct brcmf_sdio *bus)
933{ 933{
934 if (bus->sleeping) 934 if (bus->sleeping)
935 brcmf_sdbrcm_bussleep(bus, false); 935 brcmf_sdbrcm_bussleep(bus, false);
936} 936}
937 937
938static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus) 938static u32 brcmf_sdbrcm_hostmail(struct brcmf_sdio *bus)
939{ 939{
940 u32 intstatus = 0; 940 u32 intstatus = 0;
941 u32 hmb_data; 941 u32 hmb_data;
@@ -1011,7 +1011,7 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
1011 return intstatus; 1011 return intstatus;
1012} 1012}
1013 1013
1014static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx) 1014static void brcmf_sdbrcm_rxfail(struct brcmf_sdio *bus, bool abort, bool rtx)
1015{ 1015{
1016 uint retries = 0; 1016 uint retries = 0;
1017 u16 lastrbc; 1017 u16 lastrbc;
@@ -1072,7 +1072,7 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)
1072} 1072}
1073 1073
1074/* copy a buffer into a pkt buffer chain */ 1074/* copy a buffer into a pkt buffer chain */
1075static uint brcmf_sdbrcm_glom_from_buf(struct brcmf_bus *bus, uint len) 1075static uint brcmf_sdbrcm_glom_from_buf(struct brcmf_sdio *bus, uint len)
1076{ 1076{
1077 uint n, ret = 0; 1077 uint n, ret = 0;
1078 struct sk_buff *p; 1078 struct sk_buff *p;
@@ -1095,7 +1095,7 @@ static uint brcmf_sdbrcm_glom_from_buf(struct brcmf_bus *bus, uint len)
1095} 1095}
1096 1096
1097/* return total length of buffer chain */ 1097/* return total length of buffer chain */
1098static uint brcmf_sdbrcm_glom_len(struct brcmf_bus *bus) 1098static uint brcmf_sdbrcm_glom_len(struct brcmf_sdio *bus)
1099{ 1099{
1100 struct sk_buff *p; 1100 struct sk_buff *p;
1101 uint total; 1101 uint total;
@@ -1106,7 +1106,7 @@ static uint brcmf_sdbrcm_glom_len(struct brcmf_bus *bus)
1106 return total; 1106 return total;
1107} 1107}
1108 1108
1109static void brcmf_sdbrcm_free_glom(struct brcmf_bus *bus) 1109static void brcmf_sdbrcm_free_glom(struct brcmf_sdio *bus)
1110{ 1110{
1111 struct sk_buff *cur, *next; 1111 struct sk_buff *cur, *next;
1112 1112
@@ -1116,7 +1116,7 @@ static void brcmf_sdbrcm_free_glom(struct brcmf_bus *bus)
1116 } 1116 }
1117} 1117}
1118 1118
1119static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq) 1119static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
1120{ 1120{
1121 u16 dlen, totlen; 1121 u16 dlen, totlen;
1122 u8 *dptr, num = 0; 1122 u8 *dptr, num = 0;
@@ -1471,7 +1471,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
1471 return num; 1471 return num;
1472} 1472}
1473 1473
1474static int brcmf_sdbrcm_dcmd_resp_wait(struct brcmf_bus *bus, uint *condition, 1474static int brcmf_sdbrcm_dcmd_resp_wait(struct brcmf_sdio *bus, uint *condition,
1475 bool *pending) 1475 bool *pending)
1476{ 1476{
1477 DECLARE_WAITQUEUE(wait, current); 1477 DECLARE_WAITQUEUE(wait, current);
@@ -1493,7 +1493,7 @@ static int brcmf_sdbrcm_dcmd_resp_wait(struct brcmf_bus *bus, uint *condition,
1493 return timeout; 1493 return timeout;
1494} 1494}
1495 1495
1496static int brcmf_sdbrcm_dcmd_resp_wake(struct brcmf_bus *bus) 1496static int brcmf_sdbrcm_dcmd_resp_wake(struct brcmf_sdio *bus)
1497{ 1497{
1498 if (waitqueue_active(&bus->dcmd_resp_wait)) 1498 if (waitqueue_active(&bus->dcmd_resp_wait))
1499 wake_up_interruptible(&bus->dcmd_resp_wait); 1499 wake_up_interruptible(&bus->dcmd_resp_wait);
@@ -1501,7 +1501,7 @@ static int brcmf_sdbrcm_dcmd_resp_wake(struct brcmf_bus *bus)
1501 return 0; 1501 return 0;
1502} 1502}
1503static void 1503static void
1504brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff) 1504brcmf_sdbrcm_read_control(struct brcmf_sdio *bus, u8 *hdr, uint len, uint doff)
1505{ 1505{
1506 uint rdlen, pad; 1506 uint rdlen, pad;
1507 1507
@@ -1590,7 +1590,7 @@ done:
1590} 1590}
1591 1591
1592/* Pad read to blocksize for efficiency */ 1592/* Pad read to blocksize for efficiency */
1593static void brcmf_pad(struct brcmf_bus *bus, u16 *pad, u16 *rdlen) 1593static void brcmf_pad(struct brcmf_sdio *bus, u16 *pad, u16 *rdlen)
1594{ 1594{
1595 if (bus->roundup && bus->blocksize && *rdlen > bus->blocksize) { 1595 if (bus->roundup && bus->blocksize && *rdlen > bus->blocksize) {
1596 *pad = bus->blocksize - (*rdlen % bus->blocksize); 1596 *pad = bus->blocksize - (*rdlen % bus->blocksize);
@@ -1603,7 +1603,7 @@ static void brcmf_pad(struct brcmf_bus *bus, u16 *pad, u16 *rdlen)
1603} 1603}
1604 1604
1605static void 1605static void
1606brcmf_alloc_pkt_and_read(struct brcmf_bus *bus, u16 rdlen, 1606brcmf_alloc_pkt_and_read(struct brcmf_sdio *bus, u16 rdlen,
1607 struct sk_buff **pkt, u8 **rxbuf) 1607 struct sk_buff **pkt, u8 **rxbuf)
1608{ 1608{
1609 int sdret; /* Return code from calls */ 1609 int sdret; /* Return code from calls */
@@ -1635,7 +1635,7 @@ brcmf_alloc_pkt_and_read(struct brcmf_bus *bus, u16 rdlen,
1635 1635
1636/* Checks the header */ 1636/* Checks the header */
1637static int 1637static int
1638brcmf_check_rxbuf(struct brcmf_bus *bus, struct sk_buff *pkt, u8 *rxbuf, 1638brcmf_check_rxbuf(struct brcmf_sdio *bus, struct sk_buff *pkt, u8 *rxbuf,
1639 u8 rxseq, u16 nextlen, u16 *len) 1639 u8 rxseq, u16 nextlen, u16 *len)
1640{ 1640{
1641 u16 check; 1641 u16 check;
@@ -1691,7 +1691,7 @@ fail:
1691 1691
1692/* Return true if there may be more frames to read */ 1692/* Return true if there may be more frames to read */
1693static uint 1693static uint
1694brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished) 1694brcmf_sdbrcm_readframes(struct brcmf_sdio *bus, uint maxframes, bool *finished)
1695{ 1695{
1696 u16 len, check; /* Extracted hardware header fields */ 1696 u16 len, check; /* Extracted hardware header fields */
1697 u8 chan, seq, doff; /* Extracted software header fields */ 1697 u8 chan, seq, doff; /* Extracted software header fields */
@@ -2082,7 +2082,7 @@ deliver:
2082} 2082}
2083 2083
2084static void 2084static void
2085brcmf_sdbrcm_wait_for_event(struct brcmf_bus *bus, bool *lockvar) 2085brcmf_sdbrcm_wait_for_event(struct brcmf_sdio *bus, bool *lockvar)
2086{ 2086{
2087 up(&bus->sdsem); 2087 up(&bus->sdsem);
2088 wait_event_interruptible_timeout(bus->ctrl_wait, 2088 wait_event_interruptible_timeout(bus->ctrl_wait,
@@ -2092,7 +2092,7 @@ brcmf_sdbrcm_wait_for_event(struct brcmf_bus *bus, bool *lockvar)
2092} 2092}
2093 2093
2094static void 2094static void
2095brcmf_sdbrcm_wait_event_wakeup(struct brcmf_bus *bus) 2095brcmf_sdbrcm_wait_event_wakeup(struct brcmf_sdio *bus)
2096{ 2096{
2097 if (waitqueue_active(&bus->ctrl_wait)) 2097 if (waitqueue_active(&bus->ctrl_wait))
2098 wake_up_interruptible(&bus->ctrl_wait); 2098 wake_up_interruptible(&bus->ctrl_wait);
@@ -2101,7 +2101,7 @@ brcmf_sdbrcm_wait_event_wakeup(struct brcmf_bus *bus)
2101 2101
2102/* Writes a HW/SW header into the packet and sends it. */ 2102/* Writes a HW/SW header into the packet and sends it. */
2103/* Assumes: (a) header space already there, (b) caller holds lock */ 2103/* Assumes: (a) header space already there, (b) caller holds lock */
2104static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt, 2104static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt,
2105 uint chan, bool free_pkt) 2105 uint chan, bool free_pkt)
2106{ 2106{
2107 int ret; 2107 int ret;
@@ -2238,7 +2238,7 @@ done:
2238 return ret; 2238 return ret;
2239} 2239}
2240 2240
2241static uint brcmf_sdbrcm_sendfromq(struct brcmf_bus *bus, uint maxframes) 2241static uint brcmf_sdbrcm_sendfromq(struct brcmf_sdio *bus, uint maxframes)
2242{ 2242{
2243 struct sk_buff *pkt; 2243 struct sk_buff *pkt;
2244 u32 intstatus = 0; 2244 u32 intstatus = 0;
@@ -2293,7 +2293,7 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_bus *bus, uint maxframes)
2293 return cnt; 2293 return cnt;
2294} 2294}
2295 2295
2296static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus) 2296static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
2297{ 2297{
2298 u32 intstatus, newstatus = 0; 2298 u32 intstatus, newstatus = 0;
2299 uint retries = 0; 2299 uint retries = 0;
@@ -2539,7 +2539,7 @@ clkwait:
2539 2539
2540static int brcmf_sdbrcm_dpc_thread(void *data) 2540static int brcmf_sdbrcm_dpc_thread(void *data)
2541{ 2541{
2542 struct brcmf_bus *bus = (struct brcmf_bus *) data; 2542 struct brcmf_sdio *bus = (struct brcmf_sdio *) data;
2543 2543
2544 allow_signal(SIGTERM); 2544 allow_signal(SIGTERM);
2545 /* Run until signal received */ 2545 /* Run until signal received */
@@ -2564,7 +2564,7 @@ static int brcmf_sdbrcm_dpc_thread(void *data)
2564 return 0; 2564 return 0;
2565} 2565}
2566 2566
2567int brcmf_sdbrcm_bus_txdata(struct brcmf_bus *bus, struct sk_buff *pkt) 2567int brcmf_sdbrcm_bus_txdata(struct brcmf_sdio *bus, struct sk_buff *pkt)
2568{ 2568{
2569 int ret = -EBADE; 2569 int ret = -EBADE;
2570 uint datalen, prec; 2570 uint datalen, prec;
@@ -2615,7 +2615,7 @@ int brcmf_sdbrcm_bus_txdata(struct brcmf_bus *bus, struct sk_buff *pkt)
2615} 2615}
2616 2616
2617static int 2617static int
2618brcmf_sdbrcm_membytes(struct brcmf_bus *bus, bool write, u32 address, u8 *data, 2618brcmf_sdbrcm_membytes(struct brcmf_sdio *bus, bool write, u32 address, u8 *data,
2619 uint size) 2619 uint size)
2620{ 2620{
2621 int bcmerror = 0; 2621 int bcmerror = 0;
@@ -2676,7 +2676,7 @@ xfer_done:
2676#ifdef BCMDBG 2676#ifdef BCMDBG
2677#define CONSOLE_LINE_MAX 192 2677#define CONSOLE_LINE_MAX 192
2678 2678
2679static int brcmf_sdbrcm_readconsole(struct brcmf_bus *bus) 2679static int brcmf_sdbrcm_readconsole(struct brcmf_sdio *bus)
2680{ 2680{
2681 struct brcmf_console *c = &bus->console; 2681 struct brcmf_console *c = &bus->console;
2682 u8 line[CONSOLE_LINE_MAX], ch; 2682 u8 line[CONSOLE_LINE_MAX], ch;
@@ -2753,7 +2753,7 @@ break2:
2753} 2753}
2754#endif /* BCMDBG */ 2754#endif /* BCMDBG */
2755 2755
2756static int brcmf_tx_frame(struct brcmf_bus *bus, u8 *frame, u16 len) 2756static int brcmf_tx_frame(struct brcmf_sdio *bus, u8 *frame, u16 len)
2757{ 2757{
2758 int i; 2758 int i;
2759 int ret; 2759 int ret;
@@ -2796,7 +2796,7 @@ static int brcmf_tx_frame(struct brcmf_bus *bus, u8 *frame, u16 len)
2796} 2796}
2797 2797
2798int 2798int
2799brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen) 2799brcmf_sdbrcm_bus_txctl(struct brcmf_sdio *bus, unsigned char *msg, uint msglen)
2800{ 2800{
2801 u8 *frame; 2801 u8 *frame;
2802 u16 len; 2802 u16 len;
@@ -2911,7 +2911,7 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
2911} 2911}
2912 2912
2913int 2913int
2914brcmf_sdbrcm_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen) 2914brcmf_sdbrcm_bus_rxctl(struct brcmf_sdio *bus, unsigned char *msg, uint msglen)
2915{ 2915{
2916 int timeleft; 2916 int timeleft;
2917 uint rxlen = 0; 2917 uint rxlen = 0;
@@ -2948,7 +2948,7 @@ brcmf_sdbrcm_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
2948 return rxlen ? (int)rxlen : -ETIMEDOUT; 2948 return rxlen ? (int)rxlen : -ETIMEDOUT;
2949} 2949}
2950 2950
2951static int brcmf_sdbrcm_downloadvars(struct brcmf_bus *bus, void *arg, int len) 2951static int brcmf_sdbrcm_downloadvars(struct brcmf_sdio *bus, void *arg, int len)
2952{ 2952{
2953 int bcmerror = 0; 2953 int bcmerror = 0;
2954 2954
@@ -2981,7 +2981,7 @@ err:
2981 return bcmerror; 2981 return bcmerror;
2982} 2982}
2983 2983
2984static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus) 2984static int brcmf_sdbrcm_write_vars(struct brcmf_sdio *bus)
2985{ 2985{
2986 int bcmerror = 0; 2986 int bcmerror = 0;
2987 u32 varsize; 2987 u32 varsize;
@@ -3068,7 +3068,7 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
3068 return bcmerror; 3068 return bcmerror;
3069} 3069}
3070 3070
3071static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter) 3071static int brcmf_sdbrcm_download_state(struct brcmf_sdio *bus, bool enter)
3072{ 3072{
3073 uint retries; 3073 uint retries;
3074 int bcmerror = 0; 3074 int bcmerror = 0;
@@ -3117,7 +3117,7 @@ fail:
3117 return bcmerror; 3117 return bcmerror;
3118} 3118}
3119 3119
3120static int brcmf_sdbrcm_get_image(char *buf, int len, struct brcmf_bus *bus) 3120static int brcmf_sdbrcm_get_image(char *buf, int len, struct brcmf_sdio *bus)
3121{ 3121{
3122 if (bus->firmware->size < bus->fw_ptr + len) 3122 if (bus->firmware->size < bus->fw_ptr + len)
3123 len = bus->firmware->size - bus->fw_ptr; 3123 len = bus->firmware->size - bus->fw_ptr;
@@ -3127,7 +3127,7 @@ static int brcmf_sdbrcm_get_image(char *buf, int len, struct brcmf_bus *bus)
3127 return len; 3127 return len;
3128} 3128}
3129 3129
3130static int brcmf_sdbrcm_download_code_file(struct brcmf_bus *bus) 3130static int brcmf_sdbrcm_download_code_file(struct brcmf_sdio *bus)
3131{ 3131{
3132 int offset = 0; 3132 int offset = 0;
3133 uint len; 3133 uint len;
@@ -3226,7 +3226,7 @@ static uint brcmf_process_nvram_vars(char *varbuf, uint len)
3226 return buf_len; 3226 return buf_len;
3227} 3227}
3228 3228
3229static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus) 3229static int brcmf_sdbrcm_download_nvram(struct brcmf_sdio *bus)
3230{ 3230{
3231 uint len; 3231 uint len;
3232 char *memblock = NULL; 3232 char *memblock = NULL;
@@ -3273,7 +3273,7 @@ err:
3273 return ret; 3273 return ret;
3274} 3274}
3275 3275
3276static int _brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus) 3276static int _brcmf_sdbrcm_download_firmware(struct brcmf_sdio *bus)
3277{ 3277{
3278 int bcmerror = -1; 3278 int bcmerror = -1;
3279 3279
@@ -3306,7 +3306,7 @@ err:
3306} 3306}
3307 3307
3308static bool 3308static bool
3309brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus) 3309brcmf_sdbrcm_download_firmware(struct brcmf_sdio *bus)
3310{ 3310{
3311 bool ret; 3311 bool ret;
3312 3312
@@ -3320,7 +3320,7 @@ brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus)
3320 return ret; 3320 return ret;
3321} 3321}
3322 3322
3323void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus) 3323void brcmf_sdbrcm_bus_stop(struct brcmf_sdio *bus)
3324{ 3324{
3325 u32 local_hostintmask; 3325 u32 local_hostintmask;
3326 u8 saveclk; 3326 u8 saveclk;
@@ -3400,7 +3400,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus)
3400 3400
3401int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr) 3401int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr)
3402{ 3402{
3403 struct brcmf_bus *bus = drvr->bus; 3403 struct brcmf_sdio *bus = drvr->bus;
3404 unsigned long timeout; 3404 unsigned long timeout;
3405 uint retries = 0; 3405 uint retries = 0;
3406 u8 ready, enable; 3406 u8 ready, enable;
@@ -3502,7 +3502,7 @@ exit:
3502 3502
3503void brcmf_sdbrcm_isr(void *arg) 3503void brcmf_sdbrcm_isr(void *arg)
3504{ 3504{
3505 struct brcmf_bus *bus = (struct brcmf_bus *) arg; 3505 struct brcmf_sdio *bus = (struct brcmf_sdio *) arg;
3506 3506
3507 brcmf_dbg(TRACE, "Enter\n"); 3507 brcmf_dbg(TRACE, "Enter\n");
3508 3508
@@ -3536,7 +3536,7 @@ void brcmf_sdbrcm_isr(void *arg)
3536 3536
3537static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *drvr) 3537static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *drvr)
3538{ 3538{
3539 struct brcmf_bus *bus; 3539 struct brcmf_sdio *bus;
3540 3540
3541 brcmf_dbg(TIMER, "Enter\n"); 3541 brcmf_dbg(TIMER, "Enter\n");
3542 3542
@@ -3623,7 +3623,7 @@ static bool brcmf_sdbrcm_chipmatch(u16 chipid)
3623 return false; 3623 return false;
3624} 3624}
3625 3625
3626static void brcmf_sdbrcm_release_malloc(struct brcmf_bus *bus) 3626static void brcmf_sdbrcm_release_malloc(struct brcmf_sdio *bus)
3627{ 3627{
3628 brcmf_dbg(TRACE, "Enter\n"); 3628 brcmf_dbg(TRACE, "Enter\n");
3629 3629
@@ -3635,7 +3635,7 @@ static void brcmf_sdbrcm_release_malloc(struct brcmf_bus *bus)
3635 bus->databuf = NULL; 3635 bus->databuf = NULL;
3636} 3636}
3637 3637
3638static bool brcmf_sdbrcm_probe_malloc(struct brcmf_bus *bus) 3638static bool brcmf_sdbrcm_probe_malloc(struct brcmf_sdio *bus)
3639{ 3639{
3640 brcmf_dbg(TRACE, "Enter\n"); 3640 brcmf_dbg(TRACE, "Enter\n");
3641 3641
@@ -3671,7 +3671,7 @@ fail:
3671} 3671}
3672 3672
3673static bool 3673static bool
3674brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, u32 regsva) 3674brcmf_sdbrcm_probe_attach(struct brcmf_sdio *bus, u32 regsva)
3675{ 3675{
3676 u8 clkctl = 0; 3676 u8 clkctl = 0;
3677 int err = 0; 3677 int err = 0;
@@ -3756,7 +3756,7 @@ fail:
3756 return false; 3756 return false;
3757} 3757}
3758 3758
3759static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus) 3759static bool brcmf_sdbrcm_probe_init(struct brcmf_sdio *bus)
3760{ 3760{
3761 brcmf_dbg(TRACE, "Enter\n"); 3761 brcmf_dbg(TRACE, "Enter\n");
3762 3762
@@ -3791,7 +3791,7 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus)
3791static int 3791static int
3792brcmf_sdbrcm_watchdog_thread(void *data) 3792brcmf_sdbrcm_watchdog_thread(void *data)
3793{ 3793{
3794 struct brcmf_bus *bus = (struct brcmf_bus *)data; 3794 struct brcmf_sdio *bus = (struct brcmf_sdio *)data;
3795 3795
3796 allow_signal(SIGTERM); 3796 allow_signal(SIGTERM);
3797 /* Run until signal received */ 3797 /* Run until signal received */
@@ -3811,7 +3811,7 @@ brcmf_sdbrcm_watchdog_thread(void *data)
3811static void 3811static void
3812brcmf_sdbrcm_watchdog(unsigned long data) 3812brcmf_sdbrcm_watchdog(unsigned long data)
3813{ 3813{
3814 struct brcmf_bus *bus = (struct brcmf_bus *)data; 3814 struct brcmf_sdio *bus = (struct brcmf_sdio *)data;
3815 3815
3816 if (bus->watchdog_tsk) { 3816 if (bus->watchdog_tsk) {
3817 complete(&bus->watchdog_wait); 3817 complete(&bus->watchdog_wait);
@@ -3822,7 +3822,7 @@ brcmf_sdbrcm_watchdog(unsigned long data)
3822 } 3822 }
3823} 3823}
3824 3824
3825static void brcmf_sdbrcm_release_dongle(struct brcmf_bus *bus) 3825static void brcmf_sdbrcm_release_dongle(struct brcmf_sdio *bus)
3826{ 3826{
3827 brcmf_dbg(TRACE, "Enter\n"); 3827 brcmf_dbg(TRACE, "Enter\n");
3828 3828
@@ -3839,7 +3839,7 @@ static void brcmf_sdbrcm_release_dongle(struct brcmf_bus *bus)
3839} 3839}
3840 3840
3841/* Detach and free everything */ 3841/* Detach and free everything */
3842static void brcmf_sdbrcm_release(struct brcmf_bus *bus) 3842static void brcmf_sdbrcm_release(struct brcmf_sdio *bus)
3843{ 3843{
3844 brcmf_dbg(TRACE, "Enter\n"); 3844 brcmf_dbg(TRACE, "Enter\n");
3845 3845
@@ -3864,7 +3864,7 @@ static void brcmf_sdbrcm_release(struct brcmf_bus *bus)
3864void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev) 3864void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
3865{ 3865{
3866 int ret; 3866 int ret;
3867 struct brcmf_bus *bus; 3867 struct brcmf_sdio *bus;
3868 3868
3869 brcmf_dbg(TRACE, "Enter\n"); 3869 brcmf_dbg(TRACE, "Enter\n");
3870 3870
@@ -3872,7 +3872,7 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
3872 * regsva == SI_ENUM_BASE*/ 3872 * regsva == SI_ENUM_BASE*/
3873 3873
3874 /* Allocate private bus interface state */ 3874 /* Allocate private bus interface state */
3875 bus = kzalloc(sizeof(struct brcmf_bus), GFP_ATOMIC); 3875 bus = kzalloc(sizeof(struct brcmf_sdio), GFP_ATOMIC);
3876 if (!bus) 3876 if (!bus)
3877 goto fail; 3877 goto fail;
3878 3878
@@ -3976,7 +3976,7 @@ fail:
3976 3976
3977void brcmf_sdbrcm_disconnect(void *ptr) 3977void brcmf_sdbrcm_disconnect(void *ptr)
3978{ 3978{
3979 struct brcmf_bus *bus = (struct brcmf_bus *)ptr; 3979 struct brcmf_sdio *bus = (struct brcmf_sdio *)ptr;
3980 3980
3981 brcmf_dbg(TRACE, "Enter\n"); 3981 brcmf_dbg(TRACE, "Enter\n");
3982 3982
@@ -3986,13 +3986,13 @@ void brcmf_sdbrcm_disconnect(void *ptr)
3986 brcmf_dbg(TRACE, "Disconnected\n"); 3986 brcmf_dbg(TRACE, "Disconnected\n");
3987} 3987}
3988 3988
3989struct device *brcmf_bus_get_device(struct brcmf_bus *bus) 3989struct device *brcmf_bus_get_device(struct brcmf_sdio *bus)
3990{ 3990{
3991 return &bus->sdiodev->func[2]->dev; 3991 return &bus->sdiodev->func[2]->dev;
3992} 3992}
3993 3993
3994void 3994void
3995brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick) 3995brcmf_sdbrcm_wd_timer(struct brcmf_sdio *bus, uint wdtick)
3996{ 3996{
3997 /* Totally stop the timer */ 3997 /* Totally stop the timer */
3998 if (!wdtick && bus->wd_timer_valid == true) { 3998 if (!wdtick && bus->wd_timer_valid == true) {