Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279323
b: refs/heads/master
c: 712ac5b
h: refs/heads/master
i:
  279321: 7935569
  279319: 6a3d7e7
v: v3
  • Loading branch information
Franky Lin authored and John W. Linville committed Dec 19, 2011
1 parent c637e7f commit 9720319
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c8bf34849f92c5894a3d7e12573d3789d7851f23
refs/heads/master: 712ac5b37a3348cac4e040c551a6ca6186d33682
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/brcm80211/brcmfmac/dhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,8 @@ extern uint brcmf_c_mkiovar(char *name, char *data, uint datalen,
* Returned structure should have bus and prot pointers filled in.
* bus_hdrlen specifies required headroom for bus module header.
*/
extern struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus,
uint bus_hdrlen, struct device *dev);
extern int brcmf_attach(struct brcmf_sdio *bus,
uint bus_hdrlen, struct device *dev);
extern int brcmf_net_attach(struct brcmf_pub *drvr, int idx);
extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);

Expand Down
15 changes: 8 additions & 7 deletions trunk/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,17 +922,18 @@ void brcmf_del_if(struct brcmf_pub *drvr, int ifidx)
}
}

struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus, uint bus_hdrlen,
int brcmf_attach(struct brcmf_sdio *bus, uint bus_hdrlen,
struct device *dev)
{
struct brcmf_pub *drvr = NULL;
int ret = 0;

brcmf_dbg(TRACE, "Enter\n");

/* Allocate primary brcmf_info */
drvr = kzalloc(sizeof(struct brcmf_pub), GFP_ATOMIC);
if (!drvr)
goto fail;
return -ENOMEM;

mutex_init(&drvr->proto_block);

Expand All @@ -944,21 +945,21 @@ struct brcmf_pub *brcmf_attach(struct brcmf_sdio *bus, uint bus_hdrlen,
drvr->dev = dev;

/* Attach and link in the protocol */
if (brcmf_proto_attach(drvr) != 0) {
ret = brcmf_proto_attach(drvr);
if (ret != 0) {
brcmf_dbg(ERROR, "brcmf_prot_attach failed\n");
goto fail;
}

INIT_WORK(&drvr->setmacaddr_work, _brcmf_set_mac_address);
INIT_WORK(&drvr->multicast_work, _brcmf_set_multicast_list);

return drvr;
return ret;

fail:
if (drvr)
brcmf_detach(dev);
brcmf_detach(dev);

return NULL;
return ret;
}

int brcmf_bus_start(struct device *dev)
Expand Down
43 changes: 19 additions & 24 deletions trunk/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,6 @@ struct sdpcm_shared_le {
/* misc chip info needed by some of the routines */
/* Private data for SDIO bus interaction */
struct brcmf_sdio {
struct brcmf_pub *drvr;

struct brcmf_sdio_dev *sdiodev; /* sdio device handler */
struct chip_info *ci; /* Chip info struct */
char *vars; /* Variables (from CIS and/or other) */
Expand Down Expand Up @@ -1077,7 +1075,7 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_sdio *bus, bool abort, bool rtx)

/* If we can't reach the device, signal failure */
if (err || brcmf_sdcard_regfail(bus->sdiodev))
bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
}

/* copy a buffer into a pkt buffer chain */
Expand Down Expand Up @@ -1724,7 +1722,7 @@ brcmf_sdbrcm_readframes(struct brcmf_sdio *bus, uint maxframes, bool *finished)

for (rxseq = bus->rx_seq, rxleft = maxframes;
!bus->rxskip && rxleft &&
bus->drvr->bus_if->state != BRCMF_BUS_DOWN;
bus->sdiodev->bus_if->state != BRCMF_BUS_DOWN;
rxseq++, rxleft--) {

/* Handle glomming separately */
Expand Down Expand Up @@ -2259,8 +2257,6 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_sdio *bus, uint maxframes)
uint datalen;
u8 tx_prec_map;

struct brcmf_pub *drvr = bus->drvr;

brcmf_dbg(TRACE, "Enter\n");

tx_prec_map = ~bus->flowcontrol;
Expand Down Expand Up @@ -2297,8 +2293,8 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_sdio *bus, uint maxframes)
}

/* Deflow-control stack if needed */
if (drvr->bus_if->drvr_up &&
(drvr->bus_if->state == BRCMF_BUS_DATA) &&
if (bus->sdiodev->bus_if->drvr_up &&
(bus->sdiodev->bus_if->state == BRCMF_BUS_DATA) &&
bus->txoff && (pktq_len(&bus->txq) < TXLOW)) {
bus->txoff = OFF;
brcmf_txflowcontrol(bus->sdiodev->dev, 0, OFF);
Expand Down Expand Up @@ -2335,7 +2331,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
SBSDIO_DEVICE_CTL, &err);
if (err) {
brcmf_dbg(ERROR, "error reading DEVCTL: %d\n", err);
bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
}
#endif /* BCMDBG */

Expand All @@ -2345,7 +2341,7 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
if (err) {
brcmf_dbg(ERROR, "error reading CSR: %d\n",
err);
bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
}

brcmf_dbg(INFO, "DPC: PENDING, devctl 0x%02x clkctl 0x%02x\n",
Expand All @@ -2358,15 +2354,15 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
if (err) {
brcmf_dbg(ERROR, "error reading DEVCTL: %d\n",
err);
bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
}
devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, devctl, &err);
if (err) {
brcmf_dbg(ERROR, "error writing DEVCTL: %d\n",
err);
bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
}
bus->clkstate = CLK_AVAIL;
} else {
Expand Down Expand Up @@ -2522,11 +2518,11 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
else await next interrupt */
/* On failed register access, all bets are off:
no resched or interrupts */
if ((bus->drvr->bus_if->state == BRCMF_BUS_DOWN) ||
if ((bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) ||
brcmf_sdcard_regfail(bus->sdiodev)) {
brcmf_dbg(ERROR, "failed backplane access over SDIO, halting operation %d\n",
brcmf_sdcard_regfail(bus->sdiodev));
bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
bus->intstatus = 0;
} else if (bus->clkstate == CLK_PENDING) {
brcmf_dbg(INFO, "rescheduled due to CLK_PENDING awaiting I_CHIPACTIVE interrupt\n");
Expand Down Expand Up @@ -2563,7 +2559,7 @@ static int brcmf_sdbrcm_dpc_thread(void *data)
if (!wait_for_completion_interruptible(&bus->dpc_wait)) {
/* Call bus dpc unless it indicated down
(then clean stop) */
if (bus->drvr->bus_if->state != BRCMF_BUS_DOWN) {
if (bus->sdiodev->bus_if->state != BRCMF_BUS_DOWN) {
if (brcmf_sdbrcm_dpc(bus))
complete(&bus->dpc_wait);
} else {
Expand Down Expand Up @@ -3137,7 +3133,7 @@ static int brcmf_sdbrcm_download_state(struct brcmf_sdio *bus, bool enter)
/* Allow HT Clock now that the ARM is running. */
bus->alp_only = false;

bus->drvr->bus_if->state = BRCMF_BUS_LOAD;
bus->sdiodev->bus_if->state = BRCMF_BUS_LOAD;
}
fail:
return bcmerror;
Expand Down Expand Up @@ -3383,7 +3379,7 @@ void brcmf_sdbrcm_bus_stop(struct device *dev)
bus->hostintmask = 0;

/* Change our idea of bus state */
bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;

/* Force clocks on backplane to be sure F2 interrupt propagates */
saveclk = brcmf_sdcard_cfg_read(bus->sdiodev, SDIO_FUNC_1,
Expand Down Expand Up @@ -3446,7 +3442,7 @@ int brcmf_sdbrcm_bus_init(struct device *dev)
return -1;
}

if (!bus->drvr)
if (!bus->sdiodev->bus_if->drvr)
return 0;

/* Start the watchdog timer */
Expand Down Expand Up @@ -3542,7 +3538,7 @@ void brcmf_sdbrcm_isr(void *arg)
return;
}

if (bus->drvr->bus_if->state == BRCMF_BUS_DOWN) {
if (bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) {
brcmf_dbg(ERROR, "bus is down. we have nothing to do\n");
return;
}
Expand Down Expand Up @@ -3798,7 +3794,7 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_sdio *bus)
brcmf_sdcard_cfg_write(bus->sdiodev, SDIO_FUNC_0, SDIO_CCCR_IOEx,
SDIO_FUNC_ENABLE_1, NULL);

bus->drvr->bus_if->state = BRCMF_BUS_DOWN;
bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
bus->sleeping = false;
bus->rxflow = false;

Expand Down Expand Up @@ -3884,7 +3880,6 @@ static void brcmf_sdbrcm_release(struct brcmf_sdio *bus)
if (bus->sdiodev->bus_if->drvr) {
brcmf_detach(bus->sdiodev->dev);
brcmf_sdbrcm_release_dongle(bus);
bus->drvr = NULL;
}

brcmf_sdbrcm_release_malloc(bus);
Expand Down Expand Up @@ -3958,8 +3953,8 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
}

/* Attach to the brcmf/OS/network interface */
bus->drvr = brcmf_attach(bus, SDPCM_RESERVE, bus->sdiodev->dev);
if (!bus->drvr) {
ret = brcmf_attach(bus, SDPCM_RESERVE, bus->sdiodev->dev);
if (ret != 0) {
brcmf_dbg(ERROR, "brcmf_attach failed\n");
goto fail;
}
Expand Down Expand Up @@ -4032,7 +4027,7 @@ brcmf_sdbrcm_wd_timer(struct brcmf_sdio *bus, uint wdtick)
}

/* don't start the wd until fw is loaded */
if (bus->drvr->bus_if->state == BRCMF_BUS_DOWN)
if (bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN)
return;

if (wdtick) {
Expand Down

0 comments on commit 9720319

Please sign in to comment.