linux/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c

// SPDX-License-Identifier: ISC
/*
 * Copyright (c) 2014 Broadcom Corporation
 */

/*******************************************************************************
 * Communicates with the dongle by using dcmd codes.
 * For certain dcmd codes, the dongle interprets string data from the host.
 ******************************************************************************/

#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>

#include <brcmu_utils.h>
#include <brcmu_wifi.h>

#include "core.h"
#include "debug.h"
#include "proto.h"
#include "msgbuf.h"
#include "commonring.h"
#include "flowring.h"
#include "bus.h"
#include "tracepoint.h"


#define MSGBUF_IOCTL_RESP_TIMEOUT

#define MSGBUF_TYPE_GEN_STATUS
#define MSGBUF_TYPE_RING_STATUS
#define MSGBUF_TYPE_FLOW_RING_CREATE
#define MSGBUF_TYPE_FLOW_RING_CREATE_CMPLT
#define MSGBUF_TYPE_FLOW_RING_DELETE
#define MSGBUF_TYPE_FLOW_RING_DELETE_CMPLT
#define MSGBUF_TYPE_FLOW_RING_FLUSH
#define MSGBUF_TYPE_FLOW_RING_FLUSH_CMPLT
#define MSGBUF_TYPE_IOCTLPTR_REQ
#define MSGBUF_TYPE_IOCTLPTR_REQ_ACK
#define MSGBUF_TYPE_IOCTLRESP_BUF_POST
#define MSGBUF_TYPE_IOCTL_CMPLT
#define MSGBUF_TYPE_EVENT_BUF_POST
#define MSGBUF_TYPE_WL_EVENT
#define MSGBUF_TYPE_TX_POST
#define MSGBUF_TYPE_TX_STATUS
#define MSGBUF_TYPE_RXBUF_POST
#define MSGBUF_TYPE_RX_CMPLT
#define MSGBUF_TYPE_LPBK_DMAXFER
#define MSGBUF_TYPE_LPBK_DMAXFER_CMPLT

#define NR_TX_PKTIDS
#define NR_RX_PKTIDS

#define BRCMF_IOCTL_REQ_PKTID

#define BRCMF_MSGBUF_MAX_PKT_SIZE
#define BRCMF_MSGBUF_MAX_CTL_PKT_SIZE
#define BRCMF_MSGBUF_RXBUFPOST_THRESHOLD
#define BRCMF_MSGBUF_MAX_IOCTLRESPBUF_POST
#define BRCMF_MSGBUF_MAX_EVENTBUF_POST

#define BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_3
#define BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_11
#define BRCMF_MSGBUF_PKT_FLAGS_FRAME_MASK
#define BRCMF_MSGBUF_PKT_FLAGS_PRIO_SHIFT

#define BRCMF_MSGBUF_TX_FLUSH_CNT1
#define BRCMF_MSGBUF_TX_FLUSH_CNT2

#define BRCMF_MSGBUF_DELAY_TXWORKER_THRS
#define BRCMF_MSGBUF_TRICKLE_TXWORKER_THRS
#define BRCMF_MSGBUF_UPDATE_RX_PTR_THRS

#define BRCMF_MAX_TXSTATUS_WAIT_RETRIES

struct msgbuf_common_hdr {};

struct msgbuf_ioctl_req_hdr {};

struct msgbuf_tx_msghdr {};

struct msgbuf_rx_bufpost {};

struct msgbuf_rx_ioctl_resp_or_event {};

struct msgbuf_completion_hdr {};

/* Data struct for the MSGBUF_TYPE_GEN_STATUS */
struct msgbuf_gen_status {};

/* Data struct for the MSGBUF_TYPE_RING_STATUS */
struct msgbuf_ring_status {};

struct msgbuf_rx_event {};

struct msgbuf_ioctl_resp_hdr {};

struct msgbuf_tx_status {};

struct msgbuf_rx_complete {};

struct msgbuf_tx_flowring_create_req {};

struct msgbuf_tx_flowring_delete_req {};

struct msgbuf_flowring_create_resp {};

struct msgbuf_flowring_delete_resp {};

struct msgbuf_flowring_flush_resp {};

struct brcmf_msgbuf_work_item {};

struct brcmf_msgbuf {};

struct brcmf_msgbuf_pktid {};

struct brcmf_msgbuf_pktids {};

static void brcmf_msgbuf_rxbuf_ioctlresp_post(struct brcmf_msgbuf *msgbuf);


static struct brcmf_msgbuf_pktids *
brcmf_msgbuf_init_pktids(u32 nr_array_entries,
			 enum dma_data_direction direction)
{}


static int
brcmf_msgbuf_alloc_pktid(struct device *dev,
			 struct brcmf_msgbuf_pktids *pktids,
			 struct sk_buff *skb, u16 data_offset,
			 dma_addr_t *physaddr, u32 *idx)
{}


static struct sk_buff *
brcmf_msgbuf_get_pktid(struct device *dev, struct brcmf_msgbuf_pktids *pktids,
		       u32 idx)
{}


static void
brcmf_msgbuf_release_array(struct device *dev,
			   struct brcmf_msgbuf_pktids *pktids)
{}


static void brcmf_msgbuf_release_pktids(struct brcmf_msgbuf *msgbuf)
{}


static int brcmf_msgbuf_tx_ioctl(struct brcmf_pub *drvr, int ifidx,
				 uint cmd, void *buf, uint len)
{}


static int brcmf_msgbuf_ioctl_resp_wait(struct brcmf_msgbuf *msgbuf)
{}


static void brcmf_msgbuf_ioctl_resp_wake(struct brcmf_msgbuf *msgbuf)
{}


static int brcmf_msgbuf_query_dcmd(struct brcmf_pub *drvr, int ifidx,
				   uint cmd, void *buf, uint len, int *fwerr)
{}


static int brcmf_msgbuf_set_dcmd(struct brcmf_pub *drvr, int ifidx,
				 uint cmd, void *buf, uint len, int *fwerr)
{}


static int brcmf_msgbuf_hdrpull(struct brcmf_pub *drvr, bool do_fws,
				struct sk_buff *skb, struct brcmf_if **ifp)
{}

static void brcmf_msgbuf_rxreorder(struct brcmf_if *ifp, struct sk_buff *skb)
{}

static void
brcmf_msgbuf_remove_flowring(struct brcmf_msgbuf *msgbuf, u16 flowid)
{}


static struct brcmf_msgbuf_work_item *
brcmf_msgbuf_dequeue_work(struct brcmf_msgbuf *msgbuf)
{}


static u32
brcmf_msgbuf_flowring_create_worker(struct brcmf_msgbuf *msgbuf,
				    struct brcmf_msgbuf_work_item *work)
{}


static void brcmf_msgbuf_flowring_worker(struct work_struct *work)
{}


static u32 brcmf_msgbuf_flowring_create(struct brcmf_msgbuf *msgbuf, int ifidx,
					struct sk_buff *skb)
{}


static void brcmf_msgbuf_txflow(struct brcmf_msgbuf *msgbuf, u16 flowid)
{}


static void brcmf_msgbuf_txflow_worker(struct work_struct *worker)
{}


static int brcmf_msgbuf_schedule_txdata(struct brcmf_msgbuf *msgbuf, u32 flowid,
					bool force)
{}


static int brcmf_msgbuf_tx_queue_data(struct brcmf_pub *drvr, int ifidx,
				      struct sk_buff *skb)
{}


static void
brcmf_msgbuf_configure_addr_mode(struct brcmf_pub *drvr, int ifidx,
				 enum proto_addr_mode addr_mode)
{}


static void
brcmf_msgbuf_delete_peer(struct brcmf_pub *drvr, int ifidx, u8 peer[ETH_ALEN])
{}


static void
brcmf_msgbuf_add_tdls_peer(struct brcmf_pub *drvr, int ifidx, u8 peer[ETH_ALEN])
{}


static void
brcmf_msgbuf_process_ioctl_complete(struct brcmf_msgbuf *msgbuf, void *buf)
{}


static void
brcmf_msgbuf_process_txstatus(struct brcmf_msgbuf *msgbuf, void *buf)
{}


static u32 brcmf_msgbuf_rxbuf_data_post(struct brcmf_msgbuf *msgbuf, u32 count)
{}


static void
brcmf_msgbuf_rxbuf_data_fill(struct brcmf_msgbuf *msgbuf)
{}


static void
brcmf_msgbuf_update_rxbufpost_count(struct brcmf_msgbuf *msgbuf, u16 rxcnt)
{}


static u32
brcmf_msgbuf_rxbuf_ctrl_post(struct brcmf_msgbuf *msgbuf, bool event_buf,
			     u32 count)
{}


static void brcmf_msgbuf_rxbuf_ioctlresp_post(struct brcmf_msgbuf *msgbuf)
{}


static void brcmf_msgbuf_rxbuf_event_post(struct brcmf_msgbuf *msgbuf)
{}


static void brcmf_msgbuf_process_event(struct brcmf_msgbuf *msgbuf, void *buf)
{}


static void
brcmf_msgbuf_process_rx_complete(struct brcmf_msgbuf *msgbuf, void *buf)
{}

static void brcmf_msgbuf_process_gen_status(struct brcmf_msgbuf *msgbuf,
					    void *buf)
{}

static void brcmf_msgbuf_process_ring_status(struct brcmf_msgbuf *msgbuf,
					     void *buf)
{}

static void
brcmf_msgbuf_process_flow_ring_create_response(struct brcmf_msgbuf *msgbuf,
					       void *buf)
{}


static void
brcmf_msgbuf_process_flow_ring_delete_response(struct brcmf_msgbuf *msgbuf,
					       void *buf)
{}


static void brcmf_msgbuf_process_msgtype(struct brcmf_msgbuf *msgbuf, void *buf)
{}


static void brcmf_msgbuf_process_rx(struct brcmf_msgbuf *msgbuf,
				    struct brcmf_commonring *commonring)
{}


int brcmf_proto_msgbuf_rx_trigger(struct device *dev)
{}


void brcmf_msgbuf_delete_flowring(struct brcmf_pub *drvr, u16 flowid)
{}

#ifdef DEBUG
static int brcmf_msgbuf_stats_read(struct seq_file *seq, void *data)
{}
#else
static int brcmf_msgbuf_stats_read(struct seq_file *seq, void *data)
{
	return 0;
}
#endif

static void brcmf_msgbuf_debugfs_create(struct brcmf_pub *drvr)
{}

int brcmf_proto_msgbuf_attach(struct brcmf_pub *drvr)
{}


void brcmf_proto_msgbuf_detach(struct brcmf_pub *drvr)
{}