162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211
462306a36Sopenharmony_ci * Copyright (c) 2008, Jouni Malinen <j@w1.fi>
562306a36Sopenharmony_ci * Copyright (c) 2011, Javier Lopez <jlopex@gmail.com>
662306a36Sopenharmony_ci * Copyright (C) 2020, 2022 Intel Corporation
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#ifndef __MAC80211_HWSIM_H
1062306a36Sopenharmony_ci#define __MAC80211_HWSIM_H
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci/**
1362306a36Sopenharmony_ci * enum hwsim_tx_control_flags - flags to describe transmission info/status
1462306a36Sopenharmony_ci *
1562306a36Sopenharmony_ci * These flags are used to give the wmediumd extra information in order to
1662306a36Sopenharmony_ci * modify its behavior for each frame
1762306a36Sopenharmony_ci *
1862306a36Sopenharmony_ci * @HWSIM_TX_CTL_REQ_TX_STATUS: require TX status callback for this frame.
1962306a36Sopenharmony_ci * @HWSIM_TX_CTL_NO_ACK: tell the wmediumd not to wait for an ack
2062306a36Sopenharmony_ci * @HWSIM_TX_STAT_ACK: Frame was acknowledged
2162306a36Sopenharmony_ci *
2262306a36Sopenharmony_ci */
2362306a36Sopenharmony_cienum hwsim_tx_control_flags {
2462306a36Sopenharmony_ci	HWSIM_TX_CTL_REQ_TX_STATUS		= BIT(0),
2562306a36Sopenharmony_ci	HWSIM_TX_CTL_NO_ACK			= BIT(1),
2662306a36Sopenharmony_ci	HWSIM_TX_STAT_ACK			= BIT(2),
2762306a36Sopenharmony_ci};
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci/**
3062306a36Sopenharmony_ci * DOC: Frame transmission/registration support
3162306a36Sopenharmony_ci *
3262306a36Sopenharmony_ci * Frame transmission and registration support exists to allow userspace
3362306a36Sopenharmony_ci * entities such as wmediumd to receive and process all broadcasted
3462306a36Sopenharmony_ci * frames from a mac80211_hwsim radio device.
3562306a36Sopenharmony_ci *
3662306a36Sopenharmony_ci * This allow user space applications to decide if the frame should be
3762306a36Sopenharmony_ci * dropped or not and implement a wireless medium simulator at user space.
3862306a36Sopenharmony_ci *
3962306a36Sopenharmony_ci * Registration is done by sending a register message to the driver and
4062306a36Sopenharmony_ci * will be automatically unregistered if the user application doesn't
4162306a36Sopenharmony_ci * responds to sent frames.
4262306a36Sopenharmony_ci * Once registered the user application has to take responsibility of
4362306a36Sopenharmony_ci * broadcasting the frames to all listening mac80211_hwsim radio
4462306a36Sopenharmony_ci * interfaces.
4562306a36Sopenharmony_ci *
4662306a36Sopenharmony_ci * For more technical details, see the corresponding command descriptions
4762306a36Sopenharmony_ci * below.
4862306a36Sopenharmony_ci */
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci/**
5162306a36Sopenharmony_ci * enum hwsim_commands - supported hwsim commands
5262306a36Sopenharmony_ci *
5362306a36Sopenharmony_ci * @HWSIM_CMD_UNSPEC: unspecified command to catch errors
5462306a36Sopenharmony_ci *
5562306a36Sopenharmony_ci * @HWSIM_CMD_REGISTER: request to register and received all broadcasted
5662306a36Sopenharmony_ci *	frames by any mac80211_hwsim radio device.
5762306a36Sopenharmony_ci * @HWSIM_CMD_FRAME: send/receive a broadcasted frame from/to kernel/user
5862306a36Sopenharmony_ci *	space, uses:
5962306a36Sopenharmony_ci *	%HWSIM_ATTR_ADDR_TRANSMITTER, %HWSIM_ATTR_ADDR_RECEIVER,
6062306a36Sopenharmony_ci *	%HWSIM_ATTR_FRAME, %HWSIM_ATTR_FLAGS, %HWSIM_ATTR_RX_RATE,
6162306a36Sopenharmony_ci *	%HWSIM_ATTR_SIGNAL, %HWSIM_ATTR_COOKIE, %HWSIM_ATTR_FREQ (optional)
6262306a36Sopenharmony_ci * @HWSIM_CMD_TX_INFO_FRAME: Transmission info report from user space to
6362306a36Sopenharmony_ci *	kernel, uses:
6462306a36Sopenharmony_ci *	%HWSIM_ATTR_ADDR_TRANSMITTER, %HWSIM_ATTR_FLAGS,
6562306a36Sopenharmony_ci *	%HWSIM_ATTR_TX_INFO, %WSIM_ATTR_TX_INFO_FLAGS,
6662306a36Sopenharmony_ci *	%HWSIM_ATTR_SIGNAL, %HWSIM_ATTR_COOKIE
6762306a36Sopenharmony_ci * @HWSIM_CMD_NEW_RADIO: create a new radio with the given parameters,
6862306a36Sopenharmony_ci *	returns the radio ID (>= 0) or negative on errors, if successful
6962306a36Sopenharmony_ci *	then multicast the result, uses optional parameter:
7062306a36Sopenharmony_ci *	%HWSIM_ATTR_REG_STRICT_REG, %HWSIM_ATTR_SUPPORT_P2P_DEVICE,
7162306a36Sopenharmony_ci *	%HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE, %HWSIM_ATTR_CHANNELS,
7262306a36Sopenharmony_ci *	%HWSIM_ATTR_NO_VIF, %HWSIM_ATTR_RADIO_NAME, %HWSIM_ATTR_USE_CHANCTX,
7362306a36Sopenharmony_ci *	%HWSIM_ATTR_REG_HINT_ALPHA2, %HWSIM_ATTR_REG_CUSTOM_REG,
7462306a36Sopenharmony_ci *	%HWSIM_ATTR_PERM_ADDR
7562306a36Sopenharmony_ci * @HWSIM_CMD_DEL_RADIO: destroy a radio, reply is multicasted
7662306a36Sopenharmony_ci * @HWSIM_CMD_GET_RADIO: fetch information about existing radios, uses:
7762306a36Sopenharmony_ci *	%HWSIM_ATTR_RADIO_ID
7862306a36Sopenharmony_ci * @HWSIM_CMD_ADD_MAC_ADDR: add a receive MAC address (given in the
7962306a36Sopenharmony_ci *	%HWSIM_ATTR_ADDR_RECEIVER attribute) to a device identified by
8062306a36Sopenharmony_ci *	%HWSIM_ATTR_ADDR_TRANSMITTER. This lets wmediumd forward frames
8162306a36Sopenharmony_ci *	to this receiver address for a given station.
8262306a36Sopenharmony_ci * @HWSIM_CMD_DEL_MAC_ADDR: remove the MAC address again, the attributes
8362306a36Sopenharmony_ci *	are the same as to @HWSIM_CMD_ADD_MAC_ADDR.
8462306a36Sopenharmony_ci * @HWSIM_CMD_START_PMSR: request to start peer measurement with the
8562306a36Sopenharmony_ci *	%HWSIM_ATTR_PMSR_REQUEST. Result will be sent back asynchronously
8662306a36Sopenharmony_ci *	with %HWSIM_CMD_REPORT_PMSR.
8762306a36Sopenharmony_ci * @__HWSIM_CMD_MAX: enum limit
8862306a36Sopenharmony_ci */
8962306a36Sopenharmony_cienum {
9062306a36Sopenharmony_ci	HWSIM_CMD_UNSPEC,
9162306a36Sopenharmony_ci	HWSIM_CMD_REGISTER,
9262306a36Sopenharmony_ci	HWSIM_CMD_FRAME,
9362306a36Sopenharmony_ci	HWSIM_CMD_TX_INFO_FRAME,
9462306a36Sopenharmony_ci	HWSIM_CMD_NEW_RADIO,
9562306a36Sopenharmony_ci	HWSIM_CMD_DEL_RADIO,
9662306a36Sopenharmony_ci	HWSIM_CMD_GET_RADIO,
9762306a36Sopenharmony_ci	HWSIM_CMD_ADD_MAC_ADDR,
9862306a36Sopenharmony_ci	HWSIM_CMD_DEL_MAC_ADDR,
9962306a36Sopenharmony_ci	HWSIM_CMD_START_PMSR,
10062306a36Sopenharmony_ci	HWSIM_CMD_ABORT_PMSR,
10162306a36Sopenharmony_ci	HWSIM_CMD_REPORT_PMSR,
10262306a36Sopenharmony_ci	__HWSIM_CMD_MAX,
10362306a36Sopenharmony_ci};
10462306a36Sopenharmony_ci#define HWSIM_CMD_MAX (_HWSIM_CMD_MAX - 1)
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci#define HWSIM_CMD_CREATE_RADIO   HWSIM_CMD_NEW_RADIO
10762306a36Sopenharmony_ci#define HWSIM_CMD_DESTROY_RADIO  HWSIM_CMD_DEL_RADIO
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ci/**
11062306a36Sopenharmony_ci * enum hwsim_attrs - hwsim netlink attributes
11162306a36Sopenharmony_ci *
11262306a36Sopenharmony_ci * @HWSIM_ATTR_UNSPEC: unspecified attribute to catch errors
11362306a36Sopenharmony_ci *
11462306a36Sopenharmony_ci * @HWSIM_ATTR_ADDR_RECEIVER: MAC address of the radio device that
11562306a36Sopenharmony_ci *	the frame is broadcasted to
11662306a36Sopenharmony_ci * @HWSIM_ATTR_ADDR_TRANSMITTER: MAC address of the radio device that
11762306a36Sopenharmony_ci *	the frame was broadcasted from
11862306a36Sopenharmony_ci * @HWSIM_ATTR_FRAME: Data array
11962306a36Sopenharmony_ci * @HWSIM_ATTR_FLAGS: mac80211 transmission flags, used to process
12062306a36Sopenharmony_ci	properly the frame at user space
12162306a36Sopenharmony_ci * @HWSIM_ATTR_RX_RATE: estimated rx rate index for this frame at user
12262306a36Sopenharmony_ci	space
12362306a36Sopenharmony_ci * @HWSIM_ATTR_SIGNAL: estimated RX signal for this frame at user
12462306a36Sopenharmony_ci	space
12562306a36Sopenharmony_ci * @HWSIM_ATTR_TX_INFO: ieee80211_tx_rate array
12662306a36Sopenharmony_ci * @HWSIM_ATTR_COOKIE: sk_buff cookie to identify the frame
12762306a36Sopenharmony_ci * @HWSIM_ATTR_CHANNELS: u32 attribute used with the %HWSIM_CMD_CREATE_RADIO
12862306a36Sopenharmony_ci *	command giving the number of channels supported by the new radio
12962306a36Sopenharmony_ci * @HWSIM_ATTR_RADIO_ID: u32 attribute used with %HWSIM_CMD_DESTROY_RADIO
13062306a36Sopenharmony_ci *	only to destroy a radio
13162306a36Sopenharmony_ci * @HWSIM_ATTR_REG_HINT_ALPHA2: alpha2 for regulatoro driver hint
13262306a36Sopenharmony_ci *	(nla string, length 2)
13362306a36Sopenharmony_ci * @HWSIM_ATTR_REG_CUSTOM_REG: custom regulatory domain index (u32 attribute)
13462306a36Sopenharmony_ci * @HWSIM_ATTR_REG_STRICT_REG: request REGULATORY_STRICT_REG (flag attribute)
13562306a36Sopenharmony_ci * @HWSIM_ATTR_SUPPORT_P2P_DEVICE: support P2P Device virtual interface (flag)
13662306a36Sopenharmony_ci * @HWSIM_ATTR_USE_CHANCTX: used with the %HWSIM_CMD_CREATE_RADIO
13762306a36Sopenharmony_ci *	command to force use of channel contexts even when only a
13862306a36Sopenharmony_ci *	single channel is supported
13962306a36Sopenharmony_ci * @HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE: used with the %HWSIM_CMD_CREATE_RADIO
14062306a36Sopenharmony_ci *	command to force radio removal when process that created the radio dies
14162306a36Sopenharmony_ci * @HWSIM_ATTR_RADIO_NAME: Name of radio, e.g. phy666
14262306a36Sopenharmony_ci * @HWSIM_ATTR_NO_VIF:  Do not create vif (wlanX) when creating radio.
14362306a36Sopenharmony_ci * @HWSIM_ATTR_FREQ: Frequency at which packet is transmitted or received.
14462306a36Sopenharmony_ci * @HWSIM_ATTR_TX_INFO_FLAGS: additional flags for corresponding
14562306a36Sopenharmony_ci *	rates of %HWSIM_ATTR_TX_INFO
14662306a36Sopenharmony_ci * @HWSIM_ATTR_PERM_ADDR: permanent mac address of new radio
14762306a36Sopenharmony_ci * @HWSIM_ATTR_IFTYPE_SUPPORT: u32 attribute of supported interface types bits
14862306a36Sopenharmony_ci * @HWSIM_ATTR_CIPHER_SUPPORT: u32 array of supported cipher types
14962306a36Sopenharmony_ci * @HWSIM_ATTR_MLO_SUPPORT: claim MLO support (exact parameters TBD) for
15062306a36Sopenharmony_ci *	the new radio
15162306a36Sopenharmony_ci * @HWSIM_ATTR_PMSR_SUPPORT: nested attribute used with %HWSIM_CMD_CREATE_RADIO
15262306a36Sopenharmony_ci *	to provide peer measurement capabilities. (nl80211_peer_measurement_attrs)
15362306a36Sopenharmony_ci * @HWSIM_ATTR_PMSR_REQUEST: nested attribute used with %HWSIM_CMD_START_PMSR
15462306a36Sopenharmony_ci *	to provide details about peer measurement request (nl80211_peer_measurement_attrs)
15562306a36Sopenharmony_ci * @HWSIM_ATTR_PMSR_RESULT: nested attributed used with %HWSIM_CMD_REPORT_PMSR
15662306a36Sopenharmony_ci *	to provide peer measurement result (nl80211_peer_measurement_attrs)
15762306a36Sopenharmony_ci * @__HWSIM_ATTR_MAX: enum limit
15862306a36Sopenharmony_ci */
15962306a36Sopenharmony_ci
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_cienum {
16262306a36Sopenharmony_ci	HWSIM_ATTR_UNSPEC,
16362306a36Sopenharmony_ci	HWSIM_ATTR_ADDR_RECEIVER,
16462306a36Sopenharmony_ci	HWSIM_ATTR_ADDR_TRANSMITTER,
16562306a36Sopenharmony_ci	HWSIM_ATTR_FRAME,
16662306a36Sopenharmony_ci	HWSIM_ATTR_FLAGS,
16762306a36Sopenharmony_ci	HWSIM_ATTR_RX_RATE,
16862306a36Sopenharmony_ci	HWSIM_ATTR_SIGNAL,
16962306a36Sopenharmony_ci	HWSIM_ATTR_TX_INFO,
17062306a36Sopenharmony_ci	HWSIM_ATTR_COOKIE,
17162306a36Sopenharmony_ci	HWSIM_ATTR_CHANNELS,
17262306a36Sopenharmony_ci	HWSIM_ATTR_RADIO_ID,
17362306a36Sopenharmony_ci	HWSIM_ATTR_REG_HINT_ALPHA2,
17462306a36Sopenharmony_ci	HWSIM_ATTR_REG_CUSTOM_REG,
17562306a36Sopenharmony_ci	HWSIM_ATTR_REG_STRICT_REG,
17662306a36Sopenharmony_ci	HWSIM_ATTR_SUPPORT_P2P_DEVICE,
17762306a36Sopenharmony_ci	HWSIM_ATTR_USE_CHANCTX,
17862306a36Sopenharmony_ci	HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE,
17962306a36Sopenharmony_ci	HWSIM_ATTR_RADIO_NAME,
18062306a36Sopenharmony_ci	HWSIM_ATTR_NO_VIF,
18162306a36Sopenharmony_ci	HWSIM_ATTR_FREQ,
18262306a36Sopenharmony_ci	HWSIM_ATTR_PAD,
18362306a36Sopenharmony_ci	HWSIM_ATTR_TX_INFO_FLAGS,
18462306a36Sopenharmony_ci	HWSIM_ATTR_PERM_ADDR,
18562306a36Sopenharmony_ci	HWSIM_ATTR_IFTYPE_SUPPORT,
18662306a36Sopenharmony_ci	HWSIM_ATTR_CIPHER_SUPPORT,
18762306a36Sopenharmony_ci	HWSIM_ATTR_MLO_SUPPORT,
18862306a36Sopenharmony_ci	HWSIM_ATTR_PMSR_SUPPORT,
18962306a36Sopenharmony_ci	HWSIM_ATTR_PMSR_REQUEST,
19062306a36Sopenharmony_ci	HWSIM_ATTR_PMSR_RESULT,
19162306a36Sopenharmony_ci	__HWSIM_ATTR_MAX,
19262306a36Sopenharmony_ci};
19362306a36Sopenharmony_ci#define HWSIM_ATTR_MAX (__HWSIM_ATTR_MAX - 1)
19462306a36Sopenharmony_ci
19562306a36Sopenharmony_ci/**
19662306a36Sopenharmony_ci * struct hwsim_tx_rate - rate selection/status
19762306a36Sopenharmony_ci *
19862306a36Sopenharmony_ci * @idx: rate index to attempt to send with
19962306a36Sopenharmony_ci * @count: number of tries in this rate before going to the next rate
20062306a36Sopenharmony_ci *
20162306a36Sopenharmony_ci * A value of -1 for @idx indicates an invalid rate and, if used
20262306a36Sopenharmony_ci * in an array of retry rates, that no more rates should be tried.
20362306a36Sopenharmony_ci *
20462306a36Sopenharmony_ci * When used for transmit status reporting, the driver should
20562306a36Sopenharmony_ci * always report the rate and number of retries used.
20662306a36Sopenharmony_ci *
20762306a36Sopenharmony_ci */
20862306a36Sopenharmony_cistruct hwsim_tx_rate {
20962306a36Sopenharmony_ci	s8 idx;
21062306a36Sopenharmony_ci	u8 count;
21162306a36Sopenharmony_ci} __packed;
21262306a36Sopenharmony_ci
21362306a36Sopenharmony_ci/**
21462306a36Sopenharmony_ci * enum hwsim_tx_rate_flags - per-rate flags set by the rate control algorithm.
21562306a36Sopenharmony_ci *	Inspired by structure mac80211_rate_control_flags. New flags may be
21662306a36Sopenharmony_ci *	appended, but old flags not deleted, to keep compatibility for
21762306a36Sopenharmony_ci *	userspace.
21862306a36Sopenharmony_ci *
21962306a36Sopenharmony_ci * These flags are set by the Rate control algorithm for each rate during tx,
22062306a36Sopenharmony_ci * in the @flags member of struct ieee80211_tx_rate.
22162306a36Sopenharmony_ci *
22262306a36Sopenharmony_ci * @MAC80211_HWSIM_TX_RC_USE_RTS_CTS: Use RTS/CTS exchange for this rate.
22362306a36Sopenharmony_ci * @MAC80211_HWSIM_TX_RC_USE_CTS_PROTECT: CTS-to-self protection is required.
22462306a36Sopenharmony_ci *	This is set if the current BSS requires ERP protection.
22562306a36Sopenharmony_ci * @MAC80211_HWSIM_TX_RC_USE_SHORT_PREAMBLE: Use short preamble.
22662306a36Sopenharmony_ci * @MAC80211_HWSIM_TX_RC_MCS: HT rate.
22762306a36Sopenharmony_ci * @MAC80211_HWSIM_TX_RC_VHT_MCS: VHT MCS rate, in this case the idx field is
22862306a36Sopenharmony_ci *	split into a higher 4 bits (Nss) and lower 4 bits (MCS number)
22962306a36Sopenharmony_ci * @MAC80211_HWSIM_TX_RC_GREEN_FIELD: Indicates whether this rate should be used
23062306a36Sopenharmony_ci *	in Greenfield mode.
23162306a36Sopenharmony_ci * @MAC80211_HWSIM_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be
23262306a36Sopenharmony_ci *	40 MHz.
23362306a36Sopenharmony_ci * @MAC80211_HWSIM_TX_RC_80_MHZ_WIDTH: Indicates 80 MHz transmission
23462306a36Sopenharmony_ci * @MAC80211_HWSIM_TX_RC_160_MHZ_WIDTH: Indicates 160 MHz transmission
23562306a36Sopenharmony_ci *	(80+80 isn't supported yet)
23662306a36Sopenharmony_ci * @MAC80211_HWSIM_TX_RC_DUP_DATA: The frame should be transmitted on both of
23762306a36Sopenharmony_ci *	the adjacent 20 MHz channels, if the current channel type is
23862306a36Sopenharmony_ci *	NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS.
23962306a36Sopenharmony_ci * @MAC80211_HWSIM_TX_RC_SHORT_GI: Short Guard interval should be used for this
24062306a36Sopenharmony_ci *	rate.
24162306a36Sopenharmony_ci */
24262306a36Sopenharmony_cienum hwsim_tx_rate_flags {
24362306a36Sopenharmony_ci	MAC80211_HWSIM_TX_RC_USE_RTS_CTS		= BIT(0),
24462306a36Sopenharmony_ci	MAC80211_HWSIM_TX_RC_USE_CTS_PROTECT		= BIT(1),
24562306a36Sopenharmony_ci	MAC80211_HWSIM_TX_RC_USE_SHORT_PREAMBLE	= BIT(2),
24662306a36Sopenharmony_ci
24762306a36Sopenharmony_ci	/* rate index is an HT/VHT MCS instead of an index */
24862306a36Sopenharmony_ci	MAC80211_HWSIM_TX_RC_MCS			= BIT(3),
24962306a36Sopenharmony_ci	MAC80211_HWSIM_TX_RC_GREEN_FIELD		= BIT(4),
25062306a36Sopenharmony_ci	MAC80211_HWSIM_TX_RC_40_MHZ_WIDTH		= BIT(5),
25162306a36Sopenharmony_ci	MAC80211_HWSIM_TX_RC_DUP_DATA		= BIT(6),
25262306a36Sopenharmony_ci	MAC80211_HWSIM_TX_RC_SHORT_GI		= BIT(7),
25362306a36Sopenharmony_ci	MAC80211_HWSIM_TX_RC_VHT_MCS			= BIT(8),
25462306a36Sopenharmony_ci	MAC80211_HWSIM_TX_RC_80_MHZ_WIDTH		= BIT(9),
25562306a36Sopenharmony_ci	MAC80211_HWSIM_TX_RC_160_MHZ_WIDTH		= BIT(10),
25662306a36Sopenharmony_ci};
25762306a36Sopenharmony_ci
25862306a36Sopenharmony_ci/**
25962306a36Sopenharmony_ci * struct hwsim_tx_rate - rate selection/status
26062306a36Sopenharmony_ci *
26162306a36Sopenharmony_ci * @idx: rate index to attempt to send with
26262306a36Sopenharmony_ci * @count: number of tries in this rate before going to the next rate
26362306a36Sopenharmony_ci *
26462306a36Sopenharmony_ci * A value of -1 for @idx indicates an invalid rate and, if used
26562306a36Sopenharmony_ci * in an array of retry rates, that no more rates should be tried.
26662306a36Sopenharmony_ci *
26762306a36Sopenharmony_ci * When used for transmit status reporting, the driver should
26862306a36Sopenharmony_ci * always report the rate and number of retries used.
26962306a36Sopenharmony_ci *
27062306a36Sopenharmony_ci */
27162306a36Sopenharmony_cistruct hwsim_tx_rate_flag {
27262306a36Sopenharmony_ci	s8 idx;
27362306a36Sopenharmony_ci	u16 flags;
27462306a36Sopenharmony_ci} __packed;
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_ci/**
27762306a36Sopenharmony_ci * DOC: Frame transmission support over virtio
27862306a36Sopenharmony_ci *
27962306a36Sopenharmony_ci * Frame transmission is also supported over virtio to allow communication
28062306a36Sopenharmony_ci * with external entities.
28162306a36Sopenharmony_ci */
28262306a36Sopenharmony_ci
28362306a36Sopenharmony_ci/**
28462306a36Sopenharmony_ci * enum hwsim_vqs - queues for virtio frame transmission
28562306a36Sopenharmony_ci *
28662306a36Sopenharmony_ci * @HWSIM_VQ_TX: send frames to external entity
28762306a36Sopenharmony_ci * @HWSIM_VQ_RX: receive frames and transmission info reports
28862306a36Sopenharmony_ci * @HWSIM_NUM_VQS: enum limit
28962306a36Sopenharmony_ci */
29062306a36Sopenharmony_cienum {
29162306a36Sopenharmony_ci	HWSIM_VQ_TX,
29262306a36Sopenharmony_ci	HWSIM_VQ_RX,
29362306a36Sopenharmony_ci	HWSIM_NUM_VQS,
29462306a36Sopenharmony_ci};
29562306a36Sopenharmony_ci
29662306a36Sopenharmony_ci/**
29762306a36Sopenharmony_ci * enum hwsim_rate_info -- bitrate information.
29862306a36Sopenharmony_ci *
29962306a36Sopenharmony_ci * Information about a receiving or transmitting bitrate
30062306a36Sopenharmony_ci * that can be mapped to struct rate_info
30162306a36Sopenharmony_ci *
30262306a36Sopenharmony_ci * @HWSIM_RATE_INFO_ATTR_FLAGS: bitflag of flags from &enum rate_info_flags
30362306a36Sopenharmony_ci * @HWSIM_RATE_INFO_ATTR_MCS: mcs index if struct describes an HT/VHT/HE rate
30462306a36Sopenharmony_ci * @HWSIM_RATE_INFO_ATTR_LEGACY: bitrate in 100kbit/s for 802.11abg
30562306a36Sopenharmony_ci * @HWSIM_RATE_INFO_ATTR_NSS: number of streams (VHT & HE only)
30662306a36Sopenharmony_ci * @HWSIM_RATE_INFO_ATTR_BW: bandwidth (from &enum rate_info_bw)
30762306a36Sopenharmony_ci * @HWSIM_RATE_INFO_ATTR_HE_GI: HE guard interval (from &enum nl80211_he_gi)
30862306a36Sopenharmony_ci * @HWSIM_RATE_INFO_ATTR_HE_DCM: HE DCM value
30962306a36Sopenharmony_ci * @HWSIM_RATE_INFO_ATTR_HE_RU_ALLOC:  HE RU allocation (from &enum nl80211_he_ru_alloc,
31062306a36Sopenharmony_ci *	only valid if bw is %RATE_INFO_BW_HE_RU)
31162306a36Sopenharmony_ci * @HWSIM_RATE_INFO_ATTR_N_BOUNDED_CH: In case of EDMG the number of bonded channels (1-4)
31262306a36Sopenharmony_ci * @HWSIM_RATE_INFO_ATTR_EHT_GI: EHT guard interval (from &enum nl80211_eht_gi)
31362306a36Sopenharmony_ci * @HWSIM_RATE_INFO_ATTR_EHT_RU_ALLOC: EHT RU allocation (from &enum nl80211_eht_ru_alloc,
31462306a36Sopenharmony_ci *	only valid if bw is %RATE_INFO_BW_EHT_RU)
31562306a36Sopenharmony_ci * @NUM_HWSIM_RATE_INFO_ATTRS: internal
31662306a36Sopenharmony_ci * @HWSIM_RATE_INFO_ATTR_MAX: highest attribute number
31762306a36Sopenharmony_ci */
31862306a36Sopenharmony_cienum hwsim_rate_info_attributes {
31962306a36Sopenharmony_ci	__HWSIM_RATE_INFO_ATTR_INVALID,
32062306a36Sopenharmony_ci
32162306a36Sopenharmony_ci	HWSIM_RATE_INFO_ATTR_FLAGS,
32262306a36Sopenharmony_ci	HWSIM_RATE_INFO_ATTR_MCS,
32362306a36Sopenharmony_ci	HWSIM_RATE_INFO_ATTR_LEGACY,
32462306a36Sopenharmony_ci	HWSIM_RATE_INFO_ATTR_NSS,
32562306a36Sopenharmony_ci	HWSIM_RATE_INFO_ATTR_BW,
32662306a36Sopenharmony_ci	HWSIM_RATE_INFO_ATTR_HE_GI,
32762306a36Sopenharmony_ci	HWSIM_RATE_INFO_ATTR_HE_DCM,
32862306a36Sopenharmony_ci	HWSIM_RATE_INFO_ATTR_HE_RU_ALLOC,
32962306a36Sopenharmony_ci	HWSIM_RATE_INFO_ATTR_N_BOUNDED_CH,
33062306a36Sopenharmony_ci	HWSIM_RATE_INFO_ATTR_EHT_GI,
33162306a36Sopenharmony_ci	HWSIM_RATE_INFO_ATTR_EHT_RU_ALLOC,
33262306a36Sopenharmony_ci
33362306a36Sopenharmony_ci	/* keep last */
33462306a36Sopenharmony_ci	NUM_HWSIM_RATE_INFO_ATTRS,
33562306a36Sopenharmony_ci	HWSIM_RATE_INFO_ATTR_MAX = NUM_HWSIM_RATE_INFO_ATTRS - 1
33662306a36Sopenharmony_ci};
33762306a36Sopenharmony_ci
33862306a36Sopenharmony_ci#endif /* __MAC80211_HWSIM_H */
339