iwlwifi: update copyright year to 2009
[safe/jmp/linux-2.6] / drivers / net / wireless / iwlwifi / iwl-hcmd.c
index 2eb03ee..65ae2af 100644 (file)
@@ -2,7 +2,7 @@
  *
  * GPL LICENSE SUMMARY
  *
- * Copyright(c) 2008 Intel Corporation. All rights reserved.
+ * Copyright(c) 2008 - 2009 Intel Corporation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of version 2 of the GNU General Public License as
@@ -22,7 +22,7 @@
  * in the file called LICENSE.GPL.
  *
  * Contact Information:
- * Tomas Winkler <tomas.winkler@intel.com>
+ *  Intel Linux Wireless <ilw@linux.intel.com>
  * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  *****************************************************************************/
 
@@ -36,7 +36,7 @@
 #include "iwl-core.h"
 
 
-#define IWL_CMD(x) case x : return #x
+#define IWL_CMD(x) case x: return #x
 
 const char *get_cmd_string(u8 cmd)
 {
@@ -51,6 +51,7 @@ const char *get_cmd_string(u8 cmd)
                IWL_CMD(REPLY_REMOVE_STA);
                IWL_CMD(REPLY_REMOVE_ALL_STA);
                IWL_CMD(REPLY_WEPKEY);
+               IWL_CMD(REPLY_3945_RX);
                IWL_CMD(REPLY_TX);
                IWL_CMD(REPLY_RATE_SCALE);
                IWL_CMD(REPLY_LEDS_CMD);
@@ -108,20 +109,30 @@ static int iwl_generic_cmd_callback(struct iwl_priv *priv,
        struct iwl_rx_packet *pkt = NULL;
 
        if (!skb) {
-               IWL_ERROR("Error: Response NULL in %s.\n",
+               IWL_ERR(priv, "Error: Response NULL in %s.\n",
                                get_cmd_string(cmd->hdr.cmd));
                return 1;
        }
 
        pkt = (struct iwl_rx_packet *)skb->data;
        if (pkt->hdr.flags & IWL_CMD_FAILED_MSK) {
-               IWL_ERROR("Bad return from %s (0x%08X)\n",
+               IWL_ERR(priv, "Bad return from %s (0x%08X)\n",
                        get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);
                return 1;
        }
 
-       IWL_DEBUG_HC("back from %s (0x%08X)\n",
-                       get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);
+#ifdef CONFIG_IWLWIFI_DEBUG
+       switch (cmd->hdr.cmd) {
+       case REPLY_TX_LINK_QUALITY_CMD:
+       case SENSITIVITY_CMD:
+               IWL_DEBUG_HC_DUMP("back from %s (0x%08X)\n",
+                               get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);
+                               break;
+       default:
+               IWL_DEBUG_HC("back from %s (0x%08X)\n",
+                               get_cmd_string(cmd->hdr.cmd), pkt->hdr.flags);
+       }
+#endif
 
        /* Let iwl_tx_complete free the response skb */
        return 1;
@@ -145,7 +156,7 @@ static int iwl_send_cmd_async(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
 
        ret = iwl_enqueue_hcmd(priv, cmd);
        if (ret < 0) {
-               IWL_ERROR("Error sending %s: enqueue_hcmd failed: %d\n",
+               IWL_ERR(priv, "Error sending %s: enqueue_hcmd failed: %d\n",
                          get_cmd_string(cmd->id), ret);
                return ret;
        }
@@ -163,8 +174,9 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
        BUG_ON(cmd->meta.u.callback != NULL);
 
        if (test_and_set_bit(STATUS_HCMD_SYNC_ACTIVE, &priv->status)) {
-               IWL_ERROR("Error sending %s: Already sending a host command\n",
-                         get_cmd_string(cmd->id));
+               IWL_ERR(priv,
+                       "Error sending %s: Already sending a host command\n",
+                       get_cmd_string(cmd->id));
                ret = -EBUSY;
                goto out;
        }
@@ -177,7 +189,7 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
        cmd_idx = iwl_enqueue_hcmd(priv, cmd);
        if (cmd_idx < 0) {
                ret = cmd_idx;
-               IWL_ERROR("Error sending %s: enqueue_hcmd failed: %d\n",
+               IWL_ERR(priv, "Error sending %s: enqueue_hcmd failed: %d\n",
                          get_cmd_string(cmd->id), ret);
                goto out;
        }
@@ -187,9 +199,10 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
                        HOST_COMPLETE_TIMEOUT);
        if (!ret) {
                if (test_bit(STATUS_HCMD_ACTIVE, &priv->status)) {
-                       IWL_ERROR("Error sending %s: time out after %dms.\n",
-                                 get_cmd_string(cmd->id),
-                                 jiffies_to_msecs(HOST_COMPLETE_TIMEOUT));
+                       IWL_ERR(priv,
+                               "Error sending %s: time out after %dms.\n",
+                               get_cmd_string(cmd->id),
+                               jiffies_to_msecs(HOST_COMPLETE_TIMEOUT));
 
                        clear_bit(STATUS_HCMD_ACTIVE, &priv->status);
                        ret = -ETIMEDOUT;
@@ -210,10 +223,10 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
                goto fail;
        }
        if ((cmd->meta.flags & CMD_WANT_SKB) && !cmd->meta.u.skb) {
-               IWL_ERROR("Error: Response NULL in '%s'\n",
+               IWL_ERR(priv, "Error: Response NULL in '%s'\n",
                          get_cmd_string(cmd->id));
                ret = -EIO;
-               goto out;
+               goto cancel;
        }
 
        ret = 0;