18e99ea8dSJohannes Berg /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 28e99ea8dSJohannes Berg /* 3*59505471SJohannes Berg * Copyright (C) 2012-2014, 2018-2020, 2022 Intel Corporation 48e99ea8dSJohannes Berg * Copyright (C) 2013-2015 Intel Mobile Communications GmbH 58e99ea8dSJohannes Berg * Copyright (C) 2016-2017 Intel Deutschland GmbH 68e99ea8dSJohannes Berg */ 7d172a5efSJohannes Berg #ifndef __iwl_fw_api_time_event_h__ 8d172a5efSJohannes Berg #define __iwl_fw_api_time_event_h__ 9d172a5efSJohannes Berg 10d172a5efSJohannes Berg #include "fw/api/phy-ctxt.h" 11d172a5efSJohannes Berg 12d172a5efSJohannes Berg /* Time Event types, according to MAC type */ 13d172a5efSJohannes Berg enum iwl_time_event_type { 14d172a5efSJohannes Berg /* BSS Station Events */ 15d172a5efSJohannes Berg TE_BSS_STA_AGGRESSIVE_ASSOC, 16d172a5efSJohannes Berg TE_BSS_STA_ASSOC, 17d172a5efSJohannes Berg TE_BSS_EAP_DHCP_PROT, 18d172a5efSJohannes Berg TE_BSS_QUIET_PERIOD, 19d172a5efSJohannes Berg 20d172a5efSJohannes Berg /* P2P Device Events */ 21d172a5efSJohannes Berg TE_P2P_DEVICE_DISCOVERABLE, 22d172a5efSJohannes Berg TE_P2P_DEVICE_LISTEN, 23d172a5efSJohannes Berg TE_P2P_DEVICE_ACTION_SCAN, 24d172a5efSJohannes Berg TE_P2P_DEVICE_FULL_SCAN, 25d172a5efSJohannes Berg 26d172a5efSJohannes Berg /* P2P Client Events */ 27d172a5efSJohannes Berg TE_P2P_CLIENT_AGGRESSIVE_ASSOC, 28d172a5efSJohannes Berg TE_P2P_CLIENT_ASSOC, 29d172a5efSJohannes Berg TE_P2P_CLIENT_QUIET_PERIOD, 30d172a5efSJohannes Berg 31d172a5efSJohannes Berg /* P2P GO Events */ 32d172a5efSJohannes Berg TE_P2P_GO_ASSOC_PROT, 33d172a5efSJohannes Berg TE_P2P_GO_REPETITIVET_NOA, 34d172a5efSJohannes Berg TE_P2P_GO_CT_WINDOW, 35d172a5efSJohannes Berg 36d172a5efSJohannes Berg /* WiDi Sync Events */ 37d172a5efSJohannes Berg TE_WIDI_TX_SYNC, 38d172a5efSJohannes Berg 39d172a5efSJohannes Berg /* Channel Switch NoA */ 40d172a5efSJohannes Berg TE_CHANNEL_SWITCH_PERIOD, 41d172a5efSJohannes Berg 42d172a5efSJohannes Berg TE_MAX 43d172a5efSJohannes Berg }; /* MAC_EVENT_TYPE_API_E_VER_1 */ 44d172a5efSJohannes Berg 45d172a5efSJohannes Berg /* Time event - defines for command API v1 */ 46d172a5efSJohannes Berg 47d172a5efSJohannes Berg /* 48d172a5efSJohannes Berg * @TE_V1_FRAG_NONE: fragmentation of the time event is NOT allowed. 49d172a5efSJohannes Berg * @TE_V1_FRAG_SINGLE: fragmentation of the time event is allowed, but only 50d172a5efSJohannes Berg * the first fragment is scheduled. 51d172a5efSJohannes Berg * @TE_V1_FRAG_DUAL: fragmentation of the time event is allowed, but only 52d172a5efSJohannes Berg * the first 2 fragments are scheduled. 53d172a5efSJohannes Berg * @TE_V1_FRAG_ENDLESS: fragmentation of the time event is allowed, and any 54d172a5efSJohannes Berg * number of fragments are valid. 55d172a5efSJohannes Berg * 56d172a5efSJohannes Berg * Other than the constant defined above, specifying a fragmentation value 'x' 57d172a5efSJohannes Berg * means that the event can be fragmented but only the first 'x' will be 58d172a5efSJohannes Berg * scheduled. 59d172a5efSJohannes Berg */ 60d172a5efSJohannes Berg enum { 61d172a5efSJohannes Berg TE_V1_FRAG_NONE = 0, 62d172a5efSJohannes Berg TE_V1_FRAG_SINGLE = 1, 63d172a5efSJohannes Berg TE_V1_FRAG_DUAL = 2, 64d172a5efSJohannes Berg TE_V1_FRAG_ENDLESS = 0xffffffff 65d172a5efSJohannes Berg }; 66d172a5efSJohannes Berg 67d172a5efSJohannes Berg /* If a Time Event can be fragmented, this is the max number of fragments */ 68d172a5efSJohannes Berg #define TE_V1_FRAG_MAX_MSK 0x0fffffff 69d172a5efSJohannes Berg /* Repeat the time event endlessly (until removed) */ 70d172a5efSJohannes Berg #define TE_V1_REPEAT_ENDLESS 0xffffffff 71d172a5efSJohannes Berg /* If a Time Event has bounded repetitions, this is the maximal value */ 72d172a5efSJohannes Berg #define TE_V1_REPEAT_MAX_MSK_V1 0x0fffffff 73d172a5efSJohannes Berg 74d172a5efSJohannes Berg /* Time Event dependencies: none, on another TE, or in a specific time */ 75d172a5efSJohannes Berg enum { 76d172a5efSJohannes Berg TE_V1_INDEPENDENT = 0, 77d172a5efSJohannes Berg TE_V1_DEP_OTHER = BIT(0), 78d172a5efSJohannes Berg TE_V1_DEP_TSF = BIT(1), 79d172a5efSJohannes Berg TE_V1_EVENT_SOCIOPATHIC = BIT(2), 80d172a5efSJohannes Berg }; /* MAC_EVENT_DEPENDENCY_POLICY_API_E_VER_2 */ 81d172a5efSJohannes Berg 82d172a5efSJohannes Berg /* 83d172a5efSJohannes Berg * @TE_V1_NOTIF_NONE: no notifications 84d172a5efSJohannes Berg * @TE_V1_NOTIF_HOST_EVENT_START: request/receive notification on event start 85d172a5efSJohannes Berg * @TE_V1_NOTIF_HOST_EVENT_END:request/receive notification on event end 86d172a5efSJohannes Berg * @TE_V1_NOTIF_INTERNAL_EVENT_START: internal FW use 87d172a5efSJohannes Berg * @TE_V1_NOTIF_INTERNAL_EVENT_END: internal FW use. 88d172a5efSJohannes Berg * @TE_V1_NOTIF_HOST_FRAG_START: request/receive notification on frag start 89d172a5efSJohannes Berg * @TE_V1_NOTIF_HOST_FRAG_END:request/receive notification on frag end 90d172a5efSJohannes Berg * @TE_V1_NOTIF_INTERNAL_FRAG_START: internal FW use. 91d172a5efSJohannes Berg * @TE_V1_NOTIF_INTERNAL_FRAG_END: internal FW use. 92d172a5efSJohannes Berg * 93d172a5efSJohannes Berg * Supported Time event notifications configuration. 94d172a5efSJohannes Berg * A notification (both event and fragment) includes a status indicating weather 95d172a5efSJohannes Berg * the FW was able to schedule the event or not. For fragment start/end 96d172a5efSJohannes Berg * notification the status is always success. There is no start/end fragment 97d172a5efSJohannes Berg * notification for monolithic events. 98d172a5efSJohannes Berg */ 99d172a5efSJohannes Berg enum { 100d172a5efSJohannes Berg TE_V1_NOTIF_NONE = 0, 101d172a5efSJohannes Berg TE_V1_NOTIF_HOST_EVENT_START = BIT(0), 102d172a5efSJohannes Berg TE_V1_NOTIF_HOST_EVENT_END = BIT(1), 103d172a5efSJohannes Berg TE_V1_NOTIF_INTERNAL_EVENT_START = BIT(2), 104d172a5efSJohannes Berg TE_V1_NOTIF_INTERNAL_EVENT_END = BIT(3), 105d172a5efSJohannes Berg TE_V1_NOTIF_HOST_FRAG_START = BIT(4), 106d172a5efSJohannes Berg TE_V1_NOTIF_HOST_FRAG_END = BIT(5), 107d172a5efSJohannes Berg TE_V1_NOTIF_INTERNAL_FRAG_START = BIT(6), 108d172a5efSJohannes Berg TE_V1_NOTIF_INTERNAL_FRAG_END = BIT(7), 109d172a5efSJohannes Berg }; /* MAC_EVENT_ACTION_API_E_VER_2 */ 110d172a5efSJohannes Berg 111d172a5efSJohannes Berg /* Time event - defines for command API */ 112d172a5efSJohannes Berg 113d172a5efSJohannes Berg /* 114d172a5efSJohannes Berg * @TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed. 115d172a5efSJohannes Berg * @TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only 116d172a5efSJohannes Berg * the first fragment is scheduled. 117d172a5efSJohannes Berg * @TE_V2_FRAG_DUAL: fragmentation of the time event is allowed, but only 118d172a5efSJohannes Berg * the first 2 fragments are scheduled. 119d172a5efSJohannes Berg * @TE_V2_FRAG_ENDLESS: fragmentation of the time event is allowed, and any 120d172a5efSJohannes Berg * number of fragments are valid. 121d172a5efSJohannes Berg * 122d172a5efSJohannes Berg * Other than the constant defined above, specifying a fragmentation value 'x' 123d172a5efSJohannes Berg * means that the event can be fragmented but only the first 'x' will be 124d172a5efSJohannes Berg * scheduled. 125d172a5efSJohannes Berg */ 126d172a5efSJohannes Berg enum { 127d172a5efSJohannes Berg TE_V2_FRAG_NONE = 0, 128d172a5efSJohannes Berg TE_V2_FRAG_SINGLE = 1, 129d172a5efSJohannes Berg TE_V2_FRAG_DUAL = 2, 130d172a5efSJohannes Berg TE_V2_FRAG_MAX = 0xfe, 131d172a5efSJohannes Berg TE_V2_FRAG_ENDLESS = 0xff 132d172a5efSJohannes Berg }; 133d172a5efSJohannes Berg 134d172a5efSJohannes Berg /* Repeat the time event endlessly (until removed) */ 135d172a5efSJohannes Berg #define TE_V2_REPEAT_ENDLESS 0xff 136d172a5efSJohannes Berg /* If a Time Event has bounded repetitions, this is the maximal value */ 137d172a5efSJohannes Berg #define TE_V2_REPEAT_MAX 0xfe 138d172a5efSJohannes Berg 139d172a5efSJohannes Berg #define TE_V2_PLACEMENT_POS 12 140d172a5efSJohannes Berg #define TE_V2_ABSENCE_POS 15 141d172a5efSJohannes Berg 142d172a5efSJohannes Berg /** 143d172a5efSJohannes Berg * enum iwl_time_event_policy - Time event policy values 144d172a5efSJohannes Berg * A notification (both event and fragment) includes a status indicating weather 145d172a5efSJohannes Berg * the FW was able to schedule the event or not. For fragment start/end 146d172a5efSJohannes Berg * notification the status is always success. There is no start/end fragment 147d172a5efSJohannes Berg * notification for monolithic events. 148d172a5efSJohannes Berg * 149d172a5efSJohannes Berg * @TE_V2_DEFAULT_POLICY: independent, social, present, unoticable 150d172a5efSJohannes Berg * @TE_V2_NOTIF_HOST_EVENT_START: request/receive notification on event start 151d172a5efSJohannes Berg * @TE_V2_NOTIF_HOST_EVENT_END:request/receive notification on event end 152d172a5efSJohannes Berg * @TE_V2_NOTIF_INTERNAL_EVENT_START: internal FW use 153d172a5efSJohannes Berg * @TE_V2_NOTIF_INTERNAL_EVENT_END: internal FW use. 154d172a5efSJohannes Berg * @TE_V2_NOTIF_HOST_FRAG_START: request/receive notification on frag start 155d172a5efSJohannes Berg * @TE_V2_NOTIF_HOST_FRAG_END:request/receive notification on frag end 156d172a5efSJohannes Berg * @TE_V2_NOTIF_INTERNAL_FRAG_START: internal FW use. 157d172a5efSJohannes Berg * @TE_V2_NOTIF_INTERNAL_FRAG_END: internal FW use. 15840d53f4aSAndrei Otcheretianski * @TE_V2_START_IMMEDIATELY: start time event immediately 159d172a5efSJohannes Berg * @TE_V2_DEP_OTHER: depends on another time event 160d172a5efSJohannes Berg * @TE_V2_DEP_TSF: depends on a specific time 161d172a5efSJohannes Berg * @TE_V2_EVENT_SOCIOPATHIC: can't co-exist with other events of tha same MAC 162d172a5efSJohannes Berg * @TE_V2_ABSENCE: are we present or absent during the Time Event. 163d172a5efSJohannes Berg */ 164d172a5efSJohannes Berg enum iwl_time_event_policy { 165d172a5efSJohannes Berg TE_V2_DEFAULT_POLICY = 0x0, 166d172a5efSJohannes Berg 167d172a5efSJohannes Berg /* notifications (event start/stop, fragment start/stop) */ 168d172a5efSJohannes Berg TE_V2_NOTIF_HOST_EVENT_START = BIT(0), 169d172a5efSJohannes Berg TE_V2_NOTIF_HOST_EVENT_END = BIT(1), 170d172a5efSJohannes Berg TE_V2_NOTIF_INTERNAL_EVENT_START = BIT(2), 171d172a5efSJohannes Berg TE_V2_NOTIF_INTERNAL_EVENT_END = BIT(3), 172d172a5efSJohannes Berg 173d172a5efSJohannes Berg TE_V2_NOTIF_HOST_FRAG_START = BIT(4), 174d172a5efSJohannes Berg TE_V2_NOTIF_HOST_FRAG_END = BIT(5), 175d172a5efSJohannes Berg TE_V2_NOTIF_INTERNAL_FRAG_START = BIT(6), 176d172a5efSJohannes Berg TE_V2_NOTIF_INTERNAL_FRAG_END = BIT(7), 17740d53f4aSAndrei Otcheretianski TE_V2_START_IMMEDIATELY = BIT(11), 178d172a5efSJohannes Berg 179d172a5efSJohannes Berg /* placement characteristics */ 180d172a5efSJohannes Berg TE_V2_DEP_OTHER = BIT(TE_V2_PLACEMENT_POS), 181d172a5efSJohannes Berg TE_V2_DEP_TSF = BIT(TE_V2_PLACEMENT_POS + 1), 182d172a5efSJohannes Berg TE_V2_EVENT_SOCIOPATHIC = BIT(TE_V2_PLACEMENT_POS + 2), 183d172a5efSJohannes Berg 184d172a5efSJohannes Berg /* are we present or absent during the Time Event. */ 185d172a5efSJohannes Berg TE_V2_ABSENCE = BIT(TE_V2_ABSENCE_POS), 186d172a5efSJohannes Berg }; 187d172a5efSJohannes Berg 188d172a5efSJohannes Berg /** 189d172a5efSJohannes Berg * struct iwl_time_event_cmd - configuring Time Events 190d172a5efSJohannes Berg * with struct MAC_TIME_EVENT_DATA_API_S_VER_2 (see also 191d172a5efSJohannes Berg * with version 1. determined by IWL_UCODE_TLV_FLAGS) 192d172a5efSJohannes Berg * ( TIME_EVENT_CMD = 0x29 ) 193d172a5efSJohannes Berg * @id_and_color: ID and color of the relevant MAC, 194d172a5efSJohannes Berg * &enum iwl_ctxt_id_and_color 195d172a5efSJohannes Berg * @action: action to perform, one of &enum iwl_ctxt_action 196d172a5efSJohannes Berg * @id: this field has two meanings, depending on the action: 197d172a5efSJohannes Berg * If the action is ADD, then it means the type of event to add. 198d172a5efSJohannes Berg * For all other actions it is the unique event ID assigned when the 199d172a5efSJohannes Berg * event was added by the FW. 200d172a5efSJohannes Berg * @apply_time: When to start the Time Event (in GP2) 201d172a5efSJohannes Berg * @max_delay: maximum delay to event's start (apply time), in TU 202d172a5efSJohannes Berg * @depends_on: the unique ID of the event we depend on (if any) 203d172a5efSJohannes Berg * @interval: interval between repetitions, in TU 204d172a5efSJohannes Berg * @duration: duration of event in TU 205d172a5efSJohannes Berg * @repeat: how many repetitions to do, can be TE_REPEAT_ENDLESS 206d172a5efSJohannes Berg * @max_frags: maximal number of fragments the Time Event can be divided to 207d172a5efSJohannes Berg * @policy: defines whether uCode shall notify the host or other uCode modules 208d172a5efSJohannes Berg * on event and/or fragment start and/or end 209d172a5efSJohannes Berg * using one of TE_INDEPENDENT, TE_DEP_OTHER, TE_DEP_TSF 210d172a5efSJohannes Berg * TE_EVENT_SOCIOPATHIC 211d172a5efSJohannes Berg * using TE_ABSENCE and using TE_NOTIF_*, 212d172a5efSJohannes Berg * &enum iwl_time_event_policy 213d172a5efSJohannes Berg */ 214d172a5efSJohannes Berg struct iwl_time_event_cmd { 215d172a5efSJohannes Berg /* COMMON_INDEX_HDR_API_S_VER_1 */ 216d172a5efSJohannes Berg __le32 id_and_color; 217d172a5efSJohannes Berg __le32 action; 218d172a5efSJohannes Berg __le32 id; 219d172a5efSJohannes Berg /* MAC_TIME_EVENT_DATA_API_S_VER_2 */ 220d172a5efSJohannes Berg __le32 apply_time; 221d172a5efSJohannes Berg __le32 max_delay; 222d172a5efSJohannes Berg __le32 depends_on; 223d172a5efSJohannes Berg __le32 interval; 224d172a5efSJohannes Berg __le32 duration; 225d172a5efSJohannes Berg u8 repeat; 226d172a5efSJohannes Berg u8 max_frags; 227d172a5efSJohannes Berg __le16 policy; 228d172a5efSJohannes Berg } __packed; /* MAC_TIME_EVENT_CMD_API_S_VER_2 */ 229d172a5efSJohannes Berg 230d172a5efSJohannes Berg /** 231d172a5efSJohannes Berg * struct iwl_time_event_resp - response structure to iwl_time_event_cmd 232d172a5efSJohannes Berg * @status: bit 0 indicates success, all others specify errors 233d172a5efSJohannes Berg * @id: the Time Event type 234d172a5efSJohannes Berg * @unique_id: the unique ID assigned (in ADD) or given (others) to the TE 235d172a5efSJohannes Berg * @id_and_color: ID and color of the relevant MAC, 236d172a5efSJohannes Berg * &enum iwl_ctxt_id_and_color 237d172a5efSJohannes Berg */ 238d172a5efSJohannes Berg struct iwl_time_event_resp { 239d172a5efSJohannes Berg __le32 status; 240d172a5efSJohannes Berg __le32 id; 241d172a5efSJohannes Berg __le32 unique_id; 242d172a5efSJohannes Berg __le32 id_and_color; 243d172a5efSJohannes Berg } __packed; /* MAC_TIME_EVENT_RSP_API_S_VER_1 */ 244d172a5efSJohannes Berg 245d172a5efSJohannes Berg /** 246d172a5efSJohannes Berg * struct iwl_time_event_notif - notifications of time event start/stop 247d172a5efSJohannes Berg * ( TIME_EVENT_NOTIFICATION = 0x2a ) 248d172a5efSJohannes Berg * @timestamp: action timestamp in GP2 249d172a5efSJohannes Berg * @session_id: session's unique id 250d172a5efSJohannes Berg * @unique_id: unique id of the Time Event itself 251d172a5efSJohannes Berg * @id_and_color: ID and color of the relevant MAC 252d172a5efSJohannes Berg * @action: &enum iwl_time_event_policy 253d172a5efSJohannes Berg * @status: true if scheduled, false otherwise (not executed) 254d172a5efSJohannes Berg */ 255d172a5efSJohannes Berg struct iwl_time_event_notif { 256d172a5efSJohannes Berg __le32 timestamp; 257d172a5efSJohannes Berg __le32 session_id; 258d172a5efSJohannes Berg __le32 unique_id; 259d172a5efSJohannes Berg __le32 id_and_color; 260d172a5efSJohannes Berg __le32 action; 261d172a5efSJohannes Berg __le32 status; 262d172a5efSJohannes Berg } __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */ 263d172a5efSJohannes Berg 264d172a5efSJohannes Berg /* 26557e861d9SDavid Spinadel * struct iwl_hs20_roc_req_tail - tail of iwl_hs20_roc_req 26657e861d9SDavid Spinadel * 26757e861d9SDavid Spinadel * @node_addr: Our MAC Address 26857e861d9SDavid Spinadel * @reserved: reserved for alignment 26957e861d9SDavid Spinadel * @apply_time: GP2 value to start (should always be the current GP2 value) 27057e861d9SDavid Spinadel * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max 27157e861d9SDavid Spinadel * time by which start of the event is allowed to be postponed. 27257e861d9SDavid Spinadel * @duration: event duration in TU To calculate event duration: 27357e861d9SDavid Spinadel * timeEventDuration = min(duration, remainingQuota) 27457e861d9SDavid Spinadel */ 27557e861d9SDavid Spinadel struct iwl_hs20_roc_req_tail { 27657e861d9SDavid Spinadel u8 node_addr[ETH_ALEN]; 27757e861d9SDavid Spinadel __le16 reserved; 27857e861d9SDavid Spinadel __le32 apply_time; 27957e861d9SDavid Spinadel __le32 apply_time_max_delay; 28057e861d9SDavid Spinadel __le32 duration; 28157e861d9SDavid Spinadel } __packed; 28257e861d9SDavid Spinadel 28357e861d9SDavid Spinadel /* 284d172a5efSJohannes Berg * Aux ROC command 285d172a5efSJohannes Berg * 286d172a5efSJohannes Berg * Command requests the firmware to create a time event for a certain duration 287d172a5efSJohannes Berg * and remain on the given channel. This is done by using the Aux framework in 288d172a5efSJohannes Berg * the FW. 289d172a5efSJohannes Berg * The command was first used for Hot Spot issues - but can be used regardless 290d172a5efSJohannes Berg * to Hot Spot. 291d172a5efSJohannes Berg * 292d172a5efSJohannes Berg * ( HOT_SPOT_CMD 0x53 ) 293d172a5efSJohannes Berg * 294d172a5efSJohannes Berg * @id_and_color: ID and color of the MAC 295*59505471SJohannes Berg * @action: action to perform, see &enum iwl_ctxt_action 296d172a5efSJohannes Berg * @event_unique_id: If the action FW_CTXT_ACTION_REMOVE then the 297d172a5efSJohannes Berg * event_unique_id should be the id of the time event assigned by ucode. 298d172a5efSJohannes Berg * Otherwise ignore the event_unique_id. 299d172a5efSJohannes Berg * @sta_id_and_color: station id and color, resumed during "Remain On Channel" 300d172a5efSJohannes Berg * activity. 301d172a5efSJohannes Berg * @channel_info: channel info 302d172a5efSJohannes Berg */ 303d172a5efSJohannes Berg struct iwl_hs20_roc_req { 304d172a5efSJohannes Berg /* COMMON_INDEX_HDR_API_S_VER_1 hdr */ 305d172a5efSJohannes Berg __le32 id_and_color; 306d172a5efSJohannes Berg __le32 action; 307d172a5efSJohannes Berg __le32 event_unique_id; 308d172a5efSJohannes Berg __le32 sta_id_and_color; 309d172a5efSJohannes Berg struct iwl_fw_channel_info channel_info; 31057e861d9SDavid Spinadel struct iwl_hs20_roc_req_tail tail; 311d172a5efSJohannes Berg } __packed; /* HOT_SPOT_CMD_API_S_VER_1 */ 312d172a5efSJohannes Berg 313d172a5efSJohannes Berg /* 314d172a5efSJohannes Berg * values for AUX ROC result values 315d172a5efSJohannes Berg */ 316d172a5efSJohannes Berg enum iwl_mvm_hot_spot { 317d172a5efSJohannes Berg HOT_SPOT_RSP_STATUS_OK, 318d172a5efSJohannes Berg HOT_SPOT_RSP_STATUS_TOO_MANY_EVENTS, 319d172a5efSJohannes Berg HOT_SPOT_MAX_NUM_OF_SESSIONS, 320d172a5efSJohannes Berg }; 321d172a5efSJohannes Berg 322d172a5efSJohannes Berg /* 323d172a5efSJohannes Berg * Aux ROC command response 324d172a5efSJohannes Berg * 325d172a5efSJohannes Berg * In response to iwl_hs20_roc_req the FW sends this command to notify the 326d172a5efSJohannes Berg * driver the uid of the timevent. 327d172a5efSJohannes Berg * 328d172a5efSJohannes Berg * ( HOT_SPOT_CMD 0x53 ) 329d172a5efSJohannes Berg * 330d172a5efSJohannes Berg * @event_unique_id: Unique ID of time event assigned by ucode 331d172a5efSJohannes Berg * @status: Return status 0 is success, all the rest used for specific errors 332d172a5efSJohannes Berg */ 333d172a5efSJohannes Berg struct iwl_hs20_roc_res { 334d172a5efSJohannes Berg __le32 event_unique_id; 335d172a5efSJohannes Berg __le32 status; 336d172a5efSJohannes Berg } __packed; /* HOT_SPOT_RSP_API_S_VER_1 */ 337d172a5efSJohannes Berg 338fe959c7bSEmmanuel Grumbach /** 339fe959c7bSEmmanuel Grumbach * enum iwl_mvm_session_prot_conf_id - session protection's configurations 340fe959c7bSEmmanuel Grumbach * @SESSION_PROTECT_CONF_ASSOC: Start a session protection for association. 341fe959c7bSEmmanuel Grumbach * The firmware will allocate two events. 342fe959c7bSEmmanuel Grumbach * Valid for BSS_STA and P2P_STA. 343fe959c7bSEmmanuel Grumbach * * A rather short event that can't be fragmented and with a very 344fe959c7bSEmmanuel Grumbach * high priority. If every goes well (99% of the cases) the 345fe959c7bSEmmanuel Grumbach * association should complete within this first event. During 346fe959c7bSEmmanuel Grumbach * that event, no other activity will happen in the firmware, 347fe959c7bSEmmanuel Grumbach * which is why it can't be too long. 348fe959c7bSEmmanuel Grumbach * The length of this event is hard-coded in the firmware: 300TUs. 349fe959c7bSEmmanuel Grumbach * * Another event which can be much longer (it's duration is 350fe959c7bSEmmanuel Grumbach * configurable by the driver) which has a slightly lower 351fe959c7bSEmmanuel Grumbach * priority and that can be fragmented allowing other activities 352fe959c7bSEmmanuel Grumbach * to run while this event is running. 353fe959c7bSEmmanuel Grumbach * The firmware will automatically remove both events once the driver sets 354fe959c7bSEmmanuel Grumbach * the BSS MAC as associated. Neither of the events will be removed 355fe959c7bSEmmanuel Grumbach * for the P2P_STA MAC. 356fe959c7bSEmmanuel Grumbach * Only the duration is configurable for this protection. 357fe959c7bSEmmanuel Grumbach * @SESSION_PROTECT_CONF_GO_CLIENT_ASSOC: not used 358fe959c7bSEmmanuel Grumbach * @SESSION_PROTECT_CONF_P2P_DEVICE_DISCOV: Schedule the P2P Device to be in 359fe959c7bSEmmanuel Grumbach * listen mode. Will be fragmented. Valid only on the P2P Device MAC. 360fe959c7bSEmmanuel Grumbach * Valid only on the P2P Device MAC. The firmware will take into account 361fe959c7bSEmmanuel Grumbach * the duration, the interval and the repetition count. 362fe959c7bSEmmanuel Grumbach * @SESSION_PROTECT_CONF_P2P_GO_NEGOTIATION: Schedule the P2P Device to be be 363fe959c7bSEmmanuel Grumbach * able to run the GO Negotiation. Will not be fragmented and not 364fe959c7bSEmmanuel Grumbach * repetitive. Valid only on the P2P Device MAC. Only the duration will 365fe959c7bSEmmanuel Grumbach * be taken into account. 3661cf260e3SEmmanuel Grumbach * @SESSION_PROTECT_CONF_MAX_ID: not used 367fe959c7bSEmmanuel Grumbach */ 368fe959c7bSEmmanuel Grumbach enum iwl_mvm_session_prot_conf_id { 369fe959c7bSEmmanuel Grumbach SESSION_PROTECT_CONF_ASSOC, 370fe959c7bSEmmanuel Grumbach SESSION_PROTECT_CONF_GO_CLIENT_ASSOC, 371fe959c7bSEmmanuel Grumbach SESSION_PROTECT_CONF_P2P_DEVICE_DISCOV, 372fe959c7bSEmmanuel Grumbach SESSION_PROTECT_CONF_P2P_GO_NEGOTIATION, 3731cf260e3SEmmanuel Grumbach SESSION_PROTECT_CONF_MAX_ID, 374fe959c7bSEmmanuel Grumbach }; /* SESSION_PROTECTION_CONF_ID_E_VER_1 */ 375fe959c7bSEmmanuel Grumbach 376fe959c7bSEmmanuel Grumbach /** 377fe959c7bSEmmanuel Grumbach * struct iwl_mvm_session_prot_cmd - configure a session protection 378fe959c7bSEmmanuel Grumbach * @id_and_color: the id and color of the mac for which this session protection 379fe959c7bSEmmanuel Grumbach * is sent 380*59505471SJohannes Berg * @action: can be either FW_CTXT_ACTION_ADD or FW_CTXT_ACTION_REMOVE, 381*59505471SJohannes Berg * see &enum iwl_ctxt_action 382fe959c7bSEmmanuel Grumbach * @conf_id: see &enum iwl_mvm_session_prot_conf_id 383fe959c7bSEmmanuel Grumbach * @duration_tu: the duration of the whole protection in TUs. 384fe959c7bSEmmanuel Grumbach * @repetition_count: not used 385fe959c7bSEmmanuel Grumbach * @interval: not used 386fe959c7bSEmmanuel Grumbach * 387fe959c7bSEmmanuel Grumbach * Note: the session protection will always be scheduled to start as 388fe959c7bSEmmanuel Grumbach * early as possible, but the maximum delay is configuration dependent. 389fe959c7bSEmmanuel Grumbach * The firmware supports only one concurrent session protection per vif. 390fe959c7bSEmmanuel Grumbach * Adding a new session protection will remove any currently running session. 391fe959c7bSEmmanuel Grumbach */ 392fe959c7bSEmmanuel Grumbach struct iwl_mvm_session_prot_cmd { 393fe959c7bSEmmanuel Grumbach /* COMMON_INDEX_HDR_API_S_VER_1 hdr */ 394fe959c7bSEmmanuel Grumbach __le32 id_and_color; 395fe959c7bSEmmanuel Grumbach __le32 action; 396fe959c7bSEmmanuel Grumbach __le32 conf_id; 397fe959c7bSEmmanuel Grumbach __le32 duration_tu; 398fe959c7bSEmmanuel Grumbach __le32 repetition_count; 399fe959c7bSEmmanuel Grumbach __le32 interval; 400fe959c7bSEmmanuel Grumbach } __packed; /* SESSION_PROTECTION_CMD_API_S_VER_1 */ 401fe959c7bSEmmanuel Grumbach 402fe959c7bSEmmanuel Grumbach /** 403fe959c7bSEmmanuel Grumbach * struct iwl_mvm_session_prot_notif - session protection started / ended 404fe959c7bSEmmanuel Grumbach * @mac_id: the mac id for which the session protection started / ended 405fe959c7bSEmmanuel Grumbach * @status: 1 means success, 0 means failure 406fe959c7bSEmmanuel Grumbach * @start: 1 means the session protection started, 0 means it ended 4071cf260e3SEmmanuel Grumbach * @conf_id: see &enum iwl_mvm_session_prot_conf_id 408fe959c7bSEmmanuel Grumbach * 409fe959c7bSEmmanuel Grumbach * Note that any session protection will always get two notifications: start 410fe959c7bSEmmanuel Grumbach * and end even the firmware could not schedule it. 411fe959c7bSEmmanuel Grumbach */ 412fe959c7bSEmmanuel Grumbach struct iwl_mvm_session_prot_notif { 413fe959c7bSEmmanuel Grumbach __le32 mac_id; 414fe959c7bSEmmanuel Grumbach __le32 status; 415fe959c7bSEmmanuel Grumbach __le32 start; 4164658d552SEmmanuel Grumbach __le32 conf_id; 4174658d552SEmmanuel Grumbach } __packed; /* SESSION_PROTECTION_NOTIFICATION_API_S_VER_2 */ 418fe959c7bSEmmanuel Grumbach 419d172a5efSJohannes Berg #endif /* __iwl_fw_api_time_event_h__ */ 420