linux/drivers/net/wireless/st/cw1200/wsm.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * WSM host interface (HI) interface for ST-Ericsson CW1200 mac80211 drivers
 *
 * Copyright (c) 2010, ST-Ericsson
 * Author: Dmitry Tarnyagin <[email protected]>
 *
 * Based on CW1200 UMAC WSM API, which is
 * Copyright (C) ST-Ericsson SA 2010
 * Author: Stewart Mathers <[email protected]>
 */

#ifndef CW1200_WSM_H_INCLUDED
#define CW1200_WSM_H_INCLUDED

#include <linux/spinlock.h>

struct cw1200_common;

/* Bands */
/* Radio band 2.412 -2.484 GHz. */
#define WSM_PHY_BAND_2_4G

/* Radio band 4.9375-5.8250 GHz. */
#define WSM_PHY_BAND_5G

/* Transmit rates */
/* 1   Mbps            ERP-DSSS */
#define WSM_TRANSMIT_RATE_1

/* 2   Mbps            ERP-DSSS */
#define WSM_TRANSMIT_RATE_2

/* 5.5 Mbps            ERP-CCK */
#define WSM_TRANSMIT_RATE_5

/* 11  Mbps            ERP-CCK */
#define WSM_TRANSMIT_RATE_11

/* 22  Mbps            ERP-PBCC (Not supported) */
/* #define WSM_TRANSMIT_RATE_22		(4) */

/* 33  Mbps            ERP-PBCC (Not supported) */
/* #define WSM_TRANSMIT_RATE_33		(5) */

/* 6   Mbps   (3 Mbps) ERP-OFDM, BPSK coding rate 1/2 */
#define WSM_TRANSMIT_RATE_6

/* 9   Mbps (4.5 Mbps) ERP-OFDM, BPSK coding rate 3/4 */
#define WSM_TRANSMIT_RATE_9

/* 12  Mbps  (6 Mbps)  ERP-OFDM, QPSK coding rate 1/2 */
#define WSM_TRANSMIT_RATE_12

/* 18  Mbps  (9 Mbps)  ERP-OFDM, QPSK coding rate 3/4 */
#define WSM_TRANSMIT_RATE_18

/* 24  Mbps (12 Mbps)  ERP-OFDM, 16QAM coding rate 1/2 */
#define WSM_TRANSMIT_RATE_24

/* 36  Mbps (18 Mbps)  ERP-OFDM, 16QAM coding rate 3/4 */
#define WSM_TRANSMIT_RATE_36

/* 48  Mbps (24 Mbps)  ERP-OFDM, 64QAM coding rate 1/2 */
#define WSM_TRANSMIT_RATE_48

/* 54  Mbps (27 Mbps)  ERP-OFDM, 64QAM coding rate 3/4 */
#define WSM_TRANSMIT_RATE_54

/* 6.5 Mbps            HT-OFDM, BPSK coding rate 1/2 */
#define WSM_TRANSMIT_RATE_HT_6

/* 13  Mbps            HT-OFDM, QPSK coding rate 1/2 */
#define WSM_TRANSMIT_RATE_HT_13

/* 19.5 Mbps           HT-OFDM, QPSK coding rate 3/4 */
#define WSM_TRANSMIT_RATE_HT_19

/* 26  Mbps            HT-OFDM, 16QAM coding rate 1/2 */
#define WSM_TRANSMIT_RATE_HT_26

/* 39  Mbps            HT-OFDM, 16QAM coding rate 3/4 */
#define WSM_TRANSMIT_RATE_HT_39

/* 52  Mbps            HT-OFDM, 64QAM coding rate 2/3 */
#define WSM_TRANSMIT_RATE_HT_52

/* 58.5 Mbps           HT-OFDM, 64QAM coding rate 3/4 */
#define WSM_TRANSMIT_RATE_HT_58

/* 65  Mbps            HT-OFDM, 64QAM coding rate 5/6 */
#define WSM_TRANSMIT_RATE_HT_65

/* Scan types */
/* Foreground scan */
#define WSM_SCAN_TYPE_FOREGROUND

/* Background scan */
#define WSM_SCAN_TYPE_BACKGROUND

/* Auto scan */
#define WSM_SCAN_TYPE_AUTO

/* Scan flags */
/* Forced background scan means if the station cannot */
/* enter the power-save mode, it shall force to perform a */
/* background scan. Only valid when ScanType is */
/* background scan. */
#define WSM_SCAN_FLAG_FORCE_BACKGROUND

/* The WLAN device scans one channel at a time so */
/* that disturbance to the data traffic is minimized. */
#define WSM_SCAN_FLAG_SPLIT_METHOD

/* Preamble Type. Long if not set. */
#define WSM_SCAN_FLAG_SHORT_PREAMBLE

/* 11n Tx Mode. Mixed if not set. */
#define WSM_SCAN_FLAG_11N_GREENFIELD

/* Scan constraints */
/* Maximum number of channels to be scanned. */
#define WSM_SCAN_MAX_NUM_OF_CHANNELS

/* The maximum number of SSIDs that the device can scan for. */
#define WSM_SCAN_MAX_NUM_OF_SSIDS

/* Power management modes */
/* 802.11 Active mode */
#define WSM_PSM_ACTIVE

/* 802.11 PS mode */
#define WSM_PSM_PS

/* Fast Power Save bit */
#define WSM_PSM_FAST_PS_FLAG

/* Dynamic aka Fast power save */
#define WSM_PSM_FAST_PS

/* Undetermined */
/* Note : Undetermined status is reported when the */
/* NULL data frame used to advertise the PM mode to */
/* the AP at Pre or Post Background Scan is not Acknowledged */
#define WSM_PSM_UNKNOWN

/* Queue IDs */
/* best effort/legacy */
#define WSM_QUEUE_BEST_EFFORT

/* background */
#define WSM_QUEUE_BACKGROUND

/* video */
#define WSM_QUEUE_VIDEO

/* voice */
#define WSM_QUEUE_VOICE

/* HT TX parameters */
/* Non-HT */
#define WSM_HT_TX_NON_HT

/* Mixed format */
#define WSM_HT_TX_MIXED

/* Greenfield format */
#define WSM_HT_TX_GREENFIELD

/* STBC allowed */
#define WSM_HT_TX_STBC

/* EPTA prioirty flags for BT Coex */
/* default epta priority */
#define WSM_EPTA_PRIORITY_DEFAULT
/* use for normal data */
#define WSM_EPTA_PRIORITY_DATA
/* use for connect/disconnect/roaming*/
#define WSM_EPTA_PRIORITY_MGT
/* use for action frames */
#define WSM_EPTA_PRIORITY_ACTION
/* use for AC_VI data */
#define WSM_EPTA_PRIORITY_VIDEO
/* use for AC_VO data */
#define WSM_EPTA_PRIORITY_VOICE
/* use for EAPOL exchange */
#define WSM_EPTA_PRIORITY_EAPOL

/* TX status */
/* Frame was sent aggregated */
/* Only valid for WSM_SUCCESS status. */
#define WSM_TX_STATUS_AGGREGATION

/* Host should requeue this frame later. */
/* Valid only when status is WSM_REQUEUE. */
#define WSM_TX_STATUS_REQUEUE

/* Normal Ack */
#define WSM_TX_STATUS_NORMAL_ACK

/* No Ack */
#define WSM_TX_STATUS_NO_ACK

/* No explicit acknowledgement */
#define WSM_TX_STATUS_NO_EXPLICIT_ACK

/* Block Ack */
/* Only valid for WSM_SUCCESS status. */
#define WSM_TX_STATUS_BLOCK_ACK

/* RX status */
/* Unencrypted */
#define WSM_RX_STATUS_UNENCRYPTED

/* WEP */
#define WSM_RX_STATUS_WEP

/* TKIP */
#define WSM_RX_STATUS_TKIP

/* AES */
#define WSM_RX_STATUS_AES

/* WAPI */
#define WSM_RX_STATUS_WAPI

/* Macro to fetch encryption subfield. */
#define WSM_RX_STATUS_ENCRYPTION(status)

/* Frame was part of an aggregation */
#define WSM_RX_STATUS_AGGREGATE

/* Frame was first in the aggregation */
#define WSM_RX_STATUS_AGGREGATE_FIRST

/* Frame was last in the aggregation */
#define WSM_RX_STATUS_AGGREGATE_LAST

/* Indicates a defragmented frame */
#define WSM_RX_STATUS_DEFRAGMENTED

/* Indicates a Beacon frame */
#define WSM_RX_STATUS_BEACON

/* Indicates STA bit beacon TIM field */
#define WSM_RX_STATUS_TIM

/* Indicates Beacon frame's virtual bitmap contains multicast bit */
#define WSM_RX_STATUS_MULTICAST

/* Indicates frame contains a matching SSID */
#define WSM_RX_STATUS_MATCHING_SSID

/* Indicates frame contains a matching BSSI */
#define WSM_RX_STATUS_MATCHING_BSSI

/* Indicates More bit set in Framectl field */
#define WSM_RX_STATUS_MORE_DATA

/* Indicates frame received during a measurement process */
#define WSM_RX_STATUS_MEASUREMENT

/* Indicates frame received as an HT packet */
#define WSM_RX_STATUS_HT

/* Indicates frame received with STBC */
#define WSM_RX_STATUS_STBC

/* Indicates Address 1 field matches dot11StationId */
#define WSM_RX_STATUS_ADDRESS1

/* Indicates Group address present in the Address 1 field */
#define WSM_RX_STATUS_GROUP

/* Indicates Broadcast address present in the Address 1 field */
#define WSM_RX_STATUS_BROADCAST

/* Indicates group key used with encrypted frames */
#define WSM_RX_STATUS_GROUP_KEY

/* Macro to fetch encryption key index. */
#define WSM_RX_STATUS_KEY_IDX(status)

/* Indicates TSF inclusion after 802.11 frame body */
#define WSM_RX_STATUS_TSF_INCLUDED

/* Frame Control field starts at Frame offset + 2 */
#define WSM_TX_2BYTES_SHIFT

/* Join mode */
/* IBSS */
#define WSM_JOIN_MODE_IBSS

/* BSS */
#define WSM_JOIN_MODE_BSS

/* PLCP preamble type */
/* For long preamble */
#define WSM_JOIN_PREAMBLE_LONG

/* For short preamble (Long for 1Mbps) */
#define WSM_JOIN_PREAMBLE_SHORT

/* For short preamble (Long for 1 and 2Mbps) */
#define WSM_JOIN_PREAMBLE_SHORT_2

/* Join flags */
/* Unsynchronized */
#define WSM_JOIN_FLAGS_UNSYNCRONIZED
/* The BSS owner is a P2P GO */
#define WSM_JOIN_FLAGS_P2P_GO
/* Force to join BSS with the BSSID and the
 * SSID specified without waiting for beacons. The
 * ProbeForJoin parameter is ignored.
 */
#define WSM_JOIN_FLAGS_FORCE
/* Give probe request/response higher
 * priority over the BT traffic
 */
#define WSM_JOIN_FLAGS_PRIO
/* Issue immediate join confirmation and use
 * join complete to notify about completion
 */
#define WSM_JOIN_FLAGS_FORCE_WITH_COMPLETE_IND

/* Key types */
#define WSM_KEY_TYPE_WEP_DEFAULT
#define WSM_KEY_TYPE_WEP_PAIRWISE
#define WSM_KEY_TYPE_TKIP_GROUP
#define WSM_KEY_TYPE_TKIP_PAIRWISE
#define WSM_KEY_TYPE_AES_GROUP
#define WSM_KEY_TYPE_AES_PAIRWISE
#define WSM_KEY_TYPE_WAPI_GROUP
#define WSM_KEY_TYPE_WAPI_PAIRWISE

/* Key indexes */
#define WSM_KEY_MAX_INDEX

/* ACK policy */
#define WSM_ACK_POLICY_NORMAL
#define WSM_ACK_POLICY_NO_ACK

/* Start modes */
#define WSM_START_MODE_AP
#define WSM_START_MODE_P2P_GO
#define WSM_START_MODE_P2P_DEV

/* SetAssociationMode MIB flags */
#define WSM_ASSOCIATION_MODE_USE_PREAMBLE_TYPE
#define WSM_ASSOCIATION_MODE_USE_HT_MODE
#define WSM_ASSOCIATION_MODE_USE_BASIC_RATE_SET
#define WSM_ASSOCIATION_MODE_USE_MPDU_START_SPACING
#define WSM_ASSOCIATION_MODE_SNOOP_ASSOC_FRAMES

/* RcpiRssiThreshold MIB flags */
#define WSM_RCPI_RSSI_THRESHOLD_ENABLE
#define WSM_RCPI_RSSI_USE_RSSI
#define WSM_RCPI_RSSI_DONT_USE_UPPER
#define WSM_RCPI_RSSI_DONT_USE_LOWER

/* Update-ie constants */
#define WSM_UPDATE_IE_BEACON
#define WSM_UPDATE_IE_PROBE_RESP
#define WSM_UPDATE_IE_PROBE_REQ

/* WSM events */
/* Error */
#define WSM_EVENT_ERROR

/* BSS lost */
#define WSM_EVENT_BSS_LOST

/* BSS regained */
#define WSM_EVENT_BSS_REGAINED

/* Radar detected */
#define WSM_EVENT_RADAR_DETECTED

/* RCPI or RSSI threshold triggered */
#define WSM_EVENT_RCPI_RSSI

/* BT inactive */
#define WSM_EVENT_BT_INACTIVE

/* BT active */
#define WSM_EVENT_BT_ACTIVE

/* MIB IDs */
/* 4.1  dot11StationId */
#define WSM_MIB_ID_DOT11_STATION_ID

/* 4.2  dot11MaxtransmitMsduLifeTime */
#define WSM_MIB_ID_DOT11_MAX_TRANSMIT_LIFTIME

/* 4.3  dot11MaxReceiveLifeTime */
#define WSM_MIB_ID_DOT11_MAX_RECEIVE_LIFETIME

/* 4.4  dot11SlotTime */
#define WSM_MIB_ID_DOT11_SLOT_TIME

/* 4.5  dot11GroupAddressesTable */
#define WSM_MIB_ID_DOT11_GROUP_ADDRESSES_TABLE
#define WSM_MAX_GRP_ADDRTABLE_ENTRIES

/* 4.6  dot11WepDefaultKeyId */
#define WSM_MIB_ID_DOT11_WEP_DEFAULT_KEY_ID

/* 4.7  dot11CurrentTxPowerLevel */
#define WSM_MIB_ID_DOT11_CURRENT_TX_POWER_LEVEL

/* 4.8  dot11RTSThreshold */
#define WSM_MIB_ID_DOT11_RTS_THRESHOLD

/* 4.9  NonErpProtection */
#define WSM_MIB_ID_NON_ERP_PROTECTION

/* 4.10 ArpIpAddressesTable */
#define WSM_MIB_ID_ARP_IP_ADDRESSES_TABLE
#define WSM_MAX_ARP_IP_ADDRTABLE_ENTRIES

/* 4.11 TemplateFrame */
#define WSM_MIB_ID_TEMPLATE_FRAME

/* 4.12 RxFilter */
#define WSM_MIB_ID_RX_FILTER

/* 4.13 BeaconFilterTable */
#define WSM_MIB_ID_BEACON_FILTER_TABLE

/* 4.14 BeaconFilterEnable */
#define WSM_MIB_ID_BEACON_FILTER_ENABLE

/* 4.15 OperationalPowerMode */
#define WSM_MIB_ID_OPERATIONAL_POWER_MODE

/* 4.16 BeaconWakeUpPeriod */
#define WSM_MIB_ID_BEACON_WAKEUP_PERIOD

/* 4.17 RcpiRssiThreshold */
#define WSM_MIB_ID_RCPI_RSSI_THRESHOLD

/* 4.18 StatisticsTable */
#define WSM_MIB_ID_STATISTICS_TABLE

/* 4.19 IbssPsConfig */
#define WSM_MIB_ID_IBSS_PS_CONFIG

/* 4.20 CountersTable */
#define WSM_MIB_ID_COUNTERS_TABLE

/* 4.21 BlockAckPolicy */
#define WSM_MIB_ID_BLOCK_ACK_POLICY

/* 4.22 OverrideInternalTxRate */
#define WSM_MIB_ID_OVERRIDE_INTERNAL_TX_RATE

/* 4.23 SetAssociationMode */
#define WSM_MIB_ID_SET_ASSOCIATION_MODE

/* 4.24 UpdateEptaConfigData */
#define WSM_MIB_ID_UPDATE_EPTA_CONFIG_DATA

/* 4.25 SelectCcaMethod */
#define WSM_MIB_ID_SELECT_CCA_METHOD

/* 4.26 SetUpasdInformation */
#define WSM_MIB_ID_SET_UAPSD_INFORMATION

/* 4.27 SetAutoCalibrationMode  WBF00004073 */
#define WSM_MIB_ID_SET_AUTO_CALIBRATION_MODE

/* 4.28 SetTxRateRetryPolicy */
#define WSM_MIB_ID_SET_TX_RATE_RETRY_POLICY

/* 4.29 SetHostMessageTypeFilter */
#define WSM_MIB_ID_SET_HOST_MSG_TYPE_FILTER

/* 4.30 P2PFindInfo */
#define WSM_MIB_ID_P2P_FIND_INFO

/* 4.31 P2PPsModeInfo */
#define WSM_MIB_ID_P2P_PS_MODE_INFO

/* 4.32 SetEtherTypeDataFrameFilter */
#define WSM_MIB_ID_SET_ETHERTYPE_DATAFRAME_FILTER

/* 4.33 SetUDPPortDataFrameFilter */
#define WSM_MIB_ID_SET_UDPPORT_DATAFRAME_FILTER

/* 4.34 SetMagicDataFrameFilter */
#define WSM_MIB_ID_SET_MAGIC_DATAFRAME_FILTER

/* 4.35 P2PDeviceInfo */
#define WSM_MIB_ID_P2P_DEVICE_INFO

/* 4.36 SetWCDMABand */
#define WSM_MIB_ID_SET_WCDMA_BAND

/* 4.37 GroupTxSequenceCounter */
#define WSM_MIB_ID_GRP_SEQ_COUNTER

/* 4.38 ProtectedMgmtPolicy */
#define WSM_MIB_ID_PROTECTED_MGMT_POLICY

/* 4.39 SetHtProtection */
#define WSM_MIB_ID_SET_HT_PROTECTION

/* 4.40 GPIO Command */
#define WSM_MIB_ID_GPIO_COMMAND

/* 4.41 TSF Counter Value */
#define WSM_MIB_ID_TSF_COUNTER

/* Test Purposes Only */
#define WSM_MIB_ID_BLOCK_ACK_INFO

/* 4.42 UseMultiTxConfMessage */
#define WSM_MIB_USE_MULTI_TX_CONF

/* 4.43 Keep-alive period */
#define WSM_MIB_ID_KEEP_ALIVE_PERIOD

/* 4.44 Disable BSSID filter */
#define WSM_MIB_ID_DISABLE_BSSID_FILTER

/* Frame template types */
#define WSM_FRAME_TYPE_PROBE_REQUEST
#define WSM_FRAME_TYPE_BEACON
#define WSM_FRAME_TYPE_NULL
#define WSM_FRAME_TYPE_QOS_NULL
#define WSM_FRAME_TYPE_PS_POLL
#define WSM_FRAME_TYPE_PROBE_RESPONSE

#define WSM_FRAME_GREENFIELD

/* Status */
/* The WSM firmware has completed a request */
/* successfully. */
#define WSM_STATUS_SUCCESS

/* This is a generic failure code if other error codes do */
/* not apply. */
#define WSM_STATUS_FAILURE

/* A request contains one or more invalid parameters. */
#define WSM_INVALID_PARAMETER

/* The request cannot perform because the device is in */
/* an inappropriate mode. */
#define WSM_ACCESS_DENIED

/* The frame received includes a decryption error. */
#define WSM_STATUS_DECRYPTFAILURE

/* A MIC failure is detected in the received packets. */
#define WSM_STATUS_MICFAILURE

/* The transmit request failed due to retry limit being */
/* exceeded. */
#define WSM_STATUS_RETRY_EXCEEDED

/* The transmit request failed due to MSDU life time */
/* being exceeded. */
#define WSM_STATUS_TX_LIFETIME_EXCEEDED

/* The link to the AP is lost. */
#define WSM_STATUS_LINK_LOST

/* No key was found for the encrypted frame */
#define WSM_STATUS_NO_KEY_FOUND

/* Jammer was detected when transmitting this frame */
#define WSM_STATUS_JAMMER_DETECTED

/* The message should be requeued later. */
/* This is applicable only to Transmit */
#define WSM_REQUEUE

/* Advanced filtering options */
#define WSM_MAX_FILTER_ELEMENTS

#define WSM_FILTER_ACTION_IGNORE
#define WSM_FILTER_ACTION_FILTER_IN
#define WSM_FILTER_ACTION_FILTER_OUT

#define WSM_FILTER_PORT_TYPE_DST
#define WSM_FILTER_PORT_TYPE_SRC

/* Actual header of WSM messages */
struct wsm_hdr {};

#define WSM_TX_SEQ_MAX
#define WSM_TX_SEQ(seq)
#define WSM_TX_LINK_ID_MAX
#define WSM_TX_LINK_ID(link_id)

#define MAX_BEACON_SKIP_TIME_MS

#define WSM_CMD_LAST_CHANCE_TIMEOUT

/* ******************************************************************** */
/* WSM capability							*/

#define WSM_STARTUP_IND_ID

struct wsm_startup_ind {};

/* ******************************************************************** */
/* WSM commands								*/

/* 3.1 */
#define WSM_CONFIGURATION_REQ_ID
#define WSM_CONFIGURATION_RESP_ID

struct wsm_tx_power_range {};

struct wsm_configuration {};

int wsm_configuration(struct cw1200_common *priv,
		      struct wsm_configuration *arg);

/* 3.3 */
#define WSM_RESET_REQ_ID
#define WSM_RESET_RESP_ID
struct wsm_reset {};

int wsm_reset(struct cw1200_common *priv, const struct wsm_reset *arg);

/* 3.5 */
#define WSM_READ_MIB_REQ_ID
#define WSM_READ_MIB_RESP_ID
int wsm_read_mib(struct cw1200_common *priv, u16 mib_id, void *buf,
		 size_t buf_size);

/* 3.7 */
#define WSM_WRITE_MIB_REQ_ID
#define WSM_WRITE_MIB_RESP_ID
int wsm_write_mib(struct cw1200_common *priv, u16 mib_id, void *buf,
		  size_t buf_size);

/* 3.9 */
#define WSM_START_SCAN_REQ_ID
#define WSM_START_SCAN_RESP_ID

struct wsm_ssid {};

struct wsm_scan_ch {};

struct wsm_scan {};

int wsm_scan(struct cw1200_common *priv, const struct wsm_scan *arg);

/* 3.11 */
#define WSM_STOP_SCAN_REQ_ID
#define WSM_STOP_SCAN_RESP_ID
int wsm_stop_scan(struct cw1200_common *priv);

/* 3.13 */
#define WSM_SCAN_COMPLETE_IND_ID
struct wsm_scan_complete {};

/* 3.14 */
#define WSM_TX_CONFIRM_IND_ID
#define WSM_MULTI_TX_CONFIRM_ID

struct wsm_tx_confirm {};

/* 3.15 */

/* Note that ideology of wsm_tx struct is different against the rest of
 * WSM API. wsm_hdr is /not/ a caller-adapted struct to be used as an input
 * argument for WSM call, but a prepared bytestream to be sent to firmware.
 * It is filled partly in cw1200_tx, partly in low-level WSM code.
 * Please pay attention once again: ideology is different.
 *
 * Legend:
 * - [in]: cw1200_tx must fill this field.
 * - [wsm]: the field is filled by low-level WSM.
 */
struct wsm_tx {} __packed;

/* = sizeof(generic hi hdr) + sizeof(wsm hdr) + sizeof(alignment) */
#define WSM_TX_EXTRA_HEADROOM

/* 3.16 */
#define WSM_RECEIVE_IND_ID

struct wsm_rx {};

/* = sizeof(generic hi hdr) + sizeof(wsm hdr) */
#define WSM_RX_EXTRA_HEADROOM

/* 3.17 */
struct wsm_event {};

struct cw1200_wsm_event {};

/* 3.18 - 3.22 */
/* Measurement. Skipped for now. Irrelevent. */

wsm_event_cb;

/* 3.23 */
#define WSM_JOIN_REQ_ID
#define WSM_JOIN_RESP_ID

struct wsm_join {};

struct wsm_join_cnf {};

int wsm_join(struct cw1200_common *priv, struct wsm_join *arg);

/* 3.24 */
struct wsm_join_complete {};

/* 3.25 */
#define WSM_SET_PM_REQ_ID
#define WSM_SET_PM_RESP_ID
struct wsm_set_pm {};

int wsm_set_pm(struct cw1200_common *priv, const struct wsm_set_pm *arg);

/* 3.27 */
struct wsm_set_pm_complete {};

/* 3.28 */
#define WSM_SET_BSS_PARAMS_REQ_ID
#define WSM_SET_BSS_PARAMS_RESP_ID
struct wsm_set_bss_params {};

int wsm_set_bss_params(struct cw1200_common *priv,
		       const struct wsm_set_bss_params *arg);

/* 3.30 */
#define WSM_ADD_KEY_REQ_ID
#define WSM_ADD_KEY_RESP_ID
struct wsm_add_key {} __packed;

int wsm_add_key(struct cw1200_common *priv, const struct wsm_add_key *arg);

/* 3.32 */
#define WSM_REMOVE_KEY_REQ_ID
#define WSM_REMOVE_KEY_RESP_ID
struct wsm_remove_key {};

int wsm_remove_key(struct cw1200_common *priv,
		   const struct wsm_remove_key *arg);

/* 3.34 */
struct wsm_set_tx_queue_params {};

struct wsm_tx_queue_params {};


#define WSM_TX_QUEUE_SET(queue_params, queue, ack_policy, allowed_time,\
		max_life_time)

int wsm_set_tx_queue_params(struct cw1200_common *priv,
			    const struct wsm_set_tx_queue_params *arg, u8 id);

/* 3.36 */
#define WSM_EDCA_PARAMS_REQ_ID
#define WSM_EDCA_PARAMS_RESP_ID
struct wsm_edca_queue_params {};

struct wsm_edca_params {};

#define TXOP_UNIT
#define WSM_EDCA_SET(__edca, __queue, __aifs, __cw_min, __cw_max, __txop, __lifetime,\
		     __uapsd)

int wsm_set_edca_params(struct cw1200_common *priv,
			const struct wsm_edca_params *arg);

int wsm_set_uapsd_param(struct cw1200_common *priv,
			const struct wsm_edca_params *arg);

/* 3.38 */
/* Set-System info. Skipped for now. Irrelevent. */

/* 3.40 */
#define WSM_SWITCH_CHANNEL_REQ_ID
#define WSM_SWITCH_CHANNEL_RESP_ID

struct wsm_switch_channel {};

int wsm_switch_channel(struct cw1200_common *priv,
		       const struct wsm_switch_channel *arg);

#define WSM_START_REQ_ID
#define WSM_START_RESP_ID

struct wsm_start {};

int wsm_start(struct cw1200_common *priv, const struct wsm_start *arg);

#define WSM_BEACON_TRANSMIT_REQ_ID
#define WSM_BEACON_TRANSMIT_RESP_ID

struct wsm_beacon_transmit {};

int wsm_beacon_transmit(struct cw1200_common *priv,
			const struct wsm_beacon_transmit *arg);

int wsm_start_find(struct cw1200_common *priv);

int wsm_stop_find(struct cw1200_common *priv);

struct wsm_suspend_resume {};

/* 3.54 Update-IE request. */
struct wsm_update_ie {};

int wsm_update_ie(struct cw1200_common *priv,
		  const struct wsm_update_ie *arg);

/* 3.56 */
struct wsm_map_link {};

int wsm_map_link(struct cw1200_common *priv, const struct wsm_map_link *arg);

/* ******************************************************************** */
/* MIB shortcats							*/

static inline int wsm_set_output_power(struct cw1200_common *priv,
				       int power_level)
{}

static inline int wsm_set_beacon_wakeup_period(struct cw1200_common *priv,
					       unsigned dtim_interval,
					       unsigned listen_interval)
{}

struct wsm_rcpi_rssi_threshold {};

static inline int wsm_set_rcpi_rssi_threshold(struct cw1200_common *priv,
					struct wsm_rcpi_rssi_threshold *arg)
{}

struct wsm_mib_counters_table {} __packed;

static inline int wsm_get_counters_table(struct cw1200_common *priv,
					 struct wsm_mib_counters_table *arg)
{}

static inline int wsm_get_station_id(struct cw1200_common *priv, u8 *mac)
{}

struct wsm_rx_filter {};

static inline int wsm_set_rx_filter(struct cw1200_common *priv,
				    const struct wsm_rx_filter *arg)
{}

int wsm_set_probe_responder(struct cw1200_common *priv, bool enable);

#define WSM_BEACON_FILTER_IE_HAS_CHANGED
#define WSM_BEACON_FILTER_IE_NO_LONGER_PRESENT
#define WSM_BEACON_FILTER_IE_HAS_APPEARED

struct wsm_beacon_filter_table_entry {} __packed;

struct wsm_mib_beacon_filter_table {} __packed;

static inline int wsm_set_beacon_filter_table(struct cw1200_common *priv,
					      struct wsm_mib_beacon_filter_table *ft)
{}

#define WSM_BEACON_FILTER_ENABLE
#define WSM_BEACON_FILTER_AUTO_ERP

struct wsm_beacon_filter_control {};

static inline int wsm_beacon_filter_control(struct cw1200_common *priv,
					struct wsm_beacon_filter_control *arg)
{}

enum wsm_power_mode {};

struct wsm_operational_mode {};

static inline int wsm_set_operational_mode(struct cw1200_common *priv,
					const struct wsm_operational_mode *arg)
{}

struct wsm_template_frame {};

static inline int wsm_set_template_frame(struct cw1200_common *priv,
					 struct wsm_template_frame *arg)
{}


struct wsm_protected_mgmt_policy {};

static inline int wsm_set_protected_mgmt_policy(struct cw1200_common *priv,
		struct wsm_protected_mgmt_policy *arg)
{}

struct wsm_mib_block_ack_policy {} __packed;

static inline int wsm_set_block_ack_policy(struct cw1200_common *priv,
					   u8 tx_tid_policy,
					   u8 rx_tid_policy)
{}

struct wsm_mib_association_mode {} __packed;

static inline int wsm_set_association_mode(struct cw1200_common *priv,
					   struct wsm_mib_association_mode *arg)
{}

#define WSM_TX_RATE_POLICY_FLAG_TERMINATE_WHEN_FINISHED
#define WSM_TX_RATE_POLICY_FLAG_COUNT_INITIAL_TRANSMIT
struct wsm_tx_rate_retry_policy {} __packed;

struct wsm_set_tx_rate_retry_policy {} __packed;

static inline int wsm_set_tx_rate_retry_policy(struct cw1200_common *priv,
				struct wsm_set_tx_rate_retry_policy *arg)
{}

/* 4.32 SetEtherTypeDataFrameFilter */
struct wsm_ether_type_filter_hdr {} __packed;

struct wsm_ether_type_filter {} __packed;

static inline int wsm_set_ether_type_filter(struct cw1200_common *priv,
				struct wsm_ether_type_filter_hdr *arg)
{}

/* 4.33 SetUDPPortDataFrameFilter */
struct wsm_udp_port_filter_hdr {} __packed;

struct wsm_udp_port_filter {} __packed;

static inline int wsm_set_udp_port_filter(struct cw1200_common *priv,
				struct wsm_udp_port_filter_hdr *arg)
{}

/* Undocumented MIBs: */
/* 4.35 P2PDeviceInfo */
#define D11_MAX_SSID_LEN

struct wsm_p2p_device_type {} __packed;

struct wsm_p2p_device_info {} __packed;

/* 4.36 SetWCDMABand - WO */
struct wsm_cdma_band {} __packed;

/* 4.37 GroupTxSequenceCounter - RO */
struct wsm_group_tx_seq {} __packed;

/* 4.39 SetHtProtection - WO */
#define WSM_DUAL_CTS_PROT_ENB
#define WSM_NON_GREENFIELD_STA_PRESENT
#define WSM_HT_PROT_MODE__NO_PROT
#define WSM_HT_PROT_MODE__NON_MEMBER
#define WSM_HT_PROT_MODE__20_MHZ
#define WSM_HT_PROT_MODE__NON_HT_MIXED
#define WSM_LSIG_TXOP_PROT_FULL
#define WSM_LARGE_L_LENGTH_PROT

struct wsm_ht_protection {} __packed;

/* 4.40 GPIO Command - R/W */
#define WSM_GPIO_COMMAND_SETUP
#define WSM_GPIO_COMMAND_READ
#define WSM_GPIO_COMMAND_WRITE
#define WSM_GPIO_COMMAND_RESET
#define WSM_GPIO_ALL_PINS

struct wsm_gpio_command {} __packed;

/* 4.41 TSFCounter - RO */
struct wsm_tsf_counter {} __packed;

/* 4.43 Keep alive period */
struct wsm_keep_alive_period {} __packed;

static inline int wsm_keep_alive_period(struct cw1200_common *priv,
					int period)
{
	struct wsm_keep_alive_period arg = {
		.period = __cpu_to_le16(period),
	};
	return wsm_write_mib(priv, WSM_MIB_ID_KEEP_ALIVE_PERIOD,
			&arg, sizeof(arg));
};

/* BSSID filtering */
struct wsm_set_bssid_filtering {} __packed;

static inline int wsm_set_bssid_filtering(struct cw1200_common *priv,
					  bool enabled)
{}

/* Multicast filtering - 4.5 */
struct wsm_mib_multicast_filter {} __packed;

static inline int wsm_set_multicast_filter(struct cw1200_common *priv,
					   struct wsm_mib_multicast_filter *fp)
{}

/* ARP IPv4 filtering - 4.10 */
struct wsm_mib_arp_ipv4_filter {} __packed;

static inline int wsm_set_arp_ipv4_filter(struct cw1200_common *priv,
					  struct wsm_mib_arp_ipv4_filter *fp)
{}

/* P2P Power Save Mode Info - 4.31 */
struct wsm_p2p_ps_modeinfo {} __packed;

static inline int wsm_set_p2p_ps_modeinfo(struct cw1200_common *priv,
					  struct wsm_p2p_ps_modeinfo *mi)
{}

static inline int wsm_get_p2p_ps_modeinfo(struct cw1200_common *priv,
					  struct wsm_p2p_ps_modeinfo *mi)
{}

/* UseMultiTxConfMessage */

static inline int wsm_use_multi_tx_conf(struct cw1200_common *priv,
					bool enabled)
{}


/* 4.26 SetUpasdInformation */
struct wsm_uapsd_info {};

static inline int wsm_set_uapsd_info(struct cw1200_common *priv,
				     struct wsm_uapsd_info *arg)
{}

/* 4.22 OverrideInternalTxRate */
struct wsm_override_internal_txrate {} __packed;

static inline int wsm_set_override_internal_txrate(struct cw1200_common *priv,
				     struct wsm_override_internal_txrate *arg)
{}

/* ******************************************************************** */
/* WSM TX port control							*/

void wsm_lock_tx(struct cw1200_common *priv);
void wsm_lock_tx_async(struct cw1200_common *priv);
bool wsm_flush_tx(struct cw1200_common *priv);
void wsm_unlock_tx(struct cw1200_common *priv);

/* ******************************************************************** */
/* WSM / BH API								*/

int wsm_handle_exception(struct cw1200_common *priv, u8 *data, size_t len);
int wsm_handle_rx(struct cw1200_common *priv, u16 id, struct wsm_hdr *wsm,
		  struct sk_buff **skb_p);

/* ******************************************************************** */
/* wsm_buf API								*/

struct wsm_buf {};

void wsm_buf_init(struct wsm_buf *buf);
void wsm_buf_deinit(struct wsm_buf *buf);

/* ******************************************************************** */
/* wsm_cmd API								*/

struct wsm_cmd {};

/* ******************************************************************** */
/* WSM TX buffer access							*/

int wsm_get_tx(struct cw1200_common *priv, u8 **data,
	       size_t *tx_len, int *burst);
void wsm_txed(struct cw1200_common *priv, u8 *data);

/* ******************************************************************** */
/* Queue mapping: WSM <---> linux					*/
/* Linux: VO VI BE BK							*/
/* WSM:   BE BK VI VO							*/

static inline u8 wsm_queue_id_to_linux(u8 queue_id)
{}

static inline u8 wsm_queue_id_to_wsm(u8 queue_id)
{}

#endif /* CW1200_HWIO_H_INCLUDED */