/* Internal brcmf items */
bool up; /* Driver up/down (to OS) */
bool txoff; /* Transmit flow-controlled */
- bool dongle_reset; /* true = DEVRESET put dongle into reset */
enum brcmf_bus_state busstate;
uint hdrlen; /* Total BRCMF header length (proto + bus) */
uint maxctl; /* Max size rxctl request from proto to bus */
extern int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx,\
struct sk_buff *pkt);
-extern int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag);
extern int brcmf_bus_start(struct brcmf_pub *drvr);
extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg);
brcmf_dbg(TRACE, "Enter\n");
- if (bus->drvr->dongle_reset) {
- ret = -EPERM;
- goto done;
- }
-
frame = (u8 *) (pkt->data);
/* Add alignment padding, allocate new packet if needed */
brcmf_dbg(TRACE, "Enter\n");
- if (bus->drvr->dongle_reset)
- return -EIO;
-
/* Back the pointer to make a room for bus header */
frame = msg - SDPCM_HDRLEN;
len = (msglen += SDPCM_HDRLEN);
brcmf_dbg(TRACE, "Enter\n");
- if (bus->drvr->dongle_reset)
- return -EIO;
-
/* Wait until control frame is available */
timeleft = brcmf_sdbrcm_ioctl_resp_wait(bus, &bus->rxlen, &pending);
bus = drvr->bus;
- if (bus->drvr->dongle_reset)
- return false;
-
/* Ignore the timer if simulating bus down */
if (bus->sleeping)
return false;
{
brcmf_dbg(TRACE, "Enter\n");
- if (bus->drvr && bus->drvr->dongle_reset)
- return;
-
kfree(bus->rxbuf);
bus->rxctl = bus->rxbuf = NULL;
bus->rxlen = 0;
if (kthread_should_stop())
break;
if (!wait_for_completion_interruptible(&bus->watchdog_wait)) {
- if (bus->drvr->dongle_reset == false)
- brcmf_sdbrcm_bus_watchdog(bus->drvr);
+ brcmf_sdbrcm_bus_watchdog(bus->drvr);
/* Count the tick for reference */
bus->drvr->tickcnt++;
} else
{
brcmf_dbg(TRACE, "Enter\n");
- if (bus->drvr && bus->drvr->dongle_reset)
- return;
-
if (bus->ci) {
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
return &bus->sdiodev->func[2]->dev;
}
-int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
-{
- int bcmerror = 0;
- struct brcmf_bus *bus;
-
- bus = drvr->bus;
-
- if (flag == true) {
- brcmf_sdbrcm_wd_timer(bus, 0);
- if (!bus->drvr->dongle_reset) {
- /* Expect app to have torn down any
- connection before calling */
- /* Stop the bus, disable F2 */
- brcmf_sdbrcm_bus_stop(bus, false);
-
- /* Clean tx/rx buffer pointers,
- detach from the dongle */
- brcmf_sdbrcm_release_dongle(bus);
-
- bus->drvr->dongle_reset = true;
- bus->drvr->up = false;
-
- brcmf_dbg(TRACE, "WLAN OFF DONE\n");
- /* App can now remove power from device */
- } else
- bcmerror = -EIO;
- } else {
- /* App must have restored power to device before calling */
-
- brcmf_dbg(TRACE, " == WLAN ON ==\n");
-
- if (bus->drvr->dongle_reset) {
- /* Turn on WLAN */
-
- /* Attempt to re-attach & download */
- if (brcmf_sdbrcm_probe_attach(bus, SI_ENUM_BASE)) {
- /* Attempt to download binary to the dongle */
- if (brcmf_sdbrcm_probe_init(bus)) {
- /* Re-init bus, enable F2 transfer */
- brcmf_sdbrcm_bus_init(bus->drvr, false);
-
- bus->drvr->dongle_reset = false;
- bus->drvr->up = true;
-
- brcmf_dbg(TRACE, "WLAN ON DONE\n");
- } else
- bcmerror = -EIO;
- } else
- bcmerror = -EIO;
- } else {
- bcmerror = -EISCONN;
- brcmf_dbg(ERROR, "Set DEVRESET=false invoked when device is on\n");
- bcmerror = -EIO;
- }
- brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
- }
- return bcmerror;
-}
-
void
brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick)
{