1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3  * Copyright (C) 2024-2025 Intel Corporation
4  */
5 #ifndef __iwl_mld_rx_h__
6 #define __iwl_mld_rx_h__
7 
8 #include "mld.h"
9 
10 /**
11  * enum iwl_mld_internal_rxq_notif_type - RX queue sync notif types
12  *
13  * @IWL_MLD_RXQ_EMPTY: empty sync notification
14  * @IWL_MLD_RXQ_NOTIF_DEL_BA: notify RSS queues of delBA
15  */
16 enum iwl_mld_internal_rxq_notif_type {
17 	IWL_MLD_RXQ_EMPTY,
18 	IWL_MLD_RXQ_NOTIF_DEL_BA,
19 };
20 
21 /**
22  * struct iwl_mld_internal_rxq_notif - @iwl_rxq_sync_cmd internal data.
23  * This data is echoed by the firmware to all RSS queues and should be DWORD
24  * aligned. FW is agnostic to the data, so there are no endianness requirements
25  *
26  * @type: one of &iwl_mld_internal_rxq_notif_type
27  * @cookie: unique internal cookie to identify old notifications
28  * @reserved: reserved for alignment
29  * @payload: data to send to RX queues based on the type (may be empty)
30  */
31 struct iwl_mld_internal_rxq_notif {
32 	u8 type;
33 	u8 reserved[3];
34 	u32 cookie;
35 	u8 payload[];
36 } __packed;
37 
38 /**
39  * struct iwl_mld_rx_queues_sync - RX queues sync data
40  *
41  * @waitq: wait queue for RX queues sync completion
42  * @cookie: unique id to correlate sync requests with responses
43  * @state: bitmask representing the sync state of RX queues
44  *	all RX queues bits are set before sending the command, and the
45  *	corresponding queue bit cleared upon handling the notification
46  */
47 struct iwl_mld_rx_queues_sync {
48 	wait_queue_head_t waitq;
49 	u32 cookie;
50 	unsigned long state;
51 };
52 
53 void iwl_mld_rx_mpdu(struct iwl_mld *mld, struct napi_struct *napi,
54 		     struct iwl_rx_cmd_buffer *rxb, int queue);
55 
56 void iwl_mld_sync_rx_queues(struct iwl_mld *mld,
57 			    enum iwl_mld_internal_rxq_notif_type type,
58 			    const void *notif_payload, u32 notif_payload_size);
59 
60 void iwl_mld_handle_rx_queues_sync_notif(struct iwl_mld *mld,
61 					 struct napi_struct *napi,
62 					 struct iwl_rx_packet *pkt, int queue);
63 
64 void iwl_mld_pass_packet_to_mac80211(struct iwl_mld *mld,
65 				     struct napi_struct *napi,
66 				     struct sk_buff *skb, int queue,
67 				     struct ieee80211_sta *sta);
68 
69 void iwl_mld_rx_monitor_no_data(struct iwl_mld *mld, struct napi_struct *napi,
70 				struct iwl_rx_packet *pkt, int queue);
71 
72 #endif /* __iwl_mld_agg_h__ */
73