Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix kernel read/write and warnings #12

Merged
merged 7 commits into from
Mar 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chips/rt5592.c
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ static VOID NICInitRT5592BbpRegisters(
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R254, BbpReg);

RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R254, &BbpReg);
printk("BBP_R254 = %x\n", BbpReg);
printk(KERN_WARNING "BBP_R254 = %x\n", BbpReg);
}

DBGPRINT(RT_DEBUG_TRACE, ("<-- %s\n", __FUNCTION__));
Expand Down
4 changes: 2 additions & 2 deletions chips/rtmp_chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1554,8 +1554,8 @@ VOID RTMPReadChannelPwr(

RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + i * 2, Power.word);
RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + i * 2, Power2.word);
printk("Power = %x\n", Power.word);
printk("Power2 = %x\n", Power2.word);
printk(KERN_WARNING "Power = %x\n", Power.word);
printk(KERN_WARNING "Power2 = %x\n", Power2.word);

if ((Power.field.Byte0 < 0x2B) && (Power.field.Byte0 >= 0))
pAd->TxPower[i * 2 + choffset + 0].Power = Power.field.Byte0;
Expand Down
24 changes: 12 additions & 12 deletions common/cmm_aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,39 +1059,39 @@ VOID CCMP_test_vector(
UINT8 res_buf[100];
UINT res_len = 0;

printk("== CCMP test vector == \n");
printk(KERN_WARNING "== CCMP test vector == \n");

/* Check AAD */
NdisZeroMemory(res_buf, 100);
res_len = 0;
RTMPConstructCCMPAAD(HDR, TRUE, 0, 0, res_buf, &res_len);
if (res_len == 22 && NdisEqualMemory(res_buf, AAD, res_len))
printk("Construct AAD is OK!!!\n");
printk(KERN_WARNING "Construct AAD is OK!!!\n");
else
{
printk("\n!!!Construct AAD is FAILURE!!!\n\n");
printk(KERN_WARNING "\n!!!Construct AAD is FAILURE!!!\n\n");
hex_dump("Calculate AAD", res_buf, res_len);
}
/* Check NONCE */
NdisZeroMemory(res_buf, 100);
res_len = 0;
RTMPConstructCCMPNonce(HDR, 0, 0, FALSE, PN, res_buf, &res_len);
if (res_len == 13 && NdisEqualMemory(res_buf, CCM_NONCE, res_len))
printk("Construct NONCE is OK!!!\n");
printk(KERN_WARNING "Construct NONCE is OK!!!\n");
else
{
printk("\n!!!Construct NONCE is FAILURE!!!\n\n");
printk(KERN_WARNING "\n!!!Construct NONCE is FAILURE!!!\n\n");
hex_dump("Calculate NONCE", res_buf, res_len);
}
/* Check CCMP-Header */
NdisZeroMemory(res_buf, 100);
res_len = 0;
RTMPConstructCCMPHdr(Key_ID, PN, res_buf);
if (NdisEqualMemory(res_buf, CCMP_HDR, 8))
printk("Construct CCMP_HDR is OK!!!\n");
printk(KERN_WARNING "Construct CCMP_HDR is OK!!!\n");
else
{
printk("\n!!!Construct CCMP_HDR is FAILURE!!!\n\n");
printk(KERN_WARNING "\n!!!Construct CCMP_HDR is FAILURE!!!\n\n");
hex_dump("Calculate CCMP_HDR", res_buf, 8);
}

Expand All @@ -1107,10 +1107,10 @@ VOID CCMP_test_vector(
{
if (res_len == sizeof(C_TEXT_DATA) &&
NdisEqualMemory(res_buf, C_TEXT_DATA, res_len))
printk("CCM_Encrypt is OK!!!\n");
printk(KERN_WARNING "CCM_Encrypt is OK!!!\n");
else
{
printk("\n!!!CCM_Encrypt is FAILURE!!!\n\n");
printk(KERN_WARNING "\n!!!CCM_Encrypt is FAILURE!!!\n\n");
hex_dump("CCM_Encrypt", res_buf, res_len);
}
}
Expand All @@ -1126,15 +1126,15 @@ VOID CCMP_test_vector(
{
if (res_len == sizeof(P_TEXT_DATA) &&
NdisEqualMemory(res_buf, P_TEXT_DATA, res_len))
printk("CCM_Decrypt is OK!!!\n");
printk(KERN_WARNING "CCM_Decrypt is OK!!!\n");
else
{
printk("\n!!!CCM_Decrypt is FAILURE!!!\n\n");
printk(KERN_WARNING "\n!!!CCM_Decrypt is FAILURE!!!\n\n");
hex_dump("CCM_Decrypt", res_buf, res_len);
}
}

printk("== CCMP test vector == \n");
printk(KERN_WARNING "== CCMP test vector == \n");

}

Expand Down
20 changes: 10 additions & 10 deletions common/cmm_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ VOID CarrierDetectionPeriodicStateCtrl(
{
CARRIER_DETECT_DEBUG CarrDetectDebug;
RTUSBMultiRead(pAd, 0x4CB0, (PUCHAR) &CarrDetectDebug, sizeof(CarrDetectDebug));
printk("delta_div = 0x%02X, rRadarToneCount = %u, Recheck = %u, Criteria = %u, Threshold = 0x%08X, VGA_Mask = 0x%04X\n",
printk(KERN_WARNING "delta_div = 0x%02X, rRadarToneCount = %u, Recheck = %u, Criteria = %u, Threshold = 0x%08X, VGA_Mask = 0x%04X\n",
CarrDetectDebug.delta_div,
CarrDetectDebug.RadarToneCount,
CarrDetectDebug.ReCheck,
Expand All @@ -92,7 +92,7 @@ VOID CarrierDetectionPeriodicStateCtrl(
AsicDisableSync(pAd);
}
else
printk("Carrier Detected\n");
printk(KERN_WARNING "Carrier Detected\n");
}
break;

Expand Down Expand Up @@ -165,7 +165,7 @@ VOID RTMPHandleRadarInterrupt(PRTMP_ADAPTER pAd)
pCarrierDetect->Debug = 0;
for (i = 0; i < 20; i++)
{
printk("%3d %4ld %ld %ld\n", i, time[i], idle[i], busy[i]);
printk(KERN_WARNING "%3d %4ld %ld %ld\n", i, time[i], idle[i], busy[i]);
}
cd_idx = 0;

Expand Down Expand Up @@ -193,7 +193,7 @@ VOID RTMPHandleRadarInterrupt(PRTMP_ADAPTER pAd)
}
else
{
printk("Carrier Detected\n");
printk(KERN_WARNING "Carrier Detected\n");
}
}
}
Expand Down Expand Up @@ -348,7 +348,7 @@ INT Set_CarrierDebug_Proc(
IN PSTRING arg)
{
pAd->CommonCfg.CarrierDetect.Debug = simple_strtol(arg, 0, 10);
printk("pAd->CommonCfg.CarrierDetect.Debug = %ld\n", pAd->CommonCfg.CarrierDetect.Debug);
printk(KERN_WARNING "pAd->CommonCfg.CarrierDetect.Debug = %ld\n", pAd->CommonCfg.CarrierDetect.Debug);
return TRUE;
}

Expand All @@ -373,7 +373,7 @@ INT Set_CarrierDelta_Proc(
IN PSTRING arg)
{
pAd->CommonCfg.CarrierDetect.delta = simple_strtol(arg, 0, 10);
printk("Delta = %d\n", pAd->CommonCfg.CarrierDetect.delta);
printk(KERN_WARNING "Delta = %d\n", pAd->CommonCfg.CarrierDetect.delta);
CarrierDetectionStart(pAd);

return TRUE;
Expand All @@ -399,7 +399,7 @@ INT Set_CarrierDivFlag_Proc(
IN PSTRING arg)
{
pAd->CommonCfg.CarrierDetect.div_flag = simple_strtol(arg, 0, 10);
printk("DivFlag = %d\n", pAd->CommonCfg.CarrierDetect.div_flag);
printk(KERN_WARNING "DivFlag = %d\n", pAd->CommonCfg.CarrierDetect.div_flag);
CarrierDetectionStart(pAd);

return TRUE;
Expand All @@ -426,7 +426,7 @@ INT Set_CarrierThrd_Proc(
IN PSTRING arg)
{
pAd->CommonCfg.CarrierDetect.threshold = simple_strtol(arg, 0, 10);
printk("CarrThrd = %d(0x%x)\n", pAd->CommonCfg.CarrierDetect.threshold, pAd->CommonCfg.CarrierDetect.threshold);
printk(KERN_WARNING "CarrThrd = %d(0x%x)\n", pAd->CommonCfg.CarrierDetect.threshold, pAd->CommonCfg.CarrierDetect.threshold);
CarrierDetectionStart(pAd);

return TRUE;
Expand All @@ -453,7 +453,7 @@ INT Set_CarrierSymRund_Proc(
IN PSTRING arg)
{
pAd->CommonCfg.CarrierDetect.SymRund= simple_strtol(arg, 0, 10);
printk("SymRund = %d\n", pAd->CommonCfg.CarrierDetect.SymRund);
printk(KERN_WARNING "SymRund = %d\n", pAd->CommonCfg.CarrierDetect.SymRund);
CarrierDetectionStart(pAd);

return TRUE;
Expand Down Expand Up @@ -482,7 +482,7 @@ INT Set_CarrierMask_Proc(
pAd->CommonCfg.CarrierDetect.VGA_Mask = simple_strtol(arg, 0, 10);
pAd->CommonCfg.CarrierDetect.Packet_End_Mask = simple_strtol(arg, 0, 10);
pAd->CommonCfg.CarrierDetect.Rx_PE_Mask = simple_strtol(arg, 0, 10);
printk("CarrMask = %u(%x)\n", pAd->CommonCfg.CarrierDetect.VGA_Mask, pAd->CommonCfg.CarrierDetect.VGA_Mask);
printk(KERN_WARNING "CarrMask = %u(%x)\n", pAd->CommonCfg.CarrierDetect.VGA_Mask, pAd->CommonCfg.CarrierDetect.VGA_Mask);
CarrierDetectionStart(pAd);

return TRUE;
Expand Down
10 changes: 5 additions & 5 deletions common/cmm_radar.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ INT Set_RadarShow_Proc(
{

#ifdef CARRIER_DETECTION_SUPPORT
printk("pAd->CommonCfg.CarrierDetect.CD_State = %d\n", pAd->CommonCfg.CarrierDetect.CD_State);
printk("pAd->CommonCfg.CarrierDetect.criteria = %d\n", pAd->CommonCfg.CarrierDetect.criteria);
printk("pAd->CommonCfg.CarrierDetect.Delta = %d\n", pAd->CommonCfg.CarrierDetect.delta);
printk("pAd->CommonCfg.CarrierDetect.DivFlag = %d\n", pAd->CommonCfg.CarrierDetect.div_flag);
printk("pAd->CommonCfg.CarrierDetect.Threshold = %d(0x%x)\n", pAd->CommonCfg.CarrierDetect.threshold, pAd->CommonCfg.CarrierDetect.threshold);
printk(KERN_WARNING "pAd->CommonCfg.CarrierDetect.CD_State = %d\n", pAd->CommonCfg.CarrierDetect.CD_State);
printk(KERN_WARNING "pAd->CommonCfg.CarrierDetect.criteria = %d\n", pAd->CommonCfg.CarrierDetect.criteria);
printk(KERN_WARNING "pAd->CommonCfg.CarrierDetect.Delta = %d\n", pAd->CommonCfg.CarrierDetect.delta);
printk(KERN_WARNING "pAd->CommonCfg.CarrierDetect.DivFlag = %d\n", pAd->CommonCfg.CarrierDetect.div_flag);
printk(KERN_WARNING "pAd->CommonCfg.CarrierDetect.Threshold = %d(0x%x)\n", pAd->CommonCfg.CarrierDetect.threshold, pAd->CommonCfg.CarrierDetect.threshold);
#endif /* CARRIER_DETECTION_SUPPORT */

return TRUE;
Expand Down
12 changes: 6 additions & 6 deletions common/ee_efuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ INT set_eFuseGetFreeBlockCount_Proc(
if (pAd->bUseEfuse == FALSE && pAd->bFroceEEPROMBuffer == FALSE)
return FALSE;
eFuseGetFreeBlockCount(pAd,&efusefreenum);
printk("efuseFreeNumber is %d\n",efusefreenum);
printk(KERN_WARNING "efuseFreeNumber is %d\n",efusefreenum);
return TRUE;
}

Expand All @@ -912,8 +912,8 @@ INT set_eFusedump_Proc(

eFuseReadPhysical(pAd, &InBuf[0], 4, &InBuf[2], 2);
if(i%4==0)
printk("\nBlock %x:",i/8);
printk("%04x ",InBuf[2]);
printk(KERN_WARNING "\nBlock %x:",i/8);
printk(KERN_WARNING "%04x ",InBuf[2]);
}
return TRUE;
}
Expand Down Expand Up @@ -1006,8 +1006,8 @@ INT set_eFuseLoadFromBin_Proc(
}
/*
for(l=0;l<8;l++)
printk("%04x ",PDATA[l]);
printk("\n");
printk(KERN_WARNING "%04x ",PDATA[l]);
printk(KERN_WARNING "\n");
*/
NdisZeroMemory(PDATA,16);
}
Expand Down Expand Up @@ -1225,7 +1225,7 @@ static NTSTATUS eFuseWriteRegistersFromBin(
}
if(!bNotWrite)
{
printk("The data is not the same\n");
printk(KERN_WARNING "The data is not the same\n");

for(i =0; i<8; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion common/rtmp_init_inf.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ VOID RTMPDrvOpen(
{
UINT32 reg = 0;
RTMP_IO_READ32(pAd, 0x1300, &reg); /* clear garbage interrupts*/
printk("0x1300 = %08x\n", reg);
printk(KERN_WARNING "0x1300 = %08x\n", reg);
}

{
Expand Down
4 changes: 2 additions & 2 deletions include/ap_diversity.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "rtmp.h"

#define ADDBGPRINT(format,args...) do{if(atomic_read(&DEBUG_VERBOSE_MODE)) printk( format, ##args);}while(0)
#define ADDBGPRINT(format,args...) do{if(atomic_read(&DEBUG_VERBOSE_MODE)) printk(KERN_WARNING format, ##args);}while(0)
#define PROC_DIR "AntDiv"

/*
Expand Down Expand Up @@ -68,7 +68,7 @@
if (BbpCsr.field.Busy == IDLE) \
break; \
else \
printk("MCU busy\n"); \
printk(KERN_WARNING "MCU busy\n"); \
} \
if ((BbpCsr.field.Busy == IDLE) && \
(BbpCsr.field.RegNum == _I)) \
Expand Down
2 changes: 1 addition & 1 deletion include/chip/rtmp_phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ typedef union _BBP_R182_STRUC {
} \
if ((_A)->ShowRf) \
{ \
printk("RF:%x\n", _V); \
printk(KERN_WARNING "RF:%x\n", _V); \
} \
}
#endif /* RTMP_MAC_PCI */
Expand Down
4 changes: 2 additions & 2 deletions include/os/rt_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ do{ \

#define DBGPRINT_ERR(Fmt) \
{ \
printk("ERROR!!! "); \
printk(KERN_WARNING "ERROR!!! "); \
printk Fmt; \
}

Expand All @@ -367,7 +367,7 @@ do{ \
{ \
if (!(x)) \
{ \
printk(__FILE__ ":%d assert " #x "failed\n", __LINE__); \
printk(KERN_WARNING __FILE__ ":%d assert " #x "failed\n", __LINE__); \
} \
}
#else
Expand Down
2 changes: 1 addition & 1 deletion include/os/rt_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ do{ \

#define DBGPRINT_ERR(Fmt) \
{ \
printk("ERROR!!! "); \
printk(KERN_WARNING "ERROR!!! "); \
printk Fmt; \
}

Expand Down
2 changes: 1 addition & 1 deletion os/linux/pci_main_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static int rt2860_resume(
/* initialize device before it's used by a driver */
if (pci_enable_device(pci_dev))
{
printk("pci enable fail!\n");
printk(KERN_WARNING "pci enable fail!\n");
return 0;
}
#endif
Expand Down
Loading