Staging: wlan-ng: Replace WLAN_LOG_DEBUG() with printk(KERN_DEBUG
[linux-block.git] / drivers / staging / wlan-ng / prism2mgmt.c
index f1727ba6ec6f8c7181064d20b53aef087e9e2dac..953142ae9296d0aae44226cabe6c4c5ba41b6e32 100644 (file)
@@ -59,8 +59,6 @@
 
 /*================================================================*/
 /* System Includes */
-#define WLAN_DBVAR     prism2_debug
-
 
 #include <linux/if_arp.h>
 #include <linux/module.h>
@@ -76,6 +74,7 @@
 #include <asm/byteorder.h>
 #include <linux/random.h>
 #include <linux/usb.h>
+#include <linux/bitops.h>
 
 #include "wlan_compat.h"
 
 #include "prism2mgmt.h"
 
 /* Converts 802.11 format rate specifications to prism2 */
-#define p80211rate_to_p2bit(n) ((((n)&~BIT7) == 2) ? BIT0 : \
-                                (((n)&~BIT7) == 4) ? BIT1 : \
-                                (((n)&~BIT7) == 11) ? BIT2 : \
-                                (((n)&~BIT7) == 22) ? BIT3 : 0)
+#define p80211rate_to_p2bit(n) ((((n)&~BIT(7)) == 2) ? BIT(0) :  \
+                                (((n)&~BIT(7)) == 4) ? BIT(1) : \
+                                (((n)&~BIT(7)) == 11) ? BIT(2) : \
+                                (((n)&~BIT(7)) == 22) ? BIT(3) : 0)
 
 /*----------------------------------------------------------------
 * prism2mgmt_scan
@@ -134,14 +133,12 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
 
         hfa384x_HostScanRequest_data_t  scanreq;
 
-       DBFENTER;
-
         /* gatekeeper check */
         if (HFA384x_FIRMWARE_VERSION(hw->ident_sta_fw.major,
                                      hw->ident_sta_fw.minor,
                                      hw->ident_sta_fw.variant) <
             HFA384x_FIRMWARE_VERSION(1,3,2)) {
-               WLAN_LOG_ERROR("HostScan not supported with current firmware (<1.3.2).\n");
+               printk(KERN_ERR "HostScan not supported with current firmware (<1.3.2).\n");
                 result = 1;
                 msg->resultcode.data = P80211ENUM_resultcode_not_supported;
                goto exit;
@@ -153,7 +150,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
         result = hfa384x_drvr_getconfig16(hw,
                         HFA384x_RID_CNFROAMINGMODE, &roamingmode);
         if ( result ) {
-                WLAN_LOG_ERROR("getconfig(ROAMMODE) failed. result=%d\n",
+                printk(KERN_ERR "getconfig(ROAMMODE) failed. result=%d\n",
                                 result);
                 msg->resultcode.data =
                         P80211ENUM_resultcode_implementation_failure;
@@ -165,7 +162,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
                         HFA384x_RID_CNFROAMINGMODE,
                        HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM);
         if ( result ) {
-                WLAN_LOG_ERROR("setconfig(ROAMINGMODE) failed. result=%d\n",
+                printk(KERN_ERR "setconfig(ROAMINGMODE) failed. result=%d\n",
                                 result);
                 msg->resultcode.data =
                         P80211ENUM_resultcode_implementation_failure;
@@ -184,7 +181,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
                 }
                 result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPASSIVESCANCTRL, word);
                 if ( result ) {
-                        WLAN_LOG_WARNING("Passive scan not supported with "
+                        printk(KERN_WARNING "Passive scan not supported with "
                                          "current firmware.  (<1.5.1)\n");
                 }
         }
@@ -198,7 +195,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
         for (i = 0; i < msg->channellist.data.len; i++) {
                 u8 channel = msg->channellist.data.data[i];
                 if (channel > 14) continue;
-                /* channel 1 is BIT0 ... channel 14 is BIT13 */
+                /* channel 1 is BIT 0 ... channel 14 is BIT 13 */
                 word |= (1 << (channel-1));
         }
         scanreq.channelList = host2hfa384x_16(word);
@@ -210,7 +207,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
        /* Enable the MAC port if it's not already enabled  */
        result = hfa384x_drvr_getconfig16(hw, HFA384x_RID_PORTSTATUS, &word);
        if ( result ) {
-               WLAN_LOG_ERROR("getconfig(PORTSTATUS) failed. "
+               printk(KERN_ERR "getconfig(PORTSTATUS) failed. "
                                "result=%d\n", result);
                msg->resultcode.data =
                        P80211ENUM_resultcode_implementation_failure;
@@ -223,7 +220,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
                        HFA384x_RID_CNFROAMINGMODE,
                        HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM);
                if ( result ) {
-                       WLAN_LOG_ERROR("setconfig(ROAMINGMODE) failed. result=%d\n", result);
+                       printk(KERN_ERR "setconfig(ROAMINGMODE) failed. result=%d\n", result);
                        msg->resultcode.data =
                                P80211ENUM_resultcode_implementation_failure;
                        goto exit;
@@ -236,7 +233,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
                result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFOWNSSID,
                                wordbuf, HFA384x_RID_CNFOWNSSID_LEN);
                if ( result ) {
-                       WLAN_LOG_ERROR("Failed to set OwnSSID.\n");
+                       printk(KERN_ERR "Failed to set OwnSSID.\n");
                        msg->resultcode.data =
                                P80211ENUM_resultcode_implementation_failure;
                        goto exit;
@@ -244,7 +241,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
                result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFDESIREDSSID,
                                wordbuf, HFA384x_RID_CNFDESIREDSSID_LEN);
                if ( result ) {
-                       WLAN_LOG_ERROR("Failed to set DesiredSSID.\n");
+                       printk(KERN_ERR "Failed to set DesiredSSID.\n");
                        msg->resultcode.data =
                                P80211ENUM_resultcode_implementation_failure;
                        goto exit;
@@ -254,7 +251,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
                                HFA384x_RID_CNFPORTTYPE,
                                HFA384x_PORTTYPE_IBSS);
                if ( result ) {
-                       WLAN_LOG_ERROR("Failed to set CNFPORTTYPE.\n");
+                       printk(KERN_ERR "Failed to set CNFPORTTYPE.\n");
                        msg->resultcode.data =
                                P80211ENUM_resultcode_implementation_failure;
                        goto exit;
@@ -264,14 +261,14 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
                                HFA384x_RID_CREATEIBSS,
                                HFA384x_CREATEIBSS_JOINCREATEIBSS);
                if ( result ) {
-                       WLAN_LOG_ERROR("Failed to set CREATEIBSS.\n");
+                       printk(KERN_ERR "Failed to set CREATEIBSS.\n");
                        msg->resultcode.data =
                                P80211ENUM_resultcode_implementation_failure;
                        goto exit;
                }
                result = hfa384x_drvr_enable(hw, 0);
                if ( result ) {
-                       WLAN_LOG_ERROR("drvr_enable(0) failed. "
+                       printk(KERN_ERR "drvr_enable(0) failed. "
                                        "result=%d\n", result);
                        msg->resultcode.data =
                        P80211ENUM_resultcode_implementation_failure;
@@ -287,13 +284,11 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
         /* Issue the scan request */
         hw->scanflag = 0;
 
-       WLAN_HEX_DUMP(5,"hscanreq", &scanreq, sizeof(scanreq));
-
         result = hfa384x_drvr_setconfig( hw,
                         HFA384x_RID_HOSTSCAN, &scanreq,
                         sizeof(hfa384x_HostScanRequest_data_t));
         if ( result ) {
-                WLAN_LOG_ERROR("setconfig(SCANREQUEST) failed. result=%d\n",
+                printk(KERN_ERR "setconfig(SCANREQUEST) failed. result=%d\n",
                                 result);
                 msg->resultcode.data =
                         P80211ENUM_resultcode_implementation_failure;
@@ -315,7 +310,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
        if (istmpenable) {
                result = hfa384x_drvr_disable(hw, 0);
                if ( result ) {
-                       WLAN_LOG_ERROR("drvr_disable(0) failed. "
+                       printk(KERN_ERR "drvr_disable(0) failed. "
                                        "result=%d\n", result);
                        msg->resultcode.data =
                        P80211ENUM_resultcode_implementation_failure;
@@ -327,7 +322,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
        result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFROAMINGMODE,
                                          roamingmode);
         if ( result ) {
-                WLAN_LOG_ERROR("setconfig(ROAMMODE) failed. result=%d\n",
+                printk(KERN_ERR "setconfig(ROAMMODE) failed. result=%d\n",
                                 result);
                 msg->resultcode.data =
                         P80211ENUM_resultcode_implementation_failure;
@@ -340,7 +335,6 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
  exit:
        msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
 
-       DBFEXIT;
        return result;
 }
 
@@ -374,14 +368,12 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
 
        int count;
 
-       DBFENTER;
-
         req = (p80211msg_dot11req_scan_results_t *) msgp;
 
        req->resultcode.status = P80211ENUM_msgitem_status_data_ok;
 
        if (! hw->scanresults) {
-               WLAN_LOG_ERROR("dot11req_scan_results can only be used after a successful dot11req_scan.\n");
+               printk(KERN_ERR "dot11req_scan_results can only be used after a successful dot11req_scan.\n");
                result = 2;
                req->resultcode.data = P80211ENUM_resultcode_invalid_parameters;
                goto exit;
@@ -391,7 +383,7 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
        if (count > 32)  count = 32;
 
        if (req->bssindex.data >= count) {
-               WLAN_LOG_DEBUG(0, "requested index (%d) out of range (%d)\n",
+               pr_debug("requested index (%d) out of range (%d)\n",
                                req->bssindex.data, count);
                result = 2;
                req->resultcode.data = P80211ENUM_resultcode_invalid_parameters;
@@ -502,7 +494,6 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
        req->resultcode.data = P80211ENUM_resultcode_success;
 
  exit:
-       DBFEXIT;
        return result;
 }
 
@@ -535,7 +526,6 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
        u8                      bytebuf[80];
        hfa384x_bytestr_t       *p2bytestr = (hfa384x_bytestr_t*)bytebuf;
        u16                     word;
-       DBFENTER;
 
        wlandev->macmode = WLAN_MACMODE_NONE;
 
@@ -564,13 +554,13 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
        result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFOWNSSID,
                                         bytebuf, HFA384x_RID_CNFOWNSSID_LEN);
        if ( result ) {
-               WLAN_LOG_ERROR("Failed to set CnfOwnSSID\n");
+               printk(KERN_ERR "Failed to set CnfOwnSSID\n");
                goto failed;
        }
        result = hfa384x_drvr_setconfig( hw, HFA384x_RID_CNFDESIREDSSID,
                                         bytebuf, HFA384x_RID_CNFDESIREDSSID_LEN);
        if ( result ) {
-               WLAN_LOG_ERROR("Failed to set CnfDesiredSSID\n");
+               printk(KERN_ERR "Failed to set CnfDesiredSSID\n");
                goto failed;
        }
 
@@ -582,7 +572,7 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
        word = msg->beaconperiod.data;
        result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFAPBCNint, word);
        if ( result ) {
-               WLAN_LOG_ERROR("Failed to set beacon period=%d.\n", word);
+               printk(KERN_ERR "Failed to set beacon period=%d.\n", word);
                goto failed;
        }
 
@@ -590,7 +580,7 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
        word = msg->dschannel.data;
        result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFOWNCHANNEL, word);
        if ( result ) {
-               WLAN_LOG_ERROR("Failed to set channel=%d.\n", word);
+               printk(KERN_ERR "Failed to set channel=%d.\n", word);
                goto failed;
        }
        /* Basic rates */
@@ -618,7 +608,7 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
        }
        result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFBASICRATES, word);
        if ( result ) {
-               WLAN_LOG_ERROR("Failed to set basicrates=%d.\n", word);
+               printk(KERN_ERR "Failed to set basicrates=%d.\n", word);
                goto failed;
        }
 
@@ -647,13 +637,13 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
        }
        result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFSUPPRATES, word);
        if ( result ) {
-               WLAN_LOG_ERROR("Failed to set supprates=%d.\n", word);
+               printk(KERN_ERR "Failed to set supprates=%d.\n", word);
                goto failed;
        }
 
        result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_TXRATECNTL, word);
        if ( result ) {
-               WLAN_LOG_ERROR("Failed to set txrates=%d.\n", word);
+               printk(KERN_ERR "Failed to set txrates=%d.\n", word);
                goto failed;
        }
 
@@ -667,7 +657,7 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
        /* Enable the Port */
        result = hfa384x_drvr_enable(hw, 0);
        if ( result ) {
-               WLAN_LOG_ERROR("Enable macport failed, result=%d.\n", result);
+               printk(KERN_ERR "Enable macport failed, result=%d.\n", result);
                goto failed;
        }
 
@@ -675,13 +665,12 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
 
        goto done;
 failed:
-       WLAN_LOG_DEBUG(1, "Failed to set a config option, result=%d\n", result);
+       pr_debug("Failed to set a config option, result=%d\n", result);
        msg->resultcode.data = P80211ENUM_resultcode_invalid_parameters;
 
 done:
        result = 0;
 
-       DBFEXIT;
        return result;
 }
 
@@ -708,13 +697,12 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
        hfa384x_t               *hw = wlandev->priv;
        p80211msg_p2req_readpda_t       *msg = msgp;
        int                             result;
-       DBFENTER;
 
        /* We only support collecting the PDA when in the FWLOAD
         * state.
         */
        if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-               WLAN_LOG_ERROR(
+               printk(KERN_ERR
                        "PDA may only be read "
                        "in the fwload state.\n");
                msg->resultcode.data =
@@ -729,7 +717,7 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
                        msg->pda.data,
                        HFA384x_PDA_LEN_MAX);
                if (result) {
-                       WLAN_LOG_ERROR(
+                       printk(KERN_ERR
                                "hfa384x_drvr_readpda() failed, "
                                "result=%d\n",
                                result);
@@ -738,7 +726,6 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
                                P80211ENUM_resultcode_implementation_failure;
                        msg->resultcode.status =
                                P80211ENUM_msgitem_status_data_ok;
-                       DBFEXIT;
                        return 0;
                }
                msg->pda.status = P80211ENUM_msgitem_status_data_ok;
@@ -746,7 +733,6 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
                msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
        }
 
-       DBFEXIT;
        return 0;
 }
 
@@ -779,16 +765,14 @@ int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp)
 {
        hfa384x_t               *hw = wlandev->priv;
        p80211msg_p2req_ramdl_state_t   *msg = msgp;
-       DBFENTER;
 
        if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-               WLAN_LOG_ERROR(
+               printk(KERN_ERR
                        "ramdl_state(): may only be called "
                        "in the fwload state.\n");
                msg->resultcode.data =
                        P80211ENUM_resultcode_implementation_failure;
                msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
-               DBFEXIT;
                return 0;
        }
 
@@ -809,7 +793,6 @@ int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp)
                msg->resultcode.data = P80211ENUM_resultcode_success;
        }
 
-       DBFEXIT;
        return 0;
 }
 
@@ -841,16 +824,14 @@ int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp)
        u32                     addr;
        u32                     len;
        u8                      *buf;
-       DBFENTER;
 
        if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-               WLAN_LOG_ERROR(
+               printk(KERN_ERR
                        "ramdl_write(): may only be called "
                        "in the fwload state.\n");
                msg->resultcode.data =
                        P80211ENUM_resultcode_implementation_failure;
                msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
-               DBFEXIT;
                return 0;
        }
 
@@ -870,7 +851,6 @@ int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp)
        }
        msg->resultcode.data = P80211ENUM_resultcode_success;
 
-       DBFEXIT;
        return 0;
 }
 
@@ -905,16 +885,14 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
        int                     result = 0;
        hfa384x_t               *hw = wlandev->priv;
        p80211msg_p2req_flashdl_state_t *msg = msgp;
-       DBFENTER;
 
        if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-               WLAN_LOG_ERROR(
+               printk(KERN_ERR
                        "flashdl_state(): may only be called "
                        "in the fwload state.\n");
                msg->resultcode.data =
                        P80211ENUM_resultcode_implementation_failure;
                msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
-               DBFEXIT;
                return 0;
        }
 
@@ -943,7 +921,7 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
                wlandev->msdstate = WLAN_MSD_HWPRESENT;
                result = prism2sta_ifstate(wlandev, P80211ENUM_ifstate_fwload);
                if (result != P80211ENUM_resultcode_success) {
-                       WLAN_LOG_ERROR("prism2sta_ifstate(fwload) failed,"
+                       printk(KERN_ERR "prism2sta_ifstate(fwload) failed,"
                                "P80211ENUM_resultcode=%d\n", result);
                        msg->resultcode.data =
                                P80211ENUM_resultcode_implementation_failure;
@@ -951,7 +929,6 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
                }
        }
 
-       DBFEXIT;
        return 0;
 }
 
@@ -981,16 +958,14 @@ int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp)
        u32                     addr;
        u32                     len;
        u8                      *buf;
-       DBFENTER;
 
        if (wlandev->msdstate != WLAN_MSD_FWLOAD) {
-               WLAN_LOG_ERROR(
+               printk(KERN_ERR
                        "flashdl_write(): may only be called "
                        "in the fwload state.\n");
                msg->resultcode.data =
                        P80211ENUM_resultcode_implementation_failure;
                msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
-               DBFEXIT;
                return 0;
        }
 
@@ -1016,7 +991,6 @@ int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp)
        }
        msg->resultcode.data = P80211ENUM_resultcode_success;
 
-       DBFEXIT;
        return 0;
 }
 
@@ -1049,7 +1023,6 @@ int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp)
        p80211pstrd_t           *pstr;
        u8                      bytebuf[256];
        hfa384x_bytestr_t       *p2bytestr = (hfa384x_bytestr_t*)bytebuf;
-       DBFENTER;
 
        wlandev->macmode = WLAN_MACMODE_NONE;
 
@@ -1078,25 +1051,7 @@ int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp)
         result = hfa384x_drvr_setconfig(
                        hw, HFA384x_RID_CNFDESIREDSSID,
                        bytebuf, HFA384x_RID_CNFDESIREDSSID_LEN);
-#if 0
-       /* we can use the new-fangled auto-unknown mode if the firmware
-          is 1.3.3 or newer */
-       if (HFA384x_FIRMARE_VERSION(hw->ident_sta_fw.major,
-                                   hw->ident_sta_fw.minor,
-                                   hw->ident_sta_fw.variant) >=
-           HFA384x_FIRMWARE_VERSION(1,3,3)) {
-               /* Set up the IBSS options */
-               reg =  HFA384x_CREATEIBSS_JOINESS_JOINCREATEIBSS;
-               hfa384x_drvr_setconfig16(hw, HFA384x_RID_CREATEIBSS, reg);
-
-               /* Set the PortType */
-               port_type = HFA384x_PORTTYPE_IBSS;
-       } else {
-               port_type = HFA384x_PORTTYPE_BSS;
-       }
-#else
        port_type = HFA384x_PORTTYPE_BSS;
-#endif
        /* Set the PortType */
        hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFPORTTYPE, port_type);
 
@@ -1107,7 +1062,6 @@ int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp)
        msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
        msg->resultcode.data = P80211ENUM_resultcode_success;
 
-       DBFEXIT;
        return result;
 }
 
@@ -1139,8 +1093,6 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
        hfa384x_t                       *hw = wlandev->priv;
        u16                     word;
 
-       DBFENTER;
-
        msg->resultcode.status = P80211ENUM_msgitem_status_data_ok;
        switch (msg->enable.data)
        {
@@ -1154,7 +1106,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                /* Disable monitor mode */
                result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_DISABLE);
                if ( result ) {
-                       WLAN_LOG_DEBUG(1,
+                       pr_debug(
                                "failed to disable monitor mode, result=%d\n",
                                result);
                        goto failed;
@@ -1162,7 +1114,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                /* Disable port 0 */
                result = hfa384x_drvr_disable(hw, 0);
                if ( result ) {
-                       WLAN_LOG_DEBUG(1,
+                       pr_debug(
                        "failed to disable port 0 after sniffing, result=%d\n",
                        result);
                        goto failed;
@@ -1175,7 +1127,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                                HFA384x_RID_CNFWEPFLAGS,
                                hw->presniff_wepflags);
                if ( result ) {
-                       WLAN_LOG_DEBUG(1,
+                       pr_debug(
                        "failed to restore wepflags=0x%04x, result=%d\n",
                        hw->presniff_wepflags,
                        result);
@@ -1188,7 +1140,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                        result = hfa384x_drvr_setconfig16(hw,
                                HFA384x_RID_CNFPORTTYPE, word);
                        if ( result ) {
-                               WLAN_LOG_DEBUG(1,
+                               pr_debug(
                                "failed to restore porttype, result=%d\n",
                                result);
                                goto failed;
@@ -1197,7 +1149,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                        /* Enable the port */
                        result = hfa384x_drvr_enable(hw, 0);
                        if ( result ) {
-                               WLAN_LOG_DEBUG(1, "failed to enable port to presniff setting, result=%d\n", result);
+                               pr_debug("failed to enable port to presniff setting, result=%d\n", result);
                                goto failed;
                        }
                } else {
@@ -1205,7 +1157,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
 
                }
 
-               WLAN_LOG_INFO("monitor mode disabled\n");
+               printk(KERN_INFO "monitor mode disabled\n");
                msg->resultcode.data = P80211ENUM_resultcode_success;
                result = 0;
                goto exit;
@@ -1219,7 +1171,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                                                                  HFA384x_RID_CNFPORTTYPE,
                                                                  &(hw->presniff_port_type));
                                if ( result ) {
-                                       WLAN_LOG_DEBUG(1,"failed to read porttype, result=%d\n", result);
+                                       pr_debug("failed to read porttype, result=%d\n", result);
                                        goto failed;
                                }
                                /* Save the wepflags state */
@@ -1227,13 +1179,13 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                                                                  HFA384x_RID_CNFWEPFLAGS,
                                                                  &(hw->presniff_wepflags));
                                if ( result ) {
-                                       WLAN_LOG_DEBUG(1,"failed to read wepflags, result=%d\n", result);
+                                       pr_debug("failed to read wepflags, result=%d\n", result);
                                        goto failed;
                                }
                                hfa384x_drvr_stop(hw);
                                result = hfa384x_drvr_start(hw);
                                if ( result ) {
-                                       WLAN_LOG_DEBUG(1,
+                                       pr_debug(
                                                       "failed to restart the card for sniffing, result=%d\n",
                                                       result);
                                        goto failed;
@@ -1242,7 +1194,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                                /* Disable the port */
                                result = hfa384x_drvr_disable(hw, 0);
                                if ( result ) {
-                                       WLAN_LOG_DEBUG(1,
+                                       pr_debug(
                                                       "failed to enable port for sniffing, result=%d\n",
                                                       result);
                                        goto failed;
@@ -1259,7 +1211,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                hw->sniff_channel=word;
 
                if ( result ) {
-                       WLAN_LOG_DEBUG(1,
+                       pr_debug(
                                       "failed to set channel %d, result=%d\n",
                                               word,
                                       result);
@@ -1273,7 +1225,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                        result = hfa384x_drvr_setconfig16(hw,
                                                          HFA384x_RID_CNFPORTTYPE, word);
                        if ( result ) {
-                               WLAN_LOG_DEBUG(1,
+                               pr_debug(
                                               "failed to set porttype %d, result=%d\n",
                                               word,
                                               result);
@@ -1287,7 +1239,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                        }
 
                        if ( result ) {
-                               WLAN_LOG_DEBUG(1,
+                               pr_debug(
                                               "failed to set wepflags=0x%04x, result=%d\n",
                                               word,
                                               result);
@@ -1312,7 +1264,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                /* Enable the port */
                result = hfa384x_drvr_enable(hw, 0);
                if ( result ) {
-                       WLAN_LOG_DEBUG(1,
+                       pr_debug(
                        "failed to enable port for sniffing, result=%d\n",
                        result);
                        goto failed;
@@ -1320,14 +1272,14 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
                /* Enable monitor mode */
                result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_ENABLE);
                if ( result ) {
-                       WLAN_LOG_DEBUG(1,
+                       pr_debug(
                        "failed to enable monitor mode, result=%d\n",
                        result);
                        goto failed;
                }
 
                if (wlandev->netdev->type == ARPHRD_ETHER) {
-                       WLAN_LOG_INFO("monitor mode enabled\n");
+                       printk(KERN_INFO "monitor mode enabled\n");
                }
 
                /* Set the driver state */
@@ -1357,7 +1309,5 @@ failed:
        msg->resultcode.data = P80211ENUM_resultcode_refused;
        result = 0;
 exit:
-
-       DBFEXIT;
        return result;
 }