diff options
Diffstat (limited to 'drivers/staging/rtl8187se')
-rw-r--r-- | drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c | 4 | ||||
-rw-r--r-- | drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c | 16 | ||||
-rw-r--r-- | drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c | 4 | ||||
-rw-r--r-- | drivers/staging/rtl8187se/r8180_core.c | 102 | ||||
-rw-r--r-- | drivers/staging/rtl8187se/r8180_rtl8225z2.c | 129 |
5 files changed, 139 insertions, 116 deletions
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c index 2b7080cc2c05..3a724496e748 100644 --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c @@ -1489,8 +1489,6 @@ inline void ieee80211_process_probe_response( memcpy(target, &network, sizeof(*target)); list_add_tail(&target->list, &ieee->network_list); - if(ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) - ieee80211_softmac_new_net(ieee,&network); } else { IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n", escape_essid(target->ssid, @@ -1516,8 +1514,6 @@ inline void ieee80211_process_probe_response( renew = 1; //YJ,add,080819,for hidden ap,end update_network(target, &network); - if(renew && (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE)) - ieee80211_softmac_new_net(ieee,&network); } spin_unlock_irqrestore(&ieee->lock, flags); diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c index be2d17f60c35..b7426fea5498 100644 --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c @@ -1435,7 +1435,7 @@ static inline u16 auth_parse(struct sk_buff *skb, u8** challenge, int *chlen) if(*(t++) == MFIE_TYPE_CHALLENGE){ *chlen = *(t++); - *challenge = (u8*)kmalloc(*chlen, GFP_ATOMIC); + *challenge = kmalloc(*chlen, GFP_ATOMIC); memcpy(*challenge, t, *chlen); } } @@ -1555,7 +1555,8 @@ ieee80211_rx_auth_rq(struct ieee80211_device *ieee, struct sk_buff *skb) //IEEE80211DMESG("Rx probe"); ieee->softmac_stats.rx_auth_rq++; - if ((status = auth_rq_parse(skb, dest))!= -1){ + status = auth_rq_parse(skb, dest); + if (status != -1) { ieee80211_resp_to_auth(ieee, status, dest); } //DMESG("Dest is "MACSTR, MAC2STR(dest)); @@ -2321,9 +2322,11 @@ void ieee80211_disassociate(struct ieee80211_device *ieee) if(IS_DOT11D_ENABLE(ieee)) Dot11d_Reset(ieee); - ieee->state = IEEE80211_NOLINK; + ieee->link_change(ieee->dev); - notify_wx_assoc_event(ieee); + if (ieee->state == IEEE80211_LINKED) + notify_wx_assoc_event(ieee); + ieee->state = IEEE80211_NOLINK; } void ieee80211_associate_retry_wq(struct work_struct *work) @@ -2858,8 +2861,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, ieee80211_crypt_delayed_deinit(ieee, crypt); - new_crypt = (struct ieee80211_crypt_data *) - kmalloc(sizeof(*new_crypt), GFP_KERNEL); + new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL); if (new_crypt == NULL) { ret = -ENOMEM; goto done; @@ -2950,7 +2952,7 @@ int ieee80211_wpa_supplicant_ioctl(struct ieee80211_device *ieee, struct iw_poin goto out; } - param = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL); + param = kmalloc(p->length, GFP_KERNEL); if (param == NULL){ ret = -ENOMEM; goto out; diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c index ad42bcdc9374..e46ff2ffa09b 100644 --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c @@ -277,8 +277,6 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work) chan = ieee->current_network.channel; - netif_carrier_off(ieee->dev); - if (ieee->data_hard_stop) ieee->data_hard_stop(ieee->dev); @@ -300,8 +298,6 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work) if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER) ieee80211_start_send_beacons(ieee); - netif_carrier_on(ieee->dev); - //YJ,add,080828, In prevent of lossing ping packet during scanning //ieee80211_sta_ps_send_null_frame(ieee, false); //YJ,add,080828,end diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c index b09ce4b517a4..2c025a54416c 100644 --- a/drivers/staging/rtl8187se/r8180_core.c +++ b/drivers/staging/rtl8187se/r8180_core.c @@ -44,20 +44,20 @@ #include "ieee80211/dot11d.h" static struct pci_device_id rtl8180_pci_id_tbl[] __devinitdata = { - { - .vendor = PCI_VENDOR_ID_REALTEK, - .device = 0x8199, - .subvendor = PCI_ANY_ID, - .subdevice = PCI_ANY_ID, - .driver_data = 0, - }, - { - .vendor = 0, - .device = 0, - .subvendor = 0, - .subdevice = 0, - .driver_data = 0, - } + { + .vendor = PCI_VENDOR_ID_REALTEK, + .device = 0x8199, + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .driver_data = 0, + }, + { + .vendor = 0, + .device = 0, + .subvendor = 0, + .subdevice = 0, + .driver_data = 0, + } }; @@ -168,34 +168,34 @@ static struct pci_driver rtl8180_pci_driver = { u8 read_nic_byte(struct net_device *dev, int x) { - return 0xff&readb((u8*)dev->mem_start +x); + return 0xff&readb((u8 *)dev->mem_start + x); } u32 read_nic_dword(struct net_device *dev, int x) { - return readl((u8*)dev->mem_start +x); + return readl((u8 *)dev->mem_start + x); } u16 read_nic_word(struct net_device *dev, int x) { - return readw((u8*)dev->mem_start +x); + return readw((u8 *)dev->mem_start + x); } void write_nic_byte(struct net_device *dev, int x,u8 y) { - writeb(y,(u8*)dev->mem_start +x); + writeb(y, (u8 *)dev->mem_start + x); udelay(20); } void write_nic_dword(struct net_device *dev, int x,u32 y) { - writel(y,(u8*)dev->mem_start +x); + writel(y, (u8 *)dev->mem_start + x); udelay(20); } void write_nic_word(struct net_device *dev, int x,u16 y) { - writew(y,(u8*)dev->mem_start +x); + writew(y, (u8 *)dev->mem_start + x); udelay(20); } @@ -313,7 +313,7 @@ void rtl8180_proc_module_init(void) void rtl8180_proc_module_remove(void) { - remove_proc_entry(RTL8180_MODULE_NAME, init_net.proc_net); + remove_proc_entry(RTL8180_MODULE_NAME, init_net.proc_net); } void rtl8180_proc_remove_one(struct net_device *dev) @@ -383,7 +383,7 @@ void rtl8180_proc_init_one(struct net_device *dev) short buffer_add(struct buffer **buffer, u32 *buf, dma_addr_t dma, struct buffer **bufferhead) { - struct buffer *tmp; + struct buffer *tmp; if(! *buffer){ @@ -403,7 +403,8 @@ short buffer_add(struct buffer **buffer, u32 *buf, dma_addr_t dma, tmp=*buffer; while(tmp->next!=(*buffer)) tmp=tmp->next; - if ((tmp->next= kmalloc(sizeof(struct buffer),GFP_KERNEL)) == NULL){ + tmp->next = kmalloc(sizeof(struct buffer),GFP_KERNEL); + if (tmp->next == NULL) { DMESGE("Failed to kmalloc TX/RX struct"); return -1; } @@ -1155,7 +1156,8 @@ short alloc_rx_desc_ring(struct net_device *dev, u16 bufsize, int count) tmp=desc; for (i = 0; i < count; i++) { - if ((buf= kmalloc(bufsize * sizeof(u8),GFP_ATOMIC)) == NULL){ + buf = kmalloc(bufsize * sizeof(u8),GFP_ATOMIC); + if (buf == NULL) { DMESGE("Failed to kmalloc RX buffer"); return -1; } @@ -1427,7 +1429,7 @@ void rtl8180_rx(struct net_device *dev) u32 RXAGC = 0; long RxAGC_dBm = 0; u8 LNA=0, BB=0; - u8 LNA_gain[4]={02, 17, 29, 39}; + u8 LNA_gain[4] = {02, 17, 29, 39}; u8 Antenna = 0; struct ieee80211_hdr_4addr *hdr; u16 fc,type; @@ -1529,7 +1531,7 @@ void rtl8180_rx(struct net_device *dev) }else { padding = 0; } - padding = 0; + padding = 0; priv->rx_prevlen+=len; if(priv->rx_prevlen > MAX_FRAG_THRESHOLD + 100){ @@ -1622,7 +1624,7 @@ void rtl8180_rx(struct net_device *dev) bICV = ((*(priv->rxringtail)) & (0x00001000)) >> 12; hdr = (struct ieee80211_hdr_4addr *)priv->rxbuffer->buf; fc = le16_to_cpu(hdr->frame_ctl); - type = WLAN_FC_GET_TYPE(fc); + type = WLAN_FC_GET_TYPE(fc); 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)) @@ -1946,11 +1948,11 @@ short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority, u8 bUseShortPreamble = 0; u8 bCTSEnable = 0; u8 bRTSEnable = 0; - u16 Duration = 0; + u16 Duration = 0; u16 RtsDur = 0; u16 ThisFrameTime = 0; u16 TxDescDuration = 0; - u8 ownbit_flag = false; + u8 ownbit_flag = false; switch(priority) { case MANAGE_PRIORITY: @@ -1998,7 +2000,7 @@ short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority, default: return -1; break; - } + } memcpy(&dest, frag_hdr->addr1, ETH_ALEN); if (is_multicast_ether_addr(dest) || @@ -2149,8 +2151,8 @@ short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority, if(morefrag) *tail = (*tail) | (1<<17); // more fragment if(!remain) *tail = (*tail) | (1<<28); // last segment of frame - *(tail+5) = *(tail+5)|(2<<27); - *(tail+7) = *(tail+7)|(1<<4); + *(tail+5) = *(tail+5)|(2<<27); + *(tail+7) = *(tail+7)|(1<<4); wmb(); if(ownbit_flag) @@ -2287,13 +2289,13 @@ void rtl8180_hw_wakeup(struct net_device *dev) void rtl8180_hw_sleep_down(struct net_device *dev) { - unsigned long flags; - struct r8180_priv *priv = ieee80211_priv(dev); + unsigned long flags; + struct r8180_priv *priv = ieee80211_priv(dev); - spin_lock_irqsave(&priv->ps_lock,flags); - if(priv->rf_sleep) - priv->rf_sleep(dev); - spin_unlock_irqrestore(&priv->ps_lock,flags); + spin_lock_irqsave(&priv->ps_lock, flags); + if (priv->rf_sleep) + priv->rf_sleep(dev); + spin_unlock_irqrestore(&priv->ps_lock, flags); } void rtl8180_hw_sleep(struct net_device *dev, u32 th, u32 tl) @@ -2784,7 +2786,7 @@ short rtl8180_init(struct net_device *dev) priv->ieee80211->data_hard_stop = rtl8180_data_hard_stop; priv->ieee80211->data_hard_resume = rtl8180_data_hard_resume; - priv->ieee80211->init_wmmparam_flag = 0; + priv->ieee80211->init_wmmparam_flag = 0; priv->ieee80211->start_send_beacons = rtl8180_start_tx_beacon; priv->ieee80211->stop_send_beacons = rtl8180_beacon_tx_disable; @@ -2954,8 +2956,8 @@ short rtl8180_init(struct net_device *dev) return -ENOMEM; if(request_irq(dev->irq, (void *)rtl8180_interrupt, IRQF_SHARED, dev->name, dev)){ - DMESGE("Error allocating IRQ %d",dev->irq); - return -1; + DMESGE("Error allocating IRQ %d", dev->irq); + return -1; }else{ priv->irq=dev->irq; DMESG("IRQ %d",dev->irq); @@ -3100,7 +3102,7 @@ void rtl8185_set_rate(struct net_device *dev) void rtl8180_adapter_start(struct net_device *dev) { - struct r8180_priv *priv = ieee80211_priv(dev); + struct r8180_priv *priv = ieee80211_priv(dev); rtl8180_rtx_disable(dev); rtl8180_reset(dev); @@ -3194,7 +3196,7 @@ void rtl8180_start_tx_beacon(struct net_device *dev) rtl8180_set_mode(dev, EPROM_CMD_NORMAL); - rtl8185b_irq_enable(dev); + rtl8185b_irq_enable(dev); } static struct net_device_stats *rtl8180_stats(struct net_device *dev) @@ -3250,9 +3252,9 @@ void rtl8180_hw_sleep_wq (struct work_struct *work) { struct delayed_work *dwork = to_delayed_work(work); struct ieee80211_device *ieee = container_of(dwork,struct ieee80211_device,hw_sleep_wq); - struct net_device *dev = ieee->dev; + struct net_device *dev = ieee->dev; - rtl8180_hw_sleep_down(dev); + rtl8180_hw_sleep_down(dev); } static void MgntLinkKeepAlive(struct r8180_priv *priv ) @@ -3371,7 +3373,7 @@ int _rtl8180_up(struct net_device *dev) } timer_rate_adaptive((unsigned long)dev); watch_dog_adaptive((unsigned long)dev); - if(priv->bSwAntennaDiverity) + if (priv->bSwAntennaDiverity) SwAntennaDiversityTimerCallback(dev); ieee80211_softmac_start_protocol(priv->ieee80211); return 0; @@ -3612,10 +3614,10 @@ static int __devinit rtl8180_pci_probe(struct pci_dev *pdev, dev->watchdog_timeo = HZ*3; if (dev_alloc_name(dev, ifname) < 0){ - DMESG("Oops: devname already taken! Trying wlan%%d...\n"); + DMESG("Oops: devname already taken! Trying wlan%%d...\n"); strcpy(ifname, "wlan%d"); dev_alloc_name(dev, ifname); - } + } if(rtl8180_init(dev)!=0){ DMESG("Initialization failed"); @@ -4089,10 +4091,10 @@ void GPIOChangeRFWorkItemCallBack(struct work_struct *work) u8 btPSR; u8 btConfig0; RT_RF_POWER_STATE eRfPowerStateToSet; - bool bActuallySet=false; + bool bActuallySet = false; char *argv[3]; - static char *RadioPowerPath = "/etc/acpi/events/RadioPower.sh"; + static char *RadioPowerPath = "/etc/acpi/events/RadioPower.sh"; static char *envp[] = {"HOME=/", "TERM=linux", "PATH=/usr/bin:/bin", NULL}; static int readf_count = 0; diff --git a/drivers/staging/rtl8187se/r8180_rtl8225z2.c b/drivers/staging/rtl8187se/r8180_rtl8225z2.c index 6edf5a46fa40..2a2afd51cf42 100644 --- a/drivers/staging/rtl8187se/r8180_rtl8225z2.c +++ b/drivers/staging/rtl8187se/r8180_rtl8225z2.c @@ -1,14 +1,13 @@ /* - This is part of the rtl8180-sa2400 driver - released under the GPL (See file COPYING for details). - Copyright (c) 2005 Andrea Merello <andreamrl@tiscali.it> - - This files contains programming code for the rtl8225 - radio frontend. - - *Many* thanks to Realtek Corp. for their great support! - -*/ + * This is part of the rtl8180-sa2400 driver + * released under the GPL (See file COPYING for details). + * Copyright (c) 2005 Andrea Merello <andreamrl@tiscali.it> + * + * This files contains programming code for the rtl8225 + * radio frontend. + * + * *Many* thanks to Realtek Corp. for their great support! + */ #include "r8180_hw.h" #include "r8180_rtl8225.h" @@ -225,7 +224,7 @@ static void rtl8225_SetTXPowerLevel(struct net_device *dev, short ch) } static const u8 rtl8225z2_threshold[] = { - 0x8d, 0x8d, 0x8d, 0x8d, 0x9d, 0xad, 0xbd, + 0x8d, 0x8d, 0x8d, 0x8d, 0x9d, 0xad, 0xbd, }; static const u8 rtl8225z2_gain_bg[] = { @@ -307,7 +306,7 @@ static u32 read_rtl8225(struct net_device *dev, u8 adr) u32 data2Write = ((u32)(adr & 0x1f)) << 27; u32 dataRead; u32 mask; - u16 oval,oval2,oval3,tmp; + u16 oval, oval2, oval3, tmp; int i; short bit, rw; u8 wLength = 6; @@ -325,9 +324,11 @@ static u32 read_rtl8225(struct net_device *dev, u8 adr) oval &= ~0xf; - write_nic_word(dev, RFPinsOutput, oval | BB_HOST_BANG_EN ); udelay(4); + write_nic_word(dev, RFPinsOutput, oval | BB_HOST_BANG_EN); + udelay(4); - write_nic_word(dev, RFPinsOutput, oval ); udelay(5); + write_nic_word(dev, RFPinsOutput, oval); + udelay(5); rw = 0; @@ -335,31 +336,45 @@ static u32 read_rtl8225(struct net_device *dev, u8 adr) for (i = 0; i < wLength/2; i++) { bit = ((data2Write&mask) != 0) ? 1 : 0; - write_nic_word(dev, RFPinsOutput, bit|oval | rw); udelay(1); + write_nic_word(dev, RFPinsOutput, bit | oval | rw); + udelay(1); - write_nic_word(dev, RFPinsOutput, bit|oval | BB_HOST_BANG_CLK | rw); udelay(2); - write_nic_word(dev, RFPinsOutput, bit|oval | BB_HOST_BANG_CLK | rw); udelay(2); + write_nic_word(dev, RFPinsOutput, + bit | oval | BB_HOST_BANG_CLK | rw); + udelay(2); + write_nic_word(dev, RFPinsOutput, + bit | oval | BB_HOST_BANG_CLK | rw); + udelay(2); - mask = (low2high) ? (mask<<1): (mask>>1); + mask = (low2high) ? (mask<<1) : (mask>>1); if (i == 2) { rw = BB_HOST_BANG_RW; - write_nic_word(dev, RFPinsOutput, bit|oval | BB_HOST_BANG_CLK | rw); udelay(2); - write_nic_word(dev, RFPinsOutput, bit|oval | rw); udelay(2); + write_nic_word(dev, RFPinsOutput, + bit | oval | BB_HOST_BANG_CLK | rw); + udelay(2); + write_nic_word(dev, RFPinsOutput, bit | oval | rw); + udelay(2); break; } - bit = ((data2Write&mask) != 0) ? 1: 0; + bit = ((data2Write&mask) != 0) ? 1 : 0; - write_nic_word(dev, RFPinsOutput, oval|bit|rw| BB_HOST_BANG_CLK); udelay(2); - write_nic_word(dev, RFPinsOutput, oval|bit|rw| BB_HOST_BANG_CLK); udelay(2); + write_nic_word(dev, RFPinsOutput, + oval | bit | rw | BB_HOST_BANG_CLK); + udelay(2); + write_nic_word(dev, RFPinsOutput, + oval | bit | rw | BB_HOST_BANG_CLK); + udelay(2); - write_nic_word(dev, RFPinsOutput, oval| bit |rw); udelay(1); + write_nic_word(dev, RFPinsOutput, oval | bit | rw); + udelay(1); mask = (low2high) ? (mask<<1) : (mask>>1); } - write_nic_word(dev, RFPinsOutput, rw|oval); udelay(2); + write_nic_word(dev, RFPinsOutput, rw|oval); + udelay(2); mask = (low2high) ? 0x01 : (((u32)0x01) << (12-1)); /* @@ -371,9 +386,12 @@ static u32 read_rtl8225(struct net_device *dev, u8 adr) for (i = 0; i < rLength; i++) { write_nic_word(dev, RFPinsOutput, rw|oval); udelay(1); - write_nic_word(dev, RFPinsOutput, rw|oval|BB_HOST_BANG_CLK); udelay(2); - write_nic_word(dev, RFPinsOutput, rw|oval|BB_HOST_BANG_CLK); udelay(2); - write_nic_word(dev, RFPinsOutput, rw|oval|BB_HOST_BANG_CLK); udelay(2); + write_nic_word(dev, RFPinsOutput, rw|oval|BB_HOST_BANG_CLK); + udelay(2); + write_nic_word(dev, RFPinsOutput, rw|oval|BB_HOST_BANG_CLK); + udelay(2); + write_nic_word(dev, RFPinsOutput, rw|oval|BB_HOST_BANG_CLK); + udelay(2); tmp = read_nic_word(dev, RFPinsInput); dataRead |= (tmp & BB_HOST_BANG_CLK ? mask : 0); @@ -383,7 +401,9 @@ static u32 read_rtl8225(struct net_device *dev, u8 adr) mask = (low2high) ? (mask<<1) : (mask>>1); } - write_nic_word(dev, RFPinsOutput, BB_HOST_BANG_EN|BB_HOST_BANG_RW|oval); udelay(2); + write_nic_word(dev, RFPinsOutput, + BB_HOST_BANG_EN | BB_HOST_BANG_RW | oval); + udelay(2); write_nic_word(dev, RFPinsEnable, oval2); write_nic_word(dev, RFPinsSelect, oval3); /* Set To SW Switch */ @@ -426,7 +446,7 @@ void rtl8225z2_rf_close(struct net_device *dev) s8 DbmToTxPwrIdx(struct r8180_priv *priv, WIRELESS_MODE WirelessMode, s32 PowerInDbm) { - bool bUseDefault = true; + bool bUseDefault = true; s8 TxPwrIdx = 0; /* @@ -486,8 +506,10 @@ void rtl8225z2_SetTXPowerLevel(struct net_device *dev, short ch) if (IS_DOT11D_ENABLE(priv->ieee80211) && IS_DOT11D_STATE_DONE(priv->ieee80211)) { u8 MaxTxPwrInDbm = DOT11D_GetMaxTxPwrInDbm(priv->ieee80211, ch); - u8 CckMaxPwrIdx = DbmToTxPwrIdx(priv, WIRELESS_MODE_B, MaxTxPwrInDbm); - u8 OfdmMaxPwrIdx = DbmToTxPwrIdx(priv, WIRELESS_MODE_G, MaxTxPwrInDbm); + u8 CckMaxPwrIdx = DbmToTxPwrIdx(priv, WIRELESS_MODE_B, + MaxTxPwrInDbm); + u8 OfdmMaxPwrIdx = DbmToTxPwrIdx(priv, WIRELESS_MODE_G, + MaxTxPwrInDbm); if (cck_power_level > CckMaxPwrIdx) cck_power_level = CckMaxPwrIdx; @@ -524,7 +546,7 @@ void rtl8225z2_SetTXPowerLevel(struct net_device *dev, short ch) if (ofdm_power_level <= 11) { write_phy_ofdm(dev, 0x07, 0x5c); write_phy_ofdm(dev, 0x09, 0x5c); - } + } if (ofdm_power_level <= 17) { write_phy_ofdm(dev, 0x07, 0x54); @@ -613,7 +635,7 @@ void rtl8225z2_rf_init(struct net_device *dev) int i; short channel = 1; u16 brsr; - u32 data,addr; + u32 data, addr; priv->chan = channel; @@ -740,7 +762,7 @@ void rtl8225z2_rf_init(struct net_device *dev) write_phy_ofdm(dev, 0x26, 0x90); mdelay(1); write_phy_ofdm(dev, 0x27, 0x88); mdelay(1); - rtl8225z2_set_gain(dev,4); + rtl8225z2_set_gain(dev, 4); write_phy_cck(dev, 0x0, 0x98); mdelay(1); write_phy_cck(dev, 0x3, 0x20); mdelay(1); @@ -803,12 +825,12 @@ void rtl8225z2_rf_set_mode(struct net_device *dev) write_phy_ofdm(dev, 0xf, 0x20); write_phy_ofdm(dev, 0x11, 0x7); - rtl8225z2_set_gain(dev,4); + rtl8225z2_set_gain(dev, 4); - write_phy_ofdm(dev,0x15, 0x40); - write_phy_ofdm(dev,0x17, 0x40); + write_phy_ofdm(dev, 0x15, 0x40); + write_phy_ofdm(dev, 0x17, 0x40); - write_nic_dword(dev, 0x94,0x10000000); + write_nic_dword(dev, 0x94, 0x10000000); } else { write_rtl8225(dev, 0x5, 0x1864); write_nic_dword(dev, RF_PARA, 0x10044); @@ -819,18 +841,18 @@ void rtl8225z2_rf_set_mode(struct net_device *dev) write_phy_ofdm(dev, 0xf, 0x20); write_phy_ofdm(dev, 0x11, 0x7); - rtl8225z2_set_gain(dev,4); + rtl8225z2_set_gain(dev, 4); - write_phy_ofdm(dev,0x15, 0x40); - write_phy_ofdm(dev,0x17, 0x40); + write_phy_ofdm(dev, 0x15, 0x40); + write_phy_ofdm(dev, 0x17, 0x40); - write_nic_dword(dev, 0x94,0x04000002); + write_nic_dword(dev, 0x94, 0x04000002); } } -#define MAX_DOZE_WAITING_TIMES_85B 20 -#define MAX_POLLING_24F_TIMES_87SE 10 -#define LPS_MAX_SLEEP_WAITING_TIMES_87SE 5 +#define MAX_DOZE_WAITING_TIMES_85B 20 +#define MAX_POLLING_24F_TIMES_87SE 10 +#define LPS_MAX_SLEEP_WAITING_TIMES_87SE 5 bool SetZebraRFPowerState8185(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState) @@ -882,12 +904,14 @@ bool SetZebraRFPowerState8185(struct net_device *dev, break; case eRfSleep: for (QueueID = 0, i = 0; QueueID < 6;) { - if (get_curr_tx_free_desc(dev, QueueID) == priv->txringcount) { + if (get_curr_tx_free_desc(dev, QueueID) == + priv->txringcount) { QueueID++; continue; } else { priv->TxPollingTimes++; - if (priv->TxPollingTimes >= LPS_MAX_SLEEP_WAITING_TIMES_87SE) { + if (priv->TxPollingTimes >= + LPS_MAX_SLEEP_WAITING_TIMES_87SE) { bActionAllowed = false; break; } else @@ -915,7 +939,8 @@ bool SetZebraRFPowerState8185(struct net_device *dev, while (true) { u8 tmp24F = read_nic_byte(dev, 0x24f); - if ((tmp24F == 0x01) || (tmp24F == 0x09)) { + if ((tmp24F == 0x01) || + (tmp24F == 0x09)) { bTurnOffBB = true; break; } else { @@ -935,7 +960,8 @@ bool SetZebraRFPowerState8185(struct net_device *dev, if (bTurnOffBB) { /* turn off BB */ u1bTmp = read_nic_byte(dev, 0x24E); - write_nic_byte(dev, 0x24E, (u1bTmp | BIT5 | BIT6)); + write_nic_byte(dev, 0x24E, + (u1bTmp | BIT5 | BIT6)); /* turn off AFE PLL */ write_nic_byte(dev, 0x54, 0xFC); @@ -945,7 +971,8 @@ bool SetZebraRFPowerState8185(struct net_device *dev, break; case eRfOff: for (QueueID = 0, i = 0; QueueID < 6;) { - if (get_curr_tx_free_desc(dev, QueueID) == priv->txringcount) { + if (get_curr_tx_free_desc(dev, QueueID) == + priv->txringcount) { QueueID++; continue; } else { |