Staging: rtl8187se: fixed space style issues in r8180_core.c

This is a patch to the r8180_core.c file that fixes the space
style issues found by the checkpatch.pl tool.

Signed-off-by: Prashant P. Shah <pshah.mumbai@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Prashant P. Shah 2010-05-13 23:08:43 +05:30 committed by Greg Kroah-Hartman
parent fd4dc88e46
commit bbfb56520c
1 changed files with 809 additions and 819 deletions

View File

@ -402,7 +402,8 @@ short buffer_add(struct buffer **buffer, u32 *buf, dma_addr_t dma,
} }
tmp = *buffer; tmp = *buffer;
while(tmp->next!=(*buffer)) tmp=tmp->next; while (tmp->next != (*buffer))
tmp = tmp->next;
tmp->next = kmalloc(sizeof(struct buffer), GFP_KERNEL); tmp->next = kmalloc(sizeof(struct buffer), GFP_KERNEL);
if (tmp->next == NULL) { if (tmp->next == NULL) {
DMESGE("Failed to kmalloc TX/RX struct"); DMESGE("Failed to kmalloc TX/RX struct");
@ -415,8 +416,7 @@ short buffer_add(struct buffer **buffer, u32 *buf, dma_addr_t dma,
return 0; return 0;
} }
void buffer_free(struct net_device *dev,struct buffer **buffer,int len,short void buffer_free(struct net_device *dev, struct buffer **buffer, int len, short consistent)
consistent)
{ {
struct buffer *tmp, *next; struct buffer *tmp, *next;
@ -678,20 +678,18 @@ void rtl8180_RSSI_calc(struct net_device *dev, u8 *rssi, u8 *qual)
if (q <= 0x4e) { if (q <= 0x4e) {
temp = QUALITY_MAP[q]; temp = QUALITY_MAP[q];
} else { } else {
if( q & 0x80 ) { if (q & 0x80)
temp = 0x32; temp = 0x32;
} else { else
temp = 1; temp = 1;
} }
}
*qual = temp; *qual = temp;
temp2 = *rssi; temp2 = *rssi;
if (_rssi < 0x64) { if (_rssi < 0x64) {
if ( _rssi == 0 ) { if (_rssi == 0)
*rssi = 1; *rssi = 1;
}
} else { } else {
*rssi = 0x64; *rssi = 0x64;
} }
@ -742,8 +740,7 @@ void rtl8180_update_msr(struct net_device *dev)
rxconf = read_nic_dword(dev, RX_CONF); rxconf = read_nic_dword(dev, RX_CONF);
if(priv->ieee80211->state == IEEE80211_LINKED) if (priv->ieee80211->state == IEEE80211_LINKED) {
{
if (priv->ieee80211->iw_mode == IW_MODE_ADHOC) if (priv->ieee80211->iw_mode == IW_MODE_ADHOC)
msr |= (MSR_LINK_ADHOC<<MSR_LINK_SHIFT); msr |= (MSR_LINK_ADHOC<<MSR_LINK_SHIFT);
else if (priv->ieee80211->iw_mode == IW_MODE_MASTER) else if (priv->ieee80211->iw_mode == IW_MODE_MASTER)
@ -1466,7 +1463,8 @@ void rtl8180_rx(struct net_device *dev)
tmp2 = tmp; tmp2 = tmp;
} while (tmp != priv->rxring); } while (tmp != priv->rxring);
if(tmp2) priv->rxringtail = tmp2; if (tmp2)
priv->rxringtail = tmp2;
} }
/* while there are filled descriptors */ /* while there are filled descriptors */
@ -1489,7 +1487,8 @@ void rtl8180_rx(struct net_device *dev)
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
first = *(priv->rxringtail) & (1<<29) ? 1 : 0; first = *(priv->rxringtail) & (1<<29) ? 1 : 0;
if(first) priv->rx_prevlen=0; if (first)
priv->rx_prevlen = 0;
last = *(priv->rxringtail) & (1<<28) ? 1 : 0; last = *(priv->rxringtail) & (1<<28) ? 1 : 0;
if (last) { if (last) {
@ -1525,9 +1524,8 @@ void rtl8180_rx(struct net_device *dev)
padding = ((*(priv->rxringtail+3))&(0x04000000))>>26; padding = ((*(priv->rxringtail+3))&(0x04000000))>>26;
} else if (first) { } else if (first) {
padding = ((*(priv->rxringtail+3))&(0x04000000))>>26; padding = ((*(priv->rxringtail+3))&(0x04000000))>>26;
if(padding) { if (padding)
len -= 2; len -= 2;
}
} else { } else {
padding = 0; padding = 0;
} }
@ -1560,13 +1558,9 @@ void rtl8180_rx(struct net_device *dev)
stats.rate = rtl8180_rate2rate(rate); stats.rate = rtl8180_rate2rate(rate);
Antenna = (((*(priv->rxringtail+3)) & (0x00008000)) == 0) ? 0 : 1; Antenna = (((*(priv->rxringtail+3)) & (0x00008000)) == 0) ? 0 : 1;
if(!rtl8180_IsWirelessBMode(stats.rate)) if (!rtl8180_IsWirelessBMode(stats.rate)) { // OFDM rate.
{ // OFDM rate.
RxAGC_dBm = rxpower+1; //bias RxAGC_dBm = rxpower+1; //bias
} } else { // CCK rate.
else
{ // CCK rate.
RxAGC_dBm = signal; //bit 0 discard RxAGC_dBm = signal; //bit 0 discard
LNA = (u8) (RxAGC_dBm & 0x60) >> 5 ; //bit 6~ bit 5 LNA = (u8) (RxAGC_dBm & 0x60) >> 5 ; //bit 6~ bit 5
@ -1581,16 +1575,13 @@ void rtl8180_rx(struct net_device *dev)
RXAGC = ~(RxAGC_dBm)+1; RXAGC = ~(RxAGC_dBm)+1;
bCckRate = rtl8180_IsWirelessBMode(stats.rate); bCckRate = rtl8180_IsWirelessBMode(stats.rate);
// Translate RXAGC into 1-100. // Translate RXAGC into 1-100.
if(!rtl8180_IsWirelessBMode(stats.rate)) if (!rtl8180_IsWirelessBMode(stats.rate)) { // OFDM rate.
{ // OFDM rate.
if (RXAGC > 90) if (RXAGC > 90)
RXAGC = 90; RXAGC = 90;
else if (RXAGC < 25) else if (RXAGC < 25)
RXAGC = 25; RXAGC = 25;
RXAGC = (90-RXAGC)*100/65; RXAGC = (90-RXAGC)*100/65;
} } else { // CCK rate.
else
{ // CCK rate.
if (RXAGC > 95) if (RXAGC > 95)
RXAGC = 95; RXAGC = 95;
else if (RXAGC < 30) else if (RXAGC < 30)
@ -1628,8 +1619,7 @@ void rtl8180_rx(struct net_device *dev)
if ((IEEE80211_FTYPE_CTL != type) && if ((IEEE80211_FTYPE_CTL != type) &&
(eqMacAddr(priv->ieee80211->current_network.bssid, (fc & IEEE80211_FCTL_TODS) ? hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : hdr->addr3)) (eqMacAddr(priv->ieee80211->current_network.bssid, (fc & IEEE80211_FCTL_TODS) ? hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : hdr->addr3))
&& (!bHwError) && (!bCRC)&& (!bICV)) && (!bHwError) && (!bCRC) && (!bICV)) {
{
/* Perform signal smoothing for dynamic /* Perform signal smoothing for dynamic
* mechanism on demand. This is different * mechanism on demand. This is different
* with PerformSignalSmoothing8185 in smoothing * with PerformSignalSmoothing8185 in smoothing
@ -1670,7 +1660,8 @@ void rtl8180_rx(struct net_device *dev)
} else { } else {
priv->rx_skb = dev_alloc_skb(len+2); priv->rx_skb = dev_alloc_skb(len+2);
if( !priv->rx_skb) goto drop; if (!priv->rx_skb)
goto drop;
} }
priv->rx_skb_complete = 0; priv->rx_skb_complete = 0;
@ -1686,7 +1677,8 @@ void rtl8180_rx(struct net_device *dev)
tmp_skb = dev_alloc_skb(priv->rx_skb->len+len+2); tmp_skb = dev_alloc_skb(priv->rx_skb->len+len+2);
if(!tmp_skb) goto drop; if (!tmp_skb)
goto drop;
tmp_skb->dev = dev; tmp_skb->dev = dev;
@ -1781,8 +1773,7 @@ void rtl8180_data_hard_resume(struct net_device *dev)
* It checks also if we need to stop the ieee tx queue, eventually do it * It checks also if we need to stop the ieee tx queue, eventually do it
*/ */
void rtl8180_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, int void rtl8180_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, int
rate) rate) {
{
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
int mode; int mode;
struct ieee80211_hdr_3addr *h = (struct ieee80211_hdr_3addr *) skb->data; struct ieee80211_hdr_3addr *h = (struct ieee80211_hdr_3addr *) skb->data;
@ -1803,8 +1794,7 @@ rate)
priority = AC2Q(skb->priority); priority = AC2Q(skb->priority);
spin_lock_irqsave(&priv->tx_lock, flags); spin_lock_irqsave(&priv->tx_lock, flags);
if(priv->ieee80211->bHwRadioOff) if (priv->ieee80211->bHwRadioOff) {
{
spin_unlock_irqrestore(&priv->tx_lock, flags); spin_unlock_irqrestore(&priv->tx_lock, flags);
return; return;
@ -1872,14 +1862,16 @@ u16 rtl8180_len2duration(u32 len, short rate,short* ext)
*ext = 0; *ext = 0;
duration = ((len+4)<<4) / 0x2; duration = ((len+4)<<4) / 0x2;
drift = ((len+4)<<4) % 0x2; drift = ((len+4)<<4) % 0x2;
if(drift ==0 ) break; if (drift == 0)
break;
duration++; duration++;
break; break;
case 1://2mbps case 1://2mbps
*ext = 0; *ext = 0;
duration = ((len+4)<<4) / 0x4; duration = ((len+4)<<4) / 0x4;
drift = ((len+4)<<4) % 0x4; drift = ((len+4)<<4) % 0x4;
if(drift ==0 ) break; if (drift == 0)
break;
duration++; duration++;
break; break;
case 2: //5.5mbps case 2: //5.5mbps
@ -2004,8 +1996,7 @@ short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority,
memcpy(&dest, frag_hdr->addr1, ETH_ALEN); memcpy(&dest, frag_hdr->addr1, ETH_ALEN);
if (is_multicast_ether_addr(dest) || if (is_multicast_ether_addr(dest) ||
is_broadcast_ether_addr(dest)) is_broadcast_ether_addr(dest)) {
{
Duration = 0; Duration = 0;
RtsDur = 0; RtsDur = 0;
bRTSEnable = 0; bRTSEnable = 0;
@ -2023,8 +2014,7 @@ short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority,
* and Tx rate. */ * and Tx rate. */
AckTime = ComputeTxTime(14, 10, 0, 0); // AckCTSLng = 14 use 1M bps send AckTime = ComputeTxTime(14, 10, 0, 0); // AckCTSLng = 14 use 1M bps send
if ( ((len + sCrcLng) > priv->rts) && priv->rts ) if (((len + sCrcLng) > priv->rts) && priv->rts) { // RTS/CTS.
{ // RTS/CTS.
u16 RtsTime, CtsTime; u16 RtsTime, CtsTime;
//u16 CtsRate; //u16 CtsRate;
bRTSEnable = 1; bRTSEnable = 1;
@ -2045,8 +2035,7 @@ short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority,
RtsDur = CtsTime + ThisFrameTime + AckTime + 3*aSifsTime; RtsDur = CtsTime + ThisFrameTime + AckTime + 3*aSifsTime;
TxDescDuration = RtsTime + RtsDur; TxDescDuration = RtsTime + RtsDur;
} } else {// Normal case.
else {// Normal case.
bCTSEnable = 0; bCTSEnable = 0;
bRTSEnable = 0; bRTSEnable = 0;
RtsDur = 0; RtsDur = 0;
@ -2112,7 +2101,8 @@ short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority,
for (i = 0; i < buflen && remain > 0; i++, remain--) { for (i = 0; i < buflen && remain > 0; i++, remain--) {
((u8 *)buf)[i] = txbuf[i]; //copy data into descriptor pointed DMAble buffer ((u8 *)buf)[i] = txbuf[i]; //copy data into descriptor pointed DMAble buffer
if(remain == 4 && i+4 >= buflen) break; if (remain == 4 && i+4 >= buflen)
break;
/* ensure the last desc has at least 4 bytes payload */ /* ensure the last desc has at least 4 bytes payload */
} }
@ -2124,12 +2114,10 @@ short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority,
if (priv->plcp_preamble_mode == 1 && rate != 0) // short mode now, not long! if (priv->plcp_preamble_mode == 1 && rate != 0) // short mode now, not long!
;// *tail |= (1<<16); // enable short preamble mode. ;// *tail |= (1<<16); // enable short preamble mode.
if(bCTSEnable) { if (bCTSEnable)
*tail |= (1<<18); *tail |= (1<<18);
}
if(bRTSEnable) //rts enable if (bRTSEnable) { //rts enable
{
*tail |= ((ieeerate2rtlrate(priv->ieee80211->basic_rate))<<19);//RTS RATE *tail |= ((ieeerate2rtlrate(priv->ieee80211->basic_rate))<<19);//RTS RATE
*tail |= (1<<23);//rts enable *tail |= (1<<23);//rts enable
*(tail+1) |= (RtsDur&0xffff);//RTS Duration *(tail+1) |= (RtsDur&0xffff);//RTS Duration
@ -2145,20 +2133,21 @@ short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority,
if (!priv->hw_plcp_len) { if (!priv->hw_plcp_len) {
duration = rtl8180_len2duration(len, rate, &ext); duration = rtl8180_len2duration(len, rate, &ext);
*(tail+1) = *(tail+1) | ((duration & 0x7fff)<<16); *(tail+1) = *(tail+1) | ((duration & 0x7fff)<<16);
if(ext) *(tail+1) = *(tail+1) |(1<<31); //plcp length extension if (ext)
*(tail+1) = *(tail+1) | (1<<31); //plcp length extension
} }
if(morefrag) *tail = (*tail) | (1<<17); // more fragment if (morefrag)
if(!remain) *tail = (*tail) | (1<<28); // last segment of frame *tail = (*tail) | (1<<17); // more fragment
if (!remain)
*tail = (*tail) | (1<<28); // last segment of frame
*(tail+5) = *(tail+5)|(2<<27); *(tail+5) = *(tail+5)|(2<<27);
*(tail+7) = *(tail+7)|(1<<4); *(tail+7) = *(tail+7)|(1<<4);
wmb(); wmb();
if (ownbit_flag) if (ownbit_flag)
{
*tail = *tail | (1<<31); // descriptor ready to be txed *tail = *tail | (1<<31); // descriptor ready to be txed
}
if ((tail - begin)/8 == count-1) if ((tail - begin)/8 == count-1)
tail = begin; tail = begin;
@ -2234,7 +2223,8 @@ void rtl8180_link_change(struct net_device *dev)
rtl8180_set_chan(dev, priv->chan); rtl8180_set_chan(dev, priv->chan);
} }
void rtl8180_rq_tx_ack(struct net_device *dev){ void rtl8180_rq_tx_ack(struct net_device *dev)
{
struct r8180_priv *priv = ieee80211_priv(dev); struct r8180_priv *priv = ieee80211_priv(dev);
@ -2242,34 +2232,41 @@ void rtl8180_rq_tx_ack(struct net_device *dev){
priv->ack_tx_to_ieee = 1; priv->ack_tx_to_ieee = 1;
} }
short rtl8180_is_tx_queue_empty(struct net_device *dev){ short rtl8180_is_tx_queue_empty(struct net_device *dev)
{
struct r8180_priv *priv = ieee80211_priv(dev); struct r8180_priv *priv = ieee80211_priv(dev);
u32 *d; u32 *d;
for (d = priv->txmapring; for (d = priv->txmapring;
d < priv->txmapring + priv->txringcount; d += 8) d < priv->txmapring + priv->txringcount; d += 8)
if(*d & (1<<31)) return 0; if (*d & (1<<31))
return 0;
for (d = priv->txbkpring; for (d = priv->txbkpring;
d < priv->txbkpring + priv->txringcount; d += 8) d < priv->txbkpring + priv->txringcount; d += 8)
if(*d & (1<<31)) return 0; if (*d & (1<<31))
return 0;
for (d = priv->txbepring; for (d = priv->txbepring;
d < priv->txbepring + priv->txringcount; d += 8) d < priv->txbepring + priv->txringcount; d += 8)
if(*d & (1<<31)) return 0; if (*d & (1<<31))
return 0;
for (d = priv->txvipring; for (d = priv->txvipring;
d < priv->txvipring + priv->txringcount; d += 8) d < priv->txvipring + priv->txringcount; d += 8)
if(*d & (1<<31)) return 0; if (*d & (1<<31))
return 0;
for (d = priv->txvopring; for (d = priv->txvopring;
d < priv->txvopring + priv->txringcount; d += 8) d < priv->txvopring + priv->txringcount; d += 8)
if(*d & (1<<31)) return 0; if (*d & (1<<31))
return 0;
for (d = priv->txhpring; for (d = priv->txhpring;
d < priv->txhpring + priv->txringcount; d += 8) d < priv->txhpring + priv->txringcount; d += 8)
if(*d & (1<<31)) return 0; if (*d & (1<<31))
return 0;
return 1; return 1;
} }
/* FIXME FIXME 5msecs is random */ /* FIXME FIXME 5msecs is random */
@ -2493,8 +2490,7 @@ static void rtl8180_set_channel_map(u8 channel_plan, struct ieee80211_device *ie
ieee->MinPassiveChnlNum = MAX_CHANNEL_NUMBER+1; ieee->MinPassiveChnlNum = MAX_CHANNEL_NUMBER+1;
ieee->IbssStartChnl = 0; ieee->IbssStartChnl = 0;
switch (channel_plan) switch (channel_plan) {
{
case COUNTRY_CODE_FCC: case COUNTRY_CODE_FCC:
case COUNTRY_CODE_IC: case COUNTRY_CODE_IC:
case COUNTRY_CODE_ETSI: case COUNTRY_CODE_ETSI:
@ -2511,8 +2507,7 @@ static void rtl8180_set_channel_map(u8 channel_plan, struct ieee80211_device *ie
// Clear old channel map // Clear old channel map
memset(GET_DOT11D_INFO(ieee)->channel_map, 0, sizeof(GET_DOT11D_INFO(ieee)->channel_map)); memset(GET_DOT11D_INFO(ieee)->channel_map, 0, sizeof(GET_DOT11D_INFO(ieee)->channel_map));
// Set new channel map // Set new channel map
for (i=0;i<ChannelPlan[channel_plan].Len;i++) for (i = 0; i < ChannelPlan[channel_plan].Len; i++) {
{
if (ChannelPlan[channel_plan].Channel[i] <= 14) if (ChannelPlan[channel_plan].Channel[i] <= 14)
GET_DOT11D_INFO(ieee)->channel_map[ChannelPlan[channel_plan].Channel[i]] = 1; GET_DOT11D_INFO(ieee)->channel_map[ChannelPlan[channel_plan].Channel[i]] = 1;
} }
@ -2538,9 +2533,7 @@ static void rtl8180_set_channel_map(u8 channel_plan, struct ieee80211_device *ie
ieee->bGlobalDomain = false; ieee->bGlobalDomain = false;
memset(GET_DOT11D_INFO(ieee)->channel_map, 0, sizeof(GET_DOT11D_INFO(ieee)->channel_map)); memset(GET_DOT11D_INFO(ieee)->channel_map, 0, sizeof(GET_DOT11D_INFO(ieee)->channel_map));
for (i = 1; i <= 14; i++) for (i = 1; i <= 14; i++)
{
GET_DOT11D_INFO(ieee)->channel_map[i] = 1; GET_DOT11D_INFO(ieee)->channel_map[i] = 1;
}
break; break;
} }
} }
@ -3262,8 +3255,7 @@ static void MgntLinkKeepAlive(struct r8180_priv *priv )
if (priv->keepAliveLevel == 0) if (priv->keepAliveLevel == 0)
return; return;
if(priv->ieee80211->state == IEEE80211_LINKED) if (priv->ieee80211->state == IEEE80211_LINKED) {
{
// //
// Keep-Alive. // Keep-Alive.
// //
@ -3271,21 +3263,17 @@ static void MgntLinkKeepAlive(struct r8180_priv *priv )
if ((priv->keepAliveLevel == 2) || if ((priv->keepAliveLevel == 2) ||
(priv->link_detect.LastNumTxUnicast == priv->NumTxUnicast && (priv->link_detect.LastNumTxUnicast == priv->NumTxUnicast &&
priv->link_detect.LastNumRxUnicast == priv->ieee80211->NumRxUnicast) priv->link_detect.LastNumRxUnicast == priv->ieee80211->NumRxUnicast)
) ) {
{
priv->link_detect.IdleCount++; priv->link_detect.IdleCount++;
// //
// Send a Keep-Alive packet packet to AP if we had been idle for a while. // Send a Keep-Alive packet packet to AP if we had been idle for a while.
// //
if(priv->link_detect.IdleCount >= ((KEEP_ALIVE_INTERVAL / CHECK_FOR_HANG_PERIOD)-1) ) if (priv->link_detect.IdleCount >= ((KEEP_ALIVE_INTERVAL / CHECK_FOR_HANG_PERIOD)-1)) {
{
priv->link_detect.IdleCount = 0; priv->link_detect.IdleCount = 0;
ieee80211_sta_ps_send_null_frame(priv->ieee80211, false); ieee80211_sta_ps_send_null_frame(priv->ieee80211, false);
} }
} } else {
else
{
priv->link_detect.IdleCount = 0; priv->link_detect.IdleCount = 0;
} }
priv->link_detect.LastNumTxUnicast = priv->NumTxUnicast; priv->link_detect.LastNumTxUnicast = priv->NumTxUnicast;
@ -3304,10 +3292,9 @@ void rtl8180_watch_dog(struct net_device *dev)
u16 SlotIndex = 0; u16 SlotIndex = 0;
u16 i = 0; u16 i = 0;
if (priv->ieee80211->actscanning == false) { if (priv->ieee80211->actscanning == false) {
if((priv->ieee80211->iw_mode != IW_MODE_ADHOC) && (priv->ieee80211->state == IEEE80211_NOLINK) && (priv->ieee80211->beinretry == false) && (priv->eRFPowerState == eRfOn)){ if ((priv->ieee80211->iw_mode != IW_MODE_ADHOC) && (priv->ieee80211->state == IEEE80211_NOLINK) && (priv->ieee80211->beinretry == false) && (priv->eRFPowerState == eRfOn))
IPSEnter(dev); IPSEnter(dev);
} }
}
//YJ,add,080828,for link state check //YJ,add,080828,for link state check
if ((priv->ieee80211->state == IEEE80211_LINKED) && (priv->ieee80211->iw_mode == IW_MODE_INFRA)) { if ((priv->ieee80211->state == IEEE80211_LINKED) && (priv->ieee80211->iw_mode == IW_MODE_INFRA)) {
SlotIndex = (priv->link_detect.SlotIndex++) % priv->link_detect.SlotNum; SlotIndex = (priv->link_detect.SlotIndex++) % priv->link_detect.SlotNum;
@ -3394,7 +3381,8 @@ int rtl8180_up(struct net_device *dev)
{ {
struct r8180_priv *priv = ieee80211_priv(dev); struct r8180_priv *priv = ieee80211_priv(dev);
if (priv->up == 1) return -1; if (priv->up == 1)
return -1;
return _rtl8180_up(dev); return _rtl8180_up(dev);
} }
@ -3779,7 +3767,8 @@ void rtl8180_tx_isr(struct net_device *dev, int pri,short error)
int offs; int offs;
int j, i; int j, i;
int hd; int hd;
if (error) priv->stats.txretry++; //tony 20060601 if (error)
priv->stats.txretry++; //tony 20060601
spin_lock_irqsave(&priv->tx_lock, flag); spin_lock_irqsave(&priv->tx_lock, flag);
switch (pri) { switch (pri) {
case MANAGE_PRIORITY: case MANAGE_PRIORITY:
@ -3853,10 +3842,10 @@ void rtl8180_tx_isr(struct net_device *dev, int pri,short error)
j = offs + (priv->txringcount-1-hd); j = offs + (priv->txringcount-1-hd);
j -= 2; j -= 2;
if(j<0) j=0; if (j < 0)
j = 0;
for(i=0;i<j;i++) for (i = 0; i < j; i++) {
{
if ((*head) & (1<<31)) if ((*head) & (1<<31))
break; break;
if (((*head)&(0x10000000)) != 0) { if (((*head)&(0x10000000)) != 0) {
@ -3933,7 +3922,8 @@ irqreturn_t rtl8180_interrupt(int irq, void *netdev, struct pt_regs *regs)
u32 inta; u32 inta;
/* We should return IRQ_NONE, but for now let me keep this */ /* We should return IRQ_NONE, but for now let me keep this */
if(priv->irq_enabled == 0) return IRQ_HANDLED; if (priv->irq_enabled == 0)
return IRQ_HANDLED;
spin_lock_irqsave(&priv->irq_th_lock, flags); spin_lock_irqsave(&priv->irq_th_lock, flags);
@ -3989,9 +3979,9 @@ irqreturn_t rtl8180_interrupt(int irq, void *netdev, struct pt_regs *regs)
rtl8180_tx_isr(dev, HI_PRIORITY, 0); rtl8180_tx_isr(dev, HI_PRIORITY, 0);
} }
if(inta & ISR_RER) { if (inta & ISR_RER)
priv->stats.rxerr++; priv->stats.rxerr++;
}
if (inta & ISR_TBKDER) { //corresponding to BK_PRIORITY if (inta & ISR_TBKDER) { //corresponding to BK_PRIORITY
priv->stats.txbkperr++; priv->stats.txbkperr++;
priv->ieee80211->stats.tx_errors++; priv->ieee80211->stats.tx_errors++;
@ -4028,9 +4018,9 @@ irqreturn_t rtl8180_interrupt(int irq, void *netdev, struct pt_regs *regs)
priv->stats.rxint++; priv->stats.rxint++;
tasklet_schedule(&priv->irq_rx_tasklet); tasklet_schedule(&priv->irq_rx_tasklet);
} }
if(inta & ISR_BcnInt) {
if (inta & ISR_BcnInt)
rtl8180_prepare_beacon(dev); rtl8180_prepare_beacon(dev);
}
if (inta & ISR_RDU) { if (inta & ISR_RDU) {
DMESGW("No RX descriptor available"); DMESGW("No RX descriptor available");