staging: rtl8192e: Replace RT_TRACE(COMP_ERR, ...) with netdev_*
authorMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Sun, 31 May 2015 18:19:50 +0000 (20:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 May 2015 21:33:23 +0000 (06:33 +0900)
- Use netdev_* with log level depending on how serious error is
- Rework some messages to be more readable
- Pass net_device where needed for pretty prints

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
drivers/staging/rtl8192e/rtl8192e/rtl_core.c
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c

index f080a913709f9cf028671d073701b97fdeed85f9..facc6f1f302bf212f24a8634a47a3987f156c17b 100644 (file)
@@ -47,8 +47,8 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev,
                                                0x0e, bMask12Bits, 0x021);
 
                        } else {
-                               RT_TRACE(COMP_ERR,
-                                        "PHY_SetRF8256Bandwidth(): unknown hardware version\n");
+                               netdev_warn(dev, "%s(): Unknown HW version.\n",
+                                           __func__);
                        }
 
                        break;
@@ -66,16 +66,15 @@ void PHY_SetRF8256Bandwidth(struct net_device *dev,
                                                 0x0e, bMask12Bits, 0x0e1);
 
                        } else {
-                               RT_TRACE(COMP_ERR,
-                                        "PHY_SetRF8256Bandwidth(): unknown hardware version\n");
+                               netdev_warn(dev, "%s(): Unknown HW version.\n",
+                                           __func__);
                        }
 
 
                        break;
                default:
-                       RT_TRACE(COMP_ERR,
-                                "PHY_SetRF8256Bandwidth(): unknown Bandwidth: %#X\n",
-                                Bandwidth);
+                       netdev_err(dev, "%s(): Unknown bandwidth: %#X\n",
+                                  __func__, Bandwidth);
                        break;
 
                }
@@ -139,9 +138,8 @@ bool phy_RF8256_Config_ParaFile(struct net_device *dev)
                rtStatus = rtl8192_phy_checkBBAndRF(dev, HW90_BLOCK_RF,
                                                (enum rf90_radio_path)eRFPath);
                if (!rtStatus) {
-                       RT_TRACE(COMP_ERR,
-                                "PHY_RF8256_Config():Check Radio[%d] Fail!!\n",
-                                eRFPath);
+                       netdev_err(dev, "%s(): Failed to check RF Path %d.\n",
+                                  __func__, eRFPath);
                        goto phy_RF8256_Config_ParaFile_Fail;
                }
 
@@ -227,9 +225,9 @@ bool phy_RF8256_Config_ParaFile(struct net_device *dev)
                }
 
                if (ret) {
-                       RT_TRACE(COMP_ERR,
-                                "phy_RF8256_Config_ParaFile():Radio[%d] Fail!!",
-                                eRFPath);
+                       netdev_err(dev,
+                                  "%s(): Failed to initialize RF Path %d.\n",
+                                  __func__, eRFPath);
                        goto phy_RF8256_Config_ParaFile_Fail;
                }
 
index e023c706a21dcca57c5723bd6df61da083489b56..b5e4d35ee6d4a83a60bea0c275e7a082801b3ddb 100644 (file)
@@ -326,8 +326,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
 
        EEPROMId = eprom_read(dev, 0);
        if (EEPROMId != RTL8190_EEPROM_ID) {
-               RT_TRACE(COMP_ERR, "EEPROM ID is invalid:%x, %x\n",
-                        EEPROMId, RTL8190_EEPROM_ID);
+               netdev_err(dev, "%s(): Invalid EEPROM ID: %x\n", __func__,
+                          EEPROMId);
                priv->AutoloadFailFlag = true;
        } else {
                priv->AutoloadFailFlag = false;
@@ -736,9 +736,8 @@ start:
        else if (priv->pFirmware->firmware_status == FW_STATUS_5_READY)
                ulRegRead |= CPU_GEN_FIRMWARE_RESET;
        else
-               RT_TRACE(COMP_ERR,
-                        "ERROR in %s(): undefined firmware state(%d)\n",
-                        __func__,   priv->pFirmware->firmware_status);
+               netdev_err(dev, "%s(): undefined firmware state: %d.\n",
+                          __func__, priv->pFirmware->firmware_status);
 
        write_nic_dword(dev, CPU_GEN, ulRegRead);
 
@@ -754,7 +753,7 @@ start:
        RT_TRACE(COMP_INIT, "BB Config Start!\n");
        rtStatus = rtl8192_BBConfig(dev);
        if (!rtStatus) {
-               RT_TRACE(COMP_ERR, "BB Config failed\n");
+               netdev_warn(dev, "%s(): Failed to configure BB\n", __func__);
                return rtStatus;
        }
        RT_TRACE(COMP_INIT, "BB Config Finished!\n");
@@ -768,8 +767,8 @@ start:
                else if (priv->LoopbackMode == RTL819X_MAC_LOOPBACK)
                        ulRegRead |= CPU_CCK_LOOPBACK;
                else
-                       RT_TRACE(COMP_ERR,
-                                "Serious error: wrong loopback mode setting\n");
+                       netdev_err(dev, "%s: Invalid loopback mode setting.\n",
+                                  __func__);
 
                write_nic_dword(dev, CPU_GEN, ulRegRead);
 
@@ -867,7 +866,7 @@ start:
                RT_TRACE(COMP_INIT, "RF Config Started!\n");
                rtStatus = rtl8192_phy_RFConfig(dev);
                if (!rtStatus) {
-                       RT_TRACE(COMP_ERR, "RF Config failed\n");
+                       netdev_info(dev, "RF Config failed\n");
                        return rtStatus;
                }
                RT_TRACE(COMP_INIT, "RF Config Finished!\n");
@@ -1137,7 +1136,8 @@ static u8 MRateToHwRate8190Pci(u8 rate)
        return ret;
 }
 
-static u8 rtl8192_MapHwQueueToFirmwareQueue(u8 QueueID, u8 priority)
+static u8 rtl8192_MapHwQueueToFirmwareQueue(struct net_device *dev, u8 QueueID,
+                                           u8 priority)
 {
        u8 QueueSelect = 0x0;
 
@@ -1170,9 +1170,8 @@ static u8 rtl8192_MapHwQueueToFirmwareQueue(u8 QueueID, u8 priority)
                QueueSelect = QSLT_HIGH;
                break;
        default:
-               RT_TRACE(COMP_ERR,
-                        "TransmitTCB(): Impossible Queue Selection: %d\n",
-                        QueueID);
+               netdev_warn(dev, "%s(): Impossible Queue Selection: %d\n",
+                           __func__, QueueID);
                break;
        }
        return QueueSelect;
@@ -1196,7 +1195,7 @@ void  rtl8192_tx_fill_desc(struct net_device *dev, struct tx_desc *pdesc,
                                                cb_desc);
 
        if (pci_dma_mapping_error(priv->pdev, mapping))
-               RT_TRACE(COMP_ERR, "DMA Mapping error\n");
+               netdev_err(dev, "%s(): DMA Mapping error\n", __func__);
        if (cb_desc->bAMPDUEnable) {
                pTxFwInfo->AllowAggregation = 1;
                pTxFwInfo->RxMF = cb_desc->ampdu_factor;
@@ -1272,7 +1271,7 @@ void  rtl8192_tx_fill_desc(struct net_device *dev, struct tx_desc *pdesc,
 
        pdesc->PktId = 0x0;
 
-       pdesc->QueueSelect = rtl8192_MapHwQueueToFirmwareQueue(
+       pdesc->QueueSelect = rtl8192_MapHwQueueToFirmwareQueue(dev,
                                                cb_desc->queue_index,
                                                cb_desc->priority);
        pdesc->TxFWInfoSize = sizeof(struct tx_fwinfo_8190pci);
@@ -1296,7 +1295,7 @@ void  rtl8192_tx_fill_cmd_desc(struct net_device *dev,
                         PCI_DMA_TODEVICE);
 
        if (pci_dma_mapping_error(priv->pdev, mapping))
-               RT_TRACE(COMP_ERR, "DMA Mapping error\n");
+               netdev_err(dev, "%s(): DMA Mapping error\n", __func__);
        memset(entry, 0, 12);
        entry->LINIP = cb_desc->bLastIniPkt;
        entry->FirstSeg = 1;
index 54e430eeb8eb94d9a553210ff05f03abda973aa2..17d2a1540cc8b3635f4f89017eb18b4ff4424275 100644 (file)
@@ -116,7 +116,7 @@ static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
        }
 
        if (!(CPU_status&CPU_GEN_PUT_CODE_OK)) {
-               RT_TRACE(COMP_ERR, "Download Firmware: Put code fail!\n");
+               netdev_err(dev, "Firmware download failed.\n");
                goto CPUCheckMainCodeOKAndTurnOnCPU_Fail;
        } else {
                RT_TRACE(COMP_FIRMWARE, "Download Firmware: Put code ok!\n");
@@ -135,15 +135,16 @@ static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
                mdelay(2);
        }
 
-       if (!(CPU_status&CPU_GEN_BOOT_RDY))
+       if (!(CPU_status&CPU_GEN_BOOT_RDY)) {
+               netdev_err(dev, "Firmware boot failed.\n");
                goto CPUCheckMainCodeOKAndTurnOnCPU_Fail;
-       else
-               RT_TRACE(COMP_FIRMWARE, "Download Firmware: Boot ready!\n");
+       }
+
+       RT_TRACE(COMP_FIRMWARE, "Download Firmware: Boot ready!\n");
 
        return rt_status;
 
 CPUCheckMainCodeOKAndTurnOnCPU_Fail:
-       RT_TRACE(COMP_ERR, "ERR in %s()\n", __func__);
        rt_status = false;
        return rt_status;
 }
@@ -310,7 +311,7 @@ bool init_firmware(struct net_device *dev)
        return rt_status;
 
 download_firmware_fail:
-       RT_TRACE(COMP_ERR, "ERR in %s()\n", __func__);
+       netdev_err(dev, "%s: Failed to initialize firmware.\n", __func__);
        rt_status = false;
        return rt_status;
 
index 6c4832c8009b9c57ced7ca24ec3b6a5a63dc087d..fba7654160e807ab6be3aa432cb099144bbfc62d 100644 (file)
@@ -539,9 +539,7 @@ bool rtl8192_phy_checkBBAndRF(struct net_device *dev,
 
 
                if (dwRegRead != WriteData[i]) {
-                       RT_TRACE(COMP_ERR,
-                                "====>error=====dwRegRead: %x, WriteData: %x\n",
-                                dwRegRead, WriteData[i]);
+                       netdev_warn(dev, "%s(): Check failed.\n", __func__);
                        ret = false;
                        break;
                }
@@ -687,8 +685,7 @@ void rtl8192_phy_setTxPower(struct net_device *dev, u8 channel)
        case RF_8258:
                break;
        default:
-               RT_TRACE(COMP_ERR, "unknown rf chip in function %s()\n",
-                        __func__);
+               netdev_err(dev, "Invalid RF Chip ID.\n");
                break;
        }
 }
@@ -711,7 +708,7 @@ bool rtl8192_phy_RFConfig(struct net_device *dev)
                break;
 
        default:
-               RT_TRACE(COMP_ERR, "error chip id\n");
+               netdev_err(dev, "Invalid RF Chip ID.\n");
                break;
        }
        return rtStatus;
@@ -804,13 +801,13 @@ static void rtl8192_SetTxPowerLevel(struct net_device *dev, u8 channel)
        case RF_8258:
                break;
        default:
-               RT_TRACE(COMP_ERR,
-                        "unknown rf chip ID in rtl8192_SetTxPowerLevel()\n");
+               netdev_warn(dev, "%s(): Invalid RF Chip ID\n", __func__);
                break;
        }
 }
 
-static u8 rtl8192_phy_SetSwChnlCmdArray(struct sw_chnl_cmd *CmdTable,
+static u8 rtl8192_phy_SetSwChnlCmdArray(struct net_device *dev,
+                                       struct sw_chnl_cmd *CmdTable,
                                        u32 CmdTableIdx, u32 CmdTableSz,
                                        enum sw_chnl_cmd_id CmdID,
                                        u32 Para1, u32 Para2, u32 msDelay)
@@ -818,14 +815,11 @@ static u8 rtl8192_phy_SetSwChnlCmdArray(struct sw_chnl_cmd *CmdTable,
        struct sw_chnl_cmd *pCmd;
 
        if (CmdTable == NULL) {
-               RT_TRACE(COMP_ERR,
-                        "phy_SetSwChnlCmdArray(): CmdTable cannot be NULL.\n");
+               netdev_err(dev, "%s(): CmdTable cannot be NULL.\n", __func__);
                return false;
        }
        if (CmdTableIdx >= CmdTableSz) {
-               RT_TRACE(COMP_ERR,
-                        "phy_SetSwChnlCmdArray(): Access invalid index, please check size of the table, CmdTableIdx:%d, CmdTableSz:%d\n",
-                        CmdTableIdx, CmdTableSz);
+               netdev_err(dev, "%s(): Invalid index requested.\n", __func__);
                return false;
        }
 
@@ -853,24 +847,23 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
                  __func__, *stage, *step, channel);
 
        if (!rtllib_legal_channel(priv->rtllib, channel)) {
-               RT_TRACE(COMP_ERR, "=============>set to illegal channel:%d\n",
-                        channel);
+               netdev_err(dev, "Invalid channel requested: %d\n", channel);
                return true;
        }
 
        {
                PreCommonCmdCnt = 0;
-               rtl8192_phy_SetSwChnlCmdArray(ieee->PreCommonCmd,
+               rtl8192_phy_SetSwChnlCmdArray(dev, ieee->PreCommonCmd,
                                        PreCommonCmdCnt++,
                                        MAX_PRECMD_CNT, CmdID_SetTxPowerLevel,
                                        0, 0, 0);
-               rtl8192_phy_SetSwChnlCmdArray(ieee->PreCommonCmd,
+               rtl8192_phy_SetSwChnlCmdArray(dev, ieee->PreCommonCmd,
                                        PreCommonCmdCnt++,
                                        MAX_PRECMD_CNT, CmdID_End, 0, 0, 0);
 
                PostCommonCmdCnt = 0;
 
-               rtl8192_phy_SetSwChnlCmdArray(ieee->PostCommonCmd,
+               rtl8192_phy_SetSwChnlCmdArray(dev, ieee->PostCommonCmd,
                                        PostCommonCmdCnt++,
                                        MAX_POSTCMD_CNT, CmdID_End, 0, 0, 0);
 
@@ -878,32 +871,32 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
                switch (priv->rf_chip) {
                case RF_8225:
                        if (!(channel >= 1 && channel <= 14)) {
-                               RT_TRACE(COMP_ERR,
-                                        "illegal channel for Zebra 8225: %d\n",
-                                        channel);
+                               netdev_err(dev,
+                                          "Invalid channel requested for 8225: %d\n",
+                                          channel);
                                return false;
                        }
-                       rtl8192_phy_SetSwChnlCmdArray(ieee->RfDependCmd,
+                       rtl8192_phy_SetSwChnlCmdArray(dev, ieee->RfDependCmd,
                                RfDependCmdCnt++, MAX_RFDEPENDCMD_CNT,
                                CmdID_RF_WriteReg, rZebra1_Channel,
                                RF_CHANNEL_TABLE_ZEBRA[channel], 10);
-                       rtl8192_phy_SetSwChnlCmdArray(ieee->RfDependCmd,
+                       rtl8192_phy_SetSwChnlCmdArray(dev, ieee->RfDependCmd,
                                RfDependCmdCnt++, MAX_RFDEPENDCMD_CNT,
                                CmdID_End, 0, 0, 0);
                        break;
 
                case RF_8256:
                        if (!(channel >= 1 && channel <= 14)) {
-                               RT_TRACE(COMP_ERR,
-                                        "illegal channel for Zebra 8256: %d\n",
-                                        channel);
+                               netdev_err(dev,
+                                          "Invalid channel requested for 8256: %d\n",
+                                          channel);
                                return false;
                        }
-                       rtl8192_phy_SetSwChnlCmdArray(ieee->RfDependCmd,
+                       rtl8192_phy_SetSwChnlCmdArray(dev, ieee->RfDependCmd,
                                 RfDependCmdCnt++, MAX_RFDEPENDCMD_CNT,
                                CmdID_RF_WriteReg, rZebra1_Channel, channel,
                                 10);
-                       rtl8192_phy_SetSwChnlCmdArray(ieee->RfDependCmd,
+                       rtl8192_phy_SetSwChnlCmdArray(dev, ieee->RfDependCmd,
 
                                                      RfDependCmdCnt++,
                                                      MAX_RFDEPENDCMD_CNT,
@@ -914,8 +907,7 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
                        break;
 
                default:
-                       RT_TRACE(COMP_ERR, "Unknown RFChipID: %d\n",
-                                priv->rf_chip);
+                       netdev_warn(dev, "Unknown RF Chip ID\n");
                        return false;
                }
 
@@ -1015,7 +1007,7 @@ u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel)
 
        RT_TRACE(COMP_PHY, "=====>%s()\n", __func__);
        if (!priv->up) {
-               RT_TRACE(COMP_ERR, "%s(): ERR !! driver is not up\n", __func__);
+               netdev_err(dev, "%s(): Driver is not initialized\n", __func__);
                return false;
        }
        if (priv->SwChnlInProgress)
@@ -1026,20 +1018,26 @@ u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel)
        case WIRELESS_MODE_A:
        case WIRELESS_MODE_N_5G:
                if (channel <= 14) {
-                       RT_TRACE(COMP_ERR, "WIRELESS_MODE_A but channel<=14");
+                       netdev_warn(dev,
+                                   "Channel %d not available in 802.11a.\n",
+                                   channel);
                        return false;
                }
                break;
        case WIRELESS_MODE_B:
                if (channel > 14) {
-                       RT_TRACE(COMP_ERR, "WIRELESS_MODE_B but channel>14");
+                       netdev_warn(dev,
+                                   "Channel %d not available in 802.11b.\n",
+                                   channel);
                        return false;
                }
                break;
        case WIRELESS_MODE_G:
        case WIRELESS_MODE_N_24G:
                if (channel > 14) {
-                       RT_TRACE(COMP_ERR, "WIRELESS_MODE_G but channel>14");
+                       netdev_warn(dev,
+                                   "Channel %d not available in 802.11g.\n",
+                                   channel);
                        return false;
                }
                break;
@@ -1182,7 +1180,7 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
                return;
        }
        if (!priv->up) {
-               RT_TRACE(COMP_ERR, "%s(): ERR!! driver is not up\n", __func__);
+               netdev_err(dev, "%s(): Driver is not initialized\n", __func__);
                return;
        }
        regBwOpMode = read_nic_byte(dev, BW_OPMODE);
@@ -1199,9 +1197,8 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
                break;
 
        default:
-               RT_TRACE(COMP_ERR,
-                        "SetChannelBandwidth819xUsb(): unknown Bandwidth: %#X\n",
-                        priv->CurrentChannelBW);
+               netdev_err(dev, "%s(): unknown Bandwidth: %#X\n", __func__,
+                          priv->CurrentChannelBW);
                break;
        }
 
@@ -1241,9 +1238,8 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
                rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x00100000, 0);
                break;
        default:
-               RT_TRACE(COMP_ERR,
-                        "SetChannelBandwidth819xUsb(): unknown Bandwidth: %#X\n",
-                        priv->CurrentChannelBW);
+               netdev_err(dev, "%s(): unknown Bandwidth: %#X\n", __func__,
+                          priv->CurrentChannelBW);
                break;
 
        }
@@ -1263,7 +1259,8 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
                break;
 
        default:
-               RT_TRACE(COMP_ERR, "Unknown RFChipID: %d\n", priv->rf_chip);
+               netdev_info(dev, "%s(): Unknown RFChipID: %d\n", __func__,
+                           priv->rf_chip);
                break;
        }
 
@@ -1454,9 +1451,9 @@ static bool SetRFPowerState8190(struct net_device *dev,
                                } while (!rtstatus && (InitilizeCount > 0));
 
                                if (!rtstatus) {
-                                       RT_TRACE(COMP_ERR,
-                                                "%s():Initialize Adapter fail,return\n",
-                                                __func__);
+                                       netdev_err(dev,
+                                                  "%s(): Failed to initialize Adapter.\n",
+                                                  __func__);
                                        priv->SetRFPowerStateInProgress = false;
                                        return false;
                                }
@@ -1557,16 +1554,16 @@ static bool SetRFPowerState8190(struct net_device *dev,
 
                default:
                        bResult = false;
-                       RT_TRACE(COMP_ERR,
-                                "SetRFPowerState8190(): unknown state to set: 0x%X!!!\n",
-                                eRFPowerState);
+                       netdev_warn(dev,
+                                   "%s(): Unknown state requested: 0x%X.\n",
+                                   __func__, eRFPowerState);
                        break;
                }
 
                break;
 
        default:
-               RT_TRACE(COMP_ERR, "SetRFPowerState8190(): Unknown RF type\n");
+               netdev_warn(dev, "%s(): Unknown RF type\n", __func__);
                break;
        }
 
@@ -1578,8 +1575,7 @@ static bool SetRFPowerState8190(struct net_device *dev,
                        break;
 
                default:
-                       RT_TRACE(COMP_ERR,
-                                "SetRFPowerState8190(): Unknown RF type\n");
+                       netdev_warn(dev, "%s(): Unknown RF type\n", __func__);
                        break;
                }
        }
index 0ffade4f42bd480143b805c687fd81ba9e9497a5..89c3d3318e51e61a34258d8c252c2736600e5ad8 100644 (file)
@@ -113,8 +113,8 @@ void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType,
        if (priv->rtllib->PowerSaveControl.bInactivePs) {
                if (rtState == eRfOff) {
                        if (priv->rtllib->RfOffReason > RF_CHANGE_BY_IPS) {
-                               RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",
-                                       __func__);
+                               netdev_warn(dev, "%s(): RF is OFF.\n",
+                                           __func__);
                                return;
                        }
                        down(&priv->rtllib->ips_sem);
@@ -124,7 +124,7 @@ void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType,
        }
        priv->rtllib->is_set_key = true;
        if (EntryNo >= TOTAL_CAM_ENTRY)
-               RT_TRACE(COMP_ERR, "cam entry exceeds in setKey()\n");
+               netdev_info(dev, "%s(): Invalid CAM entry\n", __func__);
 
        RT_TRACE(COMP_SEC,
                 "====>to setKey(), dev:%p, EntryNo:%d, KeyIndex:%d,KeyType:%d, MacAddr %pM\n",
@@ -243,9 +243,9 @@ void CamRestoreAllEntry(struct net_device *dev)
                                       (u32 *)(&priv->rtllib->swcamtable[0].key_buf[0])
                                     );
                        } else {
-                               RT_TRACE(COMP_ERR,
-                                        "===>%s():ERR!! ADHOC TKIP ,but 0 entry is have no data\n",
-                                        __func__);
+                               netdev_warn(dev,
+                                           "%s(): ADHOC TKIP: missing key entry.\n",
+                                           __func__);
                                return;
                        }
                }
@@ -267,9 +267,9 @@ void CamRestoreAllEntry(struct net_device *dev)
                                        CAM_CONST_ADDR[0], 0,
                                        (u32 *)(&priv->rtllib->swcamtable[0].key_buf[0]));
                        } else {
-                               RT_TRACE(COMP_ERR,
-                                        "===>%s():ERR!! ADHOC CCMP ,but 0 entry is have no data\n",
-                                        __func__);
+                               netdev_warn(dev,
+                                           "%s(): ADHOC CCMP: missing key entry.\n",
+                                           __func__);
                                return;
                        }
                }
index abce472d38145a84ea742c163132e87dd6df27d6..fcc9188a209f37a74c6bfc720ecabb4a0b448417 100644 (file)
@@ -343,8 +343,9 @@ bool MgntActSet_RF_State(struct net_device *dev,
                                        mdelay(1);
 
                                        if (RFWaitCounter > 100) {
-                                               RT_TRACE(COMP_ERR,
-                                                        "MgntActSet_RF_State(): Wait too logn to set RF\n");
+                                               netdev_warn(dev,
+                                                           "%s(): Timeout waiting for RF change.\n",
+                                                           __func__);
                                                return false;
                                        }
                                }
@@ -897,9 +898,9 @@ void rtl8192_SetWirelessMode(struct net_device *dev, u8 wireless_mode)
                } else if ((bSupportMode & WIRELESS_MODE_B)) {
                        wireless_mode = WIRELESS_MODE_B;
                } else {
-                       RT_TRACE(COMP_ERR,
-                                "%s(), No valid wireless mode supported (%x)!!!\n",
-                                __func__, bSupportMode);
+                       netdev_info(dev,
+                                   "%s(): Unsupported mode requested. Fallback to 802.11b\n",
+                                   __func__);
                        wireless_mode = WIRELESS_MODE_B;
                }
        }
@@ -946,8 +947,7 @@ static int _rtl8192_sta_up(struct net_device *dev, bool is_silent_reset)
        priv->bfirst_init = true;
        init_status = priv->ops->initialize_adapter(dev);
        if (!init_status) {
-               RT_TRACE(COMP_ERR, "ERR!!! %s(): initialization is failed!\n",
-                        __func__);
+               netdev_err(dev, "%s(): Initialization failed!\n", __func__);
                priv->bfirst_init = false;
                return -1;
        }
@@ -1267,9 +1267,8 @@ static short rtl8192_get_channel_map(struct net_device *dev)
 
        if ((priv->rf_chip != RF_8225) && (priv->rf_chip != RF_8256)
                        && (priv->rf_chip != RF_6052)) {
-               RT_TRACE(COMP_ERR,
-                        "%s: unknown rf chip, can't set channel map\n",
-                        __func__);
+               netdev_err(dev, "%s: unknown rf chip, can't set channel map\n",
+                          __func__);
                return -1;
        }
 
@@ -1498,9 +1497,8 @@ RESET_START:
                        LeisurePSLeave(dev);
 
                if (priv->up) {
-                       RT_TRACE(COMP_ERR,
-                                "%s():the driver is not up! return\n",
-                                __func__);
+                       netdev_info(dev, "%s():the driver is not up.\n",
+                                   __func__);
                        up(&priv->wx_sem);
                        return;
                }
@@ -1554,9 +1552,8 @@ RESET_START:
                                reset_times++;
                                goto RESET_START;
                        } else {
-                               RT_TRACE(COMP_ERR,
-                                        " ERR!!! %s():  Reset Failed!!\n",
-                                        __func__);
+                               netdev_warn(dev, "%s(): Reset Failed\n",
+                                           __func__);
                        }
                }
 
@@ -1729,7 +1726,7 @@ void      rtl819x_watchdog_wqcallback(void *data)
 
                if (priv->check_roaming_cnt > 0) {
                        if (ieee->eRFPowerState == eRfOff)
-                               RT_TRACE(COMP_ERR, "========>%s()\n", __func__);
+                               netdev_info(dev, "%s(): RF is off\n", __func__);
 
                        netdev_info(dev,
                                    "===>%s(): AP is power off, chan:%d, connect another one\n",
@@ -1999,9 +1996,8 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
        u32 fwinfo_size = 0;
 
        if (priv->bdisable_nic) {
-               RT_TRACE(COMP_ERR,
-                        "%s: ERR!! Nic is disabled! Can't tx packet len=%d qidx=%d!!!\n",
-                        __func__, skb->len, tcb_desc->queue_index);
+               netdev_warn(dev, "%s: Nic is disabled! Can't tx packet.\n",
+                           __func__);
                return skb->len;
        }
 
@@ -2038,10 +2034,10 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
 
        pdesc = &ring->desc[idx];
        if ((pdesc->OWN == 1) && (tcb_desc->queue_index != BEACON_QUEUE)) {
-               RT_TRACE(COMP_ERR,
-                        "No more TX desc@%d, ring->idx = %d, idx = %d, skblen = 0x%x queuelen=%d",
-                        tcb_desc->queue_index, ring->idx, idx, skb->len,
-                        skb_queue_len(&ring->queue));
+               netdev_warn(dev,
+                           "No more TX desc@%d, ring->idx = %d, idx = %d, skblen = 0x%x queuelen=%d",
+                           tcb_desc->queue_index, ring->idx, idx, skb->len,
+                           skb_queue_len(&ring->queue));
                spin_unlock_irqrestore(&priv->irq_th_lock, flags);
                return skb->len;
        }
@@ -2072,7 +2068,7 @@ static short rtl8192_alloc_rx_desc_ring(struct net_device *dev)
                                              &priv->rx_ring_dma[rx_queue_idx]);
                if (!priv->rx_ring[rx_queue_idx] ||
                    (unsigned long)priv->rx_ring[rx_queue_idx] & 0xFF) {
-                       RT_TRACE(COMP_ERR, "Cannot allocate RX ring\n");
+                       netdev_warn(dev, "Cannot allocate RX ring\n");
                        return -ENOMEM;
                }
 
@@ -2118,8 +2114,7 @@ static int rtl8192_alloc_tx_desc_ring(struct net_device *dev,
 
        ring = pci_zalloc_consistent(priv->pdev, sizeof(*ring) * entries, &dma);
        if (!ring || (unsigned long)ring & 0xFF) {
-               RT_TRACE(COMP_ERR, "Cannot allocate TX ring (prio = %d)\n",
-                        prio);
+               netdev_warn(dev, "Cannot allocate TX ring (prio = %d)\n", prio);
                return -ENOMEM;
        }
 
@@ -2848,7 +2843,7 @@ static int rtl8192_pci_probe(struct pci_dev *pdev,
        RT_TRACE(COMP_INIT, "Configuring chip resources");
 
        if (pci_enable_device(pdev)) {
-               RT_TRACE(COMP_ERR, "Failed to enable PCI device");
+               dev_err(&pdev->dev, "Failed to enable PCI device");
                return -EIO;
        }
 
@@ -2886,21 +2881,21 @@ static int rtl8192_pci_probe(struct pci_dev *pdev,
        pmem_flags = pci_resource_flags(pdev, 1);
 
        if (!(pmem_flags & IORESOURCE_MEM)) {
-               RT_TRACE(COMP_ERR, "region #1 not a MMIO resource, aborting");
+               netdev_err(dev, "region #1 not a MMIO resource, aborting");
                goto err_rel_rtllib;
        }
 
        dev_info(&pdev->dev, "Memory mapped space start: 0x%08lx\n",
                 pmem_start);
        if (!request_mem_region(pmem_start, pmem_len, DRV_NAME)) {
-               RT_TRACE(COMP_ERR, "request_mem_region failed!");
+               netdev_err(dev, "request_mem_region failed!");
                goto err_rel_rtllib;
        }
 
 
        ioaddr = (unsigned long)ioremap_nocache(pmem_start, pmem_len);
        if (ioaddr == (unsigned long)NULL) {
-               RT_TRACE(COMP_ERR, "ioremap failed!");
+               netdev_err(dev, "ioremap failed!");
                goto err_rel_mem;
        }
 
@@ -2936,7 +2931,7 @@ static int rtl8192_pci_probe(struct pci_dev *pdev,
 
        RT_TRACE(COMP_INIT, "Driver probe completed1\n");
        if (rtl8192_init(dev) != 0) {
-               RT_TRACE(COMP_ERR, "Initialization failed");
+               netdev_warn(dev, "Initialization failed");
                goto err_free_irq;
        }
 
@@ -3022,8 +3017,7 @@ bool NicIFEnableNIC(struct net_device *dev)
                                        (&(priv->rtllib->PowerSaveControl));
 
        if (!priv->up) {
-               RT_TRACE(COMP_ERR, "ERR!!! %s(): Driver is already down!\n",
-                        __func__);
+               netdev_warn(dev, "%s(): Driver is already down!\n", __func__);
                priv->bdisable_nic = false;
                return false;
        }
@@ -3032,8 +3026,7 @@ bool NicIFEnableNIC(struct net_device *dev)
        priv->bfirst_init = true;
        init_status = priv->ops->initialize_adapter(dev);
        if (!init_status) {
-               RT_TRACE(COMP_ERR, "ERR!!! %s(): initialization is failed!\n",
-                        __func__);
+               netdev_warn(dev, "%s(): Initialization failed!\n", __func__);
                priv->bdisable_nic = false;
                return false;
        }
index 386ae0c5f2531b2cc1bee21b07cdef9e59fd01e7..f6eb989d62d09c16644c813aac2a315f11c8d90d 100644 (file)
@@ -202,8 +202,8 @@ void rtllib_ips_leave_wq(struct net_device *dev)
        if (priv->rtllib->PowerSaveControl.bInactivePs) {
                if (rtState == eRfOff) {
                        if (priv->rtllib->RfOffReason > RF_CHANGE_BY_IPS) {
-                               RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",
-                                        __func__);
+                               netdev_warn(dev, "%s(): RF is OFF.\n",
+                                           __func__);
                                return;
                        }
                        netdev_info(dev, "=========>%s(): IPSLeave\n",
index 26c2ad03126b58135ff632250e11aaa6307badf1..f5e4961677d2f5f74d2eebe79ee37c4b89fd6b00 100644 (file)
@@ -116,9 +116,8 @@ static int r8192_wx_set_power(struct net_device *dev,
        struct r8192_priv *priv = rtllib_priv(dev);
 
        if (priv->bHwRadioOff) {
-               RT_TRACE(COMP_ERR,
-                        "%s():Hw is Radio Off, we can't set Power,return\n",
-                        __func__);
+               netdev_warn(dev, "%s(): Can't set Power: Radio is Off.\n",
+                           __func__);
                return 0;
        }
        down(&priv->wx_sem);
@@ -278,8 +277,8 @@ static int r8192_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
                        if (rtState == eRfOff) {
                                if (priv->rtllib->RfOffReason >
                                    RF_CHANGE_BY_IPS) {
-                                       RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",
-                                                __func__);
+                                       netdev_warn(dev, "%s(): RF is OFF.\n",
+                                                   __func__);
                                        up(&priv->wx_sem);
                                        return -1;
                                }
@@ -438,9 +437,8 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
                        if (rtState == eRfOff) {
                                if (priv->rtllib->RfOffReason >
                                    RF_CHANGE_BY_IPS) {
-                                       RT_TRACE(COMP_ERR,
-                                                "%s(): RF is OFF.\n",
-                                                __func__);
+                                       netdev_warn(dev, "%s(): RF is OFF.\n",
+                                                   __func__);
                                        up(&priv->wx_sem);
                                        return -1;
                                }