aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-08-10 19:33:53 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 15:02:30 -0400
commitdf34e5e396e6cff3389549b27e898fdb5d140269 (patch)
tree63e75afb3904f7bfc4aaaf6145f522f48857271f /drivers
parent5e1ad18a8d198ccb0e201cb444a58f7e277dfb4d (diff)
Staging: rtl8192e: remove unused functions
This removes a number of unused functions. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/rtl8192e/r8192E_core.c250
-rw-r--r--drivers/staging/rtl8192e/r8192E_dm.c127
-rw-r--r--drivers/staging/rtl8192e/r819xE_firmware.c48
3 files changed, 0 insertions, 425 deletions
diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c
index 35797bf9931e..9a0ff9ce6944 100644
--- a/drivers/staging/rtl8192e/r8192E_core.c
+++ b/drivers/staging/rtl8192e/r8192E_core.c
@@ -856,25 +856,6 @@ static void rtl8192_proc_init_one(struct net_device *dev)
856 -----------------------------MISC STUFF------------------------- 856 -----------------------------MISC STUFF-------------------------
857*****************************************************************************/ 857*****************************************************************************/
858 858
859/* this is only for debugging */
860static void print_buffer(u32 *buffer, int len)
861{
862 int i;
863 u8 *buf =(u8*)buffer;
864
865 printk("ASCII BUFFER DUMP (len: %x):\n",len);
866
867 for(i=0;i<len;i++)
868 printk("%c",buf[i]);
869
870 printk("\nBINARY BUFFER DUMP (len: %x):\n",len);
871
872 for(i=0;i<len;i++)
873 printk("%x",buf[i]);
874
875 printk("\n");
876}
877
878short check_nic_enough_desc(struct net_device *dev, int prio) 859short check_nic_enough_desc(struct net_device *dev, int prio)
879{ 860{
880 struct r8192_priv *priv = ieee80211_priv(dev); 861 struct r8192_priv *priv = ieee80211_priv(dev);
@@ -904,32 +885,6 @@ static void tx_timeout(struct net_device *dev)
904} 885}
905 886
906 887
907/* this is only for debug */
908static void dump_eprom(struct net_device *dev)
909{
910 int i;
911 for(i=0; i<0xff; i++)
912 RT_TRACE(COMP_INIT, "EEPROM addr %x : %x", i, eprom_read(dev,i));
913}
914
915/* this is only for debug */
916static void rtl8192_dump_reg(struct net_device *dev)
917{
918 int i;
919 int n;
920 int max=0x5ff;
921
922 RT_TRACE(COMP_INIT, "Dumping NIC register map");
923
924 for(n=0;n<=max;)
925 {
926 printk( "\nD: %2x> ", n);
927 for(i=0;i<16 && n<=max;i++,n++)
928 printk("%2x ",read_nic_byte(dev,n));
929 }
930 printk("\n");
931}
932
933/**************************************************************************** 888/****************************************************************************
934 ------------------------------HW STUFF--------------------------- 889 ------------------------------HW STUFF---------------------------
935*****************************************************************************/ 890*****************************************************************************/
@@ -1164,27 +1119,6 @@ inline u16 rtl8192_rate2rate(short rate)
1164 1119
1165 1120
1166 1121
1167static u32 rtl819xusb_rx_command_packet(struct net_device *dev, struct ieee80211_rx_stats *pstats)
1168{
1169 u32 status;
1170
1171 //RT_TRACE(COMP_RECV, DBG_TRACE, ("---> RxCommandPacketHandle819xUsb()\n"));
1172
1173 RT_TRACE(COMP_EVENTS, "---->rtl819xusb_rx_command_packet()\n");
1174 status = cmpk_message_handle_rx(dev, pstats);
1175 if (status)
1176 {
1177 DMESG("rxcommandpackethandle819xusb: It is a command packet\n");
1178 }
1179 else
1180 {
1181 //RT_TRACE(COMP_RECV, DBG_TRACE, ("RxCommandPacketHandle819xUsb: It is not a command packet\n"));
1182 }
1183
1184 //RT_TRACE(COMP_RECV, DBG_TRACE, ("<--- RxCommandPacketHandle819xUsb()\n"));
1185 return status;
1186}
1187
1188#if 0 1122#if 0
1189void rtl8192_tx_queues_stop(struct net_device *dev) 1123void rtl8192_tx_queues_stop(struct net_device *dev)
1190{ 1124{
@@ -1483,141 +1417,6 @@ static void rtl8192_net_update(struct net_device *dev)
1483 1417
1484} 1418}
1485 1419
1486inline u8 rtl8192_IsWirelessBMode(u16 rate)
1487{
1488 if( ((rate <= 110) && (rate != 60) && (rate != 90)) || (rate == 220) )
1489 return 1;
1490 else return 0;
1491}
1492
1493u16 N_DBPSOfRate(u16 DataRate);
1494
1495static u16 ComputeTxTime(
1496 u16 FrameLength,
1497 u16 DataRate,
1498 u8 bManagementFrame,
1499 u8 bShortPreamble
1500)
1501{
1502 u16 FrameTime;
1503 u16 N_DBPS;
1504 u16 Ceiling;
1505
1506 if( rtl8192_IsWirelessBMode(DataRate) )
1507 {
1508 if( bManagementFrame || !bShortPreamble || DataRate == 10 )
1509 { // long preamble
1510 FrameTime = (u16)(144+48+(FrameLength*8/(DataRate/10)));
1511 }
1512 else
1513 { // Short preamble
1514 FrameTime = (u16)(72+24+(FrameLength*8/(DataRate/10)));
1515 }
1516 if( ( FrameLength*8 % (DataRate/10) ) != 0 ) //Get the Ceilling
1517 FrameTime ++;
1518 } else { //802.11g DSSS-OFDM PLCP length field calculation.
1519 N_DBPS = N_DBPSOfRate(DataRate);
1520 Ceiling = (16 + 8*FrameLength + 6) / N_DBPS
1521 + (((16 + 8*FrameLength + 6) % N_DBPS) ? 1 : 0);
1522 FrameTime = (u16)(16 + 4 + 4*Ceiling + 6);
1523 }
1524 return FrameTime;
1525}
1526
1527u16 N_DBPSOfRate(u16 DataRate)
1528{
1529 u16 N_DBPS = 24;
1530
1531 switch(DataRate)
1532 {
1533 case 60:
1534 N_DBPS = 24;
1535 break;
1536
1537 case 90:
1538 N_DBPS = 36;
1539 break;
1540
1541 case 120:
1542 N_DBPS = 48;
1543 break;
1544
1545 case 180:
1546 N_DBPS = 72;
1547 break;
1548
1549 case 240:
1550 N_DBPS = 96;
1551 break;
1552
1553 case 360:
1554 N_DBPS = 144;
1555 break;
1556
1557 case 480:
1558 N_DBPS = 192;
1559 break;
1560
1561 case 540:
1562 N_DBPS = 216;
1563 break;
1564
1565 default:
1566 break;
1567 }
1568
1569 return N_DBPS;
1570}
1571
1572static unsigned int txqueue2outpipe(unsigned int tx_queue)
1573{
1574 unsigned int outpipe = 0x04;
1575
1576 switch (tx_queue) {
1577 case VO_QUEUE://EP4
1578 outpipe = 0x04;
1579 break;
1580
1581 case VI_QUEUE://EP5
1582 outpipe = 0x05;
1583 break;
1584
1585 case BE_QUEUE://EP6
1586 outpipe = 0x06;
1587 break;
1588
1589 case BK_QUEUE://EP7
1590 outpipe = 0x07;
1591 break;
1592
1593 case HCCA_QUEUE://EP8
1594 outpipe = 0x08;
1595 break;
1596
1597 case BEACON_QUEUE://EPA
1598 outpipe = 0x0A;
1599 break;
1600
1601 case HIGH_QUEUE://EPB
1602 outpipe = 0x0B;
1603 break;
1604
1605 case MGNT_QUEUE://EPC
1606 outpipe = 0x0C;
1607 break;
1608
1609 case TXCMD_QUEUE://EPD
1610 outpipe = 0x0D;
1611 break;
1612
1613 default:
1614 printk("Unknow queue index!\n");
1615 break;
1616 }
1617
1618 return outpipe;
1619}
1620
1621void rtl819xE_tx_cmd(struct net_device *dev, struct sk_buff *skb) 1420void rtl819xE_tx_cmd(struct net_device *dev, struct sk_buff *skb)
1622{ 1421{
1623 struct r8192_priv *priv = ieee80211_priv(dev); 1422 struct r8192_priv *priv = ieee80211_priv(dev);
@@ -3528,10 +3327,6 @@ static short rtl8192_init(struct net_device *dev)
3528 3327
3529 //rtl8192_rx_enable(dev); 3328 //rtl8192_rx_enable(dev);
3530 //rtl8192_adapter_start(dev); 3329 //rtl8192_adapter_start(dev);
3531//#ifdef DEBUG_EPROM
3532// dump_eprom(dev);
3533//#endif
3534 //rtl8192_dump_reg(dev);
3535 return 0; 3330 return 0;
3536} 3331}
3537 3332
@@ -3707,7 +3502,6 @@ static RT_STATUS rtl8192_adapter_start(struct net_device *dev)
3707 //3// 3502 //3//
3708 //3// Initialize BB before MAC 3503 //3// Initialize BB before MAC
3709 //3// 3504 //3//
3710 //rtl8192_dump_reg(dev);
3711 RT_TRACE(COMP_INIT, "BB Config Start!\n"); 3505 RT_TRACE(COMP_INIT, "BB Config Start!\n");
3712 rtStatus = rtl8192_BBConfig(dev); 3506 rtStatus = rtl8192_BBConfig(dev);
3713 if(rtStatus != RT_STATUS_SUCCESS) 3507 if(rtStatus != RT_STATUS_SUCCESS)
@@ -3717,8 +3511,6 @@ static RT_STATUS rtl8192_adapter_start(struct net_device *dev)
3717 } 3511 }
3718 RT_TRACE(COMP_INIT,"BB Config Finished!\n"); 3512 RT_TRACE(COMP_INIT,"BB Config Finished!\n");
3719 3513
3720 //rtl8192_dump_reg(dev);
3721 //
3722 //3//Set Loopback mode or Normal mode 3514 //3//Set Loopback mode or Normal mode
3723 //3// 3515 //3//
3724 //2006.12.13 by emily. Note!We should not merge these two CPU_GEN register writings 3516 //2006.12.13 by emily. Note!We should not merge these two CPU_GEN register writings
@@ -4790,46 +4582,6 @@ IPSLeave(struct net_device *dev)
4790 } 4582 }
4791} 4583}
4792#endif 4584#endif
4793static void CAM_read_entry(
4794 struct net_device *dev,
4795 u32 iIndex
4796)
4797{
4798 u32 target_command=0;
4799 u32 target_content=0;
4800 u8 entry_i=0;
4801 u32 ulStatus;
4802 s32 i=100;
4803// printk("=======>start read CAM\n");
4804 for(entry_i=0;entry_i<CAM_CONTENT_COUNT;entry_i++)
4805 {
4806 // polling bit, and No Write enable, and address
4807 target_command= entry_i+CAM_CONTENT_COUNT*iIndex;
4808 target_command= target_command | BIT31;
4809
4810 //Check polling bit is clear
4811// mdelay(1);
4812#if 1
4813 while((i--)>=0)
4814 {
4815 ulStatus = read_nic_dword(dev, RWCAM);
4816 if(ulStatus & BIT31){
4817 continue;
4818 }
4819 else{
4820 break;
4821 }
4822 }
4823#endif
4824 write_nic_dword(dev, RWCAM, target_command);
4825 RT_TRACE(COMP_SEC,"CAM_read_entry(): WRITE A0: %x \n",target_command);
4826 // printk("CAM_read_entry(): WRITE A0: %lx \n",target_command);
4827 target_content = read_nic_dword(dev, RCAMO);
4828 RT_TRACE(COMP_SEC, "CAM_read_entry(): WRITE A8: %x \n",target_content);
4829 // printk("CAM_read_entry(): WRITE A8: %lx \n",target_content);
4830 }
4831 printk("\n");
4832}
4833 4585
4834static void rtl819x_update_rxcounts( 4586static void rtl819x_update_rxcounts(
4835 struct r8192_priv *priv, 4587 struct r8192_priv *priv,
@@ -4932,7 +4684,6 @@ extern void rtl819x_watchdog_wqcallback(struct net_device *dev)
4932 ieee->LinkDetectInfo.NumRecvDataInPeriod=0; 4684 ieee->LinkDetectInfo.NumRecvDataInPeriod=0;
4933 4685
4934 } 4686 }
4935// CAM_read_entry(dev,0);
4936 //check if reset the driver 4687 //check if reset the driver
4937 spin_lock_irqsave(&priv->tx_lock,flags); 4688 spin_lock_irqsave(&priv->tx_lock,flags);
4938 if(check_reset_cnt++ >= 3 && !ieee->is_roaming && (last_time != 1)) 4689 if(check_reset_cnt++ >= 3 && !ieee->is_roaming && (last_time != 1))
@@ -7155,7 +6906,6 @@ void setKey( struct net_device *dev,
7155 } 6906 }
7156 } 6907 }
7157 RT_TRACE(COMP_SEC,"=========>after set key, usconfig:%x\n", usConfig); 6908 RT_TRACE(COMP_SEC,"=========>after set key, usconfig:%x\n", usConfig);
7158// CAM_read_entry(dev, 0);
7159} 6909}
7160// This function seems not ready! WB 6910// This function seems not ready! WB
7161void CamPrintDbgReg(struct net_device* dev) 6911void CamPrintDbgReg(struct net_device* dev)
diff --git a/drivers/staging/rtl8192e/r8192E_dm.c b/drivers/staging/rtl8192e/r8192E_dm.c
index 99504596f528..939e4b74a903 100644
--- a/drivers/staging/rtl8192e/r8192E_dm.c
+++ b/drivers/staging/rtl8192e/r8192E_dm.c
@@ -2082,113 +2082,6 @@ void dm_change_dynamic_initgain_thresh(struct net_device *dev, u32 dm_type, u32
2082 } 2082 }
2083} /* DM_ChangeDynamicInitGainThresh */ 2083} /* DM_ChangeDynamicInitGainThresh */
2084 2084
2085static void dm_change_fsync_setting(struct net_device *dev, s32 DM_Type, s32 DM_Value)
2086{
2087 struct r8192_priv *priv = ieee80211_priv(dev);
2088
2089 if (DM_Type == 0) // monitor 0xc38 register
2090 {
2091 if(DM_Value > 1)
2092 DM_Value = 1;
2093 priv->framesyncMonitor = (u8)DM_Value;
2094 //DbgPrint("pHalData->framesyncMonitor = %d", pHalData->framesyncMonitor);
2095 }
2096}
2097
2098static void dm_change_rxpath_selection_setting(struct net_device *dev, s32 DM_Type, s32 DM_Value)
2099{
2100 struct r8192_priv *priv = ieee80211_priv(dev);
2101 prate_adaptive pRA = (prate_adaptive)&(priv->rate_adaptive);
2102
2103
2104 if(DM_Type == 0)
2105 {
2106 if(DM_Value > 1)
2107 DM_Value = 1;
2108 DM_RxPathSelTable.Enable = (u8)DM_Value;
2109 }
2110 else if(DM_Type == 1)
2111 {
2112 if(DM_Value > 1)
2113 DM_Value = 1;
2114 DM_RxPathSelTable.DbgMode = (u8)DM_Value;
2115 }
2116 else if(DM_Type == 2)
2117 {
2118 if(DM_Value > 40)
2119 DM_Value = 40;
2120 DM_RxPathSelTable.SS_TH_low = (u8)DM_Value;
2121 }
2122 else if(DM_Type == 3)
2123 {
2124 if(DM_Value > 25)
2125 DM_Value = 25;
2126 DM_RxPathSelTable.diff_TH = (u8)DM_Value;
2127 }
2128 else if(DM_Type == 4)
2129 {
2130 if(DM_Value >= CCK_Rx_Version_MAX)
2131 DM_Value = CCK_Rx_Version_1;
2132 DM_RxPathSelTable.cck_method= (u8)DM_Value;
2133 }
2134 else if(DM_Type == 10)
2135 {
2136 if(DM_Value > 100)
2137 DM_Value = 50;
2138 DM_RxPathSelTable.rf_rssi[0] = (u8)DM_Value;
2139 }
2140 else if(DM_Type == 11)
2141 {
2142 if(DM_Value > 100)
2143 DM_Value = 50;
2144 DM_RxPathSelTable.rf_rssi[1] = (u8)DM_Value;
2145 }
2146 else if(DM_Type == 12)
2147 {
2148 if(DM_Value > 100)
2149 DM_Value = 50;
2150 DM_RxPathSelTable.rf_rssi[2] = (u8)DM_Value;
2151 }
2152 else if(DM_Type == 13)
2153 {
2154 if(DM_Value > 100)
2155 DM_Value = 50;
2156 DM_RxPathSelTable.rf_rssi[3] = (u8)DM_Value;
2157 }
2158 else if(DM_Type == 20)
2159 {
2160 if(DM_Value > 1)
2161 DM_Value = 1;
2162 pRA->ping_rssi_enable = (u8)DM_Value;
2163 }
2164 else if(DM_Type == 21)
2165 {
2166 if(DM_Value > 30)
2167 DM_Value = 30;
2168 pRA->ping_rssi_thresh_for_ra = DM_Value;
2169 }
2170}
2171
2172#if 0
2173void dm_force_tx_fw_info(struct net_device *dev, u32 force_type, u32 force_value)
2174{
2175 struct r8192_priv *priv = ieee80211_priv(dev);
2176
2177 if (force_type == 0) // don't force TxSC
2178 {
2179 //DbgPrint("Set Force SubCarrier Off\n");
2180 priv->tx_fwinfo_force_subcarriermode = 0;
2181 }
2182 else if(force_type == 1) //force
2183 {
2184 //DbgPrint("Set Force SubCarrier On\n");
2185 priv->tx_fwinfo_force_subcarriermode = 1;
2186 if(force_value > 3)
2187 force_value = 3;
2188 priv->tx_fwinfo_force_subcarrierval = (u8)force_value;
2189 }
2190}
2191#endif
2192 2085
2193/*----------------------------------------------------------------------------- 2086/*-----------------------------------------------------------------------------
2194 * Function: dm_dig_init() 2087 * Function: dm_dig_init()
@@ -2941,26 +2834,6 @@ dm_CheckEdcaTurbo_EXIT:
2941} // dm_CheckEdcaTurbo 2834} // dm_CheckEdcaTurbo
2942#endif 2835#endif
2943 2836
2944static void DM_CTSToSelfSetting(struct net_device *dev, u32 DM_Type, u32 DM_Value)
2945{
2946 struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev);
2947
2948 if (DM_Type == 0) // CTS to self disable/enable
2949 {
2950 if(DM_Value > 1)
2951 DM_Value = 1;
2952 priv->ieee80211->bCTSToSelfEnable = (bool)DM_Value;
2953 //DbgPrint("pMgntInfo->bCTSToSelfEnable = %d\n", pMgntInfo->bCTSToSelfEnable);
2954 }
2955 else if(DM_Type == 1) //CTS to self Th
2956 {
2957 if(DM_Value >= 50)
2958 DM_Value = 50;
2959 priv->ieee80211->CTSToSelfTH = (u8)DM_Value;
2960 //DbgPrint("pMgntInfo->CTSToSelfTH = %d\n", pMgntInfo->CTSToSelfTH);
2961 }
2962}
2963
2964static void dm_init_ctstoself(struct net_device * dev) 2837static void dm_init_ctstoself(struct net_device * dev)
2965{ 2838{
2966 struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev); 2839 struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev);
diff --git a/drivers/staging/rtl8192e/r819xE_firmware.c b/drivers/staging/rtl8192e/r819xE_firmware.c
index 01ea5a1f92e3..c42b83e51e45 100644
--- a/drivers/staging/rtl8192e/r819xE_firmware.c
+++ b/drivers/staging/rtl8192e/r819xE_firmware.c
@@ -107,45 +107,6 @@ cmdsend_downloadcode_fail:
107#endif 107#endif
108} 108}
109 109
110static bool
111fwSendNullPacket(
112 struct net_device *dev,
113 u32 Length
114)
115{
116 bool rtStatus = true;
117 struct r8192_priv *priv = ieee80211_priv(dev);
118 struct sk_buff *skb;
119 cb_desc *tcb_desc;
120 unsigned char *ptr_buf;
121 bool bLastInitPacket = false;
122
123 //PlatformAcquireSpinLock(Adapter, RT_TX_SPINLOCK);
124
125 //Get TCB and local buffer from common pool. (It is shared by CmdQ, MgntQ, and USB coalesce DataQ)
126 skb = dev_alloc_skb(Length+ 4);
127 memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
128 tcb_desc = (cb_desc*)(skb->cb + MAX_DEV_ADDR_SIZE);
129 tcb_desc->queue_index = TXCMD_QUEUE;
130 tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT;
131 tcb_desc->bLastIniPkt = bLastInitPacket;
132 ptr_buf = skb_put(skb, Length);
133 memset(ptr_buf,0,Length);
134 tcb_desc->txbuf_size= (u16)Length;
135
136 if(!priv->ieee80211->check_nic_enough_desc(dev,tcb_desc->queue_index)||
137 (!skb_queue_empty(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index]))||\
138 (priv->ieee80211->queue_stop) ) {
139 RT_TRACE(COMP_FIRMWARE,"===================NULL packet==================================> tx full!\n");
140 skb_queue_tail(&priv->ieee80211->skb_waitQ[tcb_desc->queue_index], skb);
141 } else {
142 priv->ieee80211->softmac_hard_start_xmit(skb,dev);
143 }
144
145 //PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK);
146 return rtStatus;
147}
148
149//----------------------------------------------------------------------------- 110//-----------------------------------------------------------------------------
150// Procedure: Check whether main code is download OK. If OK, turn on CPU 111// Procedure: Check whether main code is download OK. If OK, turn on CPU
151// 112//
@@ -396,15 +357,6 @@ bool init_firmware(struct net_device *dev)
396 * will set polling bit when firmware code is also configured 357 * will set polling bit when firmware code is also configured
397 */ 358 */
398 pfirmware->firmware_status = FW_STATUS_1_MOVE_BOOT_CODE; 359 pfirmware->firmware_status = FW_STATUS_1_MOVE_BOOT_CODE;
399#ifdef RTL8190P
400 // To initialize IMEM, CPU move code from 0x80000080, hence, we send 0x80 byte packet
401 rt_status = fwSendNullPacket(dev, RTL8190_CPU_START_OFFSET);
402 if(rt_status != true)
403 {
404 RT_TRACE(COMP_INIT, "fwSendNullPacket() fail ! \n");
405 goto download_firmware_fail;
406 }
407#endif
408 //mdelay(1000); 360 //mdelay(1000);
409 /* 361 /*
410 * To initialize IMEM, CPU move code from 0x80000080, 362 * To initialize IMEM, CPU move code from 0x80000080,