linux/drivers/net/wireless/marvell/libertas/defs.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * This header file contains global constant/enum definitions,
 * global variable declaration.
 */
#ifndef _LBS_DEFS_H_
#define _LBS_DEFS_H_

#include <linux/spinlock.h>

#ifdef CONFIG_LIBERTAS_DEBUG
#define DEBUG
#define PROC_DEBUG
#endif

#ifndef DRV_NAME
#define DRV_NAME
#endif


#define LBS_DEB_ENTER
#define LBS_DEB_LEAVE
#define LBS_DEB_MAIN
#define LBS_DEB_NET
#define LBS_DEB_MESH
#define LBS_DEB_WEXT
#define LBS_DEB_IOCTL
#define LBS_DEB_SCAN
#define LBS_DEB_ASSOC
#define LBS_DEB_JOIN
#define LBS_DEB_11D
#define LBS_DEB_DEBUGFS
#define LBS_DEB_ETHTOOL
#define LBS_DEB_HOST
#define LBS_DEB_CMD
#define LBS_DEB_RX
#define LBS_DEB_TX
#define LBS_DEB_USB
#define LBS_DEB_CS
#define LBS_DEB_FW
#define LBS_DEB_THREAD
#define LBS_DEB_HEX
#define LBS_DEB_SDIO
#define LBS_DEB_SYSFS
#define LBS_DEB_SPI
#define LBS_DEB_CFG80211

extern unsigned int lbs_debug;

#ifdef DEBUG
#define LBS_DEB_LL(grp, grpnam, fmt, args...)
#else
#define LBS_DEB_LL
#endif

#define lbs_deb_main(fmt, args...)
#define lbs_deb_net(fmt, args...)
#define lbs_deb_mesh(fmt, args...)
#define lbs_deb_wext(fmt, args...)
#define lbs_deb_ioctl(fmt, args...)
#define lbs_deb_scan(fmt, args...)
#define lbs_deb_assoc(fmt, args...)
#define lbs_deb_join(fmt, args...)
#define lbs_deb_11d(fmt, args...)
#define lbs_deb_debugfs(fmt, args...)
#define lbs_deb_ethtool(fmt, args...)
#define lbs_deb_host(fmt, args...)
#define lbs_deb_cmd(fmt, args...)
#define lbs_deb_rx(fmt, args...)
#define lbs_deb_tx(fmt, args...)
#define lbs_deb_fw(fmt, args...)
#define lbs_deb_usb(fmt, args...)
#define lbs_deb_usbd(dev, fmt, args...)
#define lbs_deb_cs(fmt, args...)
#define lbs_deb_thread(fmt, args...)
#define lbs_deb_sdio(fmt, args...)
#define lbs_deb_sysfs(fmt, args...)
#define lbs_deb_spi(fmt, args...)
#define lbs_deb_cfg80211(fmt, args...)

#ifdef DEBUG
static inline void lbs_deb_hex(unsigned int grp, const char *prompt,
			       const u8 *buf, int len)
{}
#else
#define lbs_deb_hex
#endif



/* Buffer Constants */

/*	The size of SQ memory PPA, DPA are 8 DWORDs, that keep the physical
 *	addresses of TxPD buffers. Station has only 8 TxPD available, Whereas
 *	driver has more local TxPDs. Each TxPD on the host memory is associated
 *	with a Tx control node. The driver maintains 8 RxPD descriptors for
 *	station firmware to store Rx packet information.
 *
 *	Current version of MAC has a 32x6 multicast address buffer.
 *
 *	802.11b can have up to  14 channels, the driver keeps the
 *	BSSID(MAC address) of each APs or Ad hoc stations it has sensed.
 */

#define MRVDRV_MAX_MULTICAST_LIST_SIZE
#define LBS_NUM_CMD_BUFFERS
#define LBS_CMD_BUFFER_SIZE
#define MRVDRV_MAX_CHANNEL_SIZE
#define MRVDRV_ASSOCIATION_TIME_OUT
#define MRVDRV_SNAP_HEADER_LEN

#define LBS_UPLD_SIZE
#define DEV_NAME_LEN

/* Wake criteria for HOST_SLEEP_CFG command */
#define EHS_WAKE_ON_BROADCAST_DATA
#define EHS_WAKE_ON_UNICAST_DATA
#define EHS_WAKE_ON_MAC_EVENT
#define EHS_WAKE_ON_MULTICAST_DATA
#define EHS_REMOVE_WAKEUP
/* Wake rules for Host_Sleep_CFG command */
#define WOL_RULE_NET_TYPE_INFRA_OR_IBSS
#define WOL_RULE_NET_TYPE_MESH
#define WOL_RULE_ADDR_TYPE_BCAST
#define WOL_RULE_ADDR_TYPE_MCAST
#define WOL_RULE_ADDR_TYPE_UCAST
#define WOL_RULE_OP_AND
#define WOL_RULE_OP_OR
#define WOL_RULE_OP_INVALID
#define WOL_RESULT_VALID_CMD
#define WOL_RESULT_NOSPC_ERR
#define WOL_RESULT_EEXIST_ERR

/* Misc constants */
/* This section defines 802.11 specific contants */

#define MRVDRV_MAX_BSS_DESCRIPTS
#define MRVDRV_MAX_REGION_CODE

#define MRVDRV_DEFAULT_LISTEN_INTERVAL

#define MRVDRV_CHANNELS_PER_SCAN
#define MRVDRV_MAX_CHANNELS_PER_SCAN

#define MRVDRV_MIN_BEACON_INTERVAL
#define MRVDRV_MAX_BEACON_INTERVAL
#define MRVDRV_BEACON_INTERVAL

#define MARVELL_MESH_IE_LENGTH

/*
 * Values used to populate the struct mrvl_mesh_ie.  The only time you need this
 * is when enabling the mesh using CMD_MESH_CONFIG.
 */
#define MARVELL_MESH_IE_TYPE
#define MARVELL_MESH_IE_SUBTYPE
#define MARVELL_MESH_IE_VERSION
#define MARVELL_MESH_PROTO_ID_HWMP
#define MARVELL_MESH_METRIC_ID
#define MARVELL_MESH_CAPABILITY

/* INT status Bit Definition */
#define MRVDRV_TX_DNLD_RDY
#define MRVDRV_RX_UPLD_RDY
#define MRVDRV_CMD_DNLD_RDY
#define MRVDRV_CMD_UPLD_RDY
#define MRVDRV_CARDEVENT

/* Automatic TX control default levels */
#define POW_ADAPT_DEFAULT_P0
#define POW_ADAPT_DEFAULT_P1
#define POW_ADAPT_DEFAULT_P2
#define TPC_DEFAULT_P0
#define TPC_DEFAULT_P1
#define TPC_DEFAULT_P2

/* TxPD status */

/*
 *	Station firmware use TxPD status field to report final Tx transmit
 *	result, Bit masks are used to present combined situations.
 */

#define MRVDRV_TxPD_POWER_MGMT_NULL_PACKET
#define MRVDRV_TxPD_POWER_MGMT_LAST_PACKET

/* Tx mesh flag */
/*
 * Currently we are using normal WDS flag as mesh flag.
 * TODO: change to proper mesh flag when MAC understands it.
 */
#define TxPD_CONTROL_WDS_FRAME
#define TxPD_MESH_FRAME

/* Mesh interface ID */
#define MESH_IFACE_ID
/* Mesh id should be in bits 14-13-12 */
#define MESH_IFACE_BIT_OFFSET
/* Mesh enable bit in FW capability */
#define MESH_CAPINFO_ENABLE_MASK

/* FW definition from Marvell v4 */
#define MRVL_FW_V4
/* FW definition from Marvell v5 */
#define MRVL_FW_V5
/* FW definition from Marvell v10 */
#define MRVL_FW_V10
/* FW major revision definition */
#define MRVL_FW_MAJOR_REV(x)

/* RxPD status */

#define MRVDRV_RXPD_STATUS_OK

/* RxPD status - Received packet types */
/* Rx mesh flag */
/*
 * Currently we are using normal WDS flag as mesh flag.
 * TODO: change to proper mesh flag when MAC understands it.
 */
#define RxPD_CONTROL_WDS_FRAME
#define RxPD_MESH_FRAME

/* RSSI-related defines */
/*
 *	RSSI constants are used to implement 802.11 RSSI threshold
 *	indication. if the Rx packet signal got too weak for 5 consecutive
 *	times, miniport driver (driver) will report this event to wrapper
 */

#define MRVDRV_NF_DEFAULT_SCAN_VALUE

/* RTS/FRAG related defines */
#define MRVDRV_RTS_MIN_VALUE
#define MRVDRV_RTS_MAX_VALUE
#define MRVDRV_FRAG_MIN_VALUE
#define MRVDRV_FRAG_MAX_VALUE

/* This is for firmware specific length */
#define EXTRA_LEN

#define MRVDRV_ETH_TX_PACKET_BUFFER_SIZE

#define MRVDRV_ETH_RX_PACKET_BUFFER_SIZE

#define CMD_F_HOSTCMD
#define FW_CAPINFO_WPA
#define FW_CAPINFO_PS
#define FW_CAPINFO_FIRMWARE_UPGRADE
#define FW_CAPINFO_BOOT2_UPGRADE
#define FW_CAPINFO_PERSISTENT_CONFIG

#define KEY_LEN_WPA_AES
#define KEY_LEN_WPA_TKIP
#define KEY_LEN_WEP_104
#define KEY_LEN_WEP_40

#define RF_ANTENNA_1
#define RF_ANTENNA_2
#define RF_ANTENNA_AUTO

#define BAND_B
#define BAND_G
#define ALL_802_11_BANDS

#define MAX_RATES

#define MAX_LEDS

/* Global Variable Declaration */
extern const char lbs_driver_version[];
extern u16 lbs_region_code_to_index[MRVDRV_MAX_REGION_CODE];


/* ENUM definition */
/* SNRNF_TYPE */
enum SNRNF_TYPE {};

/* SNRNF_DATA */
enum SNRNF_DATA {};

/* LBS_802_11_POWER_MODE */
enum LBS_802_11_POWER_MODE {};

/* PS_STATE */
enum PS_STATE {};

/* DNLD_STATE */
enum DNLD_STATE {};

/* LBS_MEDIA_STATE */
enum LBS_MEDIA_STATE {};

/* LBS_802_11_PRIVACY_FILTER */
enum LBS_802_11_PRIVACY_FILTER {};

/* mv_ms_type */
enum mv_ms_type {};

/* KEY_TYPE_ID */
enum KEY_TYPE_ID {};

/* KEY_INFO_WPA (applies to both TKIP and AES/CCMP) */
enum KEY_INFO_WPA {};

/* Default values for fwt commands. */
#define FWT_DEFAULT_METRIC
#define FWT_DEFAULT_DIR
/* Default Rate, 11Mbps */
#define FWT_DEFAULT_RATE
#define FWT_DEFAULT_SSN
#define FWT_DEFAULT_DSN
#define FWT_DEFAULT_HOPCOUNT
#define FWT_DEFAULT_TTL
#define FWT_DEFAULT_EXPIRATION
#define FWT_DEFAULT_SLEEPMODE
#define FWT_DEFAULT_SNR

#endif