From 9f548a2a3dd8feca99f7301df474f983c1e815f3 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 11 Dec 2009 12:23:14 -0800 Subject: Staging: rt28x0: fix comments in *.c files Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rt2860/rt_main_dev.c | 168 +++++++++++++++++------------------ 1 file changed, 84 insertions(+), 84 deletions(-) (limited to 'drivers/staging/rt2860/rt_main_dev.c') diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 8f65e469b51..84be9d0cfb9 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -41,8 +41,8 @@ /* Private Variables Used */ /*---------------------------------------------------------------------*/ -PSTRING mac = ""; // default 00:00:00:00:00:00 -PSTRING hostname = ""; // default CMPC +PSTRING mac = ""; /* default 00:00:00:00:00:00 */ +PSTRING hostname = ""; /* default CMPC */ module_param(mac, charp, 0); MODULE_PARM_DESC(mac, "rt28xx: wireless mac addr"); @@ -50,11 +50,11 @@ MODULE_PARM_DESC(mac, "rt28xx: wireless mac addr"); /* Prototypes of Functions Used */ /*---------------------------------------------------------------------*/ -// public function prototype +/* public function prototype */ int rt28xx_close(IN struct net_device *net_dev); int rt28xx_open(struct net_device *net_dev); -// private function prototype +/* private function prototype */ static INT rt28xx_send_packets(IN struct sk_buff *skb_p, IN struct net_device *net_dev); @@ -87,9 +87,9 @@ int MainVirtualIF_close(IN struct net_device *net_dev) GET_PAD_FROM_NET_DEV(pAd, net_dev); - // Sanity check for pAd + /* Sanity check for pAd */ if (pAd == NULL) - return 0; // close ok + return 0; /* close ok */ netif_carrier_off(pAd->net_dev); netif_stop_queue(pAd->net_dev); @@ -117,7 +117,7 @@ int MainVirtualIF_close(IN struct net_device *net_dev) sizeof (MLME_DISASSOC_REQ_STRUCT)); - // Prevent to connect AP again in STAMlmePeriodicExec + /* Prevent to connect AP again in STAMlmePeriodicExec */ pAd->MlmeAux.AutoReconnectSsidLen = 32; NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux. @@ -142,7 +142,7 @@ int MainVirtualIF_close(IN struct net_device *net_dev) RT_MOD_DEC_USE_COUNT(); - return 0; // close ok + return 0; /* close ok */ } /* @@ -171,14 +171,14 @@ int MainVirtualIF_open(IN struct net_device *net_dev) GET_PAD_FROM_NET_DEV(pAd, net_dev); - // Sanity check for pAd + /* Sanity check for pAd */ if (pAd == NULL) - return 0; // close ok + return 0; /* close ok */ if (VIRTUAL_IF_UP(pAd) != 0) return -1; - // increase MODULE use count + /* increase MODULE use count */ RT_MOD_INC_USE_COUNT(); netif_start_queue(net_dev); @@ -218,35 +218,35 @@ int rt28xx_close(IN PNET_DEV dev) #ifdef RTMP_MAC_USB DECLARE_WAIT_QUEUE_HEAD(unlink_wakeup); DECLARE_WAITQUEUE(wait, current); -#endif // RTMP_MAC_USB // +#endif /* RTMP_MAC_USB // */ GET_PAD_FROM_NET_DEV(pAd, net_dev); DBGPRINT(RT_DEBUG_TRACE, ("===> rt28xx_close\n")); Cancelled = FALSE; - // Sanity check for pAd + /* Sanity check for pAd */ if (pAd == NULL) - return 0; // close ok + return 0; /* close ok */ { #ifdef RTMP_MAC_PCI RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_CLOSE); -#endif // RTMP_MAC_PCI // +#endif /* RTMP_MAC_PCI // */ - // If dirver doesn't wake up firmware here, - // NICLoadFirmware will hang forever when interface is up again. + /* If dirver doesn't wake up firmware here, */ + /* NICLoadFirmware will hang forever when interface is up again. */ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)) { AsicForceWakeup(pAd, TRUE); } #ifdef RTMP_MAC_USB RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS); -#endif // RTMP_MAC_USB // +#endif /* RTMP_MAC_USB // */ MlmeRadioOff(pAd); #ifdef RTMP_MAC_PCI pAd->bPCIclkOff = FALSE; -#endif // RTMP_MAC_PCI // +#endif /* RTMP_MAC_PCI // */ } RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS); @@ -261,13 +261,13 @@ int rt28xx_close(IN PNET_DEV dev) } #ifdef RTMP_MAC_USB - // ensure there are no more active urbs. + /* ensure there are no more active urbs. */ add_wait_queue(&unlink_wakeup, &wait); pAd->wait = &unlink_wakeup; - // maybe wait for deletions to finish. + /* maybe wait for deletions to finish. */ i = 0; - //while((i < 25) && atomic_read(&pAd->PendingRx) > 0) + /*while((i < 25) && atomic_read(&pAd->PendingRx) > 0) */ while (i < 25) { unsigned long IrqFlags; @@ -278,17 +278,17 @@ int rt28xx_close(IN PNET_DEV dev) } RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags); - msleep(UNLINK_TIMEOUT_MS); //Time in millisecond + msleep(UNLINK_TIMEOUT_MS); /*Time in millisecond */ i++; } pAd->wait = NULL; remove_wait_queue(&unlink_wakeup, &wait); -#endif // RTMP_MAC_USB // +#endif /* RTMP_MAC_USB // */ - // Stop Mlme state machine + /* Stop Mlme state machine */ MlmeHalt(pAd); - // Close net tasklets + /* Close net tasklets */ RtmpNetTaskExit(pAd); { @@ -298,25 +298,25 @@ int rt28xx_close(IN PNET_DEV dev) MeasureReqTabExit(pAd); TpcReqTabExit(pAd); - // Close kernel threads + /* Close kernel threads */ RtmpMgmtTaskExit(pAd); #ifdef RTMP_MAC_PCI { BOOLEAN brc; - // ULONG Value; + /* ULONG Value; */ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE)) { RTMP_ASIC_INTERRUPT_DISABLE(pAd); } - // Receive packets to clear DMA index after disable interrupt. - //RTMPHandleRxDoneInterrupt(pAd); - // put to radio off to save power when driver unload. After radiooff, can't write /read register. So need to finish all - // register access before Radio off. + /* Receive packets to clear DMA index after disable interrupt. */ + /*RTMPHandleRxDoneInterrupt(pAd); */ + /* put to radio off to save power when driver unload. After radiooff, can't write /read register. So need to finish all */ + /* register access before Radio off. */ brc = RT28xxPciAsicRadioOff(pAd, RTMP_HALT, 0); -//In solution 3 of 3090F, the bPCIclkOff will be set to TRUE after calling RT28xxPciAsicRadioOff +/*In solution 3 of 3090F, the bPCIclkOff will be set to TRUE after calling RT28xxPciAsicRadioOff */ pAd->bPCIclkOff = FALSE; if (brc == FALSE) { @@ -335,22 +335,22 @@ int rt28xx_close(IN PNET_DEV dev) // Disable Rx, register value supposed will remain after reset NICIssueReset(pAd); */ -#endif // RTMP_MAC_PCI // +#endif /* RTMP_MAC_PCI // */ - // Free IRQ + /* Free IRQ */ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE)) { #ifdef RTMP_MAC_PCI - // Deregister interrupt function + /* Deregister interrupt function */ RtmpOSIRQRelease(net_dev); -#endif // RTMP_MAC_PCI // +#endif /* RTMP_MAC_PCI // */ RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE); } - // Free Ring or USB buffers + /* Free Ring or USB buffers */ RTMPFreeTxRxRingMemory(pAd); RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS); - // Free BA reorder resource + /* Free BA reorder resource */ ba_reordering_resource_release(pAd); RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_START_UP); @@ -360,7 +360,7 @@ int rt28xx_close(IN PNET_DEV dev) } DBGPRINT(RT_DEBUG_TRACE, ("<=== rt28xx_close\n")); - return 0; // close ok + return 0; /* close ok */ } /* End of rt28xx_close */ /* @@ -383,11 +383,11 @@ int rt28xx_open(IN PNET_DEV dev) struct net_device *net_dev = (struct net_device *)dev; PRTMP_ADAPTER pAd = NULL; int retval = 0; - //POS_COOKIE pObj; + /*POS_COOKIE pObj; */ GET_PAD_FROM_NET_DEV(pAd, net_dev); - // Sanity check for pAd + /* Sanity check for pAd */ if (pAd == NULL) { /* if 1st open fail, pAd will be free; So the net_dev->ml_priv will be NULL in 2rd open */ @@ -399,52 +399,52 @@ int rt28xx_open(IN PNET_DEV dev) net_dev->wireless_handlers = (struct iw_handler_def *)&rt28xx_iw_handler_def; } - // Request interrupt service routine for PCI device - // register the interrupt routine with the os + /* Request interrupt service routine for PCI device */ + /* register the interrupt routine with the os */ RtmpOSIRQRequest(net_dev); - // Init IRQ parameters stored in pAd + /* Init IRQ parameters stored in pAd */ RTMP_IRQ_INIT(pAd); - // Chip & other init + /* Chip & other init */ if (rt28xx_init(pAd, mac, hostname) == FALSE) goto err; - // Enable Interrupt + /* Enable Interrupt */ RTMP_IRQ_ENABLE(pAd); - // Now Enable RxTx + /* Now Enable RxTx */ RTMPEnableRxTx(pAd); RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_START_UP); { UINT32 reg = 0; - RTMP_IO_READ32(pAd, 0x1300, ®); // clear garbage interrupts + RTMP_IO_READ32(pAd, 0x1300, ®); /* clear garbage interrupts */ printk("0x1300 = %08x\n", reg); } { -// u32 reg; -// UINT8 byte; -// u16 tmp; +/* u32 reg; */ +/* UINT8 byte; */ +/* u16 tmp; */ -// RTMP_IO_READ32(pAd, XIFS_TIME_CFG, ®); +/* RTMP_IO_READ32(pAd, XIFS_TIME_CFG, ®); */ -// tmp = 0x0805; -// reg = (reg & 0xffff0000) | tmp; -// RTMP_IO_WRITE32(pAd, XIFS_TIME_CFG, reg); +/* tmp = 0x0805; */ +/* reg = (reg & 0xffff0000) | tmp; */ +/* RTMP_IO_WRITE32(pAd, XIFS_TIME_CFG, reg); */ } #ifdef RTMP_MAC_PCI RTMPInitPCIeLinkCtrlValue(pAd); -#endif // RTMP_MAC_PCI // +#endif /* RTMP_MAC_PCI // */ return (retval); err: -//+++Add by shiang, move from rt28xx_init() to here. +/*+++Add by shiang, move from rt28xx_init() to here. */ RtmpOSIRQRelease(net_dev); -//---Add by shiang, move from rt28xx_init() to here. +/*---Add by shiang, move from rt28xx_init() to here. */ return (-1); } /* End of rt28xx_open */ @@ -463,7 +463,7 @@ PNET_DEV RtmpPhyNetDevInit(IN RTMP_ADAPTER * pAd, IN RTMP_OS_NETDEV_OP_HOOK * pNetDevHook) { struct net_device *net_dev = NULL; -// NDIS_STATUS Status; +/* NDIS_STATUS Status; */ net_dev = RtmpOSNetDevCreate(pAd, INT_MAIN, 0, sizeof(PRTMP_ADAPTER), @@ -518,16 +518,16 @@ int rt28xx_packet_xmit(struct sk_buff *skb) /* RT2870STA does this in RTMPSendPackets() */ { - // Drop send request since we are in monitor mode + /* Drop send request since we are in monitor mode */ if (MONITOR_ON(pAd)) { RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE); goto done; } } - // EapolStart size is 18 + /* EapolStart size is 18 */ if (skb->len < 14) { - //printk("bad packet size: %d\n", pkt->len); + /*printk("bad packet size: %d\n", pkt->len); */ hex_dump("bad packet", skb->data, skb->len); RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE); goto done; @@ -577,7 +577,7 @@ static int rt28xx_send_packets(IN struct sk_buff *skb_p, return rt28xx_packet_xmit(skb_p); } -// This function will be called when query /proc +/* This function will be called when query /proc */ struct iw_statistics *rt28xx_get_wireless_stats(IN struct net_device *net_dev) { PRTMP_ADAPTER pAd = NULL; @@ -586,9 +586,9 @@ struct iw_statistics *rt28xx_get_wireless_stats(IN struct net_device *net_dev) DBGPRINT(RT_DEBUG_TRACE, ("rt28xx_get_wireless_stats --->\n")); - pAd->iw_stats.status = 0; // Status - device dependent for now + pAd->iw_stats.status = 0; /* Status - device dependent for now */ - // link quality + /* link quality */ if (pAd->OpMode == OPMODE_STA) pAd->iw_stats.qual.qual = ((pAd->Mlme.ChannelQuality * 12) / 10 + 10); @@ -603,16 +603,16 @@ struct iw_statistics *rt28xx_get_wireless_stats(IN struct net_device *net_dev) pAd->StaCfg.RssiSample.LastRssi2); } - pAd->iw_stats.qual.noise = pAd->BbpWriteLatch[66]; // noise level (dBm) + pAd->iw_stats.qual.noise = pAd->BbpWriteLatch[66]; /* noise level (dBm) */ pAd->iw_stats.qual.noise += 256 - 143; - pAd->iw_stats.qual.updated = 1; // Flags to know if updated + pAd->iw_stats.qual.updated = 1; /* Flags to know if updated */ #ifdef IW_QUAL_DBM - pAd->iw_stats.qual.updated |= IW_QUAL_DBM; // Level + Noise are dBm -#endif // IW_QUAL_DBM // + pAd->iw_stats.qual.updated |= IW_QUAL_DBM; /* Level + Noise are dBm */ +#endif /* IW_QUAL_DBM // */ - pAd->iw_stats.discard.nwid = 0; // Rx : Wrong nwid/essid - pAd->iw_stats.miss.beacon = 0; // Missed beacons/superframe + pAd->iw_stats.discard.nwid = 0; /* Rx : Wrong nwid/essid */ + pAd->iw_stats.miss.beacon = 0; /* Missed beacons/superframe */ DBGPRINT(RT_DEBUG_TRACE, ("<--- rt28xx_get_wireless_stats\n")); return &pAd->iw_stats; @@ -620,7 +620,7 @@ struct iw_statistics *rt28xx_get_wireless_stats(IN struct net_device *net_dev) void tbtt_tasklet(unsigned long data) { -//#define MAX_TX_IN_TBTT (16) +/*#define MAX_TX_IN_TBTT (16) */ } @@ -664,24 +664,24 @@ static struct net_device_stats *RT28xx_get_ether_stats(IN struct net_device pAd->stats.rx_dropped = 0; pAd->stats.tx_dropped = 0; - pAd->stats.multicast = pAd->WlanCounters.MulticastReceivedFrameCount.QuadPart; // multicast packets received - pAd->stats.collisions = pAd->Counters8023.OneCollision + pAd->Counters8023.MoreCollisions; // Collision packets + pAd->stats.multicast = pAd->WlanCounters.MulticastReceivedFrameCount.QuadPart; /* multicast packets received */ + pAd->stats.collisions = pAd->Counters8023.OneCollision + pAd->Counters8023.MoreCollisions; /* Collision packets */ pAd->stats.rx_length_errors = 0; - pAd->stats.rx_over_errors = pAd->Counters8023.RxNoBuffer; // receiver ring buff overflow - pAd->stats.rx_crc_errors = 0; //pAd->WlanCounters.FCSErrorCount; // recved pkt with crc error - pAd->stats.rx_frame_errors = pAd->Counters8023.RcvAlignmentErrors; // recv'd frame alignment error - pAd->stats.rx_fifo_errors = pAd->Counters8023.RxNoBuffer; // recv'r fifo overrun - pAd->stats.rx_missed_errors = 0; // receiver missed packet + pAd->stats.rx_over_errors = pAd->Counters8023.RxNoBuffer; /* receiver ring buff overflow */ + pAd->stats.rx_crc_errors = 0; /*pAd->WlanCounters.FCSErrorCount; // recved pkt with crc error */ + pAd->stats.rx_frame_errors = pAd->Counters8023.RcvAlignmentErrors; /* recv'd frame alignment error */ + pAd->stats.rx_fifo_errors = pAd->Counters8023.RxNoBuffer; /* recv'r fifo overrun */ + pAd->stats.rx_missed_errors = 0; /* receiver missed packet */ - // detailed tx_errors + /* detailed tx_errors */ pAd->stats.tx_aborted_errors = 0; pAd->stats.tx_carrier_errors = 0; pAd->stats.tx_fifo_errors = 0; pAd->stats.tx_heartbeat_errors = 0; pAd->stats.tx_window_errors = 0; - // for cslip etc + /* for cslip etc */ pAd->stats.rx_compressed = 0; pAd->stats.tx_compressed = 0; @@ -693,7 +693,7 @@ static struct net_device_stats *RT28xx_get_ether_stats(IN struct net_device BOOLEAN RtmpPhyNetDevExit(IN RTMP_ADAPTER * pAd, IN PNET_DEV net_dev) { - // Unregister network device + /* Unregister network device */ if (net_dev != NULL) { printk ("RtmpOSNetDevDetach(): RtmpOSNetDeviceDetach(), dev->name=%s!\n", @@ -724,7 +724,7 @@ Note: NDIS_STATUS AdapterBlockAllocateMemory(IN PVOID handle, OUT PVOID * ppAd) { - *ppAd = (PVOID) vmalloc(sizeof(RTMP_ADAPTER)); //pci_alloc_consistent(pci_dev, sizeof(RTMP_ADAPTER), phy_addr); + *ppAd = (PVOID) vmalloc(sizeof(RTMP_ADAPTER)); /*pci_alloc_consistent(pci_dev, sizeof(RTMP_ADAPTER), phy_addr); */ if (*ppAd) { NdisZeroMemory(*ppAd, sizeof(RTMP_ADAPTER)); -- cgit v1.2.3-70-g09d2