Skip to content

Commit

Permalink
silence warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
maage committed Sep 21, 2015
1 parent 25c5d66 commit 70e7bc3
Show file tree
Hide file tree
Showing 32 changed files with 88 additions and 54 deletions.
18 changes: 11 additions & 7 deletions chips/mt76x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ VOID SetRfChFreqParametersMT76x0(
UINT32 i = 0, RfBand = 0, MacReg = 0;
UCHAR RFValue = 0;
BOOLEAN bSDM = FALSE;
MT76x0_FREQ_ITEM *pMT76x0_freq_item = NULL;
const MT76x0_FREQ_ITEM *pMT76x0_freq_item = NULL;

if (!IS_MT76x0(pAd))
{
Expand Down Expand Up @@ -1573,7 +1573,7 @@ static VOID NICInitMT76x0RFRegisters(RTMP_ADAPTER *pAd)
E2: B0.R21<0>: xo_cxo<0>, B0.R22<7:0>: xo_cxo<8:1>
*/
RFValue = (UCHAR)(pAd->RfFreqOffset & 0xFF);
RFValue = min(RFValue, 0xBF); /* Max of 9-bit built-in crystal oscillator C1 code */
RFValue = min(RFValue, (UCHAR)0xBF); /* Max of 9-bit built-in crystal oscillator C1 code */
rlt_rf_write(pAd, RF_BANK0, RF_R22, RFValue);

rlt_rf_read(pAd, RF_BANK0, RF_R22, &RFValue);
Expand Down Expand Up @@ -1733,7 +1733,9 @@ static VOID MT76x0_AsicAntennaDefaultReset(

static VOID MT76x0_ChipBBPAdjust(RTMP_ADAPTER *pAd)
{
#ifdef DBG
static char *ext_str[]={"extNone", "extAbove", "", "extBelow"};
#endif
UCHAR rf_bw, ext_ch;


Expand Down Expand Up @@ -1784,14 +1786,15 @@ static VOID MT76x0_ChipSwitchChannel(
enum SWITCH_CHANNEL_STAGE bScan)
{
CHAR TxPwer = 0; /* Bbp94 = BBPR94_DEFAULT, TxPwer2 = DEFAULT_RF_TX_POWER; */
UCHAR RFValue = 0;
UINT32 RegValue = 0;
UINT32 Index;
UINT32 rf_phy_mode, rf_bw = RF_BW_20;
UCHAR bbp_ch_idx, delta_pwr;
UCHAR bbp_ch_idx;
UINT32 ret;
ULONG Old, New, Diff;
#ifndef MT76x0_TSSI_CAL_COMPENSATION
#ifdef MT76x0_TSSI_CAL_COMPENSATION
UCHAR delta_pwr;
#else
UINT32 Value;
#endif /* !MT76x0_TSSI_CAL_COMPENSATION */
#ifdef SINGLE_SKU_V2
Expand Down Expand Up @@ -2358,16 +2361,18 @@ VOID mt76x0_read_per_rate_tx_pwr(
*/
// TODO: check if any document to describe this ?
RT28xx_EEPROM_READ16(pAd, EEPROM_VHT_BW80_TX_POWER_DELTA - 1, e2p_val);
pAd->chipCap.delta_tw_pwr_bw80 = (e2p_val & 0xFF00) == 0xFF00 ? 0 : (e2p_val & 0xFF00);

if ((e2p_val & 0xFF00) != 0xFF00) {
pAd->chipCap.delta_tw_pwr_bw80 = (USHORT)(e2p_val & 0xFF00);
if (e2p_val & 0x8000)
bw80_aband_delta = ((e2p_val & 0x1F00) >> 8);

if (e2p_val & 0x4000)
dec_aband_bw80_delta = FALSE;
else
dec_aband_bw80_delta = TRUE;
} else {
pAd->chipCap.delta_tw_pwr_bw80 = 0;
}

#ifdef SINGLE_SKU_V2
Expand Down Expand Up @@ -5495,7 +5500,6 @@ void mt76x0_temp_tx_alc_init(PRTMP_ADAPTER pAd)

void mt76x0_read_tx_alc_info_from_eeprom(PRTMP_ADAPTER pAd)
{
BOOLEAN status = TRUE;
USHORT e2p_value = 0;

if (IS_MT76x0(pAd)) {
Expand Down
6 changes: 4 additions & 2 deletions chips/rt65xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ VOID ral_wlan_chip_onoff(
VOID dump_bw_info(RTMP_ADAPTER *pAd)
{
UINT32 core_r1, agc_r0, be_r0, band_cfg;
static UCHAR *bw_str[]={"20", "10", "40", "80"};
UCHAR bw, prim_ch_idx, decode_cap;
UCHAR tx_prim;
#ifdef DBG
static UCHAR *bw_str[]={"20", "10", "40", "80"};
static UCHAR *decode_str[] = {"0", "20", "40", "20/40",
"80", "20/80", "40/80", "20/40/80"};
UCHAR tx_prim;
RTMP_CHIP_CAP *pChipCap = &pAd->chipCap;
#endif


RTMP_BBP_IO_READ32(pAd, CORE_R1, &core_r1);
Expand Down
8 changes: 5 additions & 3 deletions common/cmm_asic.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ VOID AsicUpdateProtect(
IN BOOLEAN bNonGFExist)
{
PROT_CFG_STRUC ProtCfg, ProtCfg4;
UINT32 Protect[6];
UINT32 Protect[6], PhyMode = 0x4000;
USHORT offset;
UCHAR i, PhyMode = 0x4000;
UCHAR i;
UINT32 MacReg = 0;

#ifdef RALINK_ATE
Expand Down Expand Up @@ -2271,10 +2271,12 @@ VOID AsicAddPairwiseKeyEntry(
{
INT i;
ULONG offset;
#ifdef DBG
PUCHAR pKey = pCipherKey->Key;
UCHAR CipherAlg = pCipherKey->CipherAlg;
#endif
PUCHAR pTxMic = pCipherKey->TxMic;
PUCHAR pRxMic = pCipherKey->RxMic;
UCHAR CipherAlg = pCipherKey->CipherAlg;

/* EKEY*/
offset = PAIRWISE_KEY_TABLE_BASE + (WCID * HW_KEY_ENTRY_SIZE);
Expand Down
3 changes: 2 additions & 1 deletion common/cmm_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ static UCHAR CFG_WMODE_MAP[]={
};


#ifdef DBG
static PSTRING BAND_STR[] = {"Invalid", "2.4G", "5G", "2.4G/5G"};
#endif
static PSTRING WMODE_STR[]= {"", "A", "B", "G", "gN", "aN", "AC"};

UCHAR *wmode_2_str(UCHAR wmode)
Expand Down Expand Up @@ -702,7 +704,6 @@ INT RTMP_COM_IoctlHandle(
case CMD_RTPRIV_IOCTL_USB_INTF_GET:
/* get USB INTF */
{
VOID **ppINTF = (VOID **)pData;
//*ppINTF = (VOID *)(pObj->intf);
}
break;
Expand Down
6 changes: 6 additions & 0 deletions common/cmm_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ VOID dumpRxFCEInfo(RTMP_ADAPTER *pAd, RXFCE_INFO *pRxFceInfo)
#endif /* RLT_MAC */


#ifdef DBG
static UCHAR *txwi_txop_str[]={"HT_TXOP", "PIFS", "SIFS", "BACKOFF", "Invalid"};
#endif
#define TXWI_TXOP_STR(_x) ((_x) <= 3 ? txwi_txop_str[(_x)]: txwi_txop_str[4])

VOID dumpTxWI(RTMP_ADAPTER *pAd, TXWI_STRUC *pTxWI)
Expand Down Expand Up @@ -161,9 +163,11 @@ VOID dump_rxwi(RTMP_ADAPTER *pAd, RXWI_STRUC *pRxWI)
}


#ifdef DBG
static UCHAR *txinfo_type_str[]={"PKT", "", "CMD", "RSV", "Invalid"};
static UCHAR *txinfo_d_port_str[]={"WLAN", "CPU_RX", "CPU_TX", "HOST", "VIRT_RX", "VIRT_TX", "DROP", "Invalid"};
static UCHAR *txinfo_que_str[]={"MGMT", "HCCA", "EDCA_1", "EDCA_2", "Invalid"};
#endif

#define TXINFO_TYPE_STR(_x) ((_x)<=3 ? txinfo_type_str[_x] : txinfo_type_str[4])
#define TXINFO_DPORT_STR(_x) ((_x) <= 6 ? txinfo_d_port_str[_x]: txinfo_d_port_str[7])
Expand All @@ -177,7 +181,9 @@ VOID dump_txinfo(RTMP_ADAPTER *pAd, TXINFO_STRUC *pTxInfo)

#ifdef RLT_MAC
{
#ifdef DBG
struct _TXINFO_NMAC_PKT *pkt_txinfo = (struct _TXINFO_NMAC_PKT *)pTxInfo;
#endif

DBGPRINT(RT_DEBUG_OFF, ("\tInfo_Type=%d(%s)\n", pkt_txinfo->info_type, TXINFO_TYPE_STR(pkt_txinfo->info_type)));
DBGPRINT(RT_DEBUG_OFF, ("\td_port=%d(%s)\n", pkt_txinfo->d_port, TXINFO_DPORT_STR(pkt_txinfo->d_port)));
Expand Down
3 changes: 2 additions & 1 deletion common/cmm_data_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ VOID rlt_usb_write_txinfo(
}


#if 0
static VOID rlt_usb_update_txinfo(
IN RTMP_ADAPTER *pAd,
IN TXINFO_STRUC *pTxInfo,
Expand All @@ -219,6 +220,7 @@ static VOID rlt_usb_update_txinfo(
#ifdef RLT_MAC
#endif /* RLT_MAC */
}
#endif


#ifdef CONFIG_STA_SUPPORT
Expand Down Expand Up @@ -1158,7 +1160,6 @@ PNDIS_PACKET GetPacketFromRxRing(
UCHAR *pData, *RXDMA;
ULONG ThisFrameLen, RxBufferLength, valid_len;
RXWI_STRUC *pRxWI;
UINT8 RXWISize = pAd->chipCap.RXWISize;
RXINFO_STRUC *pRxInfo;
#ifdef RLT_MAC
RXFCE_INFO *pRxFceInfo;
Expand Down
4 changes: 2 additions & 2 deletions common/cmm_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ INT Set_DebugFunc_Proc(
{
DBGPRINT_S(RT_DEBUG_TRACE, ("==>%s()\n", __FUNCTION__));
RTDebugFunc = simple_strtol(arg, 0, 10);
DBGPRINT_S(RT_DEBUG_TRACE, ("Set RTDebugFunc = 0x%x\n", RTDebugFunc));
DBGPRINT_S(RT_DEBUG_TRACE, ("Set RTDebugFunc = 0x%lx\n", RTDebugFunc));

return TRUE;
}
Expand Down Expand Up @@ -5957,7 +5957,7 @@ INT set_rf(RTMP_ADAPTER *pAd, PSTRING arg)

if (arg)
{
rv = sscanf(arg, "%d-%d-%x", &(bank_id), &(rf_id), &(rf_val));
rv = sscanf(arg, "%d-%d-%hhx", &(bank_id), &(rf_id), &(rf_val));
DBGPRINT(RT_DEBUG_TRACE, ("%s():rv = %d, bank_id = %d, rf_id = %d, rf_val = 0x%02x\n", __FUNCTION__, rv, bank_id, rf_id, rf_val));
if (rv == 3)
{
Expand Down
1 change: 0 additions & 1 deletion common/cmm_mac_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,6 @@ Return Value:
VOID RT28XXDMAEnable(
IN RTMP_ADAPTER *pAd)
{
WPDMA_GLO_CFG_STRUC GloCfg;
USB_DMA_CFG_STRUC UsbCfg;


Expand Down
6 changes: 5 additions & 1 deletion common/cmm_wpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,9 @@ VOID PeerPairMsg4Action(
PHEADER_802_11 pHeader;
UINT MsgLen;
BOOLEAN Cancelled;
UCHAR group_cipher = Ndis802_11WEPDisabled;
#ifdef DBG
UCHAR group_cipher = Ndis802_11WEPDisabled;
#endif

DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg4Action\n"));

Expand Down Expand Up @@ -1518,7 +1520,9 @@ VOID PeerGroupMsg2Action(
PUCHAR pData;
BOOLEAN Cancelled;
PEAPOL_PACKET pMsg2;
#ifdef DBG
UCHAR group_cipher = Ndis802_11WEPDisabled;
#endif

DBGPRINT(RT_DEBUG_TRACE, ("===> PeerGroupMsg2Action \n"));

Expand Down
4 changes: 2 additions & 2 deletions common/crypt_aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ INT AES_Key_Wrap (
/* if ((pResult = (UINT8 *) kmalloc(sizeof(UINT8)*PlainTextLength, GFP_ATOMIC)) == NULL) {
*/
if (pResult == NULL) {
DBGPRINT(RT_DEBUG_ERROR, ("AES_Key_Wrap: allocate %d bytes memory failure.\n", sizeof(UINT8)*PlainTextLength));
DBGPRINT(RT_DEBUG_ERROR, ("AES_Key_Wrap: allocate %lu bytes memory failure.\n", sizeof(UINT8)*PlainTextLength));
return -2;
} /* End of if */

Expand Down Expand Up @@ -1551,7 +1551,7 @@ INT AES_Key_Unwrap (
/* if ((pResult = (UINT8 *) kmalloc(sizeof(UINT8)*PlainLength, GFP_ATOMIC)) == NULL) {
*/
if (pResult == NULL) {
DBGPRINT(RT_DEBUG_ERROR, ("AES_Key_Unwrap: allocate %d bytes memory failure.\n", sizeof(UINT8)*PlainLength));
DBGPRINT(RT_DEBUG_ERROR, ("AES_Key_Unwrap: allocate %lu bytes memory failure.\n", sizeof(UINT8)*PlainLength));
return -2;
} /* End of if */

Expand Down
4 changes: 2 additions & 2 deletions common/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ VOID MlmeResetRalinkCounters(
#endif /* RALINK_ATE */
/* for performace enchanement */
NdisZeroMemory(&pAd->RalinkCounters,
(UINT32)&pAd->RalinkCounters.OneSecEnd -
(UINT32)&pAd->RalinkCounters.OneSecStart);
(UINT32)(&pAd->RalinkCounters.OneSecEnd -
&pAd->RalinkCounters.OneSecStart));

return;
}
Expand Down
4 changes: 4 additions & 0 deletions common/rtmp_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ VOID NICReadEEPROMParameters(RTMP_ADAPTER *pAd, PSTRING mac_addr)
else
#endif /* RT65xx */
/* 1. 11a*/
#if 0
{
{
}
Expand All @@ -719,6 +720,7 @@ VOID NICReadEEPROMParameters(RTMP_ADAPTER *pAd, PSTRING mac_addr)
pAd->TssiPlusBoundaryA[1], pAd->TssiPlusBoundaryA[2], pAd->TssiPlusBoundaryA[3], pAd->TssiPlusBoundaryA[4],
pAd->TxAgcStepA, pAd->bAutoTxAgcA));
}
#endif
pAd->BbpRssiToDbmDelta = 0x0;

/* Read frequency offset setting for RF*/
Expand Down Expand Up @@ -1058,7 +1060,9 @@ VOID NICInitAsicFromEEPROM(
#ifdef CONFIG_STA_SUPPORT
UINT32 data = 0;
#endif /* CONFIG_STA_SUPPORT */
#ifndef RT65xx
USHORT i;
#endif
#ifdef RALINK_ATE
USHORT value;
#endif /* RALINK_ATE */
Expand Down
1 change: 0 additions & 1 deletion common/rtusb_bulk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,6 @@ VOID RTUSBCancelPendingBulkInIRP(
PRX_CONTEXT pRxContext;
PCMD_RSP_CONTEXT pCmdRspEventContext = &pAd->CmdRspEventContext;
UINT i;
ULONG IrqFlags;

DBGPRINT_RAW(RT_DEBUG_TRACE, ("--->RTUSBCancelPendingBulkInIRP\n"));
for ( i = 0; i < (RX_RING_SIZE); i++)
Expand Down
7 changes: 5 additions & 2 deletions common/rtusb_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,9 @@ int write_reg(

if (ret) {
DBGPRINT(RT_DEBUG_ERROR, ("write reg fail\n"));
return;
}

return ret;
}

int read_reg(
Expand All @@ -537,6 +538,7 @@ int read_reg(
req = 0x47;
else if (base == 0x41)
req = 0x7;
else return -1;

ret = RTUSB_VendorRequest(ad,
(USBD_TRANSFER_DIRECTION_IN | USBD_SHORT_TRANSFER_OK),
Expand All @@ -551,6 +553,8 @@ int read_reg(

if (ret)
*value = 0xffffffff;

return ret;
}

/*
Expand Down Expand Up @@ -801,7 +805,6 @@ NTSTATUS RTUSBWriteEEPROM(
IN USHORT length)
{
NTSTATUS Status = STATUS_SUCCESS;
USHORT Value;

Status = RTUSB_VendorRequest(
pAd,
Expand Down
2 changes: 1 addition & 1 deletion common/spectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -1969,7 +1969,7 @@ static VOID PeerMeasureReportAction(
/* if ((pMeasureReportInfo = kmalloc(sizeof(MEASURE_RPI_REPORT), GFP_ATOMIC)) == NULL)*/
if (pMeasureReportInfo == NULL)
{
DBGPRINT(RT_DEBUG_ERROR, ("%s unable to alloc memory for measure report buffer (size=%d).\n", __FUNCTION__, sizeof(MEASURE_RPI_REPORT)));
DBGPRINT(RT_DEBUG_ERROR, ("%s unable to alloc memory for measure report buffer (size=%lu).\n", __FUNCTION__, sizeof(MEASURE_RPI_REPORT)));
return;
}

Expand Down
4 changes: 2 additions & 2 deletions common/txpower.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ VOID AsicGetAutoAgcOffsetForExternalTxAlc(
/* a channel */
bAutoTxAgc = pAd->bAutoTxAgcA;
TssiRef = pAd->TssiRefA;
pTssiMinusBoundary = &pAd->TssiMinusBoundaryA[0];
pTssiPlusBoundary = &pAd->TssiPlusBoundaryA[0];
pTssiMinusBoundary = &pAd->TssiMinusBoundaryA[0][0];
pTssiPlusBoundary = &pAd->TssiPlusBoundaryA[0][0];
TxAgcStep = pAd->TxAgcStepA;
pTxAgcCompensate = &pAd->TxAgcCompensateA;
}
Expand Down
4 changes: 4 additions & 0 deletions common/vht.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,10 @@ static struct vht_ch_layout vht_ch_80M[]={

VOID dump_vht_cap(RTMP_ADAPTER *pAd, VHT_CAP_IE *vht_ie)
{
#ifdef DBG
VHT_CAP_INFO *vht_cap = &vht_ie->vht_cap;
VHT_MCS_SET *vht_mcs = &vht_ie->mcs_set;
#endif

DBGPRINT(RT_DEBUG_OFF, ("Dump VHT_CAP IE\n"));
hex_dump("VHT CAP IE Raw Data", (UCHAR *)vht_ie, sizeof(VHT_CAP_IE));
Expand Down Expand Up @@ -137,8 +139,10 @@ VOID dump_vht_cap(RTMP_ADAPTER *pAd, VHT_CAP_IE *vht_ie)

VOID dump_vht_op(RTMP_ADAPTER *pAd, VHT_OP_IE *vht_ie)
{
#ifdef DBG
VHT_OP_INFO *vht_op = &vht_ie->vht_op_info;
VHT_MCS_MAP *vht_mcs = &vht_ie->basic_mcs_set;
#endif

DBGPRINT(RT_DEBUG_OFF, ("Dump VHT_OP IE\n"));
hex_dump("VHT OP IE Raw Data", (UCHAR *)vht_ie, sizeof(VHT_OP_IE));
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 @@ -792,7 +792,7 @@ void linux_pci_unmap_single(void *handle, ra_dma_addr_t dma_addr, size_t size, i
RTUSBReadMACRegister((_A), (_R), (PUINT32) (_pV))

#define RTMP_IO_WRITE32(_A, _R, _V) \
RTUSBWriteMACRegister((_A), (_R), (UINT32) (_V), FALSE)
RTUSBWriteMACRegister((_A), (_R), (_V), FALSE)

#define RTMP_IO_WRITE8(_A, _R, _V) \
{ \
Expand Down
2 changes: 1 addition & 1 deletion include/rt_os_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ VOID RtmpDrvAllE2PPrint(

VOID RtmpDrvAllRFPrint(
IN VOID *pReserved,
IN UINT32 *pBuf,
IN CHAR *pBuf,
IN UINT32 BufLen);

int RtmpOSIRQRelease(
Expand Down
Loading

0 comments on commit 70e7bc3

Please sign in to comment.