brcmfmac: add optional bus callback definition for tx queue cleanup
[deliverable/linux.git] / drivers / net / wireless / brcm80211 / brcmfmac / dhd_bus.h
index dd38b78a9726f75861bcb1f92ef3d511a81b92db..080395f49fa5922400419d821e1fda4fcc1b460e 100644 (file)
@@ -24,18 +24,6 @@ enum brcmf_bus_state {
        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 */
-};
-
 struct brcmf_bus_dcmd {
        char *name;
        char *param;
@@ -51,10 +39,12 @@ struct brcmf_bus_dcmd {
  * @txdata: send a data frame to the dongle (callee disposes skb).
  * @txctl: transmit a control request message to dongle.
  * @rxctl: receive a control response message from dongle.
+ * @gettxq: obtain a reference of bus transmit queue (optional).
  *
  * This structure provides an abstract interface towards the
  * bus specific driver. For control messages to common driver
- * will assure there is only one active transaction.
+ * will assure there is only one active transaction. Unless
+ * indicated otherwise these callbacks are mandatory.
  */
 struct brcmf_bus_ops {
        int (*init)(struct device *dev);
@@ -62,6 +52,7 @@ struct brcmf_bus_ops {
        int (*txdata)(struct device *dev, struct sk_buff *skb);
        int (*txctl)(struct device *dev, unsigned char *msg, uint len);
        int (*rxctl)(struct device *dev, unsigned char *msg, uint len);
+       struct pktq * (*gettxq)(struct device *dev);
 };
 
 /**
@@ -72,11 +63,12 @@ struct brcmf_bus_ops {
  * @drvr: public driver information.
  * @state: operational state of the bus interface.
  * @maxctl: maximum size for rxctl request message.
- * @drvr_up: indicates driver up/down status.
  * @tx_realloc: number of tx packets realloced for headroom.
  * @dstats: dongle-based statistical data.
  * @align: alignment requirement for the bus.
  * @dcmd_list: bus/device specific dongle initialization commands.
+ * @chip: device identifier of the dongle chip.
+ * @chiprev: revision of the dongle chip.
  */
 struct brcmf_bus {
        union {
@@ -87,10 +79,10 @@ struct brcmf_bus {
        struct brcmf_pub *drvr;
        enum brcmf_bus_state state;
        uint maxctl;
-       bool drvr_up;
        unsigned long tx_realloc;
-       struct dngl_stats dstats;
        u8 align;
+       u32 chip;
+       u32 chiprev;
        struct list_head dcmd_list;
 
        struct brcmf_bus_ops *ops;
@@ -126,39 +118,34 @@ int brcmf_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint len)
        return bus->ops->rxctl(bus->dev, msg, len);
 }
 
+static inline
+struct pktq *brcmf_bus_gettxq(struct brcmf_bus *bus)
+{
+       if (!bus->ops->gettxq)
+               return ERR_PTR(-ENOENT);
+
+       return bus->ops->gettxq(bus->dev);
+}
 /*
  * 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, u8 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);
-}
+extern void brcmf_rx_frames(struct device *dev, struct sk_buff_head *rxlist);
 
 /* 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 that dongle should be reset */
+extern void brcmf_dev_reset(struct device *dev);
 /* Indication from bus module to change flow-control state */
 extern void brcmf_txflowblock(struct device *dev, bool state);
 
-/* Notify tx completion */
+/* Notify the bus has transferred the tx packet to firmware */
 extern void brcmf_txcomplete(struct device *dev, struct sk_buff *txp,
                             bool success);
 
This page took 0.028615 seconds and 5 git commands to generate.