brcm80211: fmac: abstract ctrl frames interface function pointers
Abstract bus layer brcmf_bus_txctl/brcmf_bus_rxctl function pointers for common layer. This patch is part of the fullmac bus interface refactoring. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
b9692d17e8
commit
fcf094f414
3 changed files with 13 additions and 17 deletions
|
@ -55,6 +55,11 @@ struct brcmf_bus {
|
||||||
int (*brcmf_bus_init)(struct device *);
|
int (*brcmf_bus_init)(struct device *);
|
||||||
/* Send a data frame to the dongle. Callee disposes of txp. */
|
/* Send a data frame to the dongle. Callee disposes of txp. */
|
||||||
int (*brcmf_bus_txdata)(struct device *, struct sk_buff *);
|
int (*brcmf_bus_txdata)(struct device *, struct sk_buff *);
|
||||||
|
/* Send/receive a control message to/from the dongle.
|
||||||
|
* Expects caller to enforce a single outstanding transaction.
|
||||||
|
*/
|
||||||
|
int (*brcmf_bus_txctl)(struct device *, unsigned char *, uint);
|
||||||
|
int (*brcmf_bus_rxctl)(struct device *, unsigned char *, uint);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -97,16 +102,4 @@ extern int brcmf_bus_start(struct device *dev);
|
||||||
|
|
||||||
extern int brcmf_add_if(struct device *dev, int ifidx,
|
extern int brcmf_add_if(struct device *dev, int ifidx,
|
||||||
char *name, u8 *mac_addr);
|
char *name, u8 *mac_addr);
|
||||||
|
|
||||||
/*
|
|
||||||
* Exported from brcmf bus module (brcmf_usb, brcmf_sdio)
|
|
||||||
*/
|
|
||||||
/* Send/receive a control message to/from the dongle.
|
|
||||||
* Expects caller to enforce a single outstanding transaction.
|
|
||||||
*/
|
|
||||||
extern int
|
|
||||||
brcmf_sdbrcm_bus_txctl(struct device *dev, unsigned char *msg, uint msglen);
|
|
||||||
|
|
||||||
extern int
|
|
||||||
brcmf_sdbrcm_bus_rxctl(struct device *dev, unsigned char *msg, uint msglen);
|
|
||||||
#endif /* _BRCMF_BUS_H_ */
|
#endif /* _BRCMF_BUS_H_ */
|
||||||
|
|
|
@ -117,7 +117,8 @@ static int brcmf_proto_cdc_msg(struct brcmf_pub *drvr)
|
||||||
len = CDC_MAX_MSG_SIZE;
|
len = CDC_MAX_MSG_SIZE;
|
||||||
|
|
||||||
/* Send request */
|
/* Send request */
|
||||||
return brcmf_sdbrcm_bus_txctl(drvr->dev, (unsigned char *)&prot->msg,
|
return drvr->bus_if->brcmf_bus_txctl(drvr->dev,
|
||||||
|
(unsigned char *)&prot->msg,
|
||||||
len);
|
len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +130,7 @@ static int brcmf_proto_cdc_cmplt(struct brcmf_pub *drvr, u32 id, u32 len)
|
||||||
brcmf_dbg(TRACE, "Enter\n");
|
brcmf_dbg(TRACE, "Enter\n");
|
||||||
|
|
||||||
do {
|
do {
|
||||||
ret = brcmf_sdbrcm_bus_rxctl(drvr->dev,
|
ret = drvr->bus_if->brcmf_bus_rxctl(drvr->dev,
|
||||||
(unsigned char *)&prot->msg,
|
(unsigned char *)&prot->msg,
|
||||||
len + sizeof(struct brcmf_proto_cdc_dcmd));
|
len + sizeof(struct brcmf_proto_cdc_dcmd));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|
|
@ -2892,7 +2892,7 @@ static int brcmf_tx_frame(struct brcmf_sdio *bus, u8 *frame, u16 len)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
brcmf_sdbrcm_bus_txctl(struct device *dev, unsigned char *msg, uint msglen)
|
brcmf_sdbrcm_bus_txctl(struct device *dev, unsigned char *msg, uint msglen)
|
||||||
{
|
{
|
||||||
u8 *frame;
|
u8 *frame;
|
||||||
|
@ -3010,7 +3010,7 @@ brcmf_sdbrcm_bus_txctl(struct device *dev, unsigned char *msg, uint msglen)
|
||||||
return ret ? -EIO : 0;
|
return ret ? -EIO : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
brcmf_sdbrcm_bus_rxctl(struct device *dev, unsigned char *msg, uint msglen)
|
brcmf_sdbrcm_bus_rxctl(struct device *dev, unsigned char *msg, uint msglen)
|
||||||
{
|
{
|
||||||
int timeleft;
|
int timeleft;
|
||||||
|
@ -3956,6 +3956,8 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
|
||||||
bus->sdiodev->bus_if->brcmf_bus_stop = brcmf_sdbrcm_bus_stop;
|
bus->sdiodev->bus_if->brcmf_bus_stop = brcmf_sdbrcm_bus_stop;
|
||||||
bus->sdiodev->bus_if->brcmf_bus_init = brcmf_sdbrcm_bus_init;
|
bus->sdiodev->bus_if->brcmf_bus_init = brcmf_sdbrcm_bus_init;
|
||||||
bus->sdiodev->bus_if->brcmf_bus_txdata = brcmf_sdbrcm_bus_txdata;
|
bus->sdiodev->bus_if->brcmf_bus_txdata = brcmf_sdbrcm_bus_txdata;
|
||||||
|
bus->sdiodev->bus_if->brcmf_bus_txctl = brcmf_sdbrcm_bus_txctl;
|
||||||
|
bus->sdiodev->bus_if->brcmf_bus_rxctl = brcmf_sdbrcm_bus_rxctl;
|
||||||
/* Attach to the brcmf/OS/network interface */
|
/* Attach to the brcmf/OS/network interface */
|
||||||
ret = brcmf_attach(SDPCM_RESERVE, bus->sdiodev->dev);
|
ret = brcmf_attach(SDPCM_RESERVE, bus->sdiodev->dev);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue