void *drvr; /* pointer to driver pub structure brcmf_pub */
enum brcmf_bus_state state;
uint maxctl; /* Max size rxctl request from proto to bus */
+ bool drvr_up; /* Status flag of driver up/down */
};
/* Forward decls for struct brcmf_pub (see below) */
struct device *dev; /* fullmac dongle device pointer */
/* Internal brcmf items */
- bool up; /* Driver up/down (to OS) */
bool txoff; /* Transmit flow-controlled */
uint hdrlen; /* Total BRCMF header length (proto + bus) */
uint rxsz; /* Rx buffer size bus module should use */
int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx, struct sk_buff *pktbuf)
{
/* Reject if down */
- if (!drvr->up || (drvr->bus_if->state == BRCMF_BUS_DOWN))
+ if (!drvr->bus_if->drvr_up || (drvr->bus_if->state == BRCMF_BUS_DOWN))
return -ENODEV;
/* Update multicast statistic */
brcmf_dbg(TRACE, "Enter\n");
/* Reject if down */
- if (!drvr->up ||
+ if (!drvr->bus_if->drvr_up ||
(drvr->bus_if->state == BRCMF_BUS_DOWN)) {
- brcmf_dbg(ERROR, "xmit rejected pub.up=%d state=%d\n",
- drvr->up,
+ brcmf_dbg(ERROR, "xmit rejected drvup=%d state=%d\n",
+ drvr->bus_if->drvr_up,
drvr->bus_if->state);
netif_stop_queue(ndev);
return -ENODEV;
brcmf_dbg(TRACE, "Enter\n");
- if (drvr->up)
+ if (drvr->bus_if->drvr_up)
/* Use the protocol to get dongle stats */
brcmf_proto_dstats(drvr);
}
/* otherwise, require dongle to be up */
- else if (!drvr->up) {
+ else if (!drvr->bus_if->drvr_up) {
brcmf_dbg(ERROR, "dongle is not up\n");
return -ENODEV;
}
brcmf_dbg(TRACE, "Enter\n");
brcmf_cfg80211_down(drvr->config);
- if (drvr->up == 0)
+ if (drvr->bus_if->drvr_up == 0)
return 0;
/* Set state and stop OS transmissions */
- drvr->up = 0;
+ drvr->bus_if->drvr_up = 0;
netif_stop_queue(ndev);
return 0;
}
/* Allow transmit calls */
netif_start_queue(ndev);
- drvr->up = 1;
+ drvr->bus_if->drvr_up = 1;
if (brcmf_cfg80211_up(drvr->config)) {
brcmf_dbg(ERROR, "failed to bring up cfg80211\n");
return -1;
}
/* Deflow-control stack if needed */
- if (drvr->up && (drvr->bus_if->state == BRCMF_BUS_DATA) &&
+ if (drvr->bus_if->drvr_up &&
+ (drvr->bus_if->state == BRCMF_BUS_DATA) &&
drvr->txoff && (pktq_len(&bus->txq) < TXLOW))
brcmf_txflowcontrol(bus->sdiodev->dev, 0, OFF);
brcmf_dbg(TRACE, "Enter\n");
/* Basic sanity checks */
- if (bus->drvr->up) {
+ if (bus->sdiodev->bus_if->drvr_up) {
bcmerror = -EISCONN;
goto err;
}