Loading...
1/*
2 * mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211
3 * Copyright (c) 2008, Jouni Malinen <j@w1.fi>
4 * Copyright (c) 2011, Javier Lopez <jlopex@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __MAC80211_HWSIM_H
12#define __MAC80211_HWSIM_H
13
14/**
15 * enum hwsim_tx_control_flags - flags to describe transmission info/status
16 *
17 * These flags are used to give the wmediumd extra information in order to
18 * modify its behavior for each frame
19 *
20 * @HWSIM_TX_CTL_REQ_TX_STATUS: require TX status callback for this frame.
21 * @HWSIM_TX_CTL_NO_ACK: tell the wmediumd not to wait for an ack
22 * @HWSIM_TX_STAT_ACK: Frame was acknowledged
23 *
24 */
25enum hwsim_tx_control_flags {
26 HWSIM_TX_CTL_REQ_TX_STATUS = BIT(0),
27 HWSIM_TX_CTL_NO_ACK = BIT(1),
28 HWSIM_TX_STAT_ACK = BIT(2),
29};
30
31/**
32 * DOC: Frame transmission/registration support
33 *
34 * Frame transmission and registration support exists to allow userspace
35 * entities such as wmediumd to receive and process all broadcasted
36 * frames from a mac80211_hwsim radio device.
37 *
38 * This allow user space applications to decide if the frame should be
39 * dropped or not and implement a wireless medium simulator at user space.
40 *
41 * Registration is done by sending a register message to the driver and
42 * will be automatically unregistered if the user application doesn't
43 * responds to sent frames.
44 * Once registered the user application has to take responsibility of
45 * broadcasting the frames to all listening mac80211_hwsim radio
46 * interfaces.
47 *
48 * For more technical details, see the corresponding command descriptions
49 * below.
50 */
51
52/**
53 * enum hwsim_commands - supported hwsim commands
54 *
55 * @HWSIM_CMD_UNSPEC: unspecified command to catch errors
56 *
57 * @HWSIM_CMD_REGISTER: request to register and received all broadcasted
58 * frames by any mac80211_hwsim radio device.
59 * @HWSIM_CMD_FRAME: send/receive a broadcasted frame from/to kernel/user
60 * space, uses:
61 * %HWSIM_ATTR_ADDR_TRANSMITTER, %HWSIM_ATTR_ADDR_RECEIVER,
62 * %HWSIM_ATTR_FRAME, %HWSIM_ATTR_FLAGS, %HWSIM_ATTR_RX_RATE,
63 * %HWSIM_ATTR_SIGNAL, %HWSIM_ATTR_COOKIE, %HWSIM_ATTR_FREQ (optional)
64 * @HWSIM_CMD_TX_INFO_FRAME: Transmission info report from user space to
65 * kernel, uses:
66 * %HWSIM_ATTR_ADDR_TRANSMITTER, %HWSIM_ATTR_FLAGS,
67 * %HWSIM_ATTR_TX_INFO, %WSIM_ATTR_TX_INFO_FLAGS,
68 * %HWSIM_ATTR_SIGNAL, %HWSIM_ATTR_COOKIE
69 * @HWSIM_CMD_NEW_RADIO: create a new radio with the given parameters,
70 * returns the radio ID (>= 0) or negative on errors, if successful
71 * then multicast the result, uses optional parameter:
72 * %HWSIM_ATTR_REG_STRICT_REG, %HWSIM_ATTR_SUPPORT_P2P_DEVICE,
73 * %HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE, %HWSIM_ATTR_CHANNELS,
74 * %HWSIM_ATTR_NO_VIF, %HWSIM_ATTR_RADIO_NAME, %HWSIM_ATTR_USE_CHANCTX,
75 * %HWSIM_ATTR_REG_HINT_ALPHA2, %HWSIM_ATTR_REG_CUSTOM_REG,
76 * %HWSIM_ATTR_PERM_ADDR
77 * @HWSIM_CMD_DEL_RADIO: destroy a radio, reply is multicasted
78 * @HWSIM_CMD_GET_RADIO: fetch information about existing radios, uses:
79 * %HWSIM_ATTR_RADIO_ID
80 * @__HWSIM_CMD_MAX: enum limit
81 */
82enum {
83 HWSIM_CMD_UNSPEC,
84 HWSIM_CMD_REGISTER,
85 HWSIM_CMD_FRAME,
86 HWSIM_CMD_TX_INFO_FRAME,
87 HWSIM_CMD_NEW_RADIO,
88 HWSIM_CMD_DEL_RADIO,
89 HWSIM_CMD_GET_RADIO,
90 __HWSIM_CMD_MAX,
91};
92#define HWSIM_CMD_MAX (_HWSIM_CMD_MAX - 1)
93
94#define HWSIM_CMD_CREATE_RADIO HWSIM_CMD_NEW_RADIO
95#define HWSIM_CMD_DESTROY_RADIO HWSIM_CMD_DEL_RADIO
96
97/**
98 * enum hwsim_attrs - hwsim netlink attributes
99 *
100 * @HWSIM_ATTR_UNSPEC: unspecified attribute to catch errors
101 *
102 * @HWSIM_ATTR_ADDR_RECEIVER: MAC address of the radio device that
103 * the frame is broadcasted to
104 * @HWSIM_ATTR_ADDR_TRANSMITTER: MAC address of the radio device that
105 * the frame was broadcasted from
106 * @HWSIM_ATTR_FRAME: Data array
107 * @HWSIM_ATTR_FLAGS: mac80211 transmission flags, used to process
108 properly the frame at user space
109 * @HWSIM_ATTR_RX_RATE: estimated rx rate index for this frame at user
110 space
111 * @HWSIM_ATTR_SIGNAL: estimated RX signal for this frame at user
112 space
113 * @HWSIM_ATTR_TX_INFO: ieee80211_tx_rate array
114 * @HWSIM_ATTR_COOKIE: sk_buff cookie to identify the frame
115 * @HWSIM_ATTR_CHANNELS: u32 attribute used with the %HWSIM_CMD_CREATE_RADIO
116 * command giving the number of channels supported by the new radio
117 * @HWSIM_ATTR_RADIO_ID: u32 attribute used with %HWSIM_CMD_DESTROY_RADIO
118 * only to destroy a radio
119 * @HWSIM_ATTR_REG_HINT_ALPHA2: alpha2 for regulatoro driver hint
120 * (nla string, length 2)
121 * @HWSIM_ATTR_REG_CUSTOM_REG: custom regulatory domain index (u32 attribute)
122 * @HWSIM_ATTR_REG_STRICT_REG: request REGULATORY_STRICT_REG (flag attribute)
123 * @HWSIM_ATTR_SUPPORT_P2P_DEVICE: support P2P Device virtual interface (flag)
124 * @HWSIM_ATTR_USE_CHANCTX: used with the %HWSIM_CMD_CREATE_RADIO
125 * command to force use of channel contexts even when only a
126 * single channel is supported
127 * @HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE: used with the %HWSIM_CMD_CREATE_RADIO
128 * command to force radio removal when process that created the radio dies
129 * @HWSIM_ATTR_RADIO_NAME: Name of radio, e.g. phy666
130 * @HWSIM_ATTR_NO_VIF: Do not create vif (wlanX) when creating radio.
131 * @HWSIM_ATTR_FREQ: Frequency at which packet is transmitted or received.
132 * @HWSIM_ATTR_TX_INFO_FLAGS: additional flags for corresponding
133 * rates of %HWSIM_ATTR_TX_INFO
134 * @HWSIM_ATTR_PERM_ADDR: permanent mac address of new radio
135 * @__HWSIM_ATTR_MAX: enum limit
136 */
137
138
139enum {
140 HWSIM_ATTR_UNSPEC,
141 HWSIM_ATTR_ADDR_RECEIVER,
142 HWSIM_ATTR_ADDR_TRANSMITTER,
143 HWSIM_ATTR_FRAME,
144 HWSIM_ATTR_FLAGS,
145 HWSIM_ATTR_RX_RATE,
146 HWSIM_ATTR_SIGNAL,
147 HWSIM_ATTR_TX_INFO,
148 HWSIM_ATTR_COOKIE,
149 HWSIM_ATTR_CHANNELS,
150 HWSIM_ATTR_RADIO_ID,
151 HWSIM_ATTR_REG_HINT_ALPHA2,
152 HWSIM_ATTR_REG_CUSTOM_REG,
153 HWSIM_ATTR_REG_STRICT_REG,
154 HWSIM_ATTR_SUPPORT_P2P_DEVICE,
155 HWSIM_ATTR_USE_CHANCTX,
156 HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE,
157 HWSIM_ATTR_RADIO_NAME,
158 HWSIM_ATTR_NO_VIF,
159 HWSIM_ATTR_FREQ,
160 HWSIM_ATTR_PAD,
161 HWSIM_ATTR_TX_INFO_FLAGS,
162 HWSIM_ATTR_PERM_ADDR,
163 __HWSIM_ATTR_MAX,
164};
165#define HWSIM_ATTR_MAX (__HWSIM_ATTR_MAX - 1)
166
167/**
168 * struct hwsim_tx_rate - rate selection/status
169 *
170 * @idx: rate index to attempt to send with
171 * @count: number of tries in this rate before going to the next rate
172 *
173 * A value of -1 for @idx indicates an invalid rate and, if used
174 * in an array of retry rates, that no more rates should be tried.
175 *
176 * When used for transmit status reporting, the driver should
177 * always report the rate and number of retries used.
178 *
179 */
180struct hwsim_tx_rate {
181 s8 idx;
182 u8 count;
183} __packed;
184
185/**
186 * enum hwsim_tx_rate_flags - per-rate flags set by the rate control algorithm.
187 * Inspired by structure mac80211_rate_control_flags. New flags may be
188 * appended, but old flags not deleted, to keep compatibility for
189 * userspace.
190 *
191 * These flags are set by the Rate control algorithm for each rate during tx,
192 * in the @flags member of struct ieee80211_tx_rate.
193 *
194 * @MAC80211_HWSIM_TX_RC_USE_RTS_CTS: Use RTS/CTS exchange for this rate.
195 * @MAC80211_HWSIM_TX_RC_USE_CTS_PROTECT: CTS-to-self protection is required.
196 * This is set if the current BSS requires ERP protection.
197 * @MAC80211_HWSIM_TX_RC_USE_SHORT_PREAMBLE: Use short preamble.
198 * @MAC80211_HWSIM_TX_RC_MCS: HT rate.
199 * @MAC80211_HWSIM_TX_RC_VHT_MCS: VHT MCS rate, in this case the idx field is
200 * split into a higher 4 bits (Nss) and lower 4 bits (MCS number)
201 * @MAC80211_HWSIM_TX_RC_GREEN_FIELD: Indicates whether this rate should be used
202 * in Greenfield mode.
203 * @MAC80211_HWSIM_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be
204 * 40 MHz.
205 * @MAC80211_HWSIM_TX_RC_80_MHZ_WIDTH: Indicates 80 MHz transmission
206 * @MAC80211_HWSIM_TX_RC_160_MHZ_WIDTH: Indicates 160 MHz transmission
207 * (80+80 isn't supported yet)
208 * @MAC80211_HWSIM_TX_RC_DUP_DATA: The frame should be transmitted on both of
209 * the adjacent 20 MHz channels, if the current channel type is
210 * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS.
211 * @MAC80211_HWSIM_TX_RC_SHORT_GI: Short Guard interval should be used for this
212 * rate.
213 */
214enum hwsim_tx_rate_flags {
215 MAC80211_HWSIM_TX_RC_USE_RTS_CTS = BIT(0),
216 MAC80211_HWSIM_TX_RC_USE_CTS_PROTECT = BIT(1),
217 MAC80211_HWSIM_TX_RC_USE_SHORT_PREAMBLE = BIT(2),
218
219 /* rate index is an HT/VHT MCS instead of an index */
220 MAC80211_HWSIM_TX_RC_MCS = BIT(3),
221 MAC80211_HWSIM_TX_RC_GREEN_FIELD = BIT(4),
222 MAC80211_HWSIM_TX_RC_40_MHZ_WIDTH = BIT(5),
223 MAC80211_HWSIM_TX_RC_DUP_DATA = BIT(6),
224 MAC80211_HWSIM_TX_RC_SHORT_GI = BIT(7),
225 MAC80211_HWSIM_TX_RC_VHT_MCS = BIT(8),
226 MAC80211_HWSIM_TX_RC_80_MHZ_WIDTH = BIT(9),
227 MAC80211_HWSIM_TX_RC_160_MHZ_WIDTH = BIT(10),
228};
229
230/**
231 * struct hwsim_tx_rate - rate selection/status
232 *
233 * @idx: rate index to attempt to send with
234 * @count: number of tries in this rate before going to the next rate
235 *
236 * A value of -1 for @idx indicates an invalid rate and, if used
237 * in an array of retry rates, that no more rates should be tried.
238 *
239 * When used for transmit status reporting, the driver should
240 * always report the rate and number of retries used.
241 *
242 */
243struct hwsim_tx_rate_flag {
244 s8 idx;
245 u16 flags;
246} __packed;
247#endif /* __MAC80211_HWSIM_H */
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * mac80211_hwsim - software simulator of 802.11 radio(s) for mac80211
4 * Copyright (c) 2008, Jouni Malinen <j@w1.fi>
5 * Copyright (c) 2011, Javier Lopez <jlopex@gmail.com>
6 * Copyright (C) 2020, 2022 Intel Corporation
7 */
8
9#ifndef __MAC80211_HWSIM_H
10#define __MAC80211_HWSIM_H
11
12/**
13 * enum hwsim_tx_control_flags - flags to describe transmission info/status
14 *
15 * These flags are used to give the wmediumd extra information in order to
16 * modify its behavior for each frame
17 *
18 * @HWSIM_TX_CTL_REQ_TX_STATUS: require TX status callback for this frame.
19 * @HWSIM_TX_CTL_NO_ACK: tell the wmediumd not to wait for an ack
20 * @HWSIM_TX_STAT_ACK: Frame was acknowledged
21 *
22 */
23enum hwsim_tx_control_flags {
24 HWSIM_TX_CTL_REQ_TX_STATUS = BIT(0),
25 HWSIM_TX_CTL_NO_ACK = BIT(1),
26 HWSIM_TX_STAT_ACK = BIT(2),
27};
28
29/**
30 * DOC: Frame transmission/registration support
31 *
32 * Frame transmission and registration support exists to allow userspace
33 * entities such as wmediumd to receive and process all broadcasted
34 * frames from a mac80211_hwsim radio device.
35 *
36 * This allow user space applications to decide if the frame should be
37 * dropped or not and implement a wireless medium simulator at user space.
38 *
39 * Registration is done by sending a register message to the driver and
40 * will be automatically unregistered if the user application doesn't
41 * responds to sent frames.
42 * Once registered the user application has to take responsibility of
43 * broadcasting the frames to all listening mac80211_hwsim radio
44 * interfaces.
45 *
46 * For more technical details, see the corresponding command descriptions
47 * below.
48 */
49
50/**
51 * enum hwsim_commands - supported hwsim commands
52 *
53 * @HWSIM_CMD_UNSPEC: unspecified command to catch errors
54 *
55 * @HWSIM_CMD_REGISTER: request to register and received all broadcasted
56 * frames by any mac80211_hwsim radio device.
57 * @HWSIM_CMD_FRAME: send/receive a broadcasted frame from/to kernel/user
58 * space, uses:
59 * %HWSIM_ATTR_ADDR_TRANSMITTER, %HWSIM_ATTR_ADDR_RECEIVER,
60 * %HWSIM_ATTR_FRAME, %HWSIM_ATTR_FLAGS, %HWSIM_ATTR_RX_RATE,
61 * %HWSIM_ATTR_SIGNAL, %HWSIM_ATTR_COOKIE, %HWSIM_ATTR_FREQ (optional)
62 * @HWSIM_CMD_TX_INFO_FRAME: Transmission info report from user space to
63 * kernel, uses:
64 * %HWSIM_ATTR_ADDR_TRANSMITTER, %HWSIM_ATTR_FLAGS,
65 * %HWSIM_ATTR_TX_INFO, %WSIM_ATTR_TX_INFO_FLAGS,
66 * %HWSIM_ATTR_SIGNAL, %HWSIM_ATTR_COOKIE
67 * @HWSIM_CMD_NEW_RADIO: create a new radio with the given parameters,
68 * returns the radio ID (>= 0) or negative on errors, if successful
69 * then multicast the result, uses optional parameter:
70 * %HWSIM_ATTR_REG_STRICT_REG, %HWSIM_ATTR_SUPPORT_P2P_DEVICE,
71 * %HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE, %HWSIM_ATTR_CHANNELS,
72 * %HWSIM_ATTR_NO_VIF, %HWSIM_ATTR_RADIO_NAME, %HWSIM_ATTR_USE_CHANCTX,
73 * %HWSIM_ATTR_REG_HINT_ALPHA2, %HWSIM_ATTR_REG_CUSTOM_REG,
74 * %HWSIM_ATTR_PERM_ADDR
75 * @HWSIM_CMD_DEL_RADIO: destroy a radio, reply is multicasted
76 * @HWSIM_CMD_GET_RADIO: fetch information about existing radios, uses:
77 * %HWSIM_ATTR_RADIO_ID
78 * @HWSIM_CMD_ADD_MAC_ADDR: add a receive MAC address (given in the
79 * %HWSIM_ATTR_ADDR_RECEIVER attribute) to a device identified by
80 * %HWSIM_ATTR_ADDR_TRANSMITTER. This lets wmediumd forward frames
81 * to this receiver address for a given station.
82 * @HWSIM_CMD_DEL_MAC_ADDR: remove the MAC address again, the attributes
83 * are the same as to @HWSIM_CMD_ADD_MAC_ADDR.
84 * @__HWSIM_CMD_MAX: enum limit
85 */
86enum {
87 HWSIM_CMD_UNSPEC,
88 HWSIM_CMD_REGISTER,
89 HWSIM_CMD_FRAME,
90 HWSIM_CMD_TX_INFO_FRAME,
91 HWSIM_CMD_NEW_RADIO,
92 HWSIM_CMD_DEL_RADIO,
93 HWSIM_CMD_GET_RADIO,
94 HWSIM_CMD_ADD_MAC_ADDR,
95 HWSIM_CMD_DEL_MAC_ADDR,
96 __HWSIM_CMD_MAX,
97};
98#define HWSIM_CMD_MAX (_HWSIM_CMD_MAX - 1)
99
100#define HWSIM_CMD_CREATE_RADIO HWSIM_CMD_NEW_RADIO
101#define HWSIM_CMD_DESTROY_RADIO HWSIM_CMD_DEL_RADIO
102
103/**
104 * enum hwsim_attrs - hwsim netlink attributes
105 *
106 * @HWSIM_ATTR_UNSPEC: unspecified attribute to catch errors
107 *
108 * @HWSIM_ATTR_ADDR_RECEIVER: MAC address of the radio device that
109 * the frame is broadcasted to
110 * @HWSIM_ATTR_ADDR_TRANSMITTER: MAC address of the radio device that
111 * the frame was broadcasted from
112 * @HWSIM_ATTR_FRAME: Data array
113 * @HWSIM_ATTR_FLAGS: mac80211 transmission flags, used to process
114 properly the frame at user space
115 * @HWSIM_ATTR_RX_RATE: estimated rx rate index for this frame at user
116 space
117 * @HWSIM_ATTR_SIGNAL: estimated RX signal for this frame at user
118 space
119 * @HWSIM_ATTR_TX_INFO: ieee80211_tx_rate array
120 * @HWSIM_ATTR_COOKIE: sk_buff cookie to identify the frame
121 * @HWSIM_ATTR_CHANNELS: u32 attribute used with the %HWSIM_CMD_CREATE_RADIO
122 * command giving the number of channels supported by the new radio
123 * @HWSIM_ATTR_RADIO_ID: u32 attribute used with %HWSIM_CMD_DESTROY_RADIO
124 * only to destroy a radio
125 * @HWSIM_ATTR_REG_HINT_ALPHA2: alpha2 for regulatoro driver hint
126 * (nla string, length 2)
127 * @HWSIM_ATTR_REG_CUSTOM_REG: custom regulatory domain index (u32 attribute)
128 * @HWSIM_ATTR_REG_STRICT_REG: request REGULATORY_STRICT_REG (flag attribute)
129 * @HWSIM_ATTR_SUPPORT_P2P_DEVICE: support P2P Device virtual interface (flag)
130 * @HWSIM_ATTR_USE_CHANCTX: used with the %HWSIM_CMD_CREATE_RADIO
131 * command to force use of channel contexts even when only a
132 * single channel is supported
133 * @HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE: used with the %HWSIM_CMD_CREATE_RADIO
134 * command to force radio removal when process that created the radio dies
135 * @HWSIM_ATTR_RADIO_NAME: Name of radio, e.g. phy666
136 * @HWSIM_ATTR_NO_VIF: Do not create vif (wlanX) when creating radio.
137 * @HWSIM_ATTR_FREQ: Frequency at which packet is transmitted or received.
138 * @HWSIM_ATTR_TX_INFO_FLAGS: additional flags for corresponding
139 * rates of %HWSIM_ATTR_TX_INFO
140 * @HWSIM_ATTR_PERM_ADDR: permanent mac address of new radio
141 * @HWSIM_ATTR_IFTYPE_SUPPORT: u32 attribute of supported interface types bits
142 * @HWSIM_ATTR_CIPHER_SUPPORT: u32 array of supported cipher types
143 * @HWSIM_ATTR_MLO_SUPPORT: claim MLO support (exact parameters TBD) for
144 * the new radio
145 * @__HWSIM_ATTR_MAX: enum limit
146 */
147
148
149enum {
150 HWSIM_ATTR_UNSPEC,
151 HWSIM_ATTR_ADDR_RECEIVER,
152 HWSIM_ATTR_ADDR_TRANSMITTER,
153 HWSIM_ATTR_FRAME,
154 HWSIM_ATTR_FLAGS,
155 HWSIM_ATTR_RX_RATE,
156 HWSIM_ATTR_SIGNAL,
157 HWSIM_ATTR_TX_INFO,
158 HWSIM_ATTR_COOKIE,
159 HWSIM_ATTR_CHANNELS,
160 HWSIM_ATTR_RADIO_ID,
161 HWSIM_ATTR_REG_HINT_ALPHA2,
162 HWSIM_ATTR_REG_CUSTOM_REG,
163 HWSIM_ATTR_REG_STRICT_REG,
164 HWSIM_ATTR_SUPPORT_P2P_DEVICE,
165 HWSIM_ATTR_USE_CHANCTX,
166 HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE,
167 HWSIM_ATTR_RADIO_NAME,
168 HWSIM_ATTR_NO_VIF,
169 HWSIM_ATTR_FREQ,
170 HWSIM_ATTR_PAD,
171 HWSIM_ATTR_TX_INFO_FLAGS,
172 HWSIM_ATTR_PERM_ADDR,
173 HWSIM_ATTR_IFTYPE_SUPPORT,
174 HWSIM_ATTR_CIPHER_SUPPORT,
175 HWSIM_ATTR_MLO_SUPPORT,
176 __HWSIM_ATTR_MAX,
177};
178#define HWSIM_ATTR_MAX (__HWSIM_ATTR_MAX - 1)
179
180/**
181 * struct hwsim_tx_rate - rate selection/status
182 *
183 * @idx: rate index to attempt to send with
184 * @count: number of tries in this rate before going to the next rate
185 *
186 * A value of -1 for @idx indicates an invalid rate and, if used
187 * in an array of retry rates, that no more rates should be tried.
188 *
189 * When used for transmit status reporting, the driver should
190 * always report the rate and number of retries used.
191 *
192 */
193struct hwsim_tx_rate {
194 s8 idx;
195 u8 count;
196} __packed;
197
198/**
199 * enum hwsim_tx_rate_flags - per-rate flags set by the rate control algorithm.
200 * Inspired by structure mac80211_rate_control_flags. New flags may be
201 * appended, but old flags not deleted, to keep compatibility for
202 * userspace.
203 *
204 * These flags are set by the Rate control algorithm for each rate during tx,
205 * in the @flags member of struct ieee80211_tx_rate.
206 *
207 * @MAC80211_HWSIM_TX_RC_USE_RTS_CTS: Use RTS/CTS exchange for this rate.
208 * @MAC80211_HWSIM_TX_RC_USE_CTS_PROTECT: CTS-to-self protection is required.
209 * This is set if the current BSS requires ERP protection.
210 * @MAC80211_HWSIM_TX_RC_USE_SHORT_PREAMBLE: Use short preamble.
211 * @MAC80211_HWSIM_TX_RC_MCS: HT rate.
212 * @MAC80211_HWSIM_TX_RC_VHT_MCS: VHT MCS rate, in this case the idx field is
213 * split into a higher 4 bits (Nss) and lower 4 bits (MCS number)
214 * @MAC80211_HWSIM_TX_RC_GREEN_FIELD: Indicates whether this rate should be used
215 * in Greenfield mode.
216 * @MAC80211_HWSIM_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be
217 * 40 MHz.
218 * @MAC80211_HWSIM_TX_RC_80_MHZ_WIDTH: Indicates 80 MHz transmission
219 * @MAC80211_HWSIM_TX_RC_160_MHZ_WIDTH: Indicates 160 MHz transmission
220 * (80+80 isn't supported yet)
221 * @MAC80211_HWSIM_TX_RC_DUP_DATA: The frame should be transmitted on both of
222 * the adjacent 20 MHz channels, if the current channel type is
223 * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS.
224 * @MAC80211_HWSIM_TX_RC_SHORT_GI: Short Guard interval should be used for this
225 * rate.
226 */
227enum hwsim_tx_rate_flags {
228 MAC80211_HWSIM_TX_RC_USE_RTS_CTS = BIT(0),
229 MAC80211_HWSIM_TX_RC_USE_CTS_PROTECT = BIT(1),
230 MAC80211_HWSIM_TX_RC_USE_SHORT_PREAMBLE = BIT(2),
231
232 /* rate index is an HT/VHT MCS instead of an index */
233 MAC80211_HWSIM_TX_RC_MCS = BIT(3),
234 MAC80211_HWSIM_TX_RC_GREEN_FIELD = BIT(4),
235 MAC80211_HWSIM_TX_RC_40_MHZ_WIDTH = BIT(5),
236 MAC80211_HWSIM_TX_RC_DUP_DATA = BIT(6),
237 MAC80211_HWSIM_TX_RC_SHORT_GI = BIT(7),
238 MAC80211_HWSIM_TX_RC_VHT_MCS = BIT(8),
239 MAC80211_HWSIM_TX_RC_80_MHZ_WIDTH = BIT(9),
240 MAC80211_HWSIM_TX_RC_160_MHZ_WIDTH = BIT(10),
241};
242
243/**
244 * struct hwsim_tx_rate - rate selection/status
245 *
246 * @idx: rate index to attempt to send with
247 * @count: number of tries in this rate before going to the next rate
248 *
249 * A value of -1 for @idx indicates an invalid rate and, if used
250 * in an array of retry rates, that no more rates should be tried.
251 *
252 * When used for transmit status reporting, the driver should
253 * always report the rate and number of retries used.
254 *
255 */
256struct hwsim_tx_rate_flag {
257 s8 idx;
258 u16 flags;
259} __packed;
260
261/**
262 * DOC: Frame transmission support over virtio
263 *
264 * Frame transmission is also supported over virtio to allow communication
265 * with external entities.
266 */
267
268/**
269 * enum hwsim_vqs - queues for virtio frame transmission
270 *
271 * @HWSIM_VQ_TX: send frames to external entity
272 * @HWSIM_VQ_RX: receive frames and transmission info reports
273 * @HWSIM_NUM_VQS: enum limit
274 */
275enum {
276 HWSIM_VQ_TX,
277 HWSIM_VQ_RX,
278 HWSIM_NUM_VQS,
279};
280#endif /* __MAC80211_HWSIM_H */