staging: rtl8187se: code cleanups
There are some bug fixes, cleanups and dead code removal for drivers/staging/rtl8187se
Some of the patches don't pass checkpatch.pl. That's because original code did not follow kernel coding style and I've made small changes to that bad lines. I haven't done new coding style violations.
PATCH 1/17 staging: rtl8187se: Removed dead functions
Removed stale functions that are never called
--- drivers/staging/rtl8187se/r8180_core.c | 185 --------------------------- drivers/staging/rtl8187se/r8180_rtl8225z2.c | 16 --- 2 files changed, 201 deletions(-)
drivers/staging/rtl8187se/r8180_core.c +0 -185
@@ -695,14 +695,6 @@ void rtl8180_RSSI_calc(struct net_device *dev, u8 *rssi, u8 *qual)return ; } -void rtl8180_irq_enable (struct net_device *dev) -{ -struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv (dev); - - priv->irq_enabled =1 ; -write_nic_word (dev,INTA_MASK , priv->irq_mask); -} -void rtl8180_irq_disable (struct net_device *dev) {struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv (dev);
@@ -724,7 +716,6 @@ void rtl8180_set_mode(struct net_device *dev, int mode)write_nic_byte (dev,EPROM_CMD , ecmd); } -void rtl8180_adapter_start (struct net_device *dev);void rtl8180_beacon_tx_enable (struct net_device *dev);void rtl8180_update_msr (struct net_device *dev)
@@ -771,57 +762,6 @@ void rtl8180_set_chan(struct net_device *dev, short ch) priv->rf_set_chan (dev, priv->chan); } -void rtl8180_rx_enable (struct net_device *dev) -{ -u8 cmd; -u32 rxconf; -/* for now we accept data, management & ctl frame*/ -struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv (dev); - - rxconf =read_nic_dword (dev,RX_CONF ); - rxconf = rxconf & ~MAC_FILTER_MASK ; - rxconf = rxconf | (1 <<ACCEPT_MNG_FRAME_SHIFT ); - rxconf = rxconf | (1 <<ACCEPT_DATA_FRAME_SHIFT ); - rxconf = rxconf | (1 <<ACCEPT_BCAST_FRAME_SHIFT ); - rxconf = rxconf | (1 <<ACCEPT_MCAST_FRAME_SHIFT ); -if (dev->flags &IFF_PROMISC ) -DMESG ("NIC in promisc mode" ); - -if (priv->ieee80211->iw_mode ==IW_MODE_MONITOR || \ - dev->flags &IFF_PROMISC ) { - rxconf = rxconf | (1 <<ACCEPT_ALLMAC_FRAME_SHIFT ); - }else { - rxconf = rxconf | (1 <<ACCEPT_NICMAC_FRAME_SHIFT ); - } - -if (priv->ieee80211->iw_mode ==IW_MODE_MONITOR ) { - rxconf = rxconf | (1 <<ACCEPT_CTL_FRAME_SHIFT ); - rxconf = rxconf | (1 <<ACCEPT_ICVERR_FRAME_SHIFT ); - rxconf = rxconf | (1 <<ACCEPT_PWR_FRAME_SHIFT ); - } - -if (priv->crcmon ==1 && priv->ieee80211->iw_mode ==IW_MODE_MONITOR ) - rxconf = rxconf | (1 <<ACCEPT_CRCERR_FRAME_SHIFT ); - - rxconf = rxconf & ~RX_FIFO_THRESHOLD_MASK ; - rxconf = rxconf | (RX_FIFO_THRESHOLD_NONE <<RX_FIFO_THRESHOLD_SHIFT ); - - rxconf = rxconf | (1 <<RX_AUTORESETPHY_SHIFT ); - rxconf = rxconf & ~MAX_RX_DMA_MASK ; - rxconf = rxconf | (MAX_RX_DMA_2048 <<MAX_RX_DMA_SHIFT ); - - rxconf = rxconf |RCR_ONLYERLPKT ; - - rxconf = rxconf & ~RCR_CS_MASK ; - -write_nic_dword (dev,RX_CONF , rxconf); - -fix_rx_fifo (dev); - - cmd =read_nic_byte (dev,CMD ); -write_nic_byte (dev,CMD , cmd | (1 <<CMD_RX_ENABLE_SHIFT )); -} -void set_nic_txring (struct net_device *dev) {struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv (dev);
@@ -855,60 +795,6 @@ void rtl8180_conttx_disable(struct net_device *dev)write_nic_dword (dev,TX_CONF , txconf); } -void rtl8180_tx_enable (struct net_device *dev) -{ -u8 cmd; -u8 tx_agc_ctl; -u8 byte; -u32 txconf; -struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv (dev); - - txconf =read_nic_dword (dev,TX_CONF ); - - byte =read_nic_byte (dev,CW_CONF ); - byte &= ~(1 <<CW_CONF_PERPACKET_CW_SHIFT ); - byte &= ~(1 <<CW_CONF_PERPACKET_RETRY_SHIFT ); -write_nic_byte (dev,CW_CONF , byte); - - tx_agc_ctl =read_nic_byte (dev,TX_AGC_CTL ); - tx_agc_ctl &= ~(1 <<TX_AGC_CTL_PERPACKET_GAIN_SHIFT ); - tx_agc_ctl &= ~(1 <<TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT ); - tx_agc_ctl |= (1 <<TX_AGC_CTL_FEEDBACK_ANT ); -write_nic_byte (dev,TX_AGC_CTL , tx_agc_ctl); -write_nic_byte (dev,0xec ,0x3f );/* Disable early TX */ - - txconf = txconf & ~(1 <<TCR_PROBE_NOTIMESTAMP_SHIFT ); - - txconf = txconf & ~TX_LOOPBACK_MASK ; - txconf = txconf | (TX_LOOPBACK_NONE <<TX_LOOPBACK_SHIFT ); - txconf = txconf & ~TCR_DPRETRY_MASK ; - txconf = txconf & ~TCR_RTSRETRY_MASK ; - txconf = txconf | (priv->retry_data<<TX_DPRETRY_SHIFT ); - txconf = txconf | (priv->retry_rts<<TX_RTSRETRY_SHIFT ); - txconf = txconf & ~(1 <<TX_NOCRC_SHIFT ); - -if (priv->hw_plcp_len) - txconf = txconf & ~TCR_PLCP_LEN ; -else - txconf = txconf |TCR_PLCP_LEN ; - - txconf = txconf & ~TCR_MXDMA_MASK ; - txconf = txconf | (TCR_MXDMA_2048 <<TCR_MXDMA_SHIFT ); - txconf = txconf |TCR_CWMIN ; - txconf = txconf |TCR_DISCW ; - - txconf = txconf | (1 <<TX_NOICV_SHIFT ); - -write_nic_dword (dev,TX_CONF , txconf); - -fix_tx_fifo (dev); - - cmd =read_nic_byte (dev,CMD ); -write_nic_byte (dev,CMD , cmd | (1 <<CMD_TX_ENABLE_SHIFT )); - -write_nic_dword (dev,TX_CONF , txconf); -} -void rtl8180_beacon_tx_enable (struct net_device *dev) {struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv (dev);
@@ -3107,77 +2993,6 @@ void rtl8185_set_rate(struct net_device *dev)write_nic_word (dev,BRSR , word); } -void rtl8180_adapter_start (struct net_device *dev) -{ -struct r8180_priv *priv =ieee80211_priv (dev); - -rtl8180_rtx_disable (dev); -rtl8180_reset (dev); - -/* enable beacon timeout, beacon TX ok and err -* LP tx ok and err, HP TX ok and err, NP TX ok and err, -* RX ok and ERR, and GP timer -*/ - priv->irq_mask =0x6fcf ; - - priv->dma_poll_mask =0 ; - -rtl8180_beacon_tx_disable (dev); - -rtl8180_set_mode (dev,EPROM_CMD_CONFIG ); -write_nic_dword (dev,MAC0 , ((u32 *)dev->dev_addr)[0 ]); -write_nic_word (dev,MAC4 , ((u32 *)dev->dev_addr)[1 ] &0xffff ); -rtl8180_set_mode (dev,EPROM_CMD_NORMAL ); - -rtl8180_update_msr (dev); - -/* These might be unnecessary since we do in rx_enable / tx_enable */ -fix_rx_fifo (dev); -fix_tx_fifo (dev); - -rtl8180_set_mode (dev,EPROM_CMD_CONFIG ); - -/* -* The following is very strange. seems to be that 1 means test mode, -* but we need to acknowledges the nic when a packet is ready -* although we set it to 0 -*/ - -write_nic_byte (dev, -CONFIG2 ,read_nic_byte (dev,CONFIG2 ) & ~\ - (1 <<CONFIG2_DMA_POLLING_MODE_SHIFT )); -/* ^the nic isn't in test mode */ -write_nic_byte (dev, -CONFIG2 ,read_nic_byte (dev,CONFIG2 )|(1 <<4 )); - -rtl8180_set_mode (dev,EPROM_CMD_NORMAL ); - -write_nic_dword (dev,INT_TIMEOUT ,0 ); - -write_nic_byte (dev,WPA_CONFIG ,0 ); - -rtl8180_no_hw_wep (dev); - -rtl8185_set_rate (dev); -write_nic_byte (dev,RATE_FALLBACK ,0x81 ); - -write_nic_byte (dev,GP_ENABLE ,read_nic_byte (dev,GP_ENABLE ) & ~(1 <<6 )); - -/* FIXME cfg 3 ClkRun enable - isn't it ReadOnly ? */ -rtl8180_set_mode (dev,EPROM_CMD_CONFIG ); -write_nic_byte (dev,CONFIG3 ,read_nic_byte (dev,CONFIG3 ) - | (1 <<CONFIG3_CLKRUN_SHIFT )); -rtl8180_set_mode (dev,EPROM_CMD_NORMAL ); - - priv->rf_init (dev); - -if (priv->rf_set_sens !=NULL ) - priv->rf_set_sens (dev, priv->sens); -rtl8180_irq_enable (dev); - -netif_start_queue (dev); -} -/* * This configures registers for beacon tx and enables it via * rtl8180_beacon_tx_enable(). rtl8180_beacon_tx_disable() might
drivers/staging/rtl8187se/r8180_rtl8225z2.c +0 -16
@@ -412,22 +412,6 @@ static u32 read_rtl8225(struct net_device *dev, u8 adr)return dataRead; } -short rtl8225_is_V_z2 (struct net_device *dev) -{ -short vz2 =1 ; - -if (read_rtl8225 (dev,8 ) !=0x588 ) - vz2 =0 ; -else /* reg 9 pg 1 = 24 */ -if (read_rtl8225 (dev,9 ) !=0x700 ) - vz2 =0 ; - -/* sw back to pg 0 */ -write_rtl8225 (dev,0 ,0xb7 ); - -return vz2; -} -void rtl8225z2_rf_close (struct net_device *dev) {RF_WriteReg (dev,0x4 ,0x1f );
Signature · 1 line
1.7.10.4
PATCH 2/17 staging: rtl8187se: Removed legacy rtl8225_rf_set_chan()
In reply to Maxim MikityanskiyRemoved rtl8225_rf_set_chan() and corresponding arrays, changed its usage to rtl8225z2_rf_set_chan()
--- drivers/staging/rtl8187se/r8180_core.c | 41 ------- drivers/staging/rtl8187se/r8180_rtl8225z2.c | 160 +-------------------------- 2 files changed, 3 insertions(+), 198 deletions(-)
drivers/staging/rtl8187se/r8180_core.c +0 -41
@@ -444,24 +444,6 @@ void buffer_free(struct net_device *dev, struct buffer **buffer, int len, short *buffer =NULL ; } -void print_buffer (u32 *buffer,int len) -{ -int i; -u8 *buf = (u8 *)buffer; - -printk ("ASCII BUFFER DUMP (len: %x):\n" , len); - -for (i =0 ; i < len; i++) -printk ("%c" , buf[i]); - -printk ("\nBINARY BUFFER DUMP (len: %x):\n" , len); - -for (i =0 ; i < len; i++) -printk ("%02x" , buf[i]); - -printk ("\n" ); -} -int get_curr_tx_free_desc (struct net_device *dev,int priority) {struct r8180_priv *priv =ieee80211_priv (dev);
@@ -2970,29 +2952,6 @@ void write_phy_cck(struct net_device *dev, u8 adr, u32 data)rtl8185_write_phy (dev, adr, data |0x10000 ); } -void rtl8185_set_rate (struct net_device *dev) -{ -int i; -u16 word; -int basic_rate, min_rr_rate, max_rr_rate; - - basic_rate =ieeerate2rtlrate (240 ); - min_rr_rate =ieeerate2rtlrate (60 ); - max_rr_rate =ieeerate2rtlrate (240 ); - -write_nic_byte (dev,RESP_RATE , - max_rr_rate<<MAX_RESP_RATE_SHIFT | - min_rr_rate<<MIN_RESP_RATE_SHIFT ); - - word =read_nic_word (dev,BRSR ); - word &= ~BRSR_MBR_8185 ; - -for (i =0 ; i <= basic_rate; i++) - word |= (1 <<i); - -write_nic_word (dev,BRSR , word); -} -/* * This configures registers for beacon tx and enables it via * rtl8180_beacon_tx_enable(). rtl8180_beacon_tx_disable() might
drivers/staging/rtl8187se/r8180_rtl8225z2.c +3 -157
202 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 3/17 staging: rtl8187se: Removed empty functions and one-iteration loop
In reply to Maxim MikityanskiyRemoved empty functions, their calls and 'do {} while (0)' loop condition
--- drivers/staging/rtl8187se/r8185b_init.c | 210 +++++++++++++------------------ 1 file changed, 89 insertions(+), 121 deletions(-)
drivers/staging/rtl8187se/r8185b_init.c +89 -121
@@ -217,118 +217,115 @@ static int HwHSSIThreeWire(struct net_device *dev,u8 TryCnt;u8 u1bTmp; -do { -/* Check if WE and RE are cleared. */ -for (TryCnt =0 ; TryCnt <TC_3W_POLL_MAX_TRY_CNT ; TryCnt++) { - u1bTmp =read_nic_byte (dev,SW_3W_CMD1 ); -if ((u1bTmp & (SW_3W_CMD1_RE |SW_3W_CMD1_WE )) ==0 ) -break ; +/* Check if WE and RE are cleared. */ +for (TryCnt =0 ; TryCnt <TC_3W_POLL_MAX_TRY_CNT ; TryCnt++) { + u1bTmp =read_nic_byte (dev,SW_3W_CMD1 ); +if ((u1bTmp & (SW_3W_CMD1_RE |SW_3W_CMD1_WE )) ==0 ) +break ; -udelay (10 ); - } -if (TryCnt ==TC_3W_POLL_MAX_TRY_CNT ) { -printk (KERN_ERR "rtl8187se: HwThreeWire(): CmdReg:" -" %#X RE|WE bits are not clear!!\n" , u1bTmp); -dump_stack (); -return 0 ; - } +udelay (10 ); + } +if (TryCnt ==TC_3W_POLL_MAX_TRY_CNT ) { +printk (KERN_ERR "rtl8187se: HwThreeWire(): CmdReg:" +" %#X RE|WE bits are not clear!!\n" , u1bTmp); +dump_stack (); +return 0 ; + } -/* RTL8187S HSSI Read/Write Function */ - u1bTmp =read_nic_byte (dev,RF_SW_CONFIG ); +/* RTL8187S HSSI Read/Write Function */ + u1bTmp =read_nic_byte (dev,RF_SW_CONFIG ); -if (bSI) - u1bTmp |=RF_SW_CFG_SI ;/* reg08[1]=1 Serial Interface(SI) */ +if (bSI) + u1bTmp |=RF_SW_CFG_SI ;/* reg08[1]=1 Serial Interface(SI) */ -else - u1bTmp &= ~RF_SW_CFG_SI ;/* reg08[1]=0 Parallel Interface(PI) */ +else + u1bTmp &= ~RF_SW_CFG_SI ;/* reg08[1]=0 Parallel Interface(PI) */ -write_nic_byte (dev,RF_SW_CONFIG , u1bTmp); +write_nic_byte (dev,RF_SW_CONFIG , u1bTmp); -if (bSI) { -/* jong: HW SI read must set reg84[3]=0. */ - u1bTmp =read_nic_byte (dev, RFPinsSelect); - u1bTmp &= ~BIT3 ; -write_nic_byte (dev, RFPinsSelect, u1bTmp); - } -/* Fill up data buffer for write operation. */ - -if (bWrite) { -if (nDataBufBitCnt ==16 ) { -write_nic_word (dev,SW_3W_DB0 , *((u16 *)pDataBuf)); - }else if (nDataBufBitCnt ==64 ) { -/* RTL8187S shouldn't enter this case */ -write_nic_dword (dev,SW_3W_DB0 , *((u32 *)pDataBuf)); -write_nic_dword (dev,SW_3W_DB1 , *((u32 *)(pDataBuf +4 ))); - }else { -int idx; -int ByteCnt = nDataBufBitCnt /8 ; -/* printk("%d\n",nDataBufBitCnt); */ -if ((nDataBufBitCnt %8 ) !=0 ) { -printk (KERN_ERR "rtl8187se: " -"HwThreeWire(): nDataBufBitCnt(%d)" -" should be multiple of 8!!!\n" , - nDataBufBitCnt); -dump_stack (); - nDataBufBitCnt +=8 ; - nDataBufBitCnt &= ~7 ; - } +if (bSI) { +/* jong: HW SI read must set reg84[3]=0. */ + u1bTmp =read_nic_byte (dev, RFPinsSelect); + u1bTmp &= ~BIT3 ; +write_nic_byte (dev, RFPinsSelect, u1bTmp); + } +/* Fill up data buffer for write operation. */ + +if (bWrite) { +if (nDataBufBitCnt ==16 ) { +write_nic_word (dev,SW_3W_DB0 , *((u16 *)pDataBuf)); + }else if (nDataBufBitCnt ==64 ) { +/* RTL8187S shouldn't enter this case */ +write_nic_dword (dev,SW_3W_DB0 , *((u32 *)pDataBuf)); +write_nic_dword (dev,SW_3W_DB1 , *((u32 *)(pDataBuf +4 ))); + }else { +int idx; +int ByteCnt = nDataBufBitCnt /8 ; +/* printk("%d\n",nDataBufBitCnt); */ +if ((nDataBufBitCnt %8 ) !=0 ) { +printk (KERN_ERR "rtl8187se: " +"HwThreeWire(): nDataBufBitCnt(%d)" +" should be multiple of 8!!!\n" , + nDataBufBitCnt); +dump_stack (); + nDataBufBitCnt +=8 ; + nDataBufBitCnt &= ~7 ; + } -if (nDataBufBitCnt >64 ) { -printk (KERN_ERR "rtl8187se: HwThreeWire():" -" nDataBufBitCnt(%d) should <= 64!!!\n" , - nDataBufBitCnt); -dump_stack (); - nDataBufBitCnt =64 ; - } +if (nDataBufBitCnt >64 ) { +printk (KERN_ERR "rtl8187se: HwThreeWire():" +" nDataBufBitCnt(%d) should <= 64!!!\n" , + nDataBufBitCnt); +dump_stack (); + nDataBufBitCnt =64 ; + } -for (idx =0 ; idx < ByteCnt; idx++) -write_nic_byte (dev, (SW_3W_DB0 +idx), *(pDataBuf+idx)); +for (idx =0 ; idx < ByteCnt; idx++) +write_nic_byte (dev, (SW_3W_DB0 +idx), *(pDataBuf+idx)); - } - }else {/* read */ -if (bSI) { -/* SI - reg274[3:0] : RF register's Address */ -write_nic_word (dev,SW_3W_DB0 , *((u16 *)pDataBuf)); - }else { -/* PI - reg274[15:12] : RF register's Address */ -write_nic_word (dev,SW_3W_DB0 , (*((u16 *)pDataBuf)) <<12 ); - } } + }else {/* read */ +if (bSI) { +/* SI - reg274[3:0] : RF register's Address */ +write_nic_word (dev,SW_3W_DB0 , *((u16 *)pDataBuf)); + }else { +/* PI - reg274[15:12] : RF register's Address */ +write_nic_word (dev,SW_3W_DB0 , (*((u16 *)pDataBuf)) <<12 ); + } + } -/* Set up command: WE or RE. */ -if (bWrite) -write_nic_byte (dev,SW_3W_CMD1 ,SW_3W_CMD1_WE ); +/* Set up command: WE or RE. */ +if (bWrite) +write_nic_byte (dev,SW_3W_CMD1 ,SW_3W_CMD1_WE ); -else -write_nic_byte (dev,SW_3W_CMD1 ,SW_3W_CMD1_RE ); +else +write_nic_byte (dev,SW_3W_CMD1 ,SW_3W_CMD1_RE ); -/* Check if DONE is set. */ -for (TryCnt =0 ; TryCnt <TC_3W_POLL_MAX_TRY_CNT ; TryCnt++) { - u1bTmp =read_nic_byte (dev,SW_3W_CMD1 ); -if ((u1bTmp &SW_3W_CMD1_DONE ) !=0 ) -break ; - -udelay (10 ); - } +/* Check if DONE is set. */ +for (TryCnt =0 ; TryCnt <TC_3W_POLL_MAX_TRY_CNT ; TryCnt++) { + u1bTmp =read_nic_byte (dev,SW_3W_CMD1 ); +if ((u1bTmp &SW_3W_CMD1_DONE ) !=0 ) +break ; -write_nic_byte (dev,SW_3W_CMD1 ,0 ); +udelay (10 ); + } -/* Read back data for read operation. */ -if (bWrite ==0 ) { -if (bSI) { -/* Serial Interface : reg363_362[11:0] */ - *((u16 *)pDataBuf) =read_nic_word (dev,SI_DATA_READ ) ; - }else { -/* Parallel Interface : reg361_360[11:0] */ - *((u16 *)pDataBuf) =read_nic_word (dev,PI_DATA_READ ); - } +write_nic_byte (dev,SW_3W_CMD1 ,0 ); - *((u16 *)pDataBuf) &=0x0FFF ; +/* Read back data for read operation. */ +if (bWrite ==0 ) { +if (bSI) { +/* Serial Interface : reg363_362[11:0] */ + *((u16 *)pDataBuf) =read_nic_word (dev,SI_DATA_READ ) ; + }else { +/* Parallel Interface : reg361_360[11:0] */ + *((u16 *)pDataBuf) =read_nic_word (dev,PI_DATA_READ ); } - }while (0 ); + *((u16 *)pDataBuf) &=0x0FFF ; + }return bResult; }
@@ -1148,18 +1145,11 @@ void rtl8185b_irq_enable(struct net_device *dev)write_nic_dword (dev,IMR , priv->IntrMask); } -void DrvIFIndicateDisassociation (struct net_device *dev,u16 reason) -{ -/* nothing is needed after disassociation request. */ -} -void MgntDisconnectIBSS (struct net_device *dev) {struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv (dev);u8 i; -DrvIFIndicateDisassociation (dev, unspec_reason); -for (i =0 ; i <6 ; i++) priv->ieee80211->current_network.bssid[i] =0x55 ;
@@ -1190,8 +1180,6 @@ void MlmeDisassociateRequest(struct net_device *dev, u8 *asSta, u8 asRsn)if (memcmp (priv->ieee80211->current_network.bssid, asSta,6 ) ==0 ) {/* ShuChen TODO: change media status. */ -/* ShuChen TODO: What to do when disassociate. */ -DrvIFIndicateDisassociation (dev, unspec_reason);for (i =0 ; i <6 ; i++) priv->ieee80211->current_network.bssid[i] =0x22 ;
@@ -1267,14 +1255,6 @@ bool SetRFPowerState(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)return bResult; } -void HalEnableRx8185Dummy (struct net_device *dev) -{ -} - -void HalDisableRx8185Dummy (struct net_device *dev) -{ -} -bool MgntActSet_RF_State (struct net_device *dev,RT_RF_POWER_STATE StateToSet,u32 ChangeSource) {struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv (dev);
@@ -1359,18 +1339,6 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet, uif (bActionAllowed) {/* Config HW to the specified mode. */ SetRFPowerState (dev, StateToSet); - -/* Turn on RF. */ -if (StateToSet == eRfOn) { -HalEnableRx8185Dummy (dev); -if (bConnectBySSID) { -/* by amy not supported */ - } - } -/* Turn off RF. */ -else if (StateToSet == eRfOff) -HalDisableRx8185Dummy (dev); - }/* Release RF spinlock */
Signature · 1 line
1.7.10.4
PATCH 4/17 staging: rtl8187se: Fixed bugs in interrupt handler
In reply to Maxim MikityanskiyFixed typo in rtl8180_interrupt() and added missing line
--- drivers/staging/rtl8187se/r8180_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rtl8187se/r8180_core.c +2 -1
@@ -3787,7 +3787,7 @@ irqreturn_t rtl8180_interrupt(int irq, void *netdev, struct pt_regs *regs) priv->stats.txbkperr++; priv->ieee80211->stats.tx_errors++;rtl8180_tx_isr (dev,BK_PRIORITY ,1 ); -rtl8180_try_wake_queue (dev,BE_PRIORITY ); +rtl8180_try_wake_queue (dev,BK_PRIORITY ); }if (inta &ISR_TBEDER ) {/* corresponding to BE_PRIORITY */
@@ -3841,6 +3841,7 @@ irqreturn_t rtl8180_interrupt(int irq, void *netdev, struct pt_regs *regs) priv->link_detect.NumTxOkInPeriod++;/* YJ,add,080828 */ priv->stats.txnpokint++;rtl8180_tx_isr (dev,NORM_PRIORITY ,0 ); +rtl8180_try_wake_queue (dev,NORM_PRIORITY ); }if (inta &ISR_TLPDOK ) {/* Low priority tx ok */
Signature · 1 line
1.7.10.4
PATCH 5/17 staging: rtl8187se: Simplified function GetSupportedWirelessMode8185()
In reply to Maxim MikityanskiyRemoved unnecessary variable in GetSupportedWirelessMode8185() and shortened its code
--- drivers/staging/rtl8187se/r8185b_init.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/rtl8187se/r8185b_init.c +1 -4
@@ -927,10 +927,7 @@ static void MacConfig_85BASIC(struct net_device *dev)u8 GetSupportedWirelessMode8185 (struct net_device *dev) { -u8 btSupportedWirelessMode =0 ; - - btSupportedWirelessMode = (WIRELESS_MODE_B |WIRELESS_MODE_G ); -return btSupportedWirelessMode; +return WIRELESS_MODE_B |WIRELESS_MODE_G ; } void ActUpdateChannelAccessSetting(struct net_device *dev,
Signature · 1 line
1.7.10.4
PATCH 6/17 staging: rtl8187se: Fixed oops when rmmoding
In reply to Maxim MikityanskiyDon't remove procfs entry that is never created
--- drivers/staging/rtl8187se/r8180_core.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/rtl8187se/r8180_core.c +0 -1
@@ -323,7 +323,6 @@ void rtl8180_proc_remove_one(struct net_device *dev)remove_proc_entry ("stats-tx" , priv->dir_dev);remove_proc_entry ("stats-rx" , priv->dir_dev);remove_proc_entry ("registers" , priv->dir_dev); -remove_proc_entry (dev->name, rtl8180_proc); priv->dir_dev =NULL ; } }
Signature · 1 line
1.7.10.4
PATCH 7/17 staging: rtl8187se: Removed unused module parameters and fixed module description
In reply to Maxim MikityanskiyRemoved confusing and unimplemented module parameters and fix NIC name in module description
--- drivers/staging/rtl8187se/r8180_core.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/staging/rtl8187se/r8180_core.c +1 -11
@@ -61,28 +61,18 @@ static struct pci_device_id rtl8180_pci_id_tbl[] __devinitdata = { } }; -static char ifname[IFNAMSIZ ] ="wlan%d" ; -static int hwseqnum =0 ;static int hwwep =0 ; -static int channels =0x3fff ;MODULE_LICENSE ("GPL" );MODULE_DEVICE_TABLE (pci, rtl8180_pci_id_tbl);MODULE_AUTHOR ("Andrea Merello <[email protected]>" ); -MODULE_DESCRIPTION ("Linux driver for Realtek RTL8180 / RTL8185 WiFi cards" ); - +MODULE_DESCRIPTION ("Linux driver for Realtek RTL8187SE WiFi cards" );module_param_string (ifname, ifname,sizeof (ifname),S_IRUGO |S_IWUSR ); -module_param (hwseqnum, int,S_IRUGO |S_IWUSR );module_param (hwwep, int,S_IRUGO |S_IWUSR ); -module_param (channels, int,S_IRUGO |S_IWUSR ); -MODULE_PARM_DESC (devname," Net interface name, wlan%d=default" ); -MODULE_PARM_DESC (hwseqnum," Try to use hardware 802.11 header sequence numbers. Zero=default" );MODULE_PARM_DESC (hwwep," Try to use hardware WEP support. Still broken and not available on all cards" ); -MODULE_PARM_DESC (channels," Channel bitmask for specific locales. NYI" ); -static int __devinit rtl8180_pci_probe (struct pci_dev *pdev,const struct pci_device_id *id);
Signature · 1 line
1.7.10.4
PATCH 8/17 staging: rtl8187se: Removed dead code
In reply to Maxim MikityanskiyRemoved some unused functions, arrays and #define in r8180_core.c
--- drivers/staging/rtl8187se/r8180_core.c | 82 -------------------------------- 1 file changed, 82 deletions(-)
drivers/staging/rtl8187se/r8180_core.c +0 -82
@@ -606,66 +606,6 @@ void fix_rx_fifo(struct net_device *dev)set_nic_rxring (dev); } -unsigned char QUALITY_MAP [] = { -0x64 ,0x64 ,0x64 ,0x63 ,0x63 ,0x62 ,0x62 ,0x61 , -0x61 ,0x60 ,0x60 ,0x5f ,0x5f ,0x5e ,0x5d ,0x5c , -0x5b ,0x5a ,0x59 ,0x57 ,0x56 ,0x54 ,0x52 ,0x4f , -0x4c ,0x49 ,0x45 ,0x41 ,0x3c ,0x37 ,0x31 ,0x29 , -0x24 ,0x22 ,0x22 ,0x22 ,0x22 ,0x22 ,0x22 ,0x22 , -0x22 ,0x22 ,0x21 ,0x21 ,0x21 ,0x21 ,0x21 ,0x20 , -0x20 ,0x20 ,0x20 ,0x1f ,0x1f ,0x1e ,0x1e ,0x1e , -0x1d ,0x1d ,0x1c ,0x1c ,0x1b ,0x1a ,0x19 ,0x19 , -0x18 ,0x17 ,0x16 ,0x15 ,0x14 ,0x12 ,0x11 ,0x0f , -0x0e ,0x0c ,0x0a ,0x08 ,0x06 ,0x04 ,0x01 ,0x00 -}; - -unsigned char STRENGTH_MAP [] = { -0x64 ,0x64 ,0x63 ,0x62 ,0x61 ,0x60 ,0x5f ,0x5e , -0x5d ,0x5c ,0x5b ,0x5a ,0x57 ,0x54 ,0x52 ,0x50 , -0x4e ,0x4c ,0x4a ,0x48 ,0x46 ,0x44 ,0x41 ,0x3f , -0x3c ,0x3a ,0x37 ,0x36 ,0x36 ,0x1c ,0x1c ,0x1b , -0x1b ,0x1a ,0x1a ,0x19 ,0x19 ,0x18 ,0x18 ,0x17 , -0x17 ,0x16 ,0x16 ,0x15 ,0x15 ,0x14 ,0x14 ,0x13 , -0x13 ,0x12 ,0x12 ,0x11 ,0x11 ,0x10 ,0x10 ,0x0f , -0x0f ,0x0e ,0x0e ,0x0d ,0x0d ,0x0c ,0x0c ,0x0b , -0x0b ,0x0a ,0x0a ,0x09 ,0x09 ,0x08 ,0x08 ,0x07 , -0x07 ,0x06 ,0x06 ,0x05 ,0x04 ,0x03 ,0x02 ,0x00 -}; - -void rtl8180_RSSI_calc (struct net_device *dev,u8 *rssi,u8 *qual) -{ -u32 temp; -u32 temp2; -u32 q; -u32 orig_qual; -u8 _rssi; - - q = *qual; - orig_qual = *qual; - _rssi =0 ;/* avoid gcc complains.. */ - -if (q <=0x4e ) { - temp =QUALITY_MAP [q]; - }else { -if (q &0x80 ) - temp =0x32 ; -else - temp =1 ; - } - - *qual = temp; - temp2 = *rssi; - -if (_rssi <0x64 ) { -if (_rssi ==0 ) - *rssi =1 ; - }else { - *rssi =0x64 ; - } - -return ; -} -void rtl8180_irq_disable (struct net_device *dev) {struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv (dev);
@@ -746,26 +686,6 @@ void set_nic_txring(struct net_device *dev)write_nic_dword (dev,TX_BEACON_RING_ADDR , priv->txbeaconringdma); } -void rtl8180_conttx_enable (struct net_device *dev) -{ -u32 txconf; - - txconf =read_nic_dword (dev,TX_CONF ); - txconf = txconf & ~TX_LOOPBACK_MASK ; - txconf = txconf | (TX_LOOPBACK_CONTINUE <<TX_LOOPBACK_SHIFT ); -write_nic_dword (dev,TX_CONF , txconf); -} - -void rtl8180_conttx_disable (struct net_device *dev) -{ -u32 txconf; - - txconf =read_nic_dword (dev,TX_CONF ); - txconf = txconf & ~TX_LOOPBACK_MASK ; - txconf = txconf | (TX_LOOPBACK_NONE <<TX_LOOPBACK_SHIFT ); -write_nic_dword (dev,TX_CONF , txconf); -} -void rtl8180_beacon_tx_enable (struct net_device *dev) {struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv (dev);
@@ -2136,8 +2056,6 @@ short rtl8180_is_tx_queue_empty(struct net_device *dev)return 0 ;return 1 ; } -/* FIXME FIXME 5msecs is random */ -#define HW_WAKE_DELAY 5void rtl8180_hw_wakeup (struct net_device *dev) {
Signature · 1 line
1.7.10.4
PATCH 9/17 staging: rtl8187se: Removed unused parameters of HwHSSIThreeWire()
In reply to Maxim MikityanskiyRemoved two parameters of HwHSSIThreeWire() that are equal in all function calls, fixed return type, fixed register width and simplified code
--- drivers/staging/rtl8187se/r8180_rtl8225.h | 4 +- drivers/staging/rtl8187se/r8185b_init.c | 127 +++++++---------------------- 2 files changed, 31 insertions(+), 100 deletions(-)
drivers/staging/rtl8187se/r8180_rtl8225.h +2 -2
@@ -23,8 +23,8 @@ void rtl8225z2_rf_init(struct net_device *dev);void rtl8225z2_rf_set_chan (struct net_device *dev,short ch);void rtl8225z2_rf_close (struct net_device *dev); -void RF_WriteReg (struct net_device *dev,u8 offset,u32 data); -u32 RF_ReadReg (struct net_device *dev,u8 offset); +void RF_WriteReg (struct net_device *dev,u8 offset,u16 data); +u16 RF_ReadReg (struct net_device *dev,u8 offset);void rtl8180_set_mode (struct net_device *dev,int mode);void rtl8180_set_mode (struct net_device *dev,int mode);
drivers/staging/rtl8187se/r8185b_init.c +29 -98
178 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 10/17 staging: rtl8187se: Fixed typo in TransmitConfig
In reply to Maxim MikityanskiyFixed typo in TransmitConfig and removed always false condition
--- drivers/staging/rtl8187se/r8180_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/rtl8187se/r8180_core.c +2 -3
@@ -2581,11 +2581,10 @@ short rtl8180_init(struct net_device *dev) priv->CSMethod = (0x01 <<29 ); - priv->TransmitConfig = TCR_DurProcMode_OFFSET | + priv->TransmitConfig = (1 <<TCR_DurProcMode_OFFSET) | (7 <<TCR_MXDMA_OFFSET ) | (priv->ShortRetryLimit<<TCR_SRL_OFFSET ) | - (priv->LongRetryLimit<<TCR_LRL_OFFSET ) | - (0 ?TCR_SAT :0 ); + (priv->LongRetryLimit<<TCR_LRL_OFFSET ); priv->ReceiveConfig =RCR_AMF |RCR_ADF |RCR_ACF | RCR_AB | RCR_AM | RCR_APM |
Signature · 1 line
1.7.10.4
PATCH 11/17 staging: rtl8187se: Removed non-existent function headers from r8180.h
In reply to Maxim MikityanskiyCleaned up r8180.h header file by removing headers of functions that don't exist
--- drivers/staging/rtl8187se/r8180.h | 13 ------------- 1 file changed, 13 deletions(-)
drivers/staging/rtl8187se/r8180.h +0 -13
@@ -667,35 +667,22 @@ void write_nic_dword(struct net_device *dev, int x,u32 y);void force_pci_posting (struct net_device *dev);void rtl8180_rtx_disable (struct net_device *); -void rtl8180_rx_enable (struct net_device *); -void rtl8180_tx_enable (struct net_device *); -void rtl8180_start_scanning (struct net_device *dev); -void rtl8180_start_scanning_s (struct net_device *dev); -void rtl8180_stop_scanning (struct net_device *dev); -void rtl8180_disassociate (struct net_device *dev); -//void fix_rx_fifo(struct net_device *dev); void rtl8180_set_anaparam (struct net_device *dev,u32 a);void rtl8185_set_anaparam2 (struct net_device *dev,u32 a);void rtl8180_set_hw_wep (struct net_device *dev);void rtl8180_no_hw_wep (struct net_device *dev);void rtl8180_update_msr (struct net_device *dev); -//void rtl8180_BSS_create(struct net_device *dev); void rtl8180_beacon_tx_disable (struct net_device *dev);void rtl8180_beacon_rx_disable (struct net_device *dev); -void rtl8180_conttx_enable (struct net_device *dev); -void rtl8180_conttx_disable (struct net_device *dev);int rtl8180_down (struct net_device *dev);int rtl8180_up (struct net_device *dev);void rtl8180_commit (struct net_device *dev);void rtl8180_set_chan (struct net_device *dev,short ch); -void rtl8180_set_master_essid (struct net_device *dev,char *essid); -void rtl8180_update_beacon_security (struct net_device *dev);void write_phy (struct net_device *dev,u8 adr,u8 data);void write_phy_cck (struct net_device *dev,u8 adr,u32 data);void write_phy_ofdm (struct net_device *dev,u8 adr,u32 data);void rtl8185_tx_antenna (struct net_device *dev,u8 ant);void rtl8185_rf_pins_enable (struct net_device *dev); -void IBSS_randomize_cell (struct net_device *dev);void IPSEnter (struct net_device *dev);void IPSLeave (struct net_device *dev);int get_curr_tx_free_desc (struct net_device *dev,int priority);
Signature · 1 line
1.7.10.4
PATCH 12/17 staging: rtl8187se: Removed unused arrays in r8180_rtl8225z2.c
In reply to Maxim Mikityanskiy--- drivers/staging/rtl8187se/r8180_rtl8225z2.c | 33 --------------------------- 1 file changed, 33 deletions(-)
drivers/staging/rtl8187se/r8180_rtl8225z2.c +0 -33
@@ -15,7 +15,6 @@#include "ieee80211/dot11d.h" -static void write_rtl8225 (struct net_device *dev,u8 adr,u16 data) {int i;
@@ -76,22 +75,6 @@ static void write_rtl8225(struct net_device *dev, u8 adr, u16 data)rtl8185_rf_pins_enable (dev); } -static const u16 rtl8225bcd_rxgain[] = { -0x0400 ,0x0401 ,0x0402 ,0x0403 ,0x0404 ,0x0405 ,0x0408 ,0x0409 , -0x040a ,0x040b ,0x0502 ,0x0503 ,0x0504 ,0x0505 ,0x0540 ,0x0541 , -0x0542 ,0x0543 ,0x0544 ,0x0545 ,0x0580 ,0x0581 ,0x0582 ,0x0583 , -0x0584 ,0x0585 ,0x0588 ,0x0589 ,0x058a ,0x058b ,0x0643 ,0x0644 , -0x0645 ,0x0680 ,0x0681 ,0x0682 ,0x0683 ,0x0684 ,0x0685 ,0x0688 , -0x0689 ,0x068a ,0x068b ,0x068c ,0x0742 ,0x0743 ,0x0744 ,0x0745 , -0x0780 ,0x0781 ,0x0782 ,0x0783 ,0x0784 ,0x0785 ,0x0788 ,0x0789 , -0x078a ,0x078b ,0x078c ,0x078d ,0x0790 ,0x0791 ,0x0792 ,0x0793 , -0x0794 ,0x0795 ,0x0798 ,0x0799 ,0x079a ,0x079b ,0x079c ,0x079d , -0x07a0 ,0x07a1 ,0x07a2 ,0x07a3 ,0x07a4 ,0x07a5 ,0x07a8 ,0x07a9 , -0x07aa ,0x07ab ,0x07ac ,0x07ad ,0x07b0 ,0x07b1 ,0x07b2 ,0x07b3 , -0x07b4 ,0x07b5 ,0x07b8 ,0x07b9 ,0x07ba ,0x07bb ,0x07bb - -}; -static const u8 rtl8225_agc[] = {0x9e ,0x9e ,0x9e ,0x9e ,0x9e ,0x9e ,0x9e ,0x9e ,0x9d ,0x9c ,0x9b ,0x9a ,0x99 ,0x98 ,0x97 ,0x96 ,
@@ -117,10 +100,6 @@ static const u32 rtl8225_chan[] = { 0x0400, 0x0480, 0x0500, 0x0580, 0x0600, 0x0680, 0x074A, }; -static const u8 rtl8225z2_threshold[] = { -0x8d ,0x8d ,0x8d ,0x8d ,0x9d ,0xad ,0xbd , -}; -static const u8 rtl8225z2_gain_bg[] = {0x23 ,0x15 ,0xa5 ,/* -82-1dBm */ 0x23 ,0x15 ,0xb5 ,/* -82-2dBm */
@@ -157,18 +136,6 @@ static const u16 rtl8225z2_rxgain[] = { }; -static const u8 rtl8225z2_tx_power_ofdm[] = { -0x42 ,0x00 ,0x40 ,0x00 ,0x40 -}; - -static const u8 rtl8225z2_tx_power_cck_ch14[] = { -0x36 ,0x35 ,0x2e ,0x1b ,0x00 ,0x00 ,0x00 ,0x00 -}; - -static const u8 rtl8225z2_tx_power_cck[] = { -0x36 ,0x35 ,0x2e ,0x25 ,0x1c ,0x12 ,0x09 ,0x04 -}; -void rtl8225z2_set_gain (struct net_device *dev,short gain) {const u8 *rtl8225_gain;
Signature · 1 line
1.7.10.4
PATCH 13/17 staging: rtl8187se: Use ARRAY_SIZE instead of in-code constants
In reply to Maxim MikityanskiyUse ARRAY_SIZE macro instead of hardcoding array size into loop condition and remove unused last item of rtl8225z2_rxgain[]
--- drivers/staging/rtl8187se/r8180_rtl8225z2.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/staging/rtl8187se/r8180_rtl8225z2.c +9 -11
@@ -132,7 +132,7 @@ static const u16 rtl8225z2_rxgain[] = {0x0794 ,0x0795 ,0x0798 ,0x0799 ,0x079a ,0x079b ,0x079c ,0x079d ,0x07a0 ,0x07a1 ,0x07a2 ,0x07a3 ,0x07a4 ,0x07a5 ,0x07a8 ,0x07a9 ,0x03aa ,0x03ab ,0x03ac ,0x03ad ,0x03b0 ,0x03b1 ,0x03b2 ,0x03b3 , -0x03b4 ,0x03b5 ,0x03b8 ,0x03b9 ,0x03ba ,0x03bb ,0x03bb +0x03b4 ,0x03b5 ,0x03b8 ,0x03b9 ,0x03ba ,0x03bb };
@@ -431,8 +431,8 @@ void rtl8225z2_rf_init(struct net_device *dev)struct r8180_priv *priv =ieee80211_priv (dev);int i;short channel =1 ; -u16 brsr; -u32 data, addr; +u16 brsr; +u32 data; priv->chan = channel;
@@ -473,8 +473,8 @@ void rtl8225z2_rf_init(struct net_device *dev)write_rtl8225 (dev,0x0 ,0x1b7 ); -for (i =0 ; i <95 ; i++) { -write_rtl8225 (dev,0x1 , (u8)(i +1 )); +for (i =0 ; i <ARRAY_SIZE (rtl8225z2_rxgain); i++) { +write_rtl8225 (dev,0x1 , i +1 );write_rtl8225 (dev,0x2 , rtl8225z2_rxgain[i]); }
@@ -504,14 +504,12 @@ void rtl8225z2_rf_init(struct net_device *dev)write_rtl8225 (dev,0x0 ,0x2bf ); -for (i =0 ; i <128 ; i++) { - data = rtl8225_agc[i]; - - addr = i +0x80 ;/* enable writing AGC table */ -write_phy_ofdm (dev,0xb , data); +for (i =0 ; i <ARRAY_SIZE (rtl8225_agc); i++) { +write_phy_ofdm (dev,0xb , rtl8225_agc[i]);mdelay (1 ); -write_phy_ofdm (dev,0xa , addr); +/* enable writing AGC table */ +write_phy_ofdm (dev,0xa , i +0x80 );mdelay (1 ); }
Signature · 1 line
1.7.10.4
PATCH 14/17 staging: rtl8187se: Removed unneeded reads from EEPROM
In reply to Maxim MikityanskiyRemoved unneeded reads from EEPROM and some unnecessary conditions
--- drivers/staging/rtl8187se/r8180.h | 4 ---- drivers/staging/rtl8187se/r8180_core.c | 36 ++++++++------------------------ 2 files changed, 9 insertions(+), 31 deletions(-)
drivers/staging/rtl8187se/r8180.h +0 -4
@@ -365,8 +365,6 @@ typedef struct r8180_privshort digphy;short antb;short diversity; -u8 cs_treshold; -short rcr_csense;u32 key0[4 ];short (*rf_set_sens)(struct net_device *dev,short sens);void (*rf_set_chan)(struct net_device *dev,short ch);
@@ -623,8 +621,6 @@ typedef struct r8180_privu8 PowerProfile;u32 CSMethod; -u8 cck_txpwr_base; -u8 ofdm_txpwr_base;u8 dma_poll_stop_mask;//u8 RegThreeWireMode;
drivers/staging/rtl8187se/r8180_core.c +9 -27
@@ -2376,8 +2376,7 @@ short rtl8180_init(struct net_device *dev) {struct r8180_priv *priv =ieee80211_priv (dev);u16 word; -u16 version; -u32 usValue; +u16 usValue;u16 tmpu16;int i, j;struct eeprom_93cx6 eeprom;
@@ -2614,36 +2613,31 @@ short rtl8180_init(struct net_device *dev)/* just for sync 85 */ priv->enable_gpio0 =0 ; -eeprom_93cx6_read (&eeprom,EEPROM_SW_REVD_OFFSET , &eeprom_val); - usValue = eeprom_val; -DMESG ("usValue is 0x%x\n" , usValue); +eeprom_93cx6_read (&eeprom,EEPROM_SW_REVD_OFFSET , &usValue); +DMESG ("usValue is %#hx\n" , usValue);/* 3Read AntennaDiversity */ /* SW Antenna Diversity. */ -if ((usValue &EEPROM_SW_AD_MASK ) !=EEPROM_SW_AD_ENABLE ) - priv->EEPROMSwAntennaDiversity = false; -else - priv->EEPROMSwAntennaDiversity = true; + priv->EEPROMSwAntennaDiversity = (usValue &EEPROM_SW_AD_MASK ) == +EEPROM_SW_AD_ENABLE ;/* Default Antenna to use. */ -if ((usValue &EEPROM_DEF_ANT_MASK ) !=EEPROM_DEF_ANT_1 ) - priv->EEPROMDefaultAntenna1 = false; -else - priv->EEPROMDefaultAntenna1 = true; + priv->EEPROMDefaultAntenna1 = (usValue &EEPROM_DEF_ANT_MASK ) == +EEPROM_DEF_ANT_1 ;if (priv->RegSwAntennaDiversityMechanism ==0 )/* Auto */ /* 0: default from EEPROM. */ priv->bSwAntennaDiverity = priv->EEPROMSwAntennaDiversity;else /* 1:disable antenna diversity, 2: enable antenna diversity. */ - priv->bSwAntennaDiverity = ((priv->RegSwAntennaDiversityMechanism ==1 ) ? false : true); + priv->bSwAntennaDiverity = priv->RegSwAntennaDiversityMechanism ==2 ;if (priv->RegDefaultAntenna ==0 )/* 0: default from EEPROM. */ priv->bDefaultAntenna1 = priv->EEPROMDefaultAntenna1;else /* 1: main, 2: aux. */ - priv->bDefaultAntenna1 = ((priv->RegDefaultAntenna ==2 ) ? true : false); + priv->bDefaultAntenna1 = priv->RegDefaultAntenna ==2 ;/* rtl8185 can calc plcp len in HW. */ priv->hw_plcp_len =1 ;
@@ -2683,18 +2677,6 @@ short rtl8180_init(struct net_device *dev)if ((tmpu16 &EEPROM_THERMAL_METER_ENABLE ) >>13 ) priv->bTxPowerTrack = true; -eeprom_93cx6_read (&eeprom,EPROM_TXPW_BASE , &word); - priv->cck_txpwr_base = word &0xf ; - priv->ofdm_txpwr_base = (word>>4 ) &0xf ; - -eeprom_93cx6_read (&eeprom,EPROM_VERSION , &version); -DMESG ("EEPROM version %x" , version); - priv->rcr_csense =3 ; - -eeprom_93cx6_read (&eeprom,ENERGY_TRESHOLD , &eeprom_val); - priv->cs_treshold = (eeprom_val &0xff00 ) >>8 ; - -eeprom_93cx6_read (&eeprom,RFCHIPID , &eeprom_val); priv->rf_sleep = rtl8225z4_rf_sleep; priv->rf_wakeup = rtl8225z4_rf_wakeup;DMESGW ("**PLEASE** REPORT SUCCESSFUL/UNSUCCESSFUL TO Realtek!" );
Signature · 1 line
1.7.10.4
PATCH 15/17 staging: rtl8187se: Removed unused fields in r8180_priv
In reply to Maxim MikityanskiyRemoved unused fields in r8180_priv and dead code that appeared after field removal
--- drivers/staging/rtl8187se/r8180.h | 10 ------- drivers/staging/rtl8187se/r8180_core.c | 49 ++----------------------------- drivers/staging/rtl8187se/r8185b_init.c | 6 ++-- 3 files changed, 5 insertions(+), 60 deletions(-)
drivers/staging/rtl8187se/r8180.h +0 -10
@@ -327,12 +327,8 @@ typedef struct r8180_privint irq;struct ieee80211_device *ieee80211; -short phy_ver;/* meaningful for rtl8225 1:A 2:B 3:C */ -short enable_gpio0; -short hw_plcp_len;short plcp_preamble_mode;// 0:auto 1:short 2:long -spinlock_t irq_lock;spinlock_t irq_th_lock;spinlock_t tx_lock;spinlock_t ps_lock;
@@ -350,7 +346,6 @@ typedef struct r8180_privu8 channel_plan;// it's the channel plan index short up;short crcmon;//if 1 allow bad crc frame reception in monitor mode -short prism_hdr;struct timer_list scan_timer;/*short scanpending;
@@ -359,7 +354,6 @@ typedef struct r8180_privu8 active_probe;//u8 active_scan_num; struct semaphore wx_sem; -struct semaphore rf_state;short hw_wep;short digphy;
@@ -489,7 +483,6 @@ typedef struct r8180_privRT_RF_POWER_STATE eRFPowerState;u32 RfOffReason;bool RFChangeInProgress; -bool bInHctTest;bool SetRFPowerStateInProgress;u8 RFProgType;bool bLeisurePs;
@@ -616,15 +609,12 @@ typedef struct r8180_priv// struct workqueue_struct *workqueue; struct work_struct reset_wq;struct work_struct watch_dog_wq; -struct work_struct tx_irq_wq;short ack_tx_to_ieee;u8 PowerProfile; -u32 CSMethod;u8 dma_poll_stop_mask;//u8 RegThreeWireMode; -u8 MWIEnable;u16 ShortRetryLimit;u16 LongRetryLimit;u16 EarlyRxThreshold;
drivers/staging/rtl8187se/r8180_core.c +3 -46
135 lines not on this page · raw message
drivers/staging/rtl8187se/r8185b_init.c +2 -4
@@ -1231,11 +1231,9 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet, u priv->RfOffReason =0 ; bActionAllowed = true; -if (rtState == eRfOff && ChangeSource >=RF_CHANGE_BY_HW && !priv->bInHctTest) +if (rtState == eRfOff && ChangeSource >=RF_CHANGE_BY_HW ) bConnectBySSID = true; - - }else - ; + }break ;case eRfOff:
Signature · 1 line
1.7.10.4
PATCH 16/17 staging: rtl8187se: Fixed size of BEACON_INTERVAL register
In reply to Maxim MikityanskiyBEACON_INTERVAL register is 16-bit, not 32-bit
--- drivers/staging/rtl8187se/r8180_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8187se/r8180_core.c +2 -2
@@ -1984,10 +1984,10 @@ void rtl8180_link_change(struct net_device *dev)write_nic_dword (dev,BSSID , ((u32 *)net->bssid)[0 ]);write_nic_word (dev,BSSID +4 , ((u16 *)net->bssid)[2 ]); - beacon_interval =read_nic_dword (dev,BEACON_INTERVAL ); + beacon_interval =read_nic_word (dev,BEACON_INTERVAL ); beacon_interval &= ~BEACON_INTERVAL_MASK ; beacon_interval |= net->beacon_interval; -write_nic_dword (dev,BEACON_INTERVAL , beacon_interval); +write_nic_word (dev,BEACON_INTERVAL , beacon_interval);rtl8180_set_mode (dev,EPROM_CMD_NORMAL );
Signature · 1 line
1.7.10.4
PATCH 17/17 staging: rtl8187se: Removed empty stub read_acadapter_file()
In reply to Maxim MikityanskiyRemoved empty read_acadapter_file() and priv->PowerProfile that never changes its value
--- drivers/staging/rtl8187se/r8180.h | 1 - drivers/staging/rtl8187se/r8180_core.c | 18 +----------------- 2 files changed, 1 insertion(+), 18 deletions(-)
drivers/staging/rtl8187se/r8180.h +0 -1
@@ -611,7 +611,6 @@ typedef struct r8180_privstruct work_struct watch_dog_wq;short ack_tx_to_ieee; -u8 PowerProfile;u8 dma_poll_stop_mask;//u8 RegThreeWireMode;
drivers/staging/rtl8187se/r8180_core.c +1 -17
@@ -2480,7 +2480,6 @@ short rtl8180_init(struct net_device *dev) priv->NumTxOkTotal =0 ; priv->NumTxUnicast =0 ; priv->keepAliveLevel =DEFAULT_KEEP_ALIVE_LEVEL ; - priv->PowerProfile =POWER_PROFILE_AC ; priv->CurrRetryCnt =0 ; priv->LastRetryCnt =0 ; priv->LastTxokCnt =0 ;
@@ -2927,8 +2926,6 @@ static void MgntLinkKeepAlive(struct r8180_priv *priv) } } -static u8 read_acadapter_file (char *filename); -void rtl8180_watch_dog (struct net_device *dev) {struct r8180_priv *priv =ieee80211_priv (dev);
@@ -2961,12 +2958,7 @@ void rtl8180_watch_dog(struct net_device *dev)MgntLinkKeepAlive (priv);/* YJ,add,080828,for LPS */ -if (priv->PowerProfile ==POWER_PROFILE_BATTERY ) - priv->bLeisurePs = true; -else if (priv->PowerProfile ==POWER_PROFILE_AC ) { -LeisurePSLeave (priv); - priv->bLeisurePs = false; - } +LeisurePSLeave (priv);if (priv->ieee80211->state ==IEEE80211_LINKED ) { priv->link_detect.NumRxOkInPeriod = priv->ieee80211->NumRxDataInPeriod;
@@ -3735,9 +3727,6 @@ void GPIOChangeRFWorkItemCallBack(struct work_struct *work)static char *envp[] = {"HOME=/" ,"TERM=linux" ,"PATH=/usr/bin:/bin" ,NULL };static int readf_count =0 ; -if (readf_count %10 ==0 ) - priv->PowerProfile =read_acadapter_file ("/proc/acpi/ac_adapter/AC0/state" ); - readf_count = (readf_count+1 )%0xffff ;/* We should turn off LED before polling FF51[4]. */
@@ -3782,10 +3771,5 @@ void GPIOChangeRFWorkItemCallBack(struct work_struct *work) } } -static u8 read_acadapter_file (char *filename) -{ -return 0 ; -} -module_init (rtl8180_pci_module_init);module_exit (rtl8180_pci_module_exit);
Signature · 1 line
1.7.10.4