diff options
author | Franky Lin <frankyl@broadcom.com> | 2011-12-17 02:37:13 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-19 19:40:46 (GMT) |
commit | a8a363ac3b0cc947c5153d5b2e46c07bb496958b (patch) | |
tree | 6a5094420cc4c524df1cb84f98183f4b8d12754a /drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h | |
parent | a9ffda88be7416b8336f644806c2b3ed3ce08b26 (diff) | |
download | linux-a8a363ac3b0cc947c5153d5b2e46c07bb496958b.tar.xz |
brcm80211: fmac: move common layer bus interface context to dhd_bus.h
dhd_bus.h is the header file for bus interface. Move functions
declarations and brcmf_bus structure to there. This 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>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h index 25c1bc3..dc022e3 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h @@ -17,6 +17,83 @@ #ifndef _BRCMF_BUS_H_ #define _BRCMF_BUS_H_ +/* The level of bus communication with the dongle */ +enum brcmf_bus_state { + BRCMF_BUS_DOWN, /* Not ready for frame transfers */ + BRCMF_BUS_LOAD, /* Download access only (CPU reset) */ + BRCMF_BUS_DATA /* Ready for frame transfers */ +}; + +struct dngl_stats { + unsigned long rx_packets; /* total packets received */ + unsigned long tx_packets; /* total packets transmitted */ + unsigned long rx_bytes; /* total bytes received */ + unsigned long tx_bytes; /* total bytes transmitted */ + unsigned long rx_errors; /* bad packets received */ + unsigned long tx_errors; /* packet transmit problems */ + unsigned long rx_dropped; /* packets dropped by dongle */ + unsigned long tx_dropped; /* packets dropped by dongle */ + unsigned long multicast; /* multicast packets received */ +}; + +/* interface structure between common and bus layer */ +struct brcmf_bus { + u8 type; /* bus type */ + void *bus_priv; /* pointer to bus private structure */ + 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 */ + unsigned long tx_realloc; /* Tx packets realloced for headroom */ + struct dngl_stats dstats; /* Stats for dongle-based data */ + u8 align; /* bus alignment requirement */ + + /* interface functions pointers */ + /* Stop bus module: clear pending frames, disable data flow */ + void (*brcmf_bus_stop)(struct device *); +}; + +/* + * interface functions from common layer + */ + +/* Remove any protocol-specific data header. */ +extern int brcmf_proto_hdrpull(struct device *dev, int *ifidx, + struct sk_buff *rxp); + +extern bool brcmf_c_prec_enq(struct device *dev, struct pktq *q, + struct sk_buff *pkt, int prec); + +/* Receive frame for delivery to OS. Callee disposes of rxp. */ +extern void brcmf_rx_frame(struct device *dev, int ifidx, + struct sk_buff_head *rxlist); +static inline void brcmf_rx_packet(struct device *dev, int ifidx, + struct sk_buff *pkt) +{ + struct sk_buff_head q; + + skb_queue_head_init(&q); + skb_queue_tail(&q, pkt); + brcmf_rx_frame(dev, ifidx, &q); +} + +/* Indication from bus module regarding presence/insertion of dongle. */ +extern int brcmf_attach(uint bus_hdrlen, struct device *dev); +/* Indication from bus module regarding removal/absence of dongle */ +extern void brcmf_detach(struct device *dev); + +/* Indication from bus module to change flow-control state */ +extern void brcmf_txflowcontrol(struct device *dev, int ifidx, bool on); + +/* Notify tx completion */ +extern void brcmf_txcomplete(struct device *dev, struct sk_buff *txp, + bool success); + +extern int brcmf_bus_start(struct device *dev); + +extern int brcmf_add_if(struct device *dev, int ifidx, + char *name, u8 *mac_addr); + /* * Exported from brcmf bus module (brcmf_usb, brcmf_sdio) */ |