aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-notif-wait.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-notif-wait.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-notif-wait.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-notif-wait.h b/drivers/net/wireless/iwlwifi/iwl-notif-wait.h
index 5e8af957aa7b..821523100cf1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-notif-wait.h
+++ b/drivers/net/wireless/iwlwifi/iwl-notif-wait.h
@@ -72,11 +72,19 @@ struct iwl_notif_wait_data {
72 wait_queue_head_t notif_waitq; 72 wait_queue_head_t notif_waitq;
73}; 73};
74 74
75#define MAX_NOTIF_CMDS 5
76
75/** 77/**
76 * struct iwl_notification_wait - notification wait entry 78 * struct iwl_notification_wait - notification wait entry
77 * @list: list head for global list 79 * @list: list head for global list
78 * @fn: function called with the notification 80 * @fn: Function called with the notification. If the function
79 * @cmd: command ID 81 * returns true, the wait is over, if it returns false then
82 * the waiter stays blocked. If no function is given, any
83 * of the listed commands will unblock the waiter.
84 * @cmds: command IDs
85 * @n_cmds: number of command IDs
86 * @triggered: waiter should be woken up
87 * @aborted: wait was aborted
80 * 88 *
81 * This structure is not used directly, to wait for a 89 * This structure is not used directly, to wait for a
82 * notification declare it on the stack, and call 90 * notification declare it on the stack, and call
@@ -93,11 +101,12 @@ struct iwl_notif_wait_data {
93struct iwl_notification_wait { 101struct iwl_notification_wait {
94 struct list_head list; 102 struct list_head list;
95 103
96 void (*fn)(struct iwl_notif_wait_data *notif_data, 104 bool (*fn)(struct iwl_notif_wait_data *notif_data,
97 struct iwl_rx_packet *pkt, void *data); 105 struct iwl_rx_packet *pkt, void *data);
98 void *fn_data; 106 void *fn_data;
99 107
100 u8 cmd; 108 u8 cmds[MAX_NOTIF_CMDS];
109 u8 n_cmds;
101 bool triggered, aborted; 110 bool triggered, aborted;
102}; 111};
103 112
@@ -112,8 +121,8 @@ void iwl_abort_notification_waits(struct iwl_notif_wait_data *notif_data);
112void __acquires(wait_entry) 121void __acquires(wait_entry)
113iwl_init_notification_wait(struct iwl_notif_wait_data *notif_data, 122iwl_init_notification_wait(struct iwl_notif_wait_data *notif_data,
114 struct iwl_notification_wait *wait_entry, 123 struct iwl_notification_wait *wait_entry,
115 u8 cmd, 124 const u8 *cmds, int n_cmds,
116 void (*fn)(struct iwl_notif_wait_data *notif_data, 125 bool (*fn)(struct iwl_notif_wait_data *notif_data,
117 struct iwl_rx_packet *pkt, void *data), 126 struct iwl_rx_packet *pkt, void *data),
118 void *fn_data); 127 void *fn_data);
119 128