#include <linux/types.h>
#include <linux/module.h>
#include <linux/if_ether.h>
#include <linux/spinlock.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/err.h>
#include <linux/jiffies.h>
#include <net/cfg80211.h>
#include <brcmu_utils.h>
#include <brcmu_wifi.h>
#include "core.h"
#include "debug.h"
#include "bus.h"
#include "fwil.h"
#include "fwil_types.h"
#include "fweh.h"
#include "fwsignal.h"
#include "p2p.h"
#include "cfg80211.h"
#include "proto.h"
#include "bcdc.h"
#include "common.h"
#define BRCMF_FWS_TLV_DEFLIST …
#define BRCMF_FWS_TLV_DEF …
enum brcmf_fws_tlv_type { … };
#undef BRCMF_FWS_TLV_DEF
#define BRCMF_FWS_TLV_DEF …
enum brcmf_fws_tlv_len { … };
#undef BRCMF_FWS_TLV_DEF
#define BRCMF_RXREORDER_FLOWID_OFFSET …
#define BRCMF_RXREORDER_MAXIDX_OFFSET …
#define BRCMF_RXREORDER_FLAGS_OFFSET …
#define BRCMF_RXREORDER_CURIDX_OFFSET …
#define BRCMF_RXREORDER_EXPIDX_OFFSET …
#define BRCMF_RXREORDER_DEL_FLOW …
#define BRCMF_RXREORDER_FLUSH_ALL …
#define BRCMF_RXREORDER_CURIDX_VALID …
#define BRCMF_RXREORDER_EXPIDX_VALID …
#define BRCMF_RXREORDER_NEW_HOLE …
#ifdef DEBUG
#define BRCMF_FWS_TLV_DEF …
static struct { … } brcmf_fws_tlv_names[] = …;
#undef BRCMF_FWS_TLV_DEF
static const char *brcmf_fws_get_tlv_name(enum brcmf_fws_tlv_type id)
{ … }
#else
static const char *brcmf_fws_get_tlv_name(enum brcmf_fws_tlv_type id)
{
return "NODEBUG";
}
#endif
#define BRCMF_FWS_TYPE_SEQ_LEN …
#define BRCMF_FWS_FLAGS_RSSI_SIGNALS …
#define BRCMF_FWS_FLAGS_XONXOFF_SIGNALS …
#define BRCMF_FWS_FLAGS_CREDIT_STATUS_SIGNALS …
#define BRCMF_FWS_FLAGS_HOST_PROPTXSTATUS_ACTIVE …
#define BRCMF_FWS_FLAGS_PSQ_GENERATIONFSM_ENABLE …
#define BRCMF_FWS_FLAGS_PSQ_ZERO_BUFFER_ENABLE …
#define BRCMF_FWS_FLAGS_HOST_RXREORDER_ACTIVE …
#define BRCMF_FWS_MAC_DESC_TABLE_SIZE …
#define BRCMF_FWS_MAC_DESC_ID_INVALID …
#define BRCMF_FWS_HOSTIF_FLOWSTATE_OFF …
#define BRCMF_FWS_HOSTIF_FLOWSTATE_ON …
#define BRCMF_FWS_FLOWCONTROL_HIWATER …
#define BRCMF_FWS_FLOWCONTROL_LOWATER …
#define BRCMF_FWS_PSQ_PREC_COUNT …
#define BRCMF_FWS_PSQ_LEN …
#define BRCMF_FWS_HTOD_FLAG_PKTFROMHOST …
#define BRCMF_FWS_HTOD_FLAG_PKT_REQUESTED …
#define BRCMF_FWS_RET_OK_NOSCHEDULE …
#define BRCMF_FWS_RET_OK_SCHEDULE …
#define BRCMF_FWS_MODE_REUSESEQ_SHIFT …
#define BRCMF_FWS_MODE_SET_REUSESEQ(x, val) …
#define BRCMF_FWS_MODE_GET_REUSESEQ(x) …
enum brcmf_fws_skb_state { … };
struct brcmf_skbuff_cb { … };
#define brcmf_skbcb(skb) …
#define BRCMF_SKB_IF_FLAGS_REQUESTED_MASK …
#define BRCMF_SKB_IF_FLAGS_REQUESTED_SHIFT …
#define BRCMF_SKB_IF_FLAGS_SIGNAL_ONLY_MASK …
#define BRCMF_SKB_IF_FLAGS_SIGNAL_ONLY_SHIFT …
#define BRCMF_SKB_IF_FLAGS_TRANSMIT_MASK …
#define BRCMF_SKB_IF_FLAGS_TRANSMIT_SHIFT …
#define BRCMF_SKB_IF_FLAGS_REQ_CREDIT_MASK …
#define BRCMF_SKB_IF_FLAGS_REQ_CREDIT_SHIFT …
#define BRCMF_SKB_IF_FLAGS_IF_AP_MASK …
#define BRCMF_SKB_IF_FLAGS_IF_AP_SHIFT …
#define BRCMF_SKB_IF_FLAGS_INDEX_MASK …
#define BRCMF_SKB_IF_FLAGS_INDEX_SHIFT …
#define brcmf_skb_if_flags_set_field(skb, field, value) …
#define brcmf_skb_if_flags_get_field(skb, field) …
#define BRCMF_SKB_HTOD_TAG_GENERATION_MASK …
#define BRCMF_SKB_HTOD_TAG_GENERATION_SHIFT …
#define BRCMF_SKB_HTOD_TAG_FLAGS_MASK …
#define BRCMF_SKB_HTOD_TAG_FLAGS_SHIFT …
#define BRCMF_SKB_HTOD_TAG_FIFO_MASK …
#define BRCMF_SKB_HTOD_TAG_FIFO_SHIFT …
#define BRCMF_SKB_HTOD_TAG_HSLOT_MASK …
#define BRCMF_SKB_HTOD_TAG_HSLOT_SHIFT …
#define BRCMF_SKB_HTOD_TAG_FREERUN_MASK …
#define BRCMF_SKB_HTOD_TAG_FREERUN_SHIFT …
#define brcmf_skb_htod_tag_set_field(skb, field, value) …
#define brcmf_skb_htod_tag_get_field(skb, field) …
#define BRCMF_SKB_HTOD_SEQ_FROMFW_MASK …
#define BRCMF_SKB_HTOD_SEQ_FROMFW_SHIFT …
#define BRCMF_SKB_HTOD_SEQ_FROMDRV_MASK …
#define BRCMF_SKB_HTOD_SEQ_FROMDRV_SHIFT …
#define BRCMF_SKB_HTOD_SEQ_NR_MASK …
#define BRCMF_SKB_HTOD_SEQ_NR_SHIFT …
#define brcmf_skb_htod_seq_set_field(skb, field, value) …
#define brcmf_skb_htod_seq_get_field(skb, field) …
#define BRCMF_FWS_TXSTAT_GENERATION_MASK …
#define BRCMF_FWS_TXSTAT_GENERATION_SHIFT …
#define BRCMF_FWS_TXSTAT_FLAGS_MASK …
#define BRCMF_FWS_TXSTAT_FLAGS_SHIFT …
#define BRCMF_FWS_TXSTAT_FIFO_MASK …
#define BRCMF_FWS_TXSTAT_FIFO_SHIFT …
#define BRCMF_FWS_TXSTAT_HSLOT_MASK …
#define BRCMF_FWS_TXSTAT_HSLOT_SHIFT …
#define BRCMF_FWS_TXSTAT_FREERUN_MASK …
#define BRCMF_FWS_TXSTAT_FREERUN_SHIFT …
#define brcmf_txstatus_get_field(txs, field) …
#define BRCMF_FWS_BORROW_DEFER_PERIOD …
enum brcmf_fws_txstatus { … };
enum brcmf_fws_fcmode { … };
enum brcmf_fws_mac_desc_state { … };
struct brcmf_fws_mac_descriptor { … };
#define BRCMF_FWS_HANGER_MAXITEMS …
#define BRCMF_BORROW_RATIO …
enum brcmf_fws_hanger_item_state { … };
struct brcmf_fws_hanger_item { … };
struct brcmf_fws_hanger { … };
struct brcmf_fws_macdesc_table { … };
struct brcmf_fws_stats { … };
struct brcmf_fws_info { … };
#define BRCMF_FWS_TLV_DEF …
static int brcmf_fws_get_tlv_len(struct brcmf_fws_info *fws,
enum brcmf_fws_tlv_type id)
{ … }
#undef BRCMF_FWS_TLV_DEF
static void brcmf_fws_lock(struct brcmf_fws_info *fws)
__acquires(&fws->spinlock)
{ … }
static void brcmf_fws_unlock(struct brcmf_fws_info *fws)
__releases(&fws->spinlock)
{ … }
static bool brcmf_fws_ifidx_match(struct sk_buff *skb, void *arg)
{ … }
static void brcmf_fws_hanger_init(struct brcmf_fws_hanger *hanger)
{ … }
static u32 brcmf_fws_hanger_get_free_slot(struct brcmf_fws_hanger *h)
{ … }
static int brcmf_fws_hanger_pushpkt(struct brcmf_fws_hanger *h,
struct sk_buff *pkt, u32 slot_id)
{ … }
static inline int brcmf_fws_hanger_poppkt(struct brcmf_fws_hanger *h,
u32 slot_id, struct sk_buff **pktout,
bool remove_item)
{ … }
static void brcmf_fws_psq_flush(struct brcmf_fws_info *fws, struct pktq *q,
int ifidx)
{ … }
static int brcmf_fws_hanger_mark_suppressed(struct brcmf_fws_hanger *h,
u32 slot_id)
{ … }
static void brcmf_fws_hanger_cleanup(struct brcmf_fws_info *fws,
bool (*fn)(struct sk_buff *, void *),
int ifidx)
{ … }
static void brcmf_fws_macdesc_set_name(struct brcmf_fws_info *fws,
struct brcmf_fws_mac_descriptor *desc)
{ … }
static void brcmf_fws_macdesc_init(struct brcmf_fws_mac_descriptor *desc,
u8 *addr, u8 ifidx)
{ … }
static
void brcmf_fws_macdesc_deinit(struct brcmf_fws_mac_descriptor *desc)
{ … }
static struct brcmf_fws_mac_descriptor *
brcmf_fws_macdesc_lookup(struct brcmf_fws_info *fws, u8 *ea)
{ … }
static struct brcmf_fws_mac_descriptor*
brcmf_fws_macdesc_find(struct brcmf_fws_info *fws, struct brcmf_if *ifp, u8 *da)
{ … }
static bool brcmf_fws_macdesc_closed(struct brcmf_fws_info *fws,
struct brcmf_fws_mac_descriptor *entry,
int fifo)
{ … }
static void brcmf_fws_macdesc_cleanup(struct brcmf_fws_info *fws,
struct brcmf_fws_mac_descriptor *entry,
int ifidx)
{ … }
static void brcmf_fws_bus_txq_cleanup(struct brcmf_fws_info *fws,
bool (*fn)(struct sk_buff *, void *),
int ifidx)
{ … }
static void brcmf_fws_cleanup(struct brcmf_fws_info *fws, int ifidx)
{ … }
static u8 brcmf_fws_hdrpush(struct brcmf_fws_info *fws, struct sk_buff *skb)
{ … }
static bool brcmf_fws_tim_update(struct brcmf_fws_info *fws,
struct brcmf_fws_mac_descriptor *entry,
int fifo, bool send_immediately)
{ … }
static void
brcmf_fws_flow_control_check(struct brcmf_fws_info *fws, struct pktq *pq,
u8 if_id)
{ … }
static int brcmf_fws_rssi_indicate(struct brcmf_fws_info *fws, s8 rssi)
{ … }
static
int brcmf_fws_macdesc_indicate(struct brcmf_fws_info *fws, u8 type, u8 *data)
{ … }
static int brcmf_fws_macdesc_state_indicate(struct brcmf_fws_info *fws,
u8 type, u8 *data)
{ … }
static int brcmf_fws_interface_state_indicate(struct brcmf_fws_info *fws,
u8 type, u8 *data)
{ … }
static int brcmf_fws_request_indicate(struct brcmf_fws_info *fws, u8 type,
u8 *data)
{ … }
static void
brcmf_fws_macdesc_use_req_credit(struct brcmf_fws_mac_descriptor *entry,
struct sk_buff *skb)
{ … }
static void brcmf_fws_macdesc_return_req_credit(struct sk_buff *skb)
{ … }
static void brcmf_fws_return_credits(struct brcmf_fws_info *fws,
u8 fifo, u8 credits)
{ … }
static void brcmf_fws_schedule_deq(struct brcmf_fws_info *fws)
{ … }
static int brcmf_fws_enq(struct brcmf_fws_info *fws,
enum brcmf_fws_skb_state state, int fifo,
struct sk_buff *p)
{ … }
static struct sk_buff *brcmf_fws_deq(struct brcmf_fws_info *fws, int fifo)
{ … }
static int brcmf_fws_txstatus_suppressed(struct brcmf_fws_info *fws, int fifo,
struct sk_buff *skb,
u32 genbit, u16 seq)
{ … }
static int
brcmf_fws_txs_process(struct brcmf_fws_info *fws, u8 flags, u32 hslot,
u32 genbit, u16 seq, u8 compcnt)
{ … }
static int brcmf_fws_fifocreditback_indicate(struct brcmf_fws_info *fws,
u8 *data)
{ … }
static int brcmf_fws_txstatus_indicate(struct brcmf_fws_info *fws, u8 type,
u8 *data)
{ … }
static int brcmf_fws_dbg_seqnum_check(struct brcmf_fws_info *fws, u8 *data)
{ … }
static int brcmf_fws_notify_credit_map(struct brcmf_if *ifp,
const struct brcmf_event_msg *e,
void *data)
{ … }
static int brcmf_fws_notify_bcmc_credit_support(struct brcmf_if *ifp,
const struct brcmf_event_msg *e,
void *data)
{ … }
static void brcmf_rxreorder_get_skb_list(struct brcmf_ampdu_rx_reorder *rfi,
u8 start, u8 end,
struct sk_buff_head *skb_list)
{ … }
void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt)
{ … }
void brcmf_fws_hdrpull(struct brcmf_if *ifp, s16 siglen, struct sk_buff *skb)
{ … }
static u8 brcmf_fws_precommit_skb(struct brcmf_fws_info *fws, int fifo,
struct sk_buff *p)
{ … }
static void brcmf_fws_rollback_toq(struct brcmf_fws_info *fws,
struct sk_buff *skb, int fifo)
{ … }
static int brcmf_fws_borrow_credit(struct brcmf_fws_info *fws,
int highest_lender_ac, int borrower_ac,
bool borrow_all)
{ … }
static int brcmf_fws_commit_skb(struct brcmf_fws_info *fws, int fifo,
struct sk_buff *skb)
{ … }
static int brcmf_fws_assign_htod(struct brcmf_fws_info *fws, struct sk_buff *p,
int fifo)
{ … }
int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb)
{ … }
void brcmf_fws_reset_interface(struct brcmf_if *ifp)
{ … }
void brcmf_fws_add_interface(struct brcmf_if *ifp)
{ … }
void brcmf_fws_del_interface(struct brcmf_if *ifp)
{ … }
static void brcmf_fws_dequeue_worker(struct work_struct *worker)
{ … }
#ifdef DEBUG
static int brcmf_debugfs_fws_stats_read(struct seq_file *seq, void *data)
{ … }
#else
static int brcmf_debugfs_fws_stats_read(struct seq_file *seq, void *data)
{
return 0;
}
#endif
struct brcmf_fws_info *brcmf_fws_attach(struct brcmf_pub *drvr)
{ … }
void brcmf_fws_detach(struct brcmf_fws_info *fws)
{ … }
void brcmf_fws_debugfs_create(struct brcmf_pub *drvr)
{ … }
bool brcmf_fws_queue_skbs(struct brcmf_fws_info *fws)
{ … }
bool brcmf_fws_fc_active(struct brcmf_fws_info *fws)
{ … }
void brcmf_fws_bustxcomplete(struct brcmf_fws_info *fws, struct sk_buff *skb,
bool success)
{ … }
void brcmf_fws_bus_blocked(struct brcmf_pub *drvr, bool flow_blocked)
{ … }