OSDN Git Service

brcmfmac: stabilise the value of ->sbwad in use for some xfer routines.
authorIan Molton <ian@mnementh.co.uk>
Tue, 19 Dec 2017 12:47:09 +0000 (13:47 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 8 Jan 2018 17:17:55 +0000 (19:17 +0200)
The IO functions operate within the Chipcommon IO window. Explicitly
set this, rather than relying on the last initialisation IO access to
leave it set to the right value by chance.

Signed-off-by: Ian Molton <ian@mnementh.co.uk>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h

index f8b47c1..29a2d1e 100644 (file)
@@ -529,7 +529,7 @@ int brcmf_sdiod_recv_buf(struct brcmf_sdio_dev *sdiodev, u8 *buf, uint nbytes)
 
 int brcmf_sdiod_recv_pkt(struct brcmf_sdio_dev *sdiodev, struct sk_buff *pkt)
 {
-       u32 addr = sdiodev->sbwad;
+       u32 addr = sdiodev->cc_core->base;
        int err = 0;
 
        brcmf_dbg(SDIO, "addr = 0x%x, size = %d\n", addr, pkt->len);
@@ -552,7 +552,7 @@ int brcmf_sdiod_recv_chain(struct brcmf_sdio_dev *sdiodev,
 {
        struct sk_buff *glom_skb = NULL;
        struct sk_buff *skb;
-       u32 addr = sdiodev->sbwad;
+       u32 addr = sdiodev->cc_core->base;
        int err = 0;
 
        brcmf_dbg(SDIO, "addr = 0x%x, size = %d\n",
@@ -593,7 +593,7 @@ done:
 int brcmf_sdiod_send_buf(struct brcmf_sdio_dev *sdiodev, u8 *buf, uint nbytes)
 {
        struct sk_buff *mypkt;
-       u32 addr = sdiodev->sbwad;
+       u32 addr = sdiodev->cc_core->base;
        int err;
 
        mypkt = brcmu_pkt_buf_get_skb(nbytes);
@@ -625,7 +625,7 @@ int brcmf_sdiod_send_pkt(struct brcmf_sdio_dev *sdiodev,
                         struct sk_buff_head *pktq)
 {
        struct sk_buff *skb;
-       u32 addr = sdiodev->sbwad;
+       u32 addr = sdiodev->cc_core->base;
        int err;
 
        brcmf_dbg(SDIO, "addr = 0x%x, size = %d\n", addr, pktq->qlen);
index fb2fc04..65ecba6 100644 (file)
@@ -3842,6 +3842,11 @@ brcmf_sdio_probe_attach(struct brcmf_sdio *bus)
        if (!bus->sdio_core)
                goto fail;
 
+       /* Pick up the CHIPCOMMON core info struct, for bulk IO in bcmsdh.c */
+       sdiodev->cc_core = brcmf_chip_get_core(bus->ci, BCMA_CORE_CHIPCOMMON);
+       if (!sdiodev->cc_core)
+               goto fail;
+
        sdiodev->settings = brcmf_get_module_param(sdiodev->dev,
                                                   BRCMF_BUSTYPE_SDIO,
                                                   bus->ci->chip,
index 01def16..ac5f814 100644 (file)
@@ -178,6 +178,7 @@ struct brcmf_sdio_dev {
        struct sdio_func *func[SDIO_MAX_FUNCS];
        u8 num_funcs;                   /* Supported funcs on client */
        u32 sbwad;                      /* Save backplane window address */
+       struct brcmf_core *cc_core;     /* chipcommon core info struct */
        struct brcmf_sdio *bus;
        struct device *dev;
        struct brcmf_bus *bus_if;