Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / brcm80211 / brcmfmac / dhd.h
index fd672bf53867f6b7aac803fae15686d0d750ccee..5249c67b466ceabf3488f6e442da8ffd7a61f93d 100644 (file)
@@ -39,6 +39,7 @@
 #define BRCMF_C_GET_BSSID                      23
 #define BRCMF_C_GET_SSID                       25
 #define BRCMF_C_SET_SSID                       26
+#define BRCMF_C_TERMINATED                     28
 #define BRCMF_C_GET_CHANNEL                    29
 #define BRCMF_C_SET_CHANNEL                    30
 #define BRCMF_C_GET_SRL                                31
@@ -71,6 +72,8 @@
 #define BRCMF_C_SET_WSEC                       134
 #define BRCMF_C_GET_PHY_NOISE                  135
 #define BRCMF_C_GET_BSS_INFO                   136
+#define BRCMF_C_GET_BANDLIST                   140
+#define BRCMF_C_SET_SCB_TIMEOUT                        158
 #define BRCMF_C_GET_PHYLIST                    180
 #define BRCMF_C_SET_SCAN_CHANNEL_TIME          185
 #define BRCMF_C_SET_SCAN_UNASSOC_TIME          187
 #define BRCMF_E_REASON_MINTXRATE               9
 #define BRCMF_E_REASON_TXFAIL                  10
 
+#define BRCMF_E_REASON_LINK_BSSCFG_DIS         4
 #define BRCMF_E_REASON_FAST_ROAM_FAILED                5
 #define BRCMF_E_REASON_DIRECTED_ROAM           6
 #define BRCMF_E_REASON_TSPEC_REJECTED          7
@@ -374,6 +378,28 @@ struct brcmf_join_params {
        struct brcmf_assoc_params_le params_le;
 };
 
+/* scan params for extended join */
+struct brcmf_join_scan_params_le {
+       u8 scan_type;           /* 0 use default, active or passive scan */
+       __le32 nprobes;         /* -1 use default, nr of probes per channel */
+       __le32 active_time;     /* -1 use default, dwell time per channel for
+                                * active scanning
+                                */
+       __le32 passive_time;    /* -1 use default, dwell time per channel
+                                * for passive scanning
+                                */
+       __le32 home_time;       /* -1 use default, dwell time for the home
+                                * channel between channel scans
+                                */
+};
+
+/* extended join params */
+struct brcmf_ext_join_params_le {
+       struct brcmf_ssid_le ssid_le;   /* {0, ""}: wildcard scan */
+       struct brcmf_join_scan_params_le scan_le;
+       struct brcmf_assoc_params_le assoc_le;
+};
+
 struct brcmf_wsec_key {
        u32 index;              /* key index */
        u32 len;                /* key length */
@@ -450,6 +476,24 @@ struct brcmf_sta_info_le {
        __le32  rx_decrypt_failures;    /* # of packet decrypted failed */
 };
 
+struct brcmf_chanspec_list {
+       __le32  count;          /* # of entries */
+       __le32  element[1];     /* variable length uint32 list */
+};
+
+/*
+ * WLC_E_PROBRESP_MSG
+ * WLC_E_P2P_PROBREQ_MSG
+ * WLC_E_ACTION_FRAME_RX
+ */
+struct brcmf_rx_mgmt_data {
+       __be16  version;
+       __be16  chanspec;
+       __be32  rssi;
+       __be32  mactime;
+       __be32  rate;
+};
+
 /* Bus independent dongle command */
 struct brcmf_dcmd {
        uint cmd;               /* common dongle cmd definition */
@@ -463,6 +507,7 @@ struct brcmf_dcmd {
 /* Forward decls for struct brcmf_pub (see below) */
 struct brcmf_proto;    /* device communication protocol info */
 struct brcmf_cfg80211_dev; /* cfg80211 device info */
+struct brcmf_fws_info; /* firmware signalling info */
 
 /* Common structure for module and instance linkage */
 struct brcmf_pub {
@@ -480,59 +525,48 @@ struct brcmf_pub {
        unsigned long drv_version;      /* Version of dongle-resident driver */
        u8 mac[ETH_ALEN];               /* MAC address obtained from dongle */
 
-       /* Additional stats for the bus level */
-
        /* Multicast data packets sent to dongle */
        unsigned long tx_multicast;
-       /* Packets flushed due to unscheduled sendup thread */
-       unsigned long rx_flushed;
-       /* Number of times dpc scheduled by watchdog timer */
-       unsigned long wd_dpc_sched;
-
-       /* Number of flow control pkts recvd */
-       unsigned long fc_packets;
-
-       /* Last error return */
-       int bcmerror;
-
-       /* Last error from dongle */
-       int dongle_error;
-
-       /* Suspend disable flag  flag */
-       int suspend_disable_flag;       /* "1" to disable all extra powersaving
-                                        during suspend */
-       int in_suspend;         /* flag set to 1 when early suspend called */
-       int dtim_skip;          /* dtim skip , default 0 means wake each dtim */
 
        struct brcmf_if *iflist[BRCMF_MAX_IFS];
 
        struct mutex proto_block;
        unsigned char proto_buf[BRCMF_DCMD_MAXLEN];
 
-       u8 macvalue[ETH_ALEN];
-       atomic_t pend_8021x_cnt;
-       wait_queue_head_t pend_8021x_wait;
-
        struct brcmf_fweh_info fweh;
+
+       bool fw_signals;
+       struct brcmf_fws_info *fws;
+       spinlock_t fws_spinlock;
 #ifdef DEBUG
        struct dentry *dbgfs_dir;
 #endif
 };
 
-struct bcmevent_name {
-       uint event;
-       const char *name;
-};
-
 struct brcmf_if_event {
        u8 ifidx;
        u8 action;
        u8 flags;
        u8 bssidx;
+       u8 role;
 };
 
-/* forward declaration */
+/* forward declarations */
 struct brcmf_cfg80211_vif;
+struct brcmf_fws_mac_descriptor;
+
+/**
+ * enum brcmf_netif_stop_reason - reason for stopping netif queue.
+ *
+ * @BRCMF_NETIF_STOP_REASON_FWS_FC:
+ *     netif stopped due to firmware signalling flow control.
+ * @BRCMF_NETIF_STOP_REASON_BLOCK_BUS:
+ *     netif stopped due to bus blocking.
+ */
+enum brcmf_netif_stop_reason {
+       BRCMF_NETIF_STOP_REASON_FWS_FC = 1,
+       BRCMF_NETIF_STOP_REASON_BLOCK_BUS = 2
+};
 
 /**
  * struct brcmf_if - interface control information.
@@ -541,9 +575,15 @@ struct brcmf_cfg80211_vif;
  * @vif: points to cfg80211 specific interface information.
  * @ndev: associated network device.
  * @stats: interface specific network statistics.
- * @idx: interface index in device firmware.
+ * @setmacaddr_work: worker object for setting mac address.
+ * @multicast_work: worker object for multicast provisioning.
+ * @fws_desc: interface specific firmware-signalling descriptor.
+ * @ifidx: interface index in device firmware.
  * @bssidx: index of bss associated with this interface.
  * @mac_addr: assigned mac address.
+ * @netif_stop: bitmap indicates reason why netif queues are stopped.
+ * @pend_8021x_cnt: tracks outstanding number of 802.1x frames.
+ * @pend_8021x_wait: used for signalling change in count.
  */
 struct brcmf_if {
        struct brcmf_pub *drvr;
@@ -552,18 +592,15 @@ struct brcmf_if {
        struct net_device_stats stats;
        struct work_struct setmacaddr_work;
        struct work_struct multicast_work;
-       int idx;
+       struct brcmf_fws_mac_descriptor *fws_desc;
+       int ifidx;
        s32 bssidx;
        u8 mac_addr[ETH_ALEN];
+       u8 netif_stop;
+       atomic_t pend_8021x_cnt;
+       wait_queue_head_t pend_8021x_wait;
 };
 
-static inline s32 brcmf_ndev_bssidx(struct net_device *ndev)
-{
-       struct brcmf_if *ifp = netdev_priv(ndev);
-       return ifp->bssidx;
-}
-
-extern const struct bcmevent_name bcmevent_names[];
 
 extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);
 
@@ -576,9 +613,18 @@ extern int brcmf_proto_cdc_query_dcmd(struct brcmf_pub *drvr, int ifidx,
 extern int brcmf_proto_cdc_set_dcmd(struct brcmf_pub *drvr, int ifidx, uint cmd,
                                    void *buf, uint len);
 
-extern int brcmf_net_attach(struct brcmf_if *ifp);
-extern struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, int ifidx,
-                                    s32 bssidx, char *name, u8 *mac_addr);
-extern void brcmf_del_if(struct brcmf_pub *drvr, int ifidx);
+/* Remove any protocol-specific data header. */
+extern int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws, u8 *ifidx,
+                              struct sk_buff *rxp);
+
+extern int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked);
+extern struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bssidx,
+                                    s32 ifidx, char *name, u8 *mac_addr);
+extern void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx);
+void brcmf_txflowblock_if(struct brcmf_if *ifp,
+                         enum brcmf_netif_stop_reason reason, bool state);
+extern u32 brcmf_get_chip_info(struct brcmf_if *ifp);
+extern void brcmf_txfinalize(struct brcmf_pub *drvr, struct sk_buff *txp,
+                            bool success);
 
 #endif                         /* _BRCMF_H_ */