Commit c9aa7a91 authored by Arend Van Spriel's avatar Arend Van Spriel Committed by Kalle Valo

brcmfmac: Remove array of functions

Replace the array of functions with a pair of pointers to the
relevant functions.
Signed-off-by: default avatarIan Molton <ian@mnementh.co.uk>
Acked-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent a08e61d2
...@@ -118,7 +118,7 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev) ...@@ -118,7 +118,7 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev)
ret = request_irq(pdata->oob_irq_nr, brcmf_sdiod_oob_irqhandler, ret = request_irq(pdata->oob_irq_nr, brcmf_sdiod_oob_irqhandler,
pdata->oob_irq_flags, "brcmf_oob_intr", pdata->oob_irq_flags, "brcmf_oob_intr",
&sdiodev->func[1]->dev); &sdiodev->func1->dev);
if (ret != 0) { if (ret != 0) {
brcmf_err("request_irq failed %d\n", ret); brcmf_err("request_irq failed %d\n", ret);
return ret; return ret;
...@@ -132,7 +132,7 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev) ...@@ -132,7 +132,7 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev)
} }
sdiodev->irq_wake = true; sdiodev->irq_wake = true;
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func1);
if (sdiodev->bus_if->chip == BRCM_CC_43362_CHIP_ID) { if (sdiodev->bus_if->chip == BRCM_CC_43362_CHIP_ID) {
/* assign GPIO to SDIO core */ /* assign GPIO to SDIO core */
...@@ -159,13 +159,13 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev) ...@@ -159,13 +159,13 @@ int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev)
data |= SDIO_CCCR_BRCM_SEPINT_ACT_HI; data |= SDIO_CCCR_BRCM_SEPINT_ACT_HI;
brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_BRCM_SEPINT, brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_BRCM_SEPINT,
data, &ret); data, &ret);
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
} else { } else {
brcmf_dbg(SDIO, "Entering\n"); brcmf_dbg(SDIO, "Entering\n");
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func1);
sdio_claim_irq(sdiodev->func[1], brcmf_sdiod_ib_irqhandler); sdio_claim_irq(sdiodev->func1, brcmf_sdiod_ib_irqhandler);
sdio_claim_irq(sdiodev->func[2], brcmf_sdiod_dummy_irqhandler); sdio_claim_irq(sdiodev->func2, brcmf_sdiod_dummy_irqhandler);
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
sdiodev->sd_irq_requested = true; sdiodev->sd_irq_requested = true;
} }
...@@ -183,26 +183,26 @@ void brcmf_sdiod_intr_unregister(struct brcmf_sdio_dev *sdiodev) ...@@ -183,26 +183,26 @@ void brcmf_sdiod_intr_unregister(struct brcmf_sdio_dev *sdiodev)
struct brcmfmac_sdio_pd *pdata; struct brcmfmac_sdio_pd *pdata;
pdata = &sdiodev->settings->bus.sdio; pdata = &sdiodev->settings->bus.sdio;
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func1);
brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_BRCM_SEPINT, 0, NULL); brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_BRCM_SEPINT, 0, NULL);
brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_IENx, 0, NULL); brcmf_sdiod_func0_wb(sdiodev, SDIO_CCCR_IENx, 0, NULL);
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
sdiodev->oob_irq_requested = false; sdiodev->oob_irq_requested = false;
if (sdiodev->irq_wake) { if (sdiodev->irq_wake) {
disable_irq_wake(pdata->oob_irq_nr); disable_irq_wake(pdata->oob_irq_nr);
sdiodev->irq_wake = false; sdiodev->irq_wake = false;
} }
free_irq(pdata->oob_irq_nr, &sdiodev->func[1]->dev); free_irq(pdata->oob_irq_nr, &sdiodev->func1->dev);
sdiodev->irq_en = false; sdiodev->irq_en = false;
sdiodev->oob_irq_requested = false; sdiodev->oob_irq_requested = false;
} }
if (sdiodev->sd_irq_requested) { if (sdiodev->sd_irq_requested) {
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func1);
sdio_release_irq(sdiodev->func[2]); sdio_release_irq(sdiodev->func2);
sdio_release_irq(sdiodev->func[1]); sdio_release_irq(sdiodev->func1);
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
sdiodev->sd_irq_requested = false; sdiodev->sd_irq_requested = false;
} }
} }
...@@ -264,7 +264,7 @@ u32 brcmf_sdiod_readl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret) ...@@ -264,7 +264,7 @@ u32 brcmf_sdiod_readl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret)
addr &= SBSDIO_SB_OFT_ADDR_MASK; addr &= SBSDIO_SB_OFT_ADDR_MASK;
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
data = sdio_readl(sdiodev->func[1], addr, &retval); data = sdio_readl(sdiodev->func1, addr, &retval);
out: out:
if (ret) if (ret)
...@@ -285,7 +285,7 @@ void brcmf_sdiod_writel(struct brcmf_sdio_dev *sdiodev, u32 addr, ...@@ -285,7 +285,7 @@ void brcmf_sdiod_writel(struct brcmf_sdio_dev *sdiodev, u32 addr,
addr &= SBSDIO_SB_OFT_ADDR_MASK; addr &= SBSDIO_SB_OFT_ADDR_MASK;
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
sdio_writel(sdiodev->func[1], data, addr, &retval); sdio_writel(sdiodev->func1, data, addr, &retval);
out: out:
if (ret) if (ret)
...@@ -550,7 +550,7 @@ int brcmf_sdiod_recv_pkt(struct brcmf_sdio_dev *sdiodev, struct sk_buff *pkt) ...@@ -550,7 +550,7 @@ int brcmf_sdiod_recv_pkt(struct brcmf_sdio_dev *sdiodev, struct sk_buff *pkt)
addr &= SBSDIO_SB_OFT_ADDR_MASK; addr &= SBSDIO_SB_OFT_ADDR_MASK;
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func[2], addr, pkt); err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func2, addr, pkt);
done: done:
return err; return err;
...@@ -575,13 +575,13 @@ int brcmf_sdiod_recv_chain(struct brcmf_sdio_dev *sdiodev, ...@@ -575,13 +575,13 @@ int brcmf_sdiod_recv_chain(struct brcmf_sdio_dev *sdiodev,
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
if (pktq->qlen == 1) if (pktq->qlen == 1)
err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func[2], addr, err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func2, addr,
pktq->next); pktq->next);
else if (!sdiodev->sg_support) { else if (!sdiodev->sg_support) {
glom_skb = brcmu_pkt_buf_get_skb(totlen); glom_skb = brcmu_pkt_buf_get_skb(totlen);
if (!glom_skb) if (!glom_skb)
return -ENOMEM; return -ENOMEM;
err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func[2], addr, err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func2, addr,
glom_skb); glom_skb);
if (err) if (err)
goto done; goto done;
...@@ -591,7 +591,7 @@ int brcmf_sdiod_recv_chain(struct brcmf_sdio_dev *sdiodev, ...@@ -591,7 +591,7 @@ int brcmf_sdiod_recv_chain(struct brcmf_sdio_dev *sdiodev,
skb_pull(glom_skb, skb->len); skb_pull(glom_skb, skb->len);
} }
} else } else
err = brcmf_sdiod_sglist_rw(sdiodev, sdiodev->func[2], false, err = brcmf_sdiod_sglist_rw(sdiodev, sdiodev->func2, false,
addr, pktq); addr, pktq);
done: done:
...@@ -623,7 +623,7 @@ int brcmf_sdiod_send_buf(struct brcmf_sdio_dev *sdiodev, u8 *buf, uint nbytes) ...@@ -623,7 +623,7 @@ int brcmf_sdiod_send_buf(struct brcmf_sdio_dev *sdiodev, u8 *buf, uint nbytes)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
if (!err) if (!err)
err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func[2], addr, err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func2, addr,
mypkt); mypkt);
brcmu_pkt_buf_free_skb(mypkt); brcmu_pkt_buf_free_skb(mypkt);
...@@ -649,13 +649,13 @@ int brcmf_sdiod_send_pkt(struct brcmf_sdio_dev *sdiodev, ...@@ -649,13 +649,13 @@ int brcmf_sdiod_send_pkt(struct brcmf_sdio_dev *sdiodev,
if (pktq->qlen == 1 || !sdiodev->sg_support) { if (pktq->qlen == 1 || !sdiodev->sg_support) {
skb_queue_walk(pktq, skb) { skb_queue_walk(pktq, skb) {
err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func[2], err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func2,
addr, skb); addr, skb);
if (err) if (err)
break; break;
} }
} else { } else {
err = brcmf_sdiod_sglist_rw(sdiodev, sdiodev->func[2], true, err = brcmf_sdiod_sglist_rw(sdiodev, sdiodev->func2, true,
addr, pktq); addr, pktq);
} }
...@@ -686,7 +686,7 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address, ...@@ -686,7 +686,7 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address,
else else
dsize = size; dsize = size;
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func1);
/* Do the transfer(s) */ /* Do the transfer(s) */
while (size) { while (size) {
...@@ -706,10 +706,10 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address, ...@@ -706,10 +706,10 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address,
if (write) { if (write) {
memcpy(pkt->data, data, dsize); memcpy(pkt->data, data, dsize);
err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func[1], err = brcmf_sdiod_buff_write(sdiodev, sdiodev->func1,
sdaddr, pkt); sdaddr, pkt);
} else { } else {
err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func[1], err = brcmf_sdiod_buff_read(sdiodev, sdiodev->func1,
sdaddr, pkt); sdaddr, pkt);
} }
...@@ -733,7 +733,7 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address, ...@@ -733,7 +733,7 @@ brcmf_sdiod_ramrw(struct brcmf_sdio_dev *sdiodev, bool write, u32 address,
dev_kfree_skb(pkt); dev_kfree_skb(pkt);
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
return err; return err;
} }
...@@ -757,7 +757,7 @@ void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev) ...@@ -757,7 +757,7 @@ void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev)
uint nents; uint nents;
int err; int err;
func = sdiodev->func[2]; func = sdiodev->func2;
host = func->card->host; host = func->card->host;
sdiodev->sg_support = host->max_segs > 1; sdiodev->sg_support = host->max_segs > 1;
max_blocks = min_t(uint, host->max_blk_count, 511u); max_blocks = min_t(uint, host->max_blk_count, 511u);
...@@ -818,17 +818,17 @@ static int brcmf_sdiod_freezer_on(struct brcmf_sdio_dev *sdiodev) ...@@ -818,17 +818,17 @@ static int brcmf_sdiod_freezer_on(struct brcmf_sdio_dev *sdiodev)
brcmf_sdio_trigger_dpc(sdiodev->bus); brcmf_sdio_trigger_dpc(sdiodev->bus);
wait_event(sdiodev->freezer->thread_freeze, wait_event(sdiodev->freezer->thread_freeze,
atomic_read(expect) == sdiodev->freezer->frozen_count); atomic_read(expect) == sdiodev->freezer->frozen_count);
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func1);
res = brcmf_sdio_sleep(sdiodev->bus, true); res = brcmf_sdio_sleep(sdiodev->bus, true);
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
return res; return res;
} }
static void brcmf_sdiod_freezer_off(struct brcmf_sdio_dev *sdiodev) static void brcmf_sdiod_freezer_off(struct brcmf_sdio_dev *sdiodev)
{ {
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func1);
brcmf_sdio_sleep(sdiodev->bus, false); brcmf_sdio_sleep(sdiodev->bus, false);
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
atomic_set(&sdiodev->freezer->freezing, 0); atomic_set(&sdiodev->freezer->freezing, 0);
complete_all(&sdiodev->freezer->resumed); complete_all(&sdiodev->freezer->resumed);
} }
...@@ -878,19 +878,19 @@ static int brcmf_sdiod_remove(struct brcmf_sdio_dev *sdiodev) ...@@ -878,19 +878,19 @@ static int brcmf_sdiod_remove(struct brcmf_sdio_dev *sdiodev)
brcmf_sdiod_freezer_detach(sdiodev); brcmf_sdiod_freezer_detach(sdiodev);
/* Disable Function 2 */ /* Disable Function 2 */
sdio_claim_host(sdiodev->func[2]); sdio_claim_host(sdiodev->func2);
sdio_disable_func(sdiodev->func[2]); sdio_disable_func(sdiodev->func2);
sdio_release_host(sdiodev->func[2]); sdio_release_host(sdiodev->func2);
/* Disable Function 1 */ /* Disable Function 1 */
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func1);
sdio_disable_func(sdiodev->func[1]); sdio_disable_func(sdiodev->func1);
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
sg_free_table(&sdiodev->sgtable); sg_free_table(&sdiodev->sgtable);
sdiodev->sbwad = 0; sdiodev->sbwad = 0;
pm_runtime_allow(sdiodev->func[1]->card->host->parent); pm_runtime_allow(sdiodev->func1->card->host->parent);
return 0; return 0;
} }
...@@ -906,29 +906,27 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) ...@@ -906,29 +906,27 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev)
{ {
int ret = 0; int ret = 0;
sdiodev->num_funcs = 2; sdio_claim_host(sdiodev->func1);
sdio_claim_host(sdiodev->func[1]); ret = sdio_set_block_size(sdiodev->func1, SDIO_FUNC1_BLOCKSIZE);
ret = sdio_set_block_size(sdiodev->func[1], SDIO_FUNC1_BLOCKSIZE);
if (ret) { if (ret) {
brcmf_err("Failed to set F1 blocksize\n"); brcmf_err("Failed to set F1 blocksize\n");
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
goto out; goto out;
} }
ret = sdio_set_block_size(sdiodev->func[2], SDIO_FUNC2_BLOCKSIZE); ret = sdio_set_block_size(sdiodev->func2, SDIO_FUNC2_BLOCKSIZE);
if (ret) { if (ret) {
brcmf_err("Failed to set F2 blocksize\n"); brcmf_err("Failed to set F2 blocksize\n");
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
goto out; goto out;
} }
/* increase F2 timeout */ /* increase F2 timeout */
sdiodev->func[2]->enable_timeout = SDIO_WAIT_F2RDY; sdiodev->func2->enable_timeout = SDIO_WAIT_F2RDY;
/* Enable Function 1 */ /* Enable Function 1 */
ret = sdio_enable_func(sdiodev->func[1]); ret = sdio_enable_func(sdiodev->func1);
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
if (ret) { if (ret) {
brcmf_err("Failed to enable F1: err=%d\n", ret); brcmf_err("Failed to enable F1: err=%d\n", ret);
goto out; goto out;
...@@ -944,7 +942,7 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) ...@@ -944,7 +942,7 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev)
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
brcmf_sdiod_host_fixup(sdiodev->func[2]->card->host); brcmf_sdiod_host_fixup(sdiodev->func2->card->host);
out: out:
if (ret) if (ret)
brcmf_sdiod_remove(sdiodev); brcmf_sdiod_remove(sdiodev);
...@@ -1032,16 +1030,15 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func, ...@@ -1032,16 +1030,15 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
/* store refs to functions used. mmc_card does /* store refs to functions used. mmc_card does
* not hold the F0 function pointer. * not hold the F0 function pointer.
*/ */
sdiodev->func[0] = NULL; sdiodev->func1 = func->card->sdio_func[0];
sdiodev->func[1] = func->card->sdio_func[0]; sdiodev->func2 = func;
sdiodev->func[2] = func;
sdiodev->bus_if = bus_if; sdiodev->bus_if = bus_if;
bus_if->bus_priv.sdio = sdiodev; bus_if->bus_priv.sdio = sdiodev;
bus_if->proto_type = BRCMF_PROTO_BCDC; bus_if->proto_type = BRCMF_PROTO_BCDC;
dev_set_drvdata(&func->dev, bus_if); dev_set_drvdata(&func->dev, bus_if);
dev_set_drvdata(&sdiodev->func[1]->dev, bus_if); dev_set_drvdata(&sdiodev->func1->dev, bus_if);
sdiodev->dev = &sdiodev->func[1]->dev; sdiodev->dev = &sdiodev->func1->dev;
brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_DOWN); brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_DOWN);
...@@ -1057,7 +1054,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func, ...@@ -1057,7 +1054,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
fail: fail:
dev_set_drvdata(&func->dev, NULL); dev_set_drvdata(&func->dev, NULL);
dev_set_drvdata(&sdiodev->func[1]->dev, NULL); dev_set_drvdata(&sdiodev->func1->dev, NULL);
kfree(sdiodev); kfree(sdiodev);
kfree(bus_if); kfree(bus_if);
return err; return err;
...@@ -1086,8 +1083,8 @@ static void brcmf_ops_sdio_remove(struct sdio_func *func) ...@@ -1086,8 +1083,8 @@ static void brcmf_ops_sdio_remove(struct sdio_func *func)
/* only proceed with rest of cleanup if func 1 */ /* only proceed with rest of cleanup if func 1 */
brcmf_sdiod_remove(sdiodev); brcmf_sdiod_remove(sdiodev);
dev_set_drvdata(&sdiodev->func[1]->dev, NULL); dev_set_drvdata(&sdiodev->func1->dev, NULL);
dev_set_drvdata(&sdiodev->func[2]->dev, NULL); dev_set_drvdata(&sdiodev->func2->dev, NULL);
kfree(bus_if); kfree(bus_if);
kfree(sdiodev); kfree(sdiodev);
...@@ -1132,7 +1129,7 @@ static int brcmf_ops_sdio_suspend(struct device *dev) ...@@ -1132,7 +1129,7 @@ static int brcmf_ops_sdio_suspend(struct device *dev)
else else
sdio_flags |= MMC_PM_WAKE_SDIO_IRQ; sdio_flags |= MMC_PM_WAKE_SDIO_IRQ;
} }
if (sdio_set_host_pm_flags(sdiodev->func[1], sdio_flags)) if (sdio_set_host_pm_flags(sdiodev->func1, sdio_flags))
brcmf_err("Failed to set pm_flags %x\n", sdio_flags); brcmf_err("Failed to set pm_flags %x\n", sdio_flags);
return 0; return 0;
} }
......
...@@ -979,7 +979,7 @@ static int brcmf_sdio_readshared(struct brcmf_sdio *bus, ...@@ -979,7 +979,7 @@ static int brcmf_sdio_readshared(struct brcmf_sdio *bus,
struct sdpcm_shared_le sh_le; struct sdpcm_shared_le sh_le;
__le32 addr_le; __le32 addr_le;
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
brcmf_sdio_bus_sleep(bus, false, false); brcmf_sdio_bus_sleep(bus, false, false);
/* /*
...@@ -1013,7 +1013,7 @@ static int brcmf_sdio_readshared(struct brcmf_sdio *bus, ...@@ -1013,7 +1013,7 @@ static int brcmf_sdio_readshared(struct brcmf_sdio *bus,
if (rv < 0) if (rv < 0)
goto fail; goto fail;
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
/* Endianness */ /* Endianness */
sh->flags = le32_to_cpu(sh_le.flags); sh->flags = le32_to_cpu(sh_le.flags);
...@@ -1035,7 +1035,7 @@ static int brcmf_sdio_readshared(struct brcmf_sdio *bus, ...@@ -1035,7 +1035,7 @@ static int brcmf_sdio_readshared(struct brcmf_sdio *bus,
fail: fail:
brcmf_err("unable to obtain sdpcm_shared info: rv=%d (addr=0x%x)\n", brcmf_err("unable to obtain sdpcm_shared info: rv=%d (addr=0x%x)\n",
rv, addr); rv, addr);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
return rv; return rv;
} }
...@@ -1157,7 +1157,7 @@ static void brcmf_sdio_rxfail(struct brcmf_sdio *bus, bool abort, bool rtx) ...@@ -1157,7 +1157,7 @@ static void brcmf_sdio_rxfail(struct brcmf_sdio *bus, bool abort, bool rtx)
rtx ? ", send NAK" : ""); rtx ? ", send NAK" : "");
if (abort) if (abort)
brcmf_sdiod_abort(bus->sdiodev, bus->sdiodev->func[2]); brcmf_sdiod_abort(bus->sdiodev, bus->sdiodev->func2);
brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_RF_TERM, brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_RF_TERM,
&err); &err);
...@@ -1209,7 +1209,7 @@ static void brcmf_sdio_txfail(struct brcmf_sdio *bus) ...@@ -1209,7 +1209,7 @@ static void brcmf_sdio_txfail(struct brcmf_sdio *bus)
brcmf_err("sdio error, abort command and terminate frame\n"); brcmf_err("sdio error, abort command and terminate frame\n");
bus->sdcnt.tx_sderrs++; bus->sdcnt.tx_sderrs++;
brcmf_sdiod_abort(sdiodev, sdiodev->func[2]); brcmf_sdiod_abort(sdiodev, sdiodev->func2);
brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_WF_TERM, NULL); brcmf_sdiod_writeb(sdiodev, SBSDIO_FUNC1_FRAMECTRL, SFC_WF_TERM, NULL);
bus->sdcnt.f1regdata++; bus->sdcnt.f1regdata++;
...@@ -1565,10 +1565,10 @@ static u8 brcmf_sdio_rxglom(struct brcmf_sdio *bus, u8 rxseq) ...@@ -1565,10 +1565,10 @@ static u8 brcmf_sdio_rxglom(struct brcmf_sdio *bus, u8 rxseq)
* read directly into the chained packet, or allocate a large * read directly into the chained packet, or allocate a large
* packet and and copy into the chain. * packet and and copy into the chain.
*/ */
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
errcode = brcmf_sdiod_recv_chain(bus->sdiodev, errcode = brcmf_sdiod_recv_chain(bus->sdiodev,
&bus->glom, dlen); &bus->glom, dlen);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
bus->sdcnt.f2rxdata++; bus->sdcnt.f2rxdata++;
/* On failure, kill the superframe */ /* On failure, kill the superframe */
...@@ -1576,11 +1576,11 @@ static u8 brcmf_sdio_rxglom(struct brcmf_sdio *bus, u8 rxseq) ...@@ -1576,11 +1576,11 @@ static u8 brcmf_sdio_rxglom(struct brcmf_sdio *bus, u8 rxseq)
brcmf_err("glom read of %d bytes failed: %d\n", brcmf_err("glom read of %d bytes failed: %d\n",
dlen, errcode); dlen, errcode);
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
brcmf_sdio_rxfail(bus, true, false); brcmf_sdio_rxfail(bus, true, false);
bus->sdcnt.rxglomfail++; bus->sdcnt.rxglomfail++;
brcmf_sdio_free_glom(bus); brcmf_sdio_free_glom(bus);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
return 0; return 0;
} }
...@@ -1590,10 +1590,10 @@ static u8 brcmf_sdio_rxglom(struct brcmf_sdio *bus, u8 rxseq) ...@@ -1590,10 +1590,10 @@ static u8 brcmf_sdio_rxglom(struct brcmf_sdio *bus, u8 rxseq)
rd_new.seq_num = rxseq; rd_new.seq_num = rxseq;
rd_new.len = dlen; rd_new.len = dlen;
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
errcode = brcmf_sdio_hdparse(bus, pfirst->data, &rd_new, errcode = brcmf_sdio_hdparse(bus, pfirst->data, &rd_new,
BRCMF_SDIO_FT_SUPER); BRCMF_SDIO_FT_SUPER);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
bus->cur_read.len = rd_new.len_nxtfrm << 4; bus->cur_read.len = rd_new.len_nxtfrm << 4;
/* Remove superframe header, remember offset */ /* Remove superframe header, remember offset */
...@@ -1609,10 +1609,10 @@ static u8 brcmf_sdio_rxglom(struct brcmf_sdio *bus, u8 rxseq) ...@@ -1609,10 +1609,10 @@ static u8 brcmf_sdio_rxglom(struct brcmf_sdio *bus, u8 rxseq)
rd_new.len = pnext->len; rd_new.len = pnext->len;
rd_new.seq_num = rxseq++; rd_new.seq_num = rxseq++;
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
errcode = brcmf_sdio_hdparse(bus, pnext->data, &rd_new, errcode = brcmf_sdio_hdparse(bus, pnext->data, &rd_new,
BRCMF_SDIO_FT_SUB); BRCMF_SDIO_FT_SUB);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
brcmf_dbg_hex_dump(BRCMF_GLOM_ON(), brcmf_dbg_hex_dump(BRCMF_GLOM_ON(),
pnext->data, 32, "subframe:\n"); pnext->data, 32, "subframe:\n");
...@@ -1621,11 +1621,11 @@ static u8 brcmf_sdio_rxglom(struct brcmf_sdio *bus, u8 rxseq) ...@@ -1621,11 +1621,11 @@ static u8 brcmf_sdio_rxglom(struct brcmf_sdio *bus, u8 rxseq)
if (errcode) { if (errcode) {
/* Terminate frame on error */ /* Terminate frame on error */
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
brcmf_sdio_rxfail(bus, true, false); brcmf_sdio_rxfail(bus, true, false);
bus->sdcnt.rxglomfail++; bus->sdcnt.rxglomfail++;
brcmf_sdio_free_glom(bus); brcmf_sdio_free_glom(bus);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
bus->cur_read.len = 0; bus->cur_read.len = 0;
return 0; return 0;
} }
...@@ -1833,7 +1833,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) ...@@ -1833,7 +1833,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
rd->len_left = rd->len; rd->len_left = rd->len;
/* read header first for unknow frame length */ /* read header first for unknow frame length */
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
if (!rd->len) { if (!rd->len) {
ret = brcmf_sdiod_recv_buf(bus->sdiodev, ret = brcmf_sdiod_recv_buf(bus->sdiodev,
bus->rxhdr, BRCMF_FIRSTREAD); bus->rxhdr, BRCMF_FIRSTREAD);
...@@ -1843,7 +1843,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) ...@@ -1843,7 +1843,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
ret); ret);
bus->sdcnt.rx_hdrfail++; bus->sdcnt.rx_hdrfail++;
brcmf_sdio_rxfail(bus, true, true); brcmf_sdio_rxfail(bus, true, true);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
continue; continue;
} }
...@@ -1853,7 +1853,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) ...@@ -1853,7 +1853,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
if (brcmf_sdio_hdparse(bus, bus->rxhdr, rd, if (brcmf_sdio_hdparse(bus, bus->rxhdr, rd,
BRCMF_SDIO_FT_NORMAL)) { BRCMF_SDIO_FT_NORMAL)) {
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
if (!bus->rxpending) if (!bus->rxpending)
break; break;
else else
...@@ -1869,7 +1869,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) ...@@ -1869,7 +1869,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
rd->len_nxtfrm = 0; rd->len_nxtfrm = 0;
/* treat all packet as event if we don't know */ /* treat all packet as event if we don't know */
rd->channel = SDPCM_EVENT_CHANNEL; rd->channel = SDPCM_EVENT_CHANNEL;
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
continue; continue;
} }
rd->len_left = rd->len > BRCMF_FIRSTREAD ? rd->len_left = rd->len > BRCMF_FIRSTREAD ?
...@@ -1886,7 +1886,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) ...@@ -1886,7 +1886,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
brcmf_err("brcmu_pkt_buf_get_skb failed\n"); brcmf_err("brcmu_pkt_buf_get_skb failed\n");
brcmf_sdio_rxfail(bus, false, brcmf_sdio_rxfail(bus, false,
RETRYCHAN(rd->channel)); RETRYCHAN(rd->channel));
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
continue; continue;
} }
skb_pull(pkt, head_read); skb_pull(pkt, head_read);
...@@ -1894,16 +1894,16 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) ...@@ -1894,16 +1894,16 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
ret = brcmf_sdiod_recv_pkt(bus->sdiodev, pkt); ret = brcmf_sdiod_recv_pkt(bus->sdiodev, pkt);
bus->sdcnt.f2rxdata++; bus->sdcnt.f2rxdata++;
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
if (ret < 0) { if (ret < 0) {
brcmf_err("read %d bytes from channel %d failed: %d\n", brcmf_err("read %d bytes from channel %d failed: %d\n",
rd->len, rd->channel, ret); rd->len, rd->channel, ret);
brcmu_pkt_buf_free_skb(pkt); brcmu_pkt_buf_free_skb(pkt);
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
brcmf_sdio_rxfail(bus, true, brcmf_sdio_rxfail(bus, true,
RETRYCHAN(rd->channel)); RETRYCHAN(rd->channel));
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
continue; continue;
} }
...@@ -1914,7 +1914,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) ...@@ -1914,7 +1914,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
} else { } else {
memcpy(bus->rxhdr, pkt->data, SDPCM_HDRLEN); memcpy(bus->rxhdr, pkt->data, SDPCM_HDRLEN);
rd_new.seq_num = rd->seq_num; rd_new.seq_num = rd->seq_num;
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
if (brcmf_sdio_hdparse(bus, bus->rxhdr, &rd_new, if (brcmf_sdio_hdparse(bus, bus->rxhdr, &rd_new,
BRCMF_SDIO_FT_NORMAL)) { BRCMF_SDIO_FT_NORMAL)) {
rd->len = 0; rd->len = 0;
...@@ -1927,11 +1927,11 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) ...@@ -1927,11 +1927,11 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
roundup(rd_new.len, 16) >> 4); roundup(rd_new.len, 16) >> 4);
rd->len = 0; rd->len = 0;
brcmf_sdio_rxfail(bus, true, true); brcmf_sdio_rxfail(bus, true, true);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
brcmu_pkt_buf_free_skb(pkt); brcmu_pkt_buf_free_skb(pkt);
continue; continue;
} }
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
rd->len_nxtfrm = rd_new.len_nxtfrm; rd->len_nxtfrm = rd_new.len_nxtfrm;
rd->channel = rd_new.channel; rd->channel = rd_new.channel;
rd->dat_offset = rd_new.dat_offset; rd->dat_offset = rd_new.dat_offset;
...@@ -1947,9 +1947,9 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) ...@@ -1947,9 +1947,9 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
rd_new.seq_num); rd_new.seq_num);
/* Force retry w/normal header read */ /* Force retry w/normal header read */
rd->len = 0; rd->len = 0;
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
brcmf_sdio_rxfail(bus, false, true); brcmf_sdio_rxfail(bus, false, true);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
brcmu_pkt_buf_free_skb(pkt); brcmu_pkt_buf_free_skb(pkt);
continue; continue;
} }
...@@ -1972,9 +1972,9 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes) ...@@ -1972,9 +1972,9 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
} else { } else {
brcmf_err("%s: glom superframe w/o " brcmf_err("%s: glom superframe w/o "
"descriptor!\n", __func__); "descriptor!\n", __func__);
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
brcmf_sdio_rxfail(bus, false, false); brcmf_sdio_rxfail(bus, false, false);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
} }
/* prepare the descriptor for the next read */ /* prepare the descriptor for the next read */
rd->len = rd->len_nxtfrm << 4; rd->len = rd->len_nxtfrm << 4;
...@@ -2072,7 +2072,7 @@ static int brcmf_sdio_txpkt_prep_sg(struct brcmf_sdio *bus, ...@@ -2072,7 +2072,7 @@ static int brcmf_sdio_txpkt_prep_sg(struct brcmf_sdio *bus,
int ntail, ret; int ntail, ret;
sdiodev = bus->sdiodev; sdiodev = bus->sdiodev;
blksize = sdiodev->func[2]->cur_blksize; blksize = sdiodev->func2->cur_blksize;
/* sg entry alignment should be a divisor of block size */ /* sg entry alignment should be a divisor of block size */
WARN_ON(blksize % bus->sgentry_align); WARN_ON(blksize % bus->sgentry_align);
...@@ -2251,14 +2251,14 @@ static int brcmf_sdio_txpkt(struct brcmf_sdio *bus, struct sk_buff_head *pktq, ...@@ -2251,14 +2251,14 @@ static int brcmf_sdio_txpkt(struct brcmf_sdio *bus, struct sk_buff_head *pktq,
if (ret) if (ret)
goto done; goto done;
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
ret = brcmf_sdiod_send_pkt(bus->sdiodev, pktq); ret = brcmf_sdiod_send_pkt(bus->sdiodev, pktq);
bus->sdcnt.f2txdata++; bus->sdcnt.f2txdata++;
if (ret < 0) if (ret < 0)
brcmf_sdio_txfail(bus); brcmf_sdio_txfail(bus);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
done: done:
brcmf_sdio_txpkt_postp(bus, pktq); brcmf_sdio_txpkt_postp(bus, pktq);
...@@ -2314,10 +2314,11 @@ static uint brcmf_sdio_sendfromq(struct brcmf_sdio *bus, uint maxframes) ...@@ -2314,10 +2314,11 @@ static uint brcmf_sdio_sendfromq(struct brcmf_sdio *bus, uint maxframes)
/* In poll mode, need to check for other events */ /* In poll mode, need to check for other events */
if (!bus->intr) { if (!bus->intr) {
/* Check device status, signal pending interrupt */ /* Check device status, signal pending interrupt */
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
intstatus = brcmf_sdiod_readl(bus->sdiodev, intstatus = brcmf_sdiod_readl(bus->sdiodev,
intstat_addr, &ret); intstat_addr, &ret);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
bus->sdcnt.f2txdata++; bus->sdcnt.f2txdata++;
if (ret != 0) if (ret != 0)
break; break;
...@@ -2417,7 +2418,7 @@ static void brcmf_sdio_bus_stop(struct device *dev) ...@@ -2417,7 +2418,7 @@ static void brcmf_sdio_bus_stop(struct device *dev)
} }
if (sdiodev->state != BRCMF_SDIOD_NOMEDIUM) { if (sdiodev->state != BRCMF_SDIOD_NOMEDIUM) {
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func1);
/* Enable clock for device interrupts */ /* Enable clock for device interrupts */
brcmf_sdio_bus_sleep(bus, false, false); brcmf_sdio_bus_sleep(bus, false, false);
...@@ -2441,13 +2442,13 @@ static void brcmf_sdio_bus_stop(struct device *dev) ...@@ -2441,13 +2442,13 @@ static void brcmf_sdio_bus_stop(struct device *dev)
/* Turn off the bus (F2), free any pending packets */ /* Turn off the bus (F2), free any pending packets */
brcmf_dbg(INTR, "disable SDIO interrupts\n"); brcmf_dbg(INTR, "disable SDIO interrupts\n");
sdio_disable_func(sdiodev->func[2]); sdio_disable_func(sdiodev->func2);
/* Clear any pending interrupts now that F2 is disabled */ /* Clear any pending interrupts now that F2 is disabled */
brcmf_sdiod_writel(sdiodev, core->base + SD_REG(intstatus), brcmf_sdiod_writel(sdiodev, core->base + SD_REG(intstatus),
local_hostintmask, NULL); local_hostintmask, NULL);
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
} }
/* Clear the data packet queues */ /* Clear the data packet queues */
brcmu_pktq_flush(&bus->txq, true, NULL, NULL); brcmu_pktq_flush(&bus->txq, true, NULL, NULL);
...@@ -2522,7 +2523,7 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus) ...@@ -2522,7 +2523,7 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus)
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
/* If waiting for HTAVAIL, check status */ /* If waiting for HTAVAIL, check status */
if (!bus->sr_enabled && bus->clkstate == CLK_PENDING) { if (!bus->sr_enabled && bus->clkstate == CLK_PENDING) {
...@@ -2585,7 +2586,7 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus) ...@@ -2585,7 +2586,7 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus)
intstatus |= brcmf_sdio_hostmail(bus); intstatus |= brcmf_sdio_hostmail(bus);
} }
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
/* Generally don't ask for these, can get CRC errors... */ /* Generally don't ask for these, can get CRC errors... */
if (intstatus & I_WR_OOSYNC) { if (intstatus & I_WR_OOSYNC) {
...@@ -2628,7 +2629,7 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus) ...@@ -2628,7 +2629,7 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus)
if (bus->ctrl_frame_stat && (bus->clkstate == CLK_AVAIL) && if (bus->ctrl_frame_stat && (bus->clkstate == CLK_AVAIL) &&
data_ok(bus)) { data_ok(bus)) {
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
if (bus->ctrl_frame_stat) { if (bus->ctrl_frame_stat) {
err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf, err = brcmf_sdio_tx_ctrlframe(bus, bus->ctrl_frame_buf,
bus->ctrl_frame_len); bus->ctrl_frame_len);
...@@ -2636,7 +2637,7 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus) ...@@ -2636,7 +2637,7 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus)
wmb(); wmb();
bus->ctrl_frame_stat = false; bus->ctrl_frame_stat = false;
} }
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
brcmf_sdio_wait_event_wakeup(bus); brcmf_sdio_wait_event_wakeup(bus);
} }
/* Send queued frames (limit 1 if rx may still be pending) */ /* Send queued frames (limit 1 if rx may still be pending) */
...@@ -2652,14 +2653,14 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus) ...@@ -2652,14 +2653,14 @@ static void brcmf_sdio_dpc(struct brcmf_sdio *bus)
brcmf_err("failed backplane access over SDIO, halting operation\n"); brcmf_err("failed backplane access over SDIO, halting operation\n");
atomic_set(&bus->intstatus, 0); atomic_set(&bus->intstatus, 0);
if (bus->ctrl_frame_stat) { if (bus->ctrl_frame_stat) {
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
if (bus->ctrl_frame_stat) { if (bus->ctrl_frame_stat) {
bus->ctrl_frame_err = -ENODEV; bus->ctrl_frame_err = -ENODEV;
wmb(); wmb();
bus->ctrl_frame_stat = false; bus->ctrl_frame_stat = false;
brcmf_sdio_wait_event_wakeup(bus); brcmf_sdio_wait_event_wakeup(bus);
} }
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
} }
} else if (atomic_read(&bus->intstatus) || } else if (atomic_read(&bus->intstatus) ||
atomic_read(&bus->ipend) > 0 || atomic_read(&bus->ipend) > 0 ||
...@@ -2874,13 +2875,13 @@ brcmf_sdio_bus_txctl(struct device *dev, unsigned char *msg, uint msglen) ...@@ -2874,13 +2875,13 @@ brcmf_sdio_bus_txctl(struct device *dev, unsigned char *msg, uint msglen)
CTL_DONE_TIMEOUT); CTL_DONE_TIMEOUT);
ret = 0; ret = 0;
if (bus->ctrl_frame_stat) { if (bus->ctrl_frame_stat) {
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
if (bus->ctrl_frame_stat) { if (bus->ctrl_frame_stat) {
brcmf_dbg(SDIO, "ctrl_frame timeout\n"); brcmf_dbg(SDIO, "ctrl_frame timeout\n");
bus->ctrl_frame_stat = false; bus->ctrl_frame_stat = false;
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
} }
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
} }
if (!ret) { if (!ret) {
brcmf_dbg(SDIO, "ctrl_frame complete, err=%d\n", brcmf_dbg(SDIO, "ctrl_frame complete, err=%d\n",
...@@ -3004,7 +3005,7 @@ static int brcmf_sdio_assert_info(struct seq_file *seq, struct brcmf_sdio *bus, ...@@ -3004,7 +3005,7 @@ static int brcmf_sdio_assert_info(struct seq_file *seq, struct brcmf_sdio *bus,
return 0; return 0;
} }
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
if (sh->assert_file_addr != 0) { if (sh->assert_file_addr != 0) {
error = brcmf_sdiod_ramrw(bus->sdiodev, false, error = brcmf_sdiod_ramrw(bus->sdiodev, false,
sh->assert_file_addr, (u8 *)file, 80); sh->assert_file_addr, (u8 *)file, 80);
...@@ -3017,7 +3018,7 @@ static int brcmf_sdio_assert_info(struct seq_file *seq, struct brcmf_sdio *bus, ...@@ -3017,7 +3018,7 @@ static int brcmf_sdio_assert_info(struct seq_file *seq, struct brcmf_sdio *bus,
if (error < 0) if (error < 0)
return error; return error;
} }
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
seq_printf(seq, "dongle assert: %s:%d: assert(%s)\n", seq_printf(seq, "dongle assert: %s:%d: assert(%s)\n",
file, sh->assert_line, expr); file, sh->assert_line, expr);
...@@ -3291,7 +3292,7 @@ static int brcmf_sdio_download_firmware(struct brcmf_sdio *bus, ...@@ -3291,7 +3292,7 @@ static int brcmf_sdio_download_firmware(struct brcmf_sdio *bus,
int bcmerror; int bcmerror;
u32 rstvec; u32 rstvec;
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
brcmf_sdio_clkctl(bus, CLK_AVAIL, false); brcmf_sdio_clkctl(bus, CLK_AVAIL, false);
rstvec = get_unaligned_le32(fw->data); rstvec = get_unaligned_le32(fw->data);
...@@ -3320,7 +3321,7 @@ static int brcmf_sdio_download_firmware(struct brcmf_sdio *bus, ...@@ -3320,7 +3321,7 @@ static int brcmf_sdio_download_firmware(struct brcmf_sdio *bus,
err: err:
brcmf_sdio_clkctl(bus, CLK_SDONLY, false); brcmf_sdio_clkctl(bus, CLK_SDONLY, false);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
return bcmerror; return bcmerror;
} }
...@@ -3435,7 +3436,7 @@ static int brcmf_sdio_bus_preinit(struct device *dev) ...@@ -3435,7 +3436,7 @@ static int brcmf_sdio_bus_preinit(struct device *dev)
if (sdiodev->sg_support) { if (sdiodev->sg_support) {
bus->txglom = false; bus->txglom = false;
value = 1; value = 1;
pad_size = bus->sdiodev->func[2]->cur_blksize << 1; pad_size = bus->sdiodev->func2->cur_blksize << 1;
err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom", err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom",
&value, sizeof(u32)); &value, sizeof(u32));
if (err < 0) { if (err < 0) {
...@@ -3477,7 +3478,7 @@ static int brcmf_sdio_bus_get_memdump(struct device *dev, void *data, ...@@ -3477,7 +3478,7 @@ static int brcmf_sdio_bus_get_memdump(struct device *dev, void *data,
address = bus->ci->rambase; address = bus->ci->rambase;
offset = err = 0; offset = err = 0;
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func1);
while (offset < mem_size) { while (offset < mem_size) {
len = ((offset + MEMBLOCK) < mem_size) ? MEMBLOCK : len = ((offset + MEMBLOCK) < mem_size) ? MEMBLOCK :
mem_size - offset; mem_size - offset;
...@@ -3493,7 +3494,7 @@ static int brcmf_sdio_bus_get_memdump(struct device *dev, void *data, ...@@ -3493,7 +3494,7 @@ static int brcmf_sdio_bus_get_memdump(struct device *dev, void *data,
} }
done: done:
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
return err; return err;
} }
...@@ -3550,11 +3551,10 @@ static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus) ...@@ -3550,11 +3551,10 @@ static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus)
if (!bus->dpc_triggered) { if (!bus->dpc_triggered) {
u8 devpend; u8 devpend;
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
devpend = brcmf_sdiod_func0_rb(bus->sdiodev, devpend = brcmf_sdiod_func0_rb(bus->sdiodev,
SDIO_CCCR_INTx, SDIO_CCCR_INTx, NULL);
NULL); sdio_release_host(bus->sdiodev->func1);
sdio_release_host(bus->sdiodev->func[1]);
intstatus = devpend & (INTR_STATUS_FUNC1 | intstatus = devpend & (INTR_STATUS_FUNC1 |
INTR_STATUS_FUNC2); INTR_STATUS_FUNC2);
} }
...@@ -3580,13 +3580,13 @@ static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus) ...@@ -3580,13 +3580,13 @@ static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus)
bus->console.count += jiffies_to_msecs(BRCMF_WD_POLL); bus->console.count += jiffies_to_msecs(BRCMF_WD_POLL);
if (bus->console.count >= bus->console_interval) { if (bus->console.count >= bus->console_interval) {
bus->console.count -= bus->console_interval; bus->console.count -= bus->console_interval;
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
/* Make sure backplane clock is on */ /* Make sure backplane clock is on */
brcmf_sdio_bus_sleep(bus, false, false); brcmf_sdio_bus_sleep(bus, false, false);
if (brcmf_sdio_readconsole(bus) < 0) if (brcmf_sdio_readconsole(bus) < 0)
/* stop on error */ /* stop on error */
bus->console_interval = 0; bus->console_interval = 0;
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
} }
} }
#endif /* DEBUG */ #endif /* DEBUG */
...@@ -3599,11 +3599,11 @@ static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus) ...@@ -3599,11 +3599,11 @@ static void brcmf_sdio_bus_watchdog(struct brcmf_sdio *bus)
bus->idlecount++; bus->idlecount++;
if (bus->idlecount > bus->idletime) { if (bus->idlecount > bus->idletime) {
brcmf_dbg(SDIO, "idle\n"); brcmf_dbg(SDIO, "idle\n");
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
brcmf_sdio_wd_timer(bus, false); brcmf_sdio_wd_timer(bus, false);
bus->idlecount = 0; bus->idlecount = 0;
brcmf_sdio_bus_sleep(bus, true, false); brcmf_sdio_bus_sleep(bus, true, false);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
} }
} else { } else {
bus->idlecount = 0; bus->idlecount = 0;
...@@ -3773,8 +3773,8 @@ static u32 brcmf_sdio_buscore_read32(void *ctx, u32 addr) ...@@ -3773,8 +3773,8 @@ static u32 brcmf_sdio_buscore_read32(void *ctx, u32 addr)
val = brcmf_sdiod_readl(sdiodev, addr, NULL); val = brcmf_sdiod_readl(sdiodev, addr, NULL);
if (addr == CORE_CC_REG(SI_ENUM_BASE, chipid) && if (addr == CORE_CC_REG(SI_ENUM_BASE, chipid) &&
(sdiodev->func[1]->device == SDIO_DEVICE_ID_BROADCOM_4339 || (sdiodev->func1->device == SDIO_DEVICE_ID_BROADCOM_4339 ||
sdiodev->func[1]->device == SDIO_DEVICE_ID_BROADCOM_4335_4339)) { sdiodev->func1->device == SDIO_DEVICE_ID_BROADCOM_4335_4339)) {
rev = (val & CID_REV_MASK) >> CID_REV_SHIFT; rev = (val & CID_REV_MASK) >> CID_REV_SHIFT;
if (rev >= 2) { if (rev >= 2) {
val &= ~CID_ID_MASK; val &= ~CID_ID_MASK;
...@@ -3810,7 +3810,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdio *bus) ...@@ -3810,7 +3810,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdio *bus)
u32 drivestrength; u32 drivestrength;
sdiodev = bus->sdiodev; sdiodev = bus->sdiodev;
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func1);
pr_debug("F1 signature read @0x18000000=0x%4x\n", pr_debug("F1 signature read @0x18000000=0x%4x\n",
brcmf_sdiod_readl(sdiodev, SI_ENUM_BASE, NULL)); brcmf_sdiod_readl(sdiodev, SI_ENUM_BASE, NULL));
...@@ -3877,8 +3877,8 @@ brcmf_sdio_probe_attach(struct brcmf_sdio *bus) ...@@ -3877,8 +3877,8 @@ brcmf_sdio_probe_attach(struct brcmf_sdio *bus)
/* wowl can be supported when KEEP_POWER is true and (WAKE_SDIO_IRQ /* wowl can be supported when KEEP_POWER is true and (WAKE_SDIO_IRQ
* is true or when platform data OOB irq is true). * is true or when platform data OOB irq is true).
*/ */
if ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_KEEP_POWER) && if ((sdio_get_host_pm_caps(sdiodev->func1) & MMC_PM_KEEP_POWER) &&
((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_WAKE_SDIO_IRQ) || ((sdio_get_host_pm_caps(sdiodev->func1) & MMC_PM_WAKE_SDIO_IRQ) ||
(sdiodev->settings->bus.sdio.oob_irq_supported))) (sdiodev->settings->bus.sdio.oob_irq_supported)))
sdiodev->bus_if->wowl_supported = true; sdiodev->bus_if->wowl_supported = true;
#endif #endif
...@@ -3917,7 +3917,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdio *bus) ...@@ -3917,7 +3917,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdio *bus)
if (err) if (err)
goto fail; goto fail;
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN); brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);
...@@ -3938,7 +3938,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdio *bus) ...@@ -3938,7 +3938,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdio *bus)
return true; return true;
fail: fail:
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
return false; return false;
} }
...@@ -4044,7 +4044,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, ...@@ -4044,7 +4044,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err,
bus->sdcnt.tickcnt = 0; bus->sdcnt.tickcnt = 0;
brcmf_sdio_wd_timer(bus, true); brcmf_sdio_wd_timer(bus, true);
sdio_claim_host(sdiodev->func[1]); sdio_claim_host(sdiodev->func1);
/* Make sure backplane clock is on, needed to generate F2 interrupt */ /* Make sure backplane clock is on, needed to generate F2 interrupt */
brcmf_sdio_clkctl(bus, CLK_AVAIL, false); brcmf_sdio_clkctl(bus, CLK_AVAIL, false);
...@@ -4066,7 +4066,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, ...@@ -4066,7 +4066,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err,
brcmf_sdiod_writel(sdiod, core->base + SD_REG(tosbmailboxdata), brcmf_sdiod_writel(sdiod, core->base + SD_REG(tosbmailboxdata),
SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT, NULL); SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT, NULL);
err = sdio_enable_func(sdiodev->func[2]); err = sdio_enable_func(sdiodev->func2);
brcmf_dbg(INFO, "enable F2: err=%d\n", err); brcmf_dbg(INFO, "enable F2: err=%d\n", err);
...@@ -4081,7 +4081,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, ...@@ -4081,7 +4081,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err,
brcmf_sdiod_writeb(sdiodev, SBSDIO_WATERMARK, 8, &err); brcmf_sdiod_writeb(sdiodev, SBSDIO_WATERMARK, 8, &err);
} else { } else {
/* Disable F2 again */ /* Disable F2 again */
sdio_disable_func(sdiodev->func[2]); sdio_disable_func(sdiodev->func2);
goto release; goto release;
} }
...@@ -4106,7 +4106,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, ...@@ -4106,7 +4106,7 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err,
if (err != 0) if (err != 0)
brcmf_sdio_clkctl(bus, CLK_NONE, false); brcmf_sdio_clkctl(bus, CLK_NONE, false);
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
err = brcmf_bus_started(dev); err = brcmf_bus_started(dev);
if (err != 0) { if (err != 0) {
...@@ -4116,10 +4116,10 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, ...@@ -4116,10 +4116,10 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err,
return; return;
release: release:
sdio_release_host(sdiodev->func[1]); sdio_release_host(sdiodev->func1);
fail: fail:
brcmf_dbg(TRACE, "failed: dev=%s, err=%d\n", dev_name(dev), err); brcmf_dbg(TRACE, "failed: dev=%s, err=%d\n", dev_name(dev), err);
device_release_driver(&sdiodev->func[2]->dev); device_release_driver(&sdiodev->func2->dev);
device_release_driver(dev); device_release_driver(dev);
} }
...@@ -4146,7 +4146,7 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev) ...@@ -4146,7 +4146,7 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
/* single-threaded workqueue */ /* single-threaded workqueue */
wq = alloc_ordered_workqueue("brcmf_wq/%s", WQ_MEM_RECLAIM, wq = alloc_ordered_workqueue("brcmf_wq/%s", WQ_MEM_RECLAIM,
dev_name(&sdiodev->func[1]->dev)); dev_name(&sdiodev->func1->dev));
if (!wq) { if (!wq) {
brcmf_err("insufficient memory to create txworkqueue\n"); brcmf_err("insufficient memory to create txworkqueue\n");
goto fail; goto fail;
...@@ -4172,7 +4172,7 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev) ...@@ -4172,7 +4172,7 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
init_completion(&bus->watchdog_wait); init_completion(&bus->watchdog_wait);
bus->watchdog_tsk = kthread_run(brcmf_sdio_watchdog_thread, bus->watchdog_tsk = kthread_run(brcmf_sdio_watchdog_thread,
bus, "brcmf_wdog/%s", bus, "brcmf_wdog/%s",
dev_name(&sdiodev->func[1]->dev)); dev_name(&sdiodev->func1->dev));
if (IS_ERR(bus->watchdog_tsk)) { if (IS_ERR(bus->watchdog_tsk)) {
pr_warn("brcmf_watchdog thread failed to start\n"); pr_warn("brcmf_watchdog thread failed to start\n");
bus->watchdog_tsk = NULL; bus->watchdog_tsk = NULL;
...@@ -4198,7 +4198,7 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev) ...@@ -4198,7 +4198,7 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
} }
/* Query the F2 block size, set roundup accordingly */ /* Query the F2 block size, set roundup accordingly */
bus->blocksize = bus->sdiodev->func[2]->cur_blksize; bus->blocksize = bus->sdiodev->func2->cur_blksize;
bus->roundup = min(max_roundup, bus->blocksize); bus->roundup = min(max_roundup, bus->blocksize);
/* Allocate buffers */ /* Allocate buffers */
...@@ -4214,17 +4214,17 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev) ...@@ -4214,17 +4214,17 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
} }
} }
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
/* Disable F2 to clear any intermediate frame state on the dongle */ /* Disable F2 to clear any intermediate frame state on the dongle */
sdio_disable_func(bus->sdiodev->func[2]); sdio_disable_func(bus->sdiodev->func2);
bus->rxflow = false; bus->rxflow = false;
/* Done with backplane-dependent accesses, can drop clock... */ /* Done with backplane-dependent accesses, can drop clock... */
brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, 0, NULL); brcmf_sdiod_writeb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, 0, NULL);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
/* ...and initialize clock/power states */ /* ...and initialize clock/power states */
bus->clkstate = CLK_SDONLY; bus->clkstate = CLK_SDONLY;
...@@ -4276,7 +4276,7 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus) ...@@ -4276,7 +4276,7 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus)
if (bus->ci) { if (bus->ci) {
if (bus->sdiodev->state != BRCMF_SDIOD_NOMEDIUM) { if (bus->sdiodev->state != BRCMF_SDIOD_NOMEDIUM) {
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
brcmf_sdio_wd_timer(bus, false); brcmf_sdio_wd_timer(bus, false);
brcmf_sdio_clkctl(bus, CLK_AVAIL, false); brcmf_sdio_clkctl(bus, CLK_AVAIL, false);
/* Leave the device in state where it is /* Leave the device in state where it is
...@@ -4286,7 +4286,7 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus) ...@@ -4286,7 +4286,7 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus)
msleep(20); msleep(20);
brcmf_chip_set_passive(bus->ci); brcmf_chip_set_passive(bus->ci);
brcmf_sdio_clkctl(bus, CLK_NONE, false); brcmf_sdio_clkctl(bus, CLK_NONE, false);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
} }
brcmf_chip_detach(bus->ci); brcmf_chip_detach(bus->ci);
} }
...@@ -4333,9 +4333,9 @@ int brcmf_sdio_sleep(struct brcmf_sdio *bus, bool sleep) ...@@ -4333,9 +4333,9 @@ int brcmf_sdio_sleep(struct brcmf_sdio *bus, bool sleep)
{ {
int ret; int ret;
sdio_claim_host(bus->sdiodev->func[1]); sdio_claim_host(bus->sdiodev->func1);
ret = brcmf_sdio_bus_sleep(bus, sleep, false); ret = brcmf_sdio_bus_sleep(bus, sleep, false);
sdio_release_host(bus->sdiodev->func[1]); sdio_release_host(bus->sdiodev->func1);
return ret; return ret;
} }
......
...@@ -21,9 +21,6 @@ ...@@ -21,9 +21,6 @@
#include <linux/firmware.h> #include <linux/firmware.h>
#include "firmware.h" #include "firmware.h"
/* Maximum number of I/O funcs */
#define NUM_SDIO_FUNCS 3
#define SDIOD_FBR_SIZE 0x100 #define SDIOD_FBR_SIZE 0x100
/* io_en */ /* io_en */
...@@ -173,8 +170,8 @@ struct brcmf_sdio; ...@@ -173,8 +170,8 @@ struct brcmf_sdio;
struct brcmf_sdiod_freezer; struct brcmf_sdiod_freezer;
struct brcmf_sdio_dev { struct brcmf_sdio_dev {
struct sdio_func *func[NUM_SDIO_FUNCS]; struct sdio_func *func1;
u8 num_funcs; /* Supported funcs on client */ struct sdio_func *func2;
u32 sbwad; /* Save backplane window address */ u32 sbwad; /* Save backplane window address */
struct brcmf_core *cc_core; /* chipcommon core info struct */ struct brcmf_core *cc_core; /* chipcommon core info struct */
struct brcmf_sdio *bus; struct brcmf_sdio *bus;
...@@ -295,17 +292,17 @@ void brcmf_sdiod_intr_unregister(struct brcmf_sdio_dev *sdiodev); ...@@ -295,17 +292,17 @@ void brcmf_sdiod_intr_unregister(struct brcmf_sdio_dev *sdiodev);
/* SDIO device register access interface */ /* SDIO device register access interface */
/* Accessors for SDIO Function 0 */ /* Accessors for SDIO Function 0 */
#define brcmf_sdiod_func0_rb(sdiodev, addr, r) \ #define brcmf_sdiod_func0_rb(sdiodev, addr, r) \
sdio_f0_readb((sdiodev)->func[1], (addr), (r)) sdio_f0_readb((sdiodev)->func1, (addr), (r))
#define brcmf_sdiod_func0_wb(sdiodev, addr, v, ret) \ #define brcmf_sdiod_func0_wb(sdiodev, addr, v, ret) \
sdio_f0_writeb((sdiodev)->func[1], (v), (addr), (ret)) sdio_f0_writeb((sdiodev)->func1, (v), (addr), (ret))
/* Accessors for SDIO Function 1 */ /* Accessors for SDIO Function 1 */
#define brcmf_sdiod_readb(sdiodev, addr, r) \ #define brcmf_sdiod_readb(sdiodev, addr, r) \
sdio_readb((sdiodev)->func[1], (addr), (r)) sdio_readb((sdiodev)->func1, (addr), (r))
#define brcmf_sdiod_writeb(sdiodev, addr, v, ret) \ #define brcmf_sdiod_writeb(sdiodev, addr, v, ret) \
sdio_writeb((sdiodev)->func[1], (v), (addr), (ret)) sdio_writeb((sdiodev)->func1, (v), (addr), (ret))
u32 brcmf_sdiod_readl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret); u32 brcmf_sdiod_readl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret);
void brcmf_sdiod_writel(struct brcmf_sdio_dev *sdiodev, u32 addr, u32 data, void brcmf_sdiod_writel(struct brcmf_sdio_dev *sdiodev, u32 addr, u32 data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment