iwlwifi: virtualize iwl_{grab,release}_nic_access
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl-notif-wait.h
index 5e8af957aa7bf730586dcc235b779df904df7913..821523100cf1e615e227acfeeb37f22dd59a5fa2 100644 (file)
@@ -72,11 +72,19 @@ struct iwl_notif_wait_data {
        wait_queue_head_t notif_waitq;
 };
 
+#define MAX_NOTIF_CMDS 5
+
 /**
  * struct iwl_notification_wait - notification wait entry
  * @list: list head for global list
- * @fn: function called with the notification
- * @cmd: command ID
+ * @fn: Function called with the notification. If the function
+ *     returns true, the wait is over, if it returns false then
+ *     the waiter stays blocked. If no function is given, any
+ *     of the listed commands will unblock the waiter.
+ * @cmds: command IDs
+ * @n_cmds: number of command IDs
+ * @triggered: waiter should be woken up
+ * @aborted: wait was aborted
  *
  * This structure is not used directly, to wait for a
  * notification declare it on the stack, and call
@@ -93,11 +101,12 @@ struct iwl_notif_wait_data {
 struct iwl_notification_wait {
        struct list_head list;
 
-       void (*fn)(struct iwl_notif_wait_data *notif_data,
+       bool (*fn)(struct iwl_notif_wait_data *notif_data,
                   struct iwl_rx_packet *pkt, void *data);
        void *fn_data;
 
-       u8 cmd;
+       u8 cmds[MAX_NOTIF_CMDS];
+       u8 n_cmds;
        bool triggered, aborted;
 };
 
@@ -112,8 +121,8 @@ void iwl_abort_notification_waits(struct iwl_notif_wait_data *notif_data);
 void __acquires(wait_entry)
 iwl_init_notification_wait(struct iwl_notif_wait_data *notif_data,
                           struct iwl_notification_wait *wait_entry,
-                          u8 cmd,
-                          void (*fn)(struct iwl_notif_wait_data *notif_data,
+                          const u8 *cmds, int n_cmds,
+                          bool (*fn)(struct iwl_notif_wait_data *notif_data,
                                      struct iwl_rx_packet *pkt, void *data),
                           void *fn_data);
 
This page took 0.02617 seconds and 5 git commands to generate.