net: remove interrupt.h inclusion from netdevice.h
[linux-3.10.git] / drivers / net / wireless / libertas / cmdresp.c
index 83283b8..2ffe5a1 100644 (file)
@@ -1,7 +1,9 @@
-/**
-  * This file contains the handling of command
-  * responses as well as events generated by firmware.
-  */
+/*
+ * This file contains the handling of command
+ * responses as well as events generated by firmware.
+ */
+
+#include <linux/hardirq.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/sched.h>
 #include "cmd.h"
 
 /**
- *  @brief This function handles disconnect event. it
- *  reports disconnect to upper layer, clean tx/rx packets,
- *  reset link state etc.
+ * lbs_mac_event_disconnected - handles disconnect event. It
+ * reports disconnect to upper layer, clean tx/rx packets,
+ * reset link state etc.
  *
- *  @param priv    A pointer to struct lbs_private structure
- *  @return       n/a
+ * @priv:      A pointer to struct lbs_private structure
+ *
+ * returns:    n/a
  */
 void lbs_mac_event_disconnected(struct lbs_private *priv)
 {
@@ -84,15 +87,18 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
        lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, len);
 
        if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
-               lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
-                           le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
+               netdev_info(priv->dev,
+                           "Received CMD_RESP with invalid sequence %d (expected %d)\n",
+                           le16_to_cpu(resp->seqnum),
+                           le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
                spin_unlock_irqrestore(&priv->driver_lock, flags);
                ret = -1;
                goto done;
        }
        if (respcmd != CMD_RET(curcmd) &&
            respcmd != CMD_RET_802_11_ASSOCIATE && curcmd != CMD_802_11_ASSOCIATE) {
-               lbs_pr_info("Invalid CMD_RESP %x to command %x!\n", respcmd, curcmd);
+               netdev_info(priv->dev, "Invalid CMD_RESP %x to command %x!\n",
+                           respcmd, curcmd);
                spin_unlock_irqrestore(&priv->driver_lock, flags);
                ret = -1;
                goto done;
@@ -101,7 +107,8 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
        if (resp->result == cpu_to_le16(0x0004)) {
                /* 0x0004 means -EAGAIN. Drop the response, let it time out
                   and be resubmitted */
-               lbs_pr_info("Firmware returns DEFER to command %x. Will let it time out...\n",
+               netdev_info(priv->dev,
+                           "Firmware returns DEFER to command %x. Will let it time out...\n",
                            le16_to_cpu(resp->command));
                spin_unlock_irqrestore(&priv->driver_lock, flags);
                ret = -1;
@@ -112,9 +119,6 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
        del_timer(&priv->command_timer);
        priv->cmd_timed_out = 0;
 
-       /* Store the response code to cur_cmd_retcode. */
-       priv->cur_cmd_retcode = result;
-
        if (respcmd == CMD_RET(CMD_802_11_PS_MODE)) {
                struct cmd_ds_802_11_ps_mode *psmode = (void *) &resp[1];
                u16 action = le16_to_cpu(psmode->action);
@@ -316,28 +320,28 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
                lbs_deb_cmd("EVENT: ADHOC beacon lost\n");
                break;
        case MACREG_INT_CODE_RSSI_LOW:
-               lbs_pr_alert("EVENT: rssi low\n");
+               netdev_alert(priv->dev, "EVENT: rssi low\n");
                break;
        case MACREG_INT_CODE_SNR_LOW:
-               lbs_pr_alert("EVENT: snr low\n");
+               netdev_alert(priv->dev, "EVENT: snr low\n");
                break;
        case MACREG_INT_CODE_MAX_FAIL:
-               lbs_pr_alert("EVENT: max fail\n");
+               netdev_alert(priv->dev, "EVENT: max fail\n");
                break;
        case MACREG_INT_CODE_RSSI_HIGH:
-               lbs_pr_alert("EVENT: rssi high\n");
+               netdev_alert(priv->dev, "EVENT: rssi high\n");
                break;
        case MACREG_INT_CODE_SNR_HIGH:
-               lbs_pr_alert("EVENT: snr high\n");
+               netdev_alert(priv->dev, "EVENT: snr high\n");
                break;
 
        case MACREG_INT_CODE_MESH_AUTO_STARTED:
                /* Ignore spurious autostart events */
-               lbs_pr_info("EVENT: MESH_AUTO_STARTED (ignoring)\n");
+               netdev_info(priv->dev, "EVENT: MESH_AUTO_STARTED (ignoring)\n");
                break;
 
        default:
-               lbs_pr_alert("EVENT: unknown event id %d\n", event);
+               netdev_alert(priv->dev, "EVENT: unknown event id %d\n", event);
                break;
        }