Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6
[pandora-kernel.git] / drivers / net / wireless / iwlwifi / iwl-hcmd.c
index 76f9966..6cff8c1 100644 (file)
@@ -113,7 +113,7 @@ const char *get_cmd_string(u8 cmd)
        }
 }
 
-#define HOST_COMPLETE_TIMEOUT (HZ / 2)
+#define HOST_COMPLETE_TIMEOUT (2 * HZ)
 
 static void iwl_generic_cmd_callback(struct iwl_priv *priv,
                                     struct iwl_device_cmd *cmd,
@@ -143,9 +143,6 @@ static int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 {
        int ret;
 
-       if (WARN_ON(!(cmd->flags & CMD_ASYNC)))
-               return -EINVAL;
-
        /* An asynchronous command can not expect an SKB to be set. */
        if (WARN_ON(cmd->flags & CMD_WANT_SKB))
                return -EINVAL;
@@ -166,13 +163,12 @@ static int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
        return 0;
 }
 
-int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
+static int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 {
        int cmd_idx;
        int ret;
 
-       if (WARN_ON(cmd->flags & CMD_ASYNC))
-               return -EINVAL;
+       lockdep_assert_held(&priv->mutex);
 
         /* A synchronous command can not have a callback set. */
        if (WARN_ON(cmd->callback))
@@ -261,31 +257,15 @@ int iwl_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
        return iwl_send_cmd_sync(priv, cmd);
 }
 
-int iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len, const void *data)
+int iwl_send_cmd_pdu(struct iwl_priv *priv, u8 id, u32 flags, u16 len,
+                    const void *data)
 {
        struct iwl_host_cmd cmd = {
                .id = id,
                .len = { len, },
                .data = { data, },
+               .flags = flags,
        };
 
-       return iwl_send_cmd_sync(priv, &cmd);
-}
-
-int iwl_send_cmd_pdu_async(struct iwl_priv *priv,
-                          u8 id, u16 len, const void *data,
-                          void (*callback)(struct iwl_priv *priv,
-                                           struct iwl_device_cmd *cmd,
-                                           struct iwl_rx_packet *pkt))
-{
-       struct iwl_host_cmd cmd = {
-               .id = id,
-               .len = { len, },
-               .data = { data, },
-       };
-
-       cmd.flags |= CMD_ASYNC;
-       cmd.callback = callback;
-
-       return iwl_send_cmd_async(priv, &cmd);
+       return iwl_send_cmd(priv, &cmd);
 }