Commit 7fba0100 authored by Ana Rey's avatar Ana Rey Committed by Greg Kroah-Hartman

staging: rtl8187se: Clean-up comment line style in r8180_core.c

This patch clean-up comment-line style in r8180_core.c as the CodingStyle
recommends.
Signed-off-by: default avatarAna Rey <anarey@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ffb8cc92
/* /*
This is part of rtl818x pci OpenSource driver - v 0.1 * This is part of rtl818x pci OpenSource driver - v 0.1
Copyright (C) Andrea Merello 2004-2005 <andrea.merello@gmail.com> * Copyright (C) Andrea Merello 2004-2005 <andrea.merello@gmail.com>
Released under the terms of GPL (General Public License) * Released under the terms of GPL (General Public License)
*
Parts of this driver are based on the GPL part of the official * Parts of this driver are based on the GPL part of the official
Realtek driver. * Realtek driver.
*
Parts of this driver are based on the rtl8180 driver skeleton * Parts of this driver are based on the rtl8180 driver skeleton
from Patric Schenke & Andres Salomon. * from Patric Schenke & Andres Salomon.
*
Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver. * Parts of this driver are based on the Intel Pro Wireless 2100 GPL driver.
*
Parts of BB/RF code are derived from David Young rtl8180 netbsd driver. * Parts of BB/RF code are derived from David Young rtl8180 netbsd driver.
*
RSSI calc function from 'The Deuce' * RSSI calc function from 'The Deuce'
*
Some ideas borrowed from the 8139too.c driver included in linux kernel. * Some ideas borrowed from the 8139too.c driver included in linux kernel.
*
We (I?) want to thanks the Authors of those projecs and also the * We (I?) want to thanks the Authors of those projecs and also the
Ndiswrapper's project Authors. * Ndiswrapper's project Authors.
*
A big big thanks goes also to Realtek corp. for their help in my attempt to * A big big thanks goes also to Realtek corp. for their help in my attempt to
add RTL8185 and RTL8225 support, and to David Young also. * add RTL8185 and RTL8225 support, and to David Young also.
*
Power management interface routines. * Power management interface routines.
Written by Mariusz Matuszek. * Written by Mariusz Matuszek.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
...@@ -347,9 +347,9 @@ static void rtl8180_proc_init_one(struct net_device *dev) ...@@ -347,9 +347,9 @@ static void rtl8180_proc_init_one(struct net_device *dev)
} }
/* /*
FIXME: check if we can use some standard already-existent * FIXME: check if we can use some standard already-existent
data type+functions in kernel * data type+functions in kernel.
*/ */
static short buffer_add(struct buffer **buffer, u32 *buf, dma_addr_t dma, static short buffer_add(struct buffer **buffer, u32 *buf, dma_addr_t dma,
struct buffer **bufferhead) struct buffer **bufferhead)
...@@ -1206,8 +1206,9 @@ static void rtl8180_rx(struct net_device *dev) ...@@ -1206,8 +1206,9 @@ static void rtl8180_rx(struct net_device *dev)
rx_desc_size = 8; rx_desc_size = 8;
if ((*(priv->rxringtail)) & (1<<31)) { if ((*(priv->rxringtail)) & (1<<31)) {
/* we have got an RX int, but the descriptor /* we have got an RX int, but the descriptor. we are pointing
* we are pointing is empty */ * is empty.
*/
priv->stats.rxnodata++; priv->stats.rxnodata++;
priv->ieee80211->stats.rx_errors++; priv->ieee80211->stats.rx_errors++;
...@@ -1254,10 +1255,9 @@ static void rtl8180_rx(struct net_device *dev) ...@@ -1254,10 +1255,9 @@ static void rtl8180_rx(struct net_device *dev)
if (last) { if (last) {
lastlen = ((*priv->rxringtail) & 0xfff); lastlen = ((*priv->rxringtail) & 0xfff);
/* if the last descriptor (that should /* if the last descriptor (that should tell us the total
* tell us the total packet len) tell * packet len) tell us something less than the
* us something less than the descriptors * descriptors len we had until now, then there is some
* len we had until now, then there is some
* problem.. * problem..
* workaround to prevent kernel panic * workaround to prevent kernel panic
*/ */
...@@ -1293,11 +1293,11 @@ static void rtl8180_rx(struct net_device *dev) ...@@ -1293,11 +1293,11 @@ static void rtl8180_rx(struct net_device *dev)
priv->rx_prevlen += len; priv->rx_prevlen += len;
if (priv->rx_prevlen > MAX_FRAG_THRESHOLD + 100) { if (priv->rx_prevlen > MAX_FRAG_THRESHOLD + 100) {
/* HW is probably passing several buggy frames /* HW is probably passing several buggy frames without
* without FD or LD flag set. * FD or LD flag set.
* Throw this garbage away to prevent skb * Throw this garbage away to prevent skb memory
* memory exhausting * exhausting
*/ */
if (!priv->rx_skb_complete) if (!priv->rx_skb_complete)
dev_kfree_skb_any(priv->rx_skb); dev_kfree_skb_any(priv->rx_skb);
priv->rx_skb_complete = 1; priv->rx_skb_complete = 1;
...@@ -1361,7 +1361,9 @@ static void rtl8180_rx(struct net_device *dev) ...@@ -1361,7 +1361,9 @@ static void rtl8180_rx(struct net_device *dev)
quality = 127 - quality; quality = 127 - quality;
priv->SignalQuality = quality; priv->SignalQuality = quality;
stats.signal = (u8)quality; /*priv->wstats.qual.level = priv->SignalStrength; */ stats.signal = (u8)quality; /* priv->wstats.qual.level = priv->
* SignalStrength;
*/
stats.signalstrength = RXAGC; stats.signalstrength = RXAGC;
if (stats.signalstrength > 100) if (stats.signalstrength > 100)
stats.signalstrength = 100; stats.signalstrength = 100;
...@@ -1402,14 +1404,17 @@ static void rtl8180_rx(struct net_device *dev) ...@@ -1402,14 +1404,17 @@ static void rtl8180_rx(struct net_device *dev)
priv->LastSignalStrengthInPercent = SignalStrengthIndex; priv->LastSignalStrengthInPercent = SignalStrengthIndex;
priv->Stats_SignalStrength = TranslateToDbm8185((u8)SignalStrengthIndex); priv->Stats_SignalStrength = TranslateToDbm8185((u8)SignalStrengthIndex);
/* /*
* We need more correct power of received packets and the "SignalStrength" of RxStats is beautified, * We need more correct power of received packets and
* so we record the correct power here. * the "SignalStrength" of RxStats is beautified,
*/ * so we record the correct power here.
*/
priv->Stats_SignalQuality = (long)(priv->Stats_SignalQuality * 5 + (long)priv->SignalQuality + 5) / 6; priv->Stats_SignalQuality = (long)(priv->Stats_SignalQuality * 5 + (long)priv->SignalQuality + 5) / 6;
priv->Stats_RecvSignalPower = (long)(priv->Stats_RecvSignalPower * 5 + priv->RecvSignalPower - 1) / 6; priv->Stats_RecvSignalPower = (long)(priv->Stats_RecvSignalPower * 5 + priv->RecvSignalPower - 1) / 6;
/* Figure out which antenna that received the last packet. */ /* Figure out which antenna that received the last
* packet.
*/
priv->LastRxPktAntenna = Antenna ? 1 : 0; /* 0: aux, 1: main. */ priv->LastRxPktAntenna = Antenna ? 1 : 0; /* 0: aux, 1: main. */
SwAntennaDiversityRxOk8185(dev, priv->SignalStrength); SwAntennaDiversityRxOk8185(dev, priv->SignalStrength);
} }
...@@ -1417,7 +1422,8 @@ static void rtl8180_rx(struct net_device *dev) ...@@ -1417,7 +1422,8 @@ static void rtl8180_rx(struct net_device *dev)
if (first) { if (first) {
if (!priv->rx_skb_complete) { if (!priv->rx_skb_complete) {
/* seems that HW sometimes fails to receive and /* seems that HW sometimes fails to receive and
doesn't provide the last descriptor */ * doesn't provide the last descriptor.
*/
dev_kfree_skb_any(priv->rx_skb); dev_kfree_skb_any(priv->rx_skb);
priv->stats.rxnolast++; priv->stats.rxnolast++;
} }
...@@ -1428,12 +1434,12 @@ static void rtl8180_rx(struct net_device *dev) ...@@ -1428,12 +1434,12 @@ static void rtl8180_rx(struct net_device *dev)
priv->rx_skb_complete = 0; priv->rx_skb_complete = 0;
priv->rx_skb->dev = dev; priv->rx_skb->dev = dev;
} else { } else {
/* if we are here we should have already RXed /* if we are here we should have already RXed the first
* the first frame. * frame.
* If we get here and the skb is not allocated then * If we get here and the skb is not allocated then
* we have just throw out garbage (skb not allocated) * we have just throw out garbage (skb not allocated)
* and we are still rxing garbage.... * and we are still rxing garbage....
*/ */
if (!priv->rx_skb_complete) { if (!priv->rx_skb_complete) {
tmp_skb = dev_alloc_skb(priv->rx_skb->len+len+2); tmp_skb = dev_alloc_skb(priv->rx_skb->len+len+2);
...@@ -1547,11 +1553,10 @@ static void rtl8180_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, ...@@ -1547,11 +1553,10 @@ static void rtl8180_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
rate = ieeerate2rtlrate(rate); rate = ieeerate2rtlrate(rate);
/* /*
* This function doesn't require lock because we make * This function doesn't require lock because we make sure it's called
* sure it's called with the tx_lock already acquired. * with the tx_lock already acquired.
* this come from the kernel's hard_xmit callback (through * This come from the kernel's hard_xmit callback (through the ieee
* the ieee stack, or from the try_wake_queue (again through * stack, or from the try_wake_queue (again through the ieee stack.
* the ieee stack.
*/ */
priority = AC2Q(skb->priority); priority = AC2Q(skb->priority);
spin_lock_irqsave(&priv->tx_lock, flags); spin_lock_irqsave(&priv->tx_lock, flags);
...@@ -1632,9 +1637,9 @@ static void rtl8180_prepare_beacon(struct net_device *dev) ...@@ -1632,9 +1637,9 @@ static void rtl8180_prepare_beacon(struct net_device *dev)
} }
/* /*
* This function do the real dirty work: it enqueues a TX command * This function do the real dirty work: it enqueues a TX command descriptor in
* descriptor in the ring buffer, copyes the frame in a TX buffer * the ring buffer, copyes the frame in a TX buffer and kicks the NIC to ensure
* and kicks the NIC to ensure it does the DMA transfer. * it does the DMA transfer.
*/ */
short rtl8180_tx(struct net_device *dev, u8 *txbuf, int len, int priority, short rtl8180_tx(struct net_device *dev, u8 *txbuf, int len, int priority,
short morefrag, short descfrag, int rate) short morefrag, short descfrag, int rate)
...@@ -2763,9 +2768,9 @@ void rtl8180_start_tx_beacon(struct net_device *dev) ...@@ -2763,9 +2768,9 @@ void rtl8180_start_tx_beacon(struct net_device *dev)
word = read_nic_word(dev, BintrItv); word = read_nic_word(dev, BintrItv);
word &= ~BintrItv_BintrItv; word &= ~BintrItv_BintrItv;
word |= 1000; /* priv->ieee80211->current_network.beacon_interval * word |= 1000; /* priv->ieee80211->current_network.beacon_interval *
((priv->txbeaconcount > 1)?(priv->txbeaconcount-1):1); * ((priv->txbeaconcount > 1)?(priv->txbeaconcount-1):1);
// FIXME: check if correct ^^ worked with 0x3e8; * FIXME: check if correct ^^ worked with 0x3e8;
*/ */
write_nic_word(dev, BintrItv, word); write_nic_word(dev, BintrItv, word);
rtl8180_set_mode(dev, EPROM_CMD_NORMAL); rtl8180_set_mode(dev, EPROM_CMD_NORMAL);
......
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