0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BRCMFMAC_CORE_H
0011 #define BRCMFMAC_CORE_H
0012
0013 #include <net/cfg80211.h>
0014 #include "fweh.h"
0015
0016 #define TOE_TX_CSUM_OL 0x00000001
0017 #define TOE_RX_CSUM_OL 0x00000002
0018
0019
0020 #define BRCMF_MAX_IFS 16
0021
0022
0023
0024 #define BRCMF_DCMD_SMLEN 256
0025 #define BRCMF_DCMD_MEDLEN 1536
0026 #define BRCMF_DCMD_MAXLEN 8192
0027
0028
0029
0030
0031 #define BRCMF_TX_IOCTL_MAX_MSG_SIZE (ETH_FRAME_LEN+ETH_FCS_LEN)
0032
0033 #define BRCMF_AMPDU_RX_REORDER_MAXFLOWS 256
0034
0035
0036
0037
0038 #define BRCMF_DRIVER_FIRMWARE_VERSION_LEN 32
0039
0040 #define NDOL_MAX_ENTRIES 8
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 struct brcmf_ampdu_rx_reorder {
0053 struct sk_buff **pktslots;
0054 u8 flow_id;
0055 u8 cur_idx;
0056 u8 exp_idx;
0057 u8 max_idx;
0058 u8 pend_pkts;
0059 };
0060
0061
0062 struct brcmf_proto;
0063 struct brcmf_fws_info;
0064 struct brcmf_mp_device;
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074 struct brcmf_rev_info {
0075 int result;
0076 u32 vendorid;
0077 u32 deviceid;
0078 u32 radiorev;
0079 u32 corerev;
0080 u32 boardid;
0081 u32 boardvendor;
0082 u32 boardrev;
0083 u32 driverrev;
0084 u32 ucoderev;
0085 u32 bus;
0086 char chipname[12];
0087 u32 phytype;
0088 u32 phyrev;
0089 u32 anarev;
0090 u32 chippkg;
0091 u32 nvramrev;
0092 };
0093
0094
0095 struct brcmf_pub {
0096
0097 struct brcmf_bus *bus_if;
0098 struct brcmf_proto *proto;
0099 struct wiphy *wiphy;
0100 struct cfg80211_ops *ops;
0101 struct brcmf_cfg80211_info *config;
0102
0103
0104 uint hdrlen;
0105
0106
0107 char fwver[BRCMF_DRIVER_FIRMWARE_VERSION_LEN];
0108 u8 mac[ETH_ALEN];
0109
0110 struct mac_address addresses[BRCMF_MAX_IFS];
0111
0112 struct brcmf_if *iflist[BRCMF_MAX_IFS];
0113 s32 if2bss[BRCMF_MAX_IFS];
0114 struct brcmf_if *mon_if;
0115
0116 struct mutex proto_block;
0117 unsigned char proto_buf[BRCMF_DCMD_MAXLEN];
0118
0119 struct brcmf_fweh_info fweh;
0120
0121 struct brcmf_ampdu_rx_reorder
0122 *reorder_flows[BRCMF_AMPDU_RX_REORDER_MAXFLOWS];
0123
0124 u32 feat_flags;
0125 u32 chip_quirks;
0126
0127 struct brcmf_rev_info revinfo;
0128 #ifdef DEBUG
0129 struct dentry *dbgfs_dir;
0130 #endif
0131
0132 struct notifier_block inetaddr_notifier;
0133 struct notifier_block inet6addr_notifier;
0134 struct brcmf_mp_device *settings;
0135
0136 struct work_struct bus_reset;
0137
0138 u8 clmver[BRCMF_DCMD_SMLEN];
0139 };
0140
0141
0142 struct brcmf_cfg80211_vif;
0143 struct brcmf_fws_mac_descriptor;
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155 enum brcmf_netif_stop_reason {
0156 BRCMF_NETIF_STOP_REASON_FWS_FC = BIT(0),
0157 BRCMF_NETIF_STOP_REASON_FLOW = BIT(1),
0158 BRCMF_NETIF_STOP_REASON_DISCONNECTED = BIT(2)
0159 };
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179 struct brcmf_if {
0180 struct brcmf_pub *drvr;
0181 struct brcmf_cfg80211_vif *vif;
0182 struct net_device *ndev;
0183 struct work_struct multicast_work;
0184 struct work_struct ndoffload_work;
0185 struct brcmf_fws_mac_descriptor *fws_desc;
0186 int ifidx;
0187 s32 bsscfgidx;
0188 u8 mac_addr[ETH_ALEN];
0189 u8 netif_stop;
0190 spinlock_t netif_stop_lock;
0191 atomic_t pend_8021x_cnt;
0192 wait_queue_head_t pend_8021x_wait;
0193 struct in6_addr ipv6_addr_tbl[NDOL_MAX_ENTRIES];
0194 u8 ipv6addr_idx;
0195 bool fwil_fwerr;
0196 };
0197
0198 int brcmf_netdev_wait_pend8021x(struct brcmf_if *ifp);
0199
0200
0201 char *brcmf_ifname(struct brcmf_if *ifp);
0202 struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx);
0203 void brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable);
0204 int brcmf_net_attach(struct brcmf_if *ifp, bool locked);
0205 struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx,
0206 bool is_p2pdev, const char *name, u8 *mac_addr);
0207 void brcmf_remove_interface(struct brcmf_if *ifp, bool locked);
0208 void brcmf_txflowblock_if(struct brcmf_if *ifp,
0209 enum brcmf_netif_stop_reason reason, bool state);
0210 void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success);
0211 void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb);
0212 void brcmf_netif_mon_rx(struct brcmf_if *ifp, struct sk_buff *skb);
0213 void brcmf_net_detach(struct net_device *ndev, bool locked);
0214 int brcmf_net_mon_attach(struct brcmf_if *ifp);
0215 void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on);
0216 int __init brcmf_core_init(void);
0217 void __exit brcmf_core_exit(void);
0218
0219 #endif