Commit 9f548a2a authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Greg Kroah-Hartman

Staging: rt28x0: fix comments in *.c files

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 52b81c89
......@@ -41,18 +41,18 @@
#ifndef RTMP_RF_RW_SUPPORT
#error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip"
#endif // RTMP_RF_RW_SUPPORT //
#endif /* RTMP_RF_RW_SUPPORT // */
VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
{
INT i;
UCHAR RFValue;
// Driver must read EEPROM to get RfIcType before initial RF registers
// Initialize RF register to default value
/* Driver must read EEPROM to get RfIcType before initial RF registers */
/* Initialize RF register to default value */
if (IS_RT3070(pAd) || IS_RT3071(pAd)) {
// Init RF calibration
// Driver should toggle RF R30 bit7 before init RF registers
/* Init RF calibration */
/* Driver should toggle RF R30 bit7 before init RF registers */
UINT32 RfReg = 0;
UINT32 data;
......@@ -63,38 +63,38 @@ VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
RfReg &= 0x7F;
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg);
// Initialize RF register to default value
/* Initialize RF register to default value */
for (i = 0; i < NUM_RF_REG_PARMS; i++) {
RT30xxWriteRFRegister(pAd,
RT30xx_RFRegTable[i].Register,
RT30xx_RFRegTable[i].Value);
}
// add by johnli
/* add by johnli */
if (IS_RT3070(pAd)) {
//
// The DAC issue(LDO_CFG0) has been fixed in RT3070(F).
// The voltage raising patch is no longer needed for RT3070(F)
//
/* */
/* The DAC issue(LDO_CFG0) has been fixed in RT3070(F). */
/* The voltage raising patch is no longer needed for RT3070(F) */
/* */
if ((pAd->MACVersion & 0xffff) < 0x0201) {
// Update MAC 0x05D4 from 01xxxxxx to 0Dxxxxxx (voltage 1.2V to 1.35V) for RT3070 to improve yield rate
/* Update MAC 0x05D4 from 01xxxxxx to 0Dxxxxxx (voltage 1.2V to 1.35V) for RT3070 to improve yield rate */
RTUSBReadMACRegister(pAd, LDO_CFG0, &data);
data = ((data & 0xF0FFFFFF) | 0x0D000000);
RTUSBWriteMACRegister(pAd, LDO_CFG0, data);
}
} else if (IS_RT3071(pAd)) {
// Driver should set RF R6 bit6 on before init RF registers
/* Driver should set RF R6 bit6 on before init RF registers */
RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR) & RfReg);
RfReg |= 0x40;
RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR) RfReg);
// init R31
/* init R31 */
RT30xxWriteRFRegister(pAd, RF_R31, 0x14);
// RT3071 version E has fixed this issue
/* RT3071 version E has fixed this issue */
if ((pAd->NicConfig2.field.DACTestBit == 1)
&& ((pAd->MACVersion & 0xffff) < 0x0211)) {
// patch tx EVM issue temporarily
/* patch tx EVM issue temporarily */
RTUSBReadMACRegister(pAd, LDO_CFG0, &data);
data = ((data & 0xE0FFFFFF) | 0x0D000000);
RTUSBWriteMACRegister(pAd, LDO_CFG0, data);
......@@ -104,35 +104,35 @@ VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
RTMP_IO_WRITE32(pAd, LDO_CFG0, data);
}
// patch LNA_PE_G1 failed issue
/* patch LNA_PE_G1 failed issue */
RTUSBReadMACRegister(pAd, GPIO_SWITCH, &data);
data &= ~(0x20);
RTUSBWriteMACRegister(pAd, GPIO_SWITCH, data);
}
//For RF filter Calibration
/*For RF filter Calibration */
RTMPFilterCalibration(pAd);
// Initialize RF R27 register, set RF R27 must be behind RTMPFilterCalibration()
//
// TX to RX IQ glitch(RF_R27) has been fixed in RT3070(F).
// Raising RF voltage is no longer needed for RT3070(F)
//
/* Initialize RF R27 register, set RF R27 must be behind RTMPFilterCalibration() */
/* */
/* TX to RX IQ glitch(RF_R27) has been fixed in RT3070(F). */
/* Raising RF voltage is no longer needed for RT3070(F) */
/* */
if ((IS_RT3070(pAd)) && ((pAd->MACVersion & 0xffff) < 0x0201)) {
RT30xxWriteRFRegister(pAd, RF_R27, 0x3);
} else if ((IS_RT3071(pAd))
&& ((pAd->MACVersion & 0xffff) < 0x0211)) {
RT30xxWriteRFRegister(pAd, RF_R27, 0x3);
}
// set led open drain enable
/* set led open drain enable */
RTUSBReadMACRegister(pAd, OPT_14, &data);
data |= 0x01;
RTUSBWriteMACRegister(pAd, OPT_14, data);
// move from RT30xxLoadRFNormalModeSetup because it's needed for both RT3070 and RT3071
// TX_LO1_en, RF R17 register Bit 3 to 0
/* move from RT30xxLoadRFNormalModeSetup because it's needed for both RT3070 and RT3071 */
/* TX_LO1_en, RF R17 register Bit 3 to 0 */
RT30xxReadRFRegister(pAd, RF_R17, &RFValue);
RFValue &= (~0x08);
// to fix rx long range issue
/* to fix rx long range issue */
if (pAd->NicConfig2.field.ExternalLNAForG == 0) {
if ((IS_RT3071(pAd)
&& ((pAd->MACVersion & 0xffff) >= 0x0211))
......@@ -140,22 +140,22 @@ VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
RFValue |= 0x20;
}
}
// set RF_R17_bit[2:0] equal to EEPROM setting at 0x48h
/* set RF_R17_bit[2:0] equal to EEPROM setting at 0x48h */
if (pAd->TxMixerGain24G >= 1) {
RFValue &= (~0x7); // clean bit [2:0]
RFValue &= (~0x7); /* clean bit [2:0] */
RFValue |= pAd->TxMixerGain24G;
}
RT30xxWriteRFRegister(pAd, RF_R17, RFValue);
if (IS_RT3071(pAd)) {
// add by johnli, RF power sequence setup, load RF normal operation-mode setup
/* add by johnli, RF power sequence setup, load RF normal operation-mode setup */
RT30xxLoadRFNormalModeSetup(pAd);
} else if (IS_RT3070(pAd)) {
/* add by johnli, reset RF_R27 when interface down & up to fix throughput problem */
// LDORF_VC, RF R27 register Bit 2 to 0
/* LDORF_VC, RF R27 register Bit 2 to 0 */
RT30xxReadRFRegister(pAd, RF_R27, &RFValue);
// TX to RX IQ glitch(RF_R27) has been fixed in RT3070(F).
// Raising RF voltage is no longer needed for RT3070(F)
/* TX to RX IQ glitch(RF_R27) has been fixed in RT3070(F). */
/* Raising RF voltage is no longer needed for RT3070(F) */
if ((pAd->MACVersion & 0xffff) < 0x0201)
RFValue = (RFValue & (~0x77)) | 0x3;
else
......@@ -166,4 +166,4 @@ VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
}
}
#endif // RT3070 //
#endif /* RT3070 // */
......@@ -41,16 +41,16 @@
#ifndef RTMP_RF_RW_SUPPORT
#error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip"
#endif // RTMP_RF_RW_SUPPORT //
#endif /* RTMP_RF_RW_SUPPORT // */
VOID NICInitRT3090RFRegisters(IN PRTMP_ADAPTER pAd)
{
INT i;
// Driver must read EEPROM to get RfIcType before initial RF registers
// Initialize RF register to default value
/* Driver must read EEPROM to get RfIcType before initial RF registers */
/* Initialize RF register to default value */
if (IS_RT3090(pAd)) {
// Init RF calibration
// Driver should toggle RF R30 bit7 before init RF registers
/* Init RF calibration */
/* Driver should toggle RF R30 bit7 before init RF registers */
UINT32 RfReg = 0, data;
RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR) & RfReg);
......@@ -60,14 +60,14 @@ VOID NICInitRT3090RFRegisters(IN PRTMP_ADAPTER pAd)
RfReg &= 0x7F;
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR) RfReg);
// init R24, R31
/* init R24, R31 */
RT30xxWriteRFRegister(pAd, RF_R24, 0x0F);
RT30xxWriteRFRegister(pAd, RF_R31, 0x0F);
// RT309x version E has fixed this issue
/* RT309x version E has fixed this issue */
if ((pAd->NicConfig2.field.DACTestBit == 1)
&& ((pAd->MACVersion & 0xffff) < 0x0211)) {
// patch tx EVM issue temporarily
/* patch tx EVM issue temporarily */
RTMP_IO_READ32(pAd, LDO_CFG0, &data);
data = ((data & 0xE0FFFFFF) | 0x0D000000);
RTMP_IO_WRITE32(pAd, LDO_CFG0, data);
......@@ -77,43 +77,43 @@ VOID NICInitRT3090RFRegisters(IN PRTMP_ADAPTER pAd)
RTMP_IO_WRITE32(pAd, LDO_CFG0, data);
}
// patch LNA_PE_G1 failed issue
/* patch LNA_PE_G1 failed issue */
RTMP_IO_READ32(pAd, GPIO_SWITCH, &data);
data &= ~(0x20);
RTMP_IO_WRITE32(pAd, GPIO_SWITCH, data);
// Initialize RF register to default value
/* Initialize RF register to default value */
for (i = 0; i < NUM_RF_REG_PARMS; i++) {
RT30xxWriteRFRegister(pAd,
RT30xx_RFRegTable[i].Register,
RT30xx_RFRegTable[i].Value);
}
// Driver should set RF R6 bit6 on before calibration
/* Driver should set RF R6 bit6 on before calibration */
RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR) & RfReg);
RfReg |= 0x40;
RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR) RfReg);
//For RF filter Calibration
/*For RF filter Calibration */
RTMPFilterCalibration(pAd);
// Initialize RF R27 register, set RF R27 must be behind RTMPFilterCalibration()
/* Initialize RF R27 register, set RF R27 must be behind RTMPFilterCalibration() */
if ((pAd->MACVersion & 0xffff) < 0x0211)
RT30xxWriteRFRegister(pAd, RF_R27, 0x3);
// set led open drain enable
/* set led open drain enable */
RTMP_IO_READ32(pAd, OPT_14, &data);
data |= 0x01;
RTMP_IO_WRITE32(pAd, OPT_14, data);
// set default antenna as main
/* set default antenna as main */
if (pAd->RfIcType == RFIC_3020)
AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
// add by johnli, RF power sequence setup, load RF normal operation-mode setup
/* add by johnli, RF power sequence setup, load RF normal operation-mode setup */
RT30xxLoadRFNormalModeSetup(pAd);
}
}
#endif // RT3090 //
#endif /* RT3090 // */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -26,9 +26,9 @@
#include "rt_config.h"
// Following information will be show when you run 'modinfo'
// *** If you have a solution for the bug in current version of driver, please mail to me.
// Otherwise post to forum in ralinktech's web site(www.ralinktech.com) and let all users help you. ***
/* Following information will be show when you run 'modinfo' */
/* *** If you have a solution for the bug in current version of driver, please mail to me. */
/* Otherwise post to forum in ralinktech's web site(www.ralinktech.com) and let all users help you. *** */
MODULE_AUTHOR("Paul Lin <paul_lin@ralinktech.com>");
MODULE_DESCRIPTION("RT2870/RT3070 Wireless Lan Linux Driver");
MODULE_LICENSE("GPL");
......@@ -101,7 +101,7 @@ struct usb_device_id rtusb_usb_id[] = {
{USB_DEVICE(0x1737, 0x0071)}, /* Linksys WUSB600N */
{USB_DEVICE(0x0411, 0x00e8)}, /* Buffalo WLI-UC-G300N */
{USB_DEVICE(0x050d, 0x815c)}, /* Belkin F5D8053 */
#endif // RT2870 //
#endif /* RT2870 // */
#ifdef RT3070
{USB_DEVICE(0x148F, 0x3070)}, /* Ralink 3070 */
{USB_DEVICE(0x148F, 0x3071)}, /* Ralink 3071 */
......@@ -134,7 +134,7 @@ struct usb_device_id rtusb_usb_id[] = {
{USB_DEVICE(0x5A57, 0x0283)}, /* Zinwell 3072 */
{USB_DEVICE(0x04BB, 0x0945)}, /* I-O DATA 3072 */
{USB_DEVICE(0x203D, 0x1480)}, /* Encore 3070 */
#endif // RT3070 //
#endif /* RT3070 // */
{USB_DEVICE(0x0DF6, 0x003F)}, /* Sitecom WL-608 */
{USB_DEVICE(0x1737, 0x0077)}, /* Linksys WUSB54GC-EU v3 */
{USB_DEVICE(0x2001, 0x3C09)}, /* D-Link */
......@@ -207,14 +207,14 @@ BOOLEAN RT28XXChipsetCheck(IN void *_dev_p)
/**************************************************************************/
/**************************************************************************/
//tested for kernel 2.6series
/*tested for kernel 2.6series */
/**************************************************************************/
/**************************************************************************/
#ifdef CONFIG_PM
static int rt2870_suspend(struct usb_interface *intf, pm_message_t state);
static int rt2870_resume(struct usb_interface *intf);
#endif // CONFIG_PM //
#endif /* CONFIG_PM // */
static int rtusb_probe(struct usb_interface *intf,
const struct usb_device_id *id);
......@@ -264,8 +264,8 @@ static BOOLEAN USBDevConfigInit(IN struct usb_device *dev,
((iface_desc->endpoint[i].desc.
bEndpointAddress & USB_ENDPOINT_DIR_MASK) ==
USB_DIR_OUT)) {
// there are 6 bulk out EP. EP6 highest priority.
// EP1-4 is EDCA. EP5 is HCCA.
/* there are 6 bulk out EP. EP6 highest priority. */
/* EP1-4 is EDCA. EP5 is HCCA. */
pAd->BulkOutEpAddr[BulkOutIdx++] =
iface_desc->endpoint[i].desc.bEndpointAddress;
pAd->BulkOutMaxPacketSize =
......@@ -340,8 +340,8 @@ resume:rt2870_resume,
VOID RT2870RejectPendingPackets(IN PRTMP_ADAPTER pAd)
{
// clear PS packets
// clear TxSw packets
/* clear PS packets */
/* clear TxSw packets */
}
static int rt2870_suspend(struct usb_interface *intf, pm_message_t state)
......@@ -379,16 +379,16 @@ static int rt2870_resume(struct usb_interface *intf)
DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2870_resume()\n"));
return 0;
}
#endif // CONFIG_PM //
#endif /* CONFIG_PM // */
// Init driver module
/* Init driver module */
INT __init rtusb_init(void)
{
printk("rtusb init --->\n");
return usb_register(&rtusb_driver);
}
// Deinit driver module
/* Deinit driver module */
VOID __exit rtusb_exit(void)
{
usb_deregister(&rtusb_driver);
......@@ -442,7 +442,7 @@ INT MlmeThread(IN void *Context)
#endif
/* lock the device pointers , need to check if required */
//down(&(pAd->usbdev_semaphore));
/*down(&(pAd->usbdev_semaphore)); */
if (!pAd->PM_FlgSuspend)
MlmeHandler(pAd);
......@@ -521,7 +521,7 @@ INT RTUSBCmdThread(IN void *Context)
CMDHandler(pAd);
}
if (pAd && !pAd->PM_FlgSuspend) { // Clear the CmdQElements.
if (pAd && !pAd->PM_FlgSuspend) { /* Clear the CmdQElements. */
CmdQElmt *pCmdQElmt = NULL;
NdisAcquireSpinLock(&pAd->CmdQLock);
......@@ -633,10 +633,10 @@ VOID RTUSBWatchDog(IN RTMP_ADAPTER * pAd)
fRTMP_ADAPTER_NIC_NOT_EXIST |
fRTMP_ADAPTER_BULKOUT_RESET)))
) {
// FIXME: Following code just support single bulk out. If you wanna support multiple bulk out. Modify it!
/* FIXME: Following code just support single bulk out. If you wanna support multiple bulk out. Modify it! */
pHTTXContext =
(PHT_TX_CONTEXT) (&pAd->TxContext[idx]);
if (pHTTXContext->IRPPending) { // Check TxContext.
if (pHTTXContext->IRPPending) { /* Check TxContext. */
pUrb = pHTTXContext->pUrb;
actual_length = pUrb->actual_length;
......@@ -647,7 +647,7 @@ VOID RTUSBWatchDog(IN RTMP_ADAPTER * pAd)
PTX_CONTEXT pMLMEContext, pNULLContext,
pPsPollContext;
//Check MgmtContext.
/*Check MgmtContext. */
pMLMEContext =
(PTX_CONTEXT) (pAd->MgmtRing.
Cell[pAd->MgmtRing.
......@@ -688,7 +688,7 @@ VOID RTUSBWatchDog(IN RTMP_ADAPTER * pAd)
&& pAd->TransferedLength[idx] <
transfer_buffer_length
&& actual_length != 0
// && TxRxQ_Pcnt==0
/* && TxRxQ_Pcnt==0 */
&& pAd->watchDogTxPendingCnt[idx] >
3)
|| isDataPacket == FALSE
......@@ -699,10 +699,10 @@ VOID RTUSBWatchDog(IN RTMP_ADAPTER * pAd)
idx));
DBGPRINT(RT_DEBUG_TRACE,
("Unlink the pending URB!\n"));
// unlink it now
/* unlink it now */
RTUSB_UNLINK_URB(pUrb);
// Sleep 200 microseconds to give cancellation time to work
//RTMPusecDelay(200);
/* Sleep 200 microseconds to give cancellation time to work */
/*RTMPusecDelay(200); */
needDumpSeq = TRUE;
}
} else {
......@@ -721,7 +721,7 @@ VOID RTUSBWatchDog(IN RTMP_ADAPTER * pAd)
}
}
// For Sigma debug, dump the ba_reordering sequence.
/* For Sigma debug, dump the ba_reordering sequence. */
if ((needDumpSeq == TRUE) && (pAd->CommonCfg.bDisableReordering == 0)) {
USHORT Idx;
PBA_REC_ENTRY pBAEntry = NULL;
......@@ -780,22 +780,22 @@ static void rt2870_disconnect(struct usb_device *dev, PRTMP_ADAPTER pAd)
}
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST);
// for debug, wait to show some messages to /proc system
/* for debug, wait to show some messages to /proc system */
udelay(1);
RtmpPhyNetDevExit(pAd, pAd->net_dev);
// FIXME: Shall we need following delay and flush the schedule??
/* FIXME: Shall we need following delay and flush the schedule?? */
udelay(1);
flush_scheduled_work();
udelay(1);
// free the root net_device
/* free the root net_device */
RtmpOSNetDevFree(pAd->net_dev);
RtmpRaDevCtrlExit(pAd);
// release a use of the usb device structure
/* release a use of the usb device structure */
usb_put_dev(dev);
udelay(1);
......@@ -815,12 +815,12 @@ static int __devinit rt2870_probe(IN struct usb_interface *intf,
DBGPRINT(RT_DEBUG_TRACE, ("===>rt2870_probe()!\n"));
// Check chipset vendor/product ID
//if (RT28XXChipsetCheck(_dev_p) == FALSE)
// goto err_out;
/* Check chipset vendor/product ID */
/*if (RT28XXChipsetCheck(_dev_p) == FALSE) */
/* goto err_out; */
//RtmpDevInit=============================================
// Allocate RTMP_ADAPTER adapter structure
/*RtmpDevInit============================================= */
/* Allocate RTMP_ADAPTER adapter structure */
handle = kmalloc(sizeof(struct os_cookie), GFP_KERNEL);
if (handle == NULL) {
printk
......@@ -834,18 +834,18 @@ static int __devinit rt2870_probe(IN struct usb_interface *intf,
kfree(handle);
goto err_out;
}
//USBDevInit==============================================
/*USBDevInit============================================== */
if (USBDevConfigInit(usb_dev, intf, pAd) == FALSE)
goto err_out_free_radev;
RtmpRaDevCtrlInit(pAd, RTMP_DEV_INF_USB);
//NetDevInit==============================================
/*NetDevInit============================================== */
net_dev = RtmpPhyNetDevInit(pAd, &netDevHook);
if (net_dev == NULL)
goto err_out_free_radev;
// Here are the net_device structure with usb specific parameters.
/* Here are the net_device structure with usb specific parameters. */
/* for supporting Network Manager.
* Set the sysfs physical device reference for the network logical device if set prior to registration will
* cause a symlink during initialization.
......@@ -854,8 +854,8 @@ static int __devinit rt2870_probe(IN struct usb_interface *intf,
pAd->StaCfg.OriDevType = net_dev->type;
//All done, it's time to register the net device to linux kernel.
// Register this device
/*All done, it's time to register the net device to linux kernel. */
/* Register this device */
status = RtmpOSNetDevAttach(net_dev, &netDevHook);
if (status != 0)
goto err_out_free_netdev;
......
This diff is collapsed.
......@@ -41,7 +41,7 @@
#include "../rt_config.h"
extern UCHAR Phy11BGNextRateUpward[]; // defined in mlme.c
extern UCHAR Phy11BGNextRateUpward[]; /* defined in mlme.c */
extern UCHAR EpToQueue[];
VOID REPORT_AMSDU_FRAMES_TO_LLC(IN PRTMP_ADAPTER pAd,
......@@ -89,8 +89,8 @@ NDIS_STATUS RTUSBFreeDescriptorRequest(IN PRTMP_ADAPTER pAd,
IN UCHAR BulkOutPipeId,
IN UINT32 NumberRequired)
{
// UCHAR FreeNumber = 0;
// UINT Index;
/* UCHAR FreeNumber = 0; */
/* UINT Index; */
NDIS_STATUS Status = NDIS_STATUS_FAILURE;
unsigned long IrqFlags;
HT_TX_CONTEXT *pHTTXContext;
......@@ -251,7 +251,7 @@ VOID RTMPWriteTxInfo(IN PRTMP_ADAPTER pAd,
if (QueueSel != FIFO_EDCA)
DBGPRINT(RT_DEBUG_TRACE,
("====> QueueSel != FIFO_EDCA<============\n"));
pTxInfo->USBDMANextVLD = FALSE; //NextValid; // Need to check with Jan about this.
pTxInfo->USBDMANextVLD = FALSE; /*NextValid; // Need to check with Jan about this. */
pTxInfo->USBDMATxburst = TxBurst;
pTxInfo->WIV = bWiv;
pTxInfo->SwUseLastRound = 0;
......@@ -259,4 +259,4 @@ VOID RTMPWriteTxInfo(IN PRTMP_ADAPTER pAd,
pTxInfo->rsv2 = 0;
}
#endif // RTMP_MAC_USB //
#endif /* RTMP_MAC_USB // */
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment