aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-08-12 19:36:38 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 15:02:32 -0400
commit19bebc5217c0798a16b56c18609e0f52db6b0924 (patch)
tree734af44521f05692ce5d606acccafdc28313ec88 /drivers
parentca9b2f88d97ee39286be3cc83ac10f2c09194410 (diff)
Staging: rtl8192e: remove #if 0 sections
This removes a lot of code that is never built in to the driver. The size of the built code after this patch is identical to before it. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/rtl8192e/r8192E_core.c236
-rw-r--r--drivers/staging/rtl8192e/r8192E_dm.c171
-rw-r--r--drivers/staging/rtl8192e/r8192E_wx.c45
-rw-r--r--drivers/staging/rtl8192e/r819xE_cmdpkt.c16
-rw-r--r--drivers/staging/rtl8192e/r819xE_firmware.c219
5 files changed, 2 insertions, 685 deletions
diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c
index aded8fa81d0a..e9d0a69359a6 100644
--- a/drivers/staging/rtl8192e/r8192E_core.c
+++ b/drivers/staging/rtl8192e/r8192E_core.c
@@ -115,10 +115,6 @@ static struct pci_device_id rtl8192_pci_id_tbl[] __devinitdata = {
115}; 115};
116 116
117static char* ifname = "wlan%d"; 117static char* ifname = "wlan%d";
118#if 0
119static int hwseqnum = 0;
120static int hwwep = 0;
121#endif
122static int hwwep = 1; //default use hw. set 0 to use software security 118static int hwwep = 1; //default use hw. set 0 to use software security
123static int channels = 0x3fff; 119static int channels = 0x3fff;
124 120
@@ -130,19 +126,6 @@ MODULE_DEVICE_TABLE(pci, rtl8192_pci_id_tbl);
130//MODULE_AUTHOR("Andrea Merello <andreamrl@tiscali.it>"); 126//MODULE_AUTHOR("Andrea Merello <andreamrl@tiscali.it>");
131MODULE_DESCRIPTION("Linux driver for Realtek RTL819x WiFi cards"); 127MODULE_DESCRIPTION("Linux driver for Realtek RTL819x WiFi cards");
132 128
133#if 0
134MODULE_PARM(ifname,"s");
135MODULE_PARM_DESC(devname," Net interface name, wlan%d=default");
136
137MODULE_PARM(hwseqnum,"i");
138MODULE_PARM_DESC(hwseqnum," Try to use hardware 802.11 header sequence numbers. Zero=default");
139
140MODULE_PARM(hwwep,"i");
141MODULE_PARM_DESC(hwwep," Try to use hardware WEP support. Still broken and not available on all cards");
142
143MODULE_PARM(channels,"i");
144MODULE_PARM_DESC(channels," Channel bitmask for specific locales. NYI");
145#endif
146 129
147#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9) 130#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9)
148module_param(ifname, charp, S_IRUGO|S_IWUSR ); 131module_param(ifname, charp, S_IRUGO|S_IWUSR );
@@ -515,99 +498,6 @@ static int proc_get_registers(char *page, char **start,
515} 498}
516 499
517 500
518#if 0
519static int proc_get_cck_reg(char *page, char **start,
520 off_t offset, int count,
521 int *eof, void *data)
522{
523 struct net_device *dev = data;
524// struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
525
526 int len = 0;
527 int i,n;
528
529 int max = 0x5F;
530
531 /* This dump the current register page */
532 for(n=0;n<=max;)
533 {
534 //printk( "\nD: %2x> ", n);
535 len += snprintf(page + len, count - len,
536 "\nD: %2x > ",n);
537
538 for(i=0;i<16 && n<=max;i++,n++)
539 len += snprintf(page + len, count - len,
540 "%2x ",read_phy_cck(dev,n));
541
542 // printk("%2x ",read_nic_byte(dev,n));
543 }
544 len += snprintf(page + len, count - len,"\n");
545
546
547 *eof = 1;
548 return len;
549}
550
551#endif
552
553#if 0
554static int proc_get_ofdm_reg(char *page, char **start,
555 off_t offset, int count,
556 int *eof, void *data)
557{
558
559 struct net_device *dev = data;
560// struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
561
562 int len = 0;
563 int i,n;
564
565 //int max=0xff;
566 int max = 0x40;
567
568 /* This dump the current register page */
569 for(n=0;n<=max;)
570 {
571 //printk( "\nD: %2x> ", n);
572 len += snprintf(page + len, count - len,
573 "\nD: %2x > ",n);
574
575 for(i=0;i<16 && n<=max;i++,n++)
576 len += snprintf(page + len, count - len,
577 "%2x ",read_phy_ofdm(dev,n));
578
579 // printk("%2x ",read_nic_byte(dev,n));
580 }
581 len += snprintf(page + len, count - len,"\n");
582
583
584
585 *eof = 1;
586 return len;
587}
588
589#endif
590
591#if 0
592static int proc_get_stats_hw(char *page, char **start,
593 off_t offset, int count,
594 int *eof, void *data)
595{
596 struct net_device *dev = data;
597 struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
598
599 int len = 0;
600
601 len += snprintf(page + len, count - len,
602 "NIC int: %lu\n"
603 "Total int: %lu\n",
604 priv->stats.ints,
605 priv->stats.shints);
606
607 *eof = 1;
608 return len;
609}
610#endif
611 501
612static int proc_get_stats_tx(char *page, char **start, 502static int proc_get_stats_tx(char *page, char **start,
613 off_t offset, int count, 503 off_t offset, int count,
@@ -770,16 +660,6 @@ static void rtl8192_proc_init_one(struct net_device *dev)
770 dev->name); 660 dev->name);
771 return; 661 return;
772 } 662 }
773 #if 0
774 e = create_proc_read_entry("stats-hw", S_IFREG | S_IRUGO,
775 priv->dir_dev, proc_get_stats_hw, dev);
776
777 if (!e) {
778 DMESGE("Unable to initialize "
779 "/proc/net/rtl8192/%s/stats-hw\n",
780 dev->name);
781 }
782 #endif
783 e = create_proc_read_entry("stats-rx", S_IFREG | S_IRUGO, 663 e = create_proc_read_entry("stats-rx", S_IFREG | S_IRUGO,
784 priv->dir_dev, proc_get_stats_rx, dev); 664 priv->dir_dev, proc_get_stats_rx, dev);
785 665
@@ -798,17 +678,6 @@ static void rtl8192_proc_init_one(struct net_device *dev)
798 "/proc/net/rtl8192/%s/stats-tx\n", 678 "/proc/net/rtl8192/%s/stats-tx\n",
799 dev->name); 679 dev->name);
800 } 680 }
801 #if 0
802 e = create_proc_read_entry("stats-ieee", S_IFREG | S_IRUGO,
803 priv->dir_dev, proc_get_stats_ieee, dev);
804
805 if (!e) {
806 DMESGE("Unable to initialize "
807 "/proc/net/rtl8192/%s/stats-ieee\n",
808 dev->name);
809 }
810
811 #endif
812 681
813 e = create_proc_read_entry("stats-ap", S_IFREG | S_IRUGO, 682 e = create_proc_read_entry("stats-ap", S_IFREG | S_IRUGO,
814 priv->dir_dev, proc_get_stats_ap, dev); 683 priv->dir_dev, proc_get_stats_ap, dev);
@@ -826,23 +695,6 @@ static void rtl8192_proc_init_one(struct net_device *dev)
826 "/proc/net/rtl8192/%s/registers\n", 695 "/proc/net/rtl8192/%s/registers\n",
827 dev->name); 696 dev->name);
828 } 697 }
829#if 0
830 e = create_proc_read_entry("cck-registers", S_IFREG | S_IRUGO,
831 priv->dir_dev, proc_get_cck_reg, dev);
832 if (!e) {
833 RT_TRACE(COMP_ERR, "Unable to initialize "
834 "/proc/net/rtl8192/%s/cck-registers\n",
835 dev->name);
836 }
837
838 e = create_proc_read_entry("ofdm-registers", S_IFREG | S_IRUGO,
839 priv->dir_dev, proc_get_ofdm_reg, dev);
840 if (!e) {
841 RT_TRACE(COMP_ERR, "Unable to initialize "
842 "/proc/net/rtl8192/%s/ofdm-registers\n",
843 dev->name);
844 }
845#endif
846} 698}
847/**************************************************************************** 699/****************************************************************************
848 -----------------------------MISC STUFF------------------------- 700 -----------------------------MISC STUFF-------------------------
@@ -1002,19 +854,6 @@ void rtl8192_tx_enable(struct net_device *dev)
1002 ieee80211_reset_queue(priv->ieee80211); 854 ieee80211_reset_queue(priv->ieee80211);
1003} 855}
1004 856
1005#if 0
1006void rtl8192_beacon_tx_enable(struct net_device *dev)
1007{
1008 struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
1009 u32 reg;
1010
1011 reg = read_nic_dword(priv->ieee80211->dev,INTA_MASK);
1012
1013 /* enable Beacon realted interrupt signal */
1014 reg |= (IMR_BcnInt | IMR_BcnInt | IMR_TBDOK | IMR_TBDER);
1015 write_nic_byte(dev,reg);
1016}
1017#endif
1018 857
1019static void rtl8192_free_rx_ring(struct net_device *dev) 858static void rtl8192_free_rx_ring(struct net_device *dev)
1020{ 859{
@@ -1111,20 +950,6 @@ inline u16 rtl8192_rate2rate(short rate)
1111 950
1112 951
1113 952
1114#if 0
1115void rtl8192_tx_queues_stop(struct net_device *dev)
1116{
1117 //struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
1118 u8 dma_poll_mask = (1<<TX_DMA_STOP_LOWPRIORITY_SHIFT);
1119 dma_poll_mask |= (1<<TX_DMA_STOP_HIPRIORITY_SHIFT);
1120 dma_poll_mask |= (1<<TX_DMA_STOP_NORMPRIORITY_SHIFT);
1121 dma_poll_mask |= (1<<TX_DMA_STOP_BEACON_SHIFT);
1122
1123 rtl8192_set_mode(dev,EPROM_CMD_CONFIG);
1124 write_nic_byte(dev,TX_DMA_POLLING,dma_poll_mask);
1125 rtl8192_set_mode(dev,EPROM_CMD_NORMAL);
1126}
1127#endif
1128 953
1129static void rtl8192_data_hard_stop(struct net_device *dev) 954static void rtl8192_data_hard_stop(struct net_device *dev)
1130{ 955{
@@ -2378,13 +2203,6 @@ short rtl8192_is_tx_queue_empty(struct net_device *dev)
2378 } 2203 }
2379 return 1; 2204 return 1;
2380} 2205}
2381#if 0
2382void rtl8192_rq_tx_ack(struct net_device *dev)
2383{
2384 struct r8192_priv *priv = ieee80211_priv(dev);
2385 priv->ieee80211->ack_tx_to_ieee = 1;
2386}
2387#endif
2388static void rtl8192_hw_sleep_down(struct net_device *dev) 2206static void rtl8192_hw_sleep_down(struct net_device *dev)
2389{ 2207{
2390 RT_TRACE(COMP_POWER, "%s()============>come to sleep down\n", __FUNCTION__); 2208 RT_TRACE(COMP_POWER, "%s()============>come to sleep down\n", __FUNCTION__);
@@ -2857,13 +2675,6 @@ static void rtl8192_read_eeprom_info(struct net_device* dev)
2857 // when auto load failed, the last address byte set to be a random one. 2675 // when auto load failed, the last address byte set to be a random one.
2858 // added by david woo.2007/11/7 2676 // added by david woo.2007/11/7
2859 memcpy(dev->dev_addr, bMac_Tmp_Addr, 6); 2677 memcpy(dev->dev_addr, bMac_Tmp_Addr, 6);
2860 #if 0
2861 for(i = 0; i < 6; i++)
2862 {
2863 Adapter->PermanentAddress[i] = sMacAddr[i];
2864 PlatformEFIOWrite1Byte(Adapter, IDR0+i, sMacAddr[i]);
2865 }
2866 #endif
2867 } 2678 }
2868 2679
2869 RT_TRACE(COMP_INIT, "Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n", 2680 RT_TRACE(COMP_INIT, "Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n",
@@ -3883,23 +3694,6 @@ void rtl8192_prepare_beacon(struct r8192_priv *priv)
3883 //spin_unlock_irqrestore (&priv->tx_lock, flags); 3694 //spin_unlock_irqrestore (&priv->tx_lock, flags);
3884} 3695}
3885 3696
3886#if 0
3887void rtl8192_beacon_tx_enable(struct net_device *dev)
3888{
3889 struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
3890
3891 rtl8180_set_mode(dev,EPROM_CMD_CONFIG);
3892#ifdef CONFIG_RTL8185B
3893 priv->dma_poll_stop_mask &= ~(TPPOLLSTOP_BQ);MgntQuery_MgntFrameTxRateMgntQuery_MgntFrameTxRate
3894 write_nic_byte(dev,TPPollStop, priv->dma_poll_mask);
3895#else
3896 priv->dma_poll_mask &=~(1<<TX_DMA_STOP_BEACON_SHIFT);
3897 write_nic_byte(dev,TX_DMA_POLLING,priv->dma_poll_mask);
3898#endif
3899 rtl8180_set_mode(dev,EPROM_CMD_NORMAL);
3900}
3901#endif
3902
3903 3697
3904/* this configures registers for beacon tx and enables it via 3698/* this configures registers for beacon tx and enables it via
3905 * rtl8192_beacon_tx_enable(). rtl8192_beacon_tx_disable() might 3699 * rtl8192_beacon_tx_enable(). rtl8192_beacon_tx_disable() might
@@ -3955,14 +3749,6 @@ void rtl8192_start_beacon(struct net_device *dev)
3955/*************************************************************************** 3749/***************************************************************************
3956 -------------------------------NET STUFF--------------------------- 3750 -------------------------------NET STUFF---------------------------
3957***************************************************************************/ 3751***************************************************************************/
3958#if 0
3959static struct net_device_stats *rtl8192_stats(struct net_device *dev)
3960{
3961 struct r8192_priv *priv = ieee80211_priv(dev);
3962
3963 return &priv->ieee80211->stats;
3964}
3965#endif
3966 3752
3967 3753
3968 3754
@@ -4064,13 +3850,6 @@ TxCheckStuck(struct net_device *dev)
4064 continue; 3850 continue;
4065 } 3851 }
4066 txring->nStuckCount++; 3852 txring->nStuckCount++;
4067 #if 0
4068 if(txring->nStuckCount > ResetThreshold)
4069 {
4070 RT_TRACE( COMP_RESET, "<== TxCheckStuck()\n" );
4071 return RESET_TYPE_NORMAL;
4072 }
4073 #endif
4074 bCheckFwTxCnt = TRUE; 3853 bCheckFwTxCnt = TRUE;
4075 } 3854 }
4076 } 3855 }
@@ -4144,12 +3923,6 @@ static bool HalRxCheckStuck8190Pci(struct net_device *dev)
4144 //DbgPrint("RSSI <= %d, check this time \n", VeryLowRSSI); 3923 //DbgPrint("RSSI <= %d, check this time \n", VeryLowRSSI);
4145 } 3924 }
4146 } 3925 }
4147#if 0
4148 if (rx_chk_cnt < 2)
4149 return bStuck;
4150 else
4151 rx_chk_cnt = 0;
4152#endif
4153 if(priv->RxCounter==RegRxCounter) 3926 if(priv->RxCounter==RegRxCounter)
4154 bStuck = TRUE; 3927 bStuck = TRUE;
4155 3928
@@ -4506,10 +4279,6 @@ void InactivePsWorkItemCallback(struct net_device *dev)
4506 // 4279 //
4507 // To solve CAM values miss in RF OFF, rewrite CAM values after RF ON. By Bruce, 2007-09-20. 4280 // To solve CAM values miss in RF OFF, rewrite CAM values after RF ON. By Bruce, 2007-09-20.
4508 // 4281 //
4509#if 0
4510 if(pPSC->eInactivePowerState == eRfOn)
4511 CamRestoreAllEntry(dev);
4512#endif
4513 pPSC->bSwRfProcessing = FALSE; 4282 pPSC->bSwRfProcessing = FALSE;
4514 RT_TRACE(COMP_POWER, "InactivePsWorkItemCallback() <--------- \n"); 4283 RT_TRACE(COMP_POWER, "InactivePsWorkItemCallback() <--------- \n");
4515} 4284}
@@ -4868,11 +4637,6 @@ void rtl8192_commit(struct net_device *dev)
4868 _rtl8192_up(dev); 4637 _rtl8192_up(dev);
4869} 4638}
4870 4639
4871/*
4872void rtl8192_restart(struct net_device *dev)
4873{
4874 struct r8192_priv *priv = ieee80211_priv(dev);
4875*/
4876#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 4640#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
4877void rtl8192_restart(struct work_struct *work) 4641void rtl8192_restart(struct work_struct *work)
4878{ 4642{
diff --git a/drivers/staging/rtl8192e/r8192E_dm.c b/drivers/staging/rtl8192e/r8192E_dm.c
index 939e4b74a903..e3d5aa3f8cb7 100644
--- a/drivers/staging/rtl8192e/r8192E_dm.c
+++ b/drivers/staging/rtl8192e/r8192E_dm.c
@@ -95,9 +95,6 @@ extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work);
95extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev); 95extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev);
96#endif 96#endif
97extern void dm_fsync_timer_callback(unsigned long data); 97extern void dm_fsync_timer_callback(unsigned long data);
98#if 0
99extern bool dm_check_lbus_status(struct net_device *dev);
100#endif
101extern void dm_check_fsync(struct net_device *dev); 98extern void dm_check_fsync(struct net_device *dev);
102extern void dm_shadow_init(struct net_device *dev); 99extern void dm_shadow_init(struct net_device *dev);
103extern void dm_initialize_txpower_tracking(struct net_device *dev); 100extern void dm_initialize_txpower_tracking(struct net_device *dev);
@@ -946,33 +943,6 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device * dev)
946 return; 943 return;
947 } 944 }
948 945
949 //==========================
950 // this is only for test, should be masked
951#if 0
952{
953 //UINT32 eRFPath;
954 //UINT32 start_rf, end_rf;
955 UINT32 curr_addr;
956 //UINT32 reg_addr;
957 //UINT32 reg_addr_end;
958 UINT32 reg_value;
959 //start_rf = RF90_PATH_A;
960 //end_rf = RF90_PATH_B;//RF90_PATH_MAX;
961 //reg_addr = 0x0;
962 //reg_addr_end = 0x2F;
963
964 for (curr_addr = 0; curr_addr < 0x2d; curr_addr++)
965 {
966 reg_value = PHY_QueryRFReg( Adapter, (RF90_RADIO_PATH_E)RF90_PATH_A,
967 curr_addr, bMaskDWord);
968 }
969
970 pHalData->TXPowercount = 0;
971 return;
972}
973#endif
974 //==========================
975
976 // read and filter out unreasonable value 946 // read and filter out unreasonable value
977 tmpRegA = rtl8192_phy_QueryRFReg(dev, RF90_PATH_A, 0x12, 0x078); // 0x12: RF Reg[10:7] 947 tmpRegA = rtl8192_phy_QueryRFReg(dev, RF90_PATH_A, 0x12, 0x078); // 0x12: RF Reg[10:7]
978 RT_TRACE(COMP_POWER_TRACKING, "Readback ThermalMeterA = %d \n", tmpRegA); 948 RT_TRACE(COMP_POWER_TRACKING, "Readback ThermalMeterA = %d \n", tmpRegA);
@@ -1648,19 +1618,7 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev)
1648{ 1618{
1649 struct r8192_priv *priv = ieee80211_priv(dev); 1619 struct r8192_priv *priv = ieee80211_priv(dev);
1650 static u8 TM_Trigger=0; 1620 static u8 TM_Trigger=0;
1651#if 0 1621
1652 u1Byte i;
1653 u4Byte tmpRegA;
1654 for(i=0; i<50; i++)
1655 {
1656 tmpRegA = PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x12, 0x078); // 0x12: RF Reg[10:7]
1657 PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4d);
1658 //delay_us(100);
1659 PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4f);
1660 //delay_us(100);
1661 }
1662 DbgPrint("Trigger and readback ThermalMeter, write RF reg0x2 = 0x4d to 0x4f for 50 times\n");
1663#else
1664 //DbgPrint("dm_CheckTXPowerTracking() \n"); 1622 //DbgPrint("dm_CheckTXPowerTracking() \n");
1665 if(!priv->btxpower_tracking) 1623 if(!priv->btxpower_tracking)
1666 return; 1624 return;
@@ -1699,8 +1657,7 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev)
1699 #endif 1657 #endif
1700 TM_Trigger = 0; 1658 TM_Trigger = 0;
1701 } 1659 }
1702#endif 1660}
1703 }
1704#endif 1661#endif
1705 1662
1706static void dm_check_txpower_tracking(struct net_device *dev) 1663static void dm_check_txpower_tracking(struct net_device *dev)
@@ -1908,14 +1865,6 @@ void dm_restore_dynamic_mechanism_state(struct net_device *dev)
1908 //cosa PlatformEFIOWrite4Byte(Adapter, RATR0, ((pu4Byte)(val))[0]); 1865 //cosa PlatformEFIOWrite4Byte(Adapter, RATR0, ((pu4Byte)(val))[0]);
1909 write_nic_dword(dev, RATR0, ratr_value); 1866 write_nic_dword(dev, RATR0, ratr_value);
1910 write_nic_byte(dev, UFWP, 1); 1867 write_nic_byte(dev, UFWP, 1);
1911#if 0 // Disable old code.
1912 u1Byte index;
1913 u4Byte input_value;
1914 index = (u1Byte)((((pu4Byte)(val))[0]) >> 28);
1915 input_value = (((pu4Byte)(val))[0]) & 0x0fffffff;
1916 // TODO: Correct it. Emily 2007.01.11
1917 PlatformEFIOWrite4Byte(Adapter, RATR0+index*4, input_value);
1918#endif
1919 } 1868 }
1920 //Resore TX Power Tracking Index 1869 //Resore TX Power Tracking Index
1921 if(priv->btxpower_trackingInit && priv->btxpower_tracking){ 1870 if(priv->btxpower_trackingInit && priv->btxpower_tracking){
@@ -2895,78 +2844,6 @@ static void dm_ctstoself(struct net_device *dev)
2895} 2844}
2896 2845
2897 2846
2898#if 0
2899/*-----------------------------------------------------------------------------
2900 * Function: dm_rf_operation_test_callback()
2901 *
2902 * Overview: Only for RF operation test now.
2903 *
2904 * Input: NONE
2905 *
2906 * Output: NONE
2907 *
2908 * Return: NONE
2909 *
2910 * Revised History:
2911 * When Who Remark
2912 * 05/29/2008 amy Create Version 0 porting from windows code.
2913 *
2914 *---------------------------------------------------------------------------*/
2915void dm_rf_operation_test_callback(unsigned long dev)
2916{
2917// struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev);
2918 u8 erfpath;
2919
2920
2921 for(erfpath=0; erfpath<4; erfpath++)
2922 {
2923 //DbgPrint("Set RF-%d\n\r", eRFPath);
2924 //PHY_SetRFReg(Adapter, (RF90_RADIO_PATH_E)eRFPath, 0x2c, bMask12Bits, 0x3d7);
2925 udelay(100);
2926 }
2927
2928 {
2929 //PlatformSetPeriodicTimer(Adapter, &pHalData->RfTest1Timer, 500);
2930 }
2931
2932 // For test
2933 {
2934 //u8 i;
2935 //PlatformSetPeriodicTimer(Adapter, &pHalData->RfTest1Timer, 500);
2936#if 0
2937 for(i=0; i<50; i++)
2938 {
2939 // Write Test
2940 PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4d);
2941 //delay_us(100);
2942 PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4f);
2943 //delay_us(100);
2944 PHY_SetRFReg(Adapter, RF90_PATH_C, 0x02, bMask12Bits, 0x4d);
2945 //delay_us(100);
2946 PHY_SetRFReg(Adapter, RF90_PATH_C, 0x02, bMask12Bits, 0x4f);
2947 //delay_us(100);
2948
2949#if 0
2950 // Read test
2951 PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits);
2952 //delay_us(100);
2953 PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits);
2954 //delay_us(100);
2955 PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x12, bMask12Bits);
2956 //delay_us(100);
2957 PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x12, bMask12Bits);
2958 //delay_us(100);
2959 PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x21, bMask12Bits);
2960 //delay_us(100);
2961 PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x21, bMask12Bits);
2962 //delay_us(100);
2963#endif
2964 }
2965#endif
2966 }
2967
2968} /* DM_RfOperationTestCallBack */
2969#endif
2970 2847
2971/*----------------------------------------------------------------------------- 2848/*-----------------------------------------------------------------------------
2972 * Function: dm_check_rfctrl_gpio() 2849 * Function: dm_check_rfctrl_gpio()
@@ -3889,50 +3766,6 @@ void dm_check_fsync(struct net_device *dev)
3889 } 3766 }
3890} 3767}
3891 3768
3892#if 0
3893/*-----------------------------------------------------------------------------
3894 * Function: DM_CheckLBusStatus()
3895 *
3896 * Overview: For 9x series, we must make sure LBUS is active for IO.
3897 *
3898 * Input: NONE
3899 *
3900 * Output: NONE
3901 *
3902 * Return: NONE
3903 *
3904 * Revised History:
3905 * When Who Remark
3906 * 02/22/2008 MHC Create Version 0.
3907 *
3908 *---------------------------------------------------------------------------*/
3909extern s1Byte DM_CheckLBusStatus(IN PADAPTER Adapter)
3910{
3911 PMGNT_INFO pMgntInfo=&Adapter->MgntInfo;
3912
3913#if (HAL_CODE_BASE & RTL819X)
3914
3915#if (HAL_CODE_BASE == RTL8192)
3916
3917#if( DEV_BUS_TYPE==PCI_INTERFACE)
3918 //return (pMgntInfo->bLbusEnable); // For debug only
3919 return TRUE;
3920#endif
3921
3922#if( DEV_BUS_TYPE==USB_INTERFACE)
3923 return TRUE;
3924#endif
3925
3926#endif // #if (HAL_CODE_BASE == RTL8192)
3927
3928#if (HAL_CODE_BASE == RTL8190)
3929 return TRUE;
3930#endif // #if (HAL_CODE_BASE == RTL8190)
3931
3932#endif // #if (HAL_CODE_BASE & RTL819X)
3933} /* DM_CheckLBusStatus */
3934
3935#endif
3936 3769
3937/*----------------------------------------------------------------------------- 3770/*-----------------------------------------------------------------------------
3938 * Function: dm_shadow_init() 3771 * Function: dm_shadow_init()
diff --git a/drivers/staging/rtl8192e/r8192E_wx.c b/drivers/staging/rtl8192e/r8192E_wx.c
index 2b87edacfc46..88ad00db056e 100644
--- a/drivers/staging/rtl8192e/r8192E_wx.c
+++ b/drivers/staging/rtl8192e/r8192E_wx.c
@@ -43,40 +43,6 @@ static int r8192_wx_get_freq(struct net_device *dev,
43} 43}
44 44
45 45
46#if 0
47
48static int r8192_wx_set_beaconinterval(struct net_device *dev, struct iw_request_info *aa,
49 union iwreq_data *wrqu, char *b)
50{
51 int *parms = (int *)b;
52 int bi = parms[0];
53
54 struct r8192_priv *priv = ieee80211_priv(dev);
55
56 down(&priv->wx_sem);
57 DMESG("setting beacon interval to %x",bi);
58
59 priv->ieee80211->beacon_interval=bi;
60 rtl8180_commit(dev);
61 up(&priv->wx_sem);
62
63 return 0;
64}
65
66
67static int r8192_wx_set_forceassociate(struct net_device *dev, struct iw_request_info *aa,
68 union iwreq_data *wrqu, char *extra)
69{
70 struct r8192_priv *priv=ieee80211_priv(dev);
71 int *parms = (int *)extra;
72
73 priv->ieee80211->force_associate = (parms[0] > 0);
74
75
76 return 0;
77}
78
79#endif
80static int r8192_wx_get_mode(struct net_device *dev, struct iw_request_info *a, 46static int r8192_wx_get_mode(struct net_device *dev, struct iw_request_info *a,
81 union iwreq_data *wrqu, char *b) 47 union iwreq_data *wrqu, char *b)
82{ 48{
@@ -1037,17 +1003,6 @@ exit:
1037} 1003}
1038 1004
1039#if (WIRELESS_EXT >= 18) 1005#if (WIRELESS_EXT >= 18)
1040#if 0
1041static int r8192_wx_get_enc_ext(struct net_device *dev,
1042 struct iw_request_info *info,
1043 union iwreq_data *wrqu, char *extra)
1044{
1045 struct r8192_priv *priv = ieee80211_priv(dev);
1046 int ret = 0;
1047 ret = ieee80211_wx_get_encode_ext(priv->ieee80211, info, wrqu, extra);
1048 return ret;
1049}
1050#endif
1051static int r8192_wx_set_enc_ext(struct net_device *dev, 1006static int r8192_wx_set_enc_ext(struct net_device *dev,
1052 struct iw_request_info *info, 1007 struct iw_request_info *info,
1053 union iwreq_data *wrqu, char *extra) 1008 union iwreq_data *wrqu, char *extra)
diff --git a/drivers/staging/rtl8192e/r819xE_cmdpkt.c b/drivers/staging/rtl8192e/r819xE_cmdpkt.c
index 8602a55c6048..d6b7d2f39e3e 100644
--- a/drivers/staging/rtl8192e/r819xE_cmdpkt.c
+++ b/drivers/staging/rtl8192e/r819xE_cmdpkt.c
@@ -148,22 +148,6 @@ RT_STATUS cmpk_message_handle_tx(
148 code_virtual_address += frag_length; 148 code_virtual_address += frag_length;
149 frag_offset += frag_length; 149 frag_offset += frag_length;
150 150
151#if 0
152 {
153 int k;
154 printk("------------tx cmd------------\n");
155 for(k = 0; k<i; k++)
156 printk(" 0x%x",((u8*)buf)[k]);
157 printk("\n");
158 }
159 {
160 int m;
161 printk("-------------cmd desc----------\n");
162 for(m=0;m<32;m++)
163 printk(" 0x%x",((u8*)pdesc)[m]);
164 printk("\n");
165 }
166#endif
167 }while(frag_offset < buffer_len); 151 }while(frag_offset < buffer_len);
168 152
169Failed: 153Failed:
diff --git a/drivers/staging/rtl8192e/r819xE_firmware.c b/drivers/staging/rtl8192e/r819xE_firmware.c
index c42b83e51e45..98fbd0c50281 100644
--- a/drivers/staging/rtl8192e/r819xE_firmware.c
+++ b/drivers/staging/rtl8192e/r819xE_firmware.c
@@ -98,13 +98,6 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, u
98 }while(frag_offset < buffer_len); 98 }while(frag_offset < buffer_len);
99 99
100 return rt_status; 100 return rt_status;
101
102#if 0
103cmdsend_downloadcode_fail:
104 rt_status = false;
105 RT_TRACE(COMP_ERR, "CmdSendDownloadCode fail !!\n");
106 return rt_status;
107#endif
108} 101}
109 102
110//----------------------------------------------------------------------------- 103//-----------------------------------------------------------------------------
@@ -406,215 +399,3 @@ download_firmware_fail:
406 return rt_status; 399 return rt_status;
407 400
408} 401}
409
410#if 0
411/*
412 * Procedure: (1) Transform firmware code from little endian to big endian if required.
413 * (2) Number of bytes in Firmware downloading should be multiple
414 * of 4 bytes. If length is not multiple of 4 bytes, appending of zeros is required
415 *
416 */
417void CmdAppendZeroAndEndianTransform(
418 u1Byte *pDst,
419 u1Byte *pSrc,
420 u2Byte *pLength)
421{
422
423 u2Byte ulAppendBytes = 0, i;
424 u2Byte ulLength = *pLength;
425
426//test only
427 //memset(pDst, 0xcc, 12);
428
429
430 /* Transform from little endian to big endian */
431//#if DEV_BUS_TYPE==PCI_INTERFACE
432#if 0
433 for( i=0 ; i<(*pLength) ; i+=4)
434 {
435 if((i+3) < (*pLength)) pDst[i+0] = pSrc[i+3];
436 if((i+2) < (*pLength)) pDst[i+1] = pSrc[i+2];
437 if((i+1) < (*pLength)) pDst[i+2] = pSrc[i+1];
438 if((i+0) < (*pLength)) pDst[i+3] = pSrc[i+0];
439 }
440#else
441 pDst += USB_HWDESC_HEADER_LEN;
442 ulLength -= USB_HWDESC_HEADER_LEN;
443
444 for( i=0 ; i<ulLength ; i+=4) {
445 if((i+3) < ulLength) pDst[i+0] = pSrc[i+3];
446 if((i+2) < ulLength) pDst[i+1] = pSrc[i+2];
447 if((i+1) < ulLength) pDst[i+2] = pSrc[i+1];
448 if((i+0) < ulLength) pDst[i+3] = pSrc[i+0];
449
450 }
451#endif
452
453 //1(2) Append Zero
454 if( ((*pLength) % 4) >0)
455 {
456 ulAppendBytes = 4-((*pLength) % 4);
457
458 for(i=0 ; i<ulAppendBytes; i++)
459 pDst[ 4*((*pLength)/4) + i ] = 0x0;
460
461 *pLength += ulAppendBytes;
462 }
463}
464#endif
465
466#if 0
467RT_STATUS
468CmdSendPacket(
469 PADAPTER Adapter,
470 PRT_TCB pTcb,
471 PRT_TX_LOCAL_BUFFER pBuf,
472 u4Byte BufferLen,
473 u4Byte PacketType,
474 BOOLEAN bLastInitPacket
475 )
476{
477 s2Byte i;
478 u1Byte QueueID;
479 u2Byte firstDesc,curDesc = 0;
480 u2Byte FragIndex=0, FragBufferIndex=0;
481
482 RT_STATUS rtStatus = RT_STATUS_SUCCESS;
483
484 CmdInitTCB(Adapter, pTcb, pBuf, BufferLen);
485
486
487 if(CmdCheckFragment(Adapter, pTcb, pBuf))
488 CmdFragmentTCB(Adapter, pTcb);
489 else
490 pTcb->FragLength[0] = (u2Byte)pTcb->BufferList[0].Length;
491
492 QueueID=pTcb->SpecifiedQueueID;
493#if DEV_BUS_TYPE!=USB_INTERFACE
494 firstDesc=curDesc=Adapter->NextTxDescToFill[QueueID];
495#endif
496
497#if DEV_BUS_TYPE!=USB_INTERFACE
498 if(VacancyTxDescNum(Adapter, QueueID) > pTcb->BufferCount)
499#else
500 if(PlatformIsTxQueueAvailable(Adapter, QueueID, pTcb->BufferCount) &&
501 RTIsListEmpty(&Adapter->TcbWaitQueue[QueueID]))
502#endif
503 {
504 pTcb->nDescUsed=0;
505
506 for(i=0 ; i<pTcb->BufferCount ; i++)
507 {
508 Adapter->HalFunc.TxFillCmdDescHandler(
509 Adapter,
510 pTcb,
511 QueueID, //QueueIndex
512 curDesc, //index
513 FragBufferIndex==0, //bFirstSeg
514 FragBufferIndex==(pTcb->FragBufCount[FragIndex]-1), //bLastSeg
515 pTcb->BufferList[i].VirtualAddress, //VirtualAddress
516 pTcb->BufferList[i].PhysicalAddressLow, //PhyAddressLow
517 pTcb->BufferList[i].Length, //BufferLen
518 i!=0, //bSetOwnBit
519 (i==(pTcb->BufferCount-1)) && bLastInitPacket, //bLastInitPacket
520 PacketType, //DescPacketType
521 pTcb->FragLength[FragIndex] //PktLen
522 );
523
524 if(FragBufferIndex==(pTcb->FragBufCount[FragIndex]-1))
525 { // Last segment of the fragment.
526 pTcb->nFragSent++;
527 }
528
529 FragBufferIndex++;
530 if(FragBufferIndex==pTcb->FragBufCount[FragIndex])
531 {
532 FragIndex++;
533 FragBufferIndex=0;
534 }
535
536#if DEV_BUS_TYPE!=USB_INTERFACE
537 curDesc=(curDesc+1)%Adapter->NumTxDesc[QueueID];
538#endif
539 pTcb->nDescUsed++;
540 }
541
542#if DEV_BUS_TYPE!=USB_INTERFACE
543 RTInsertTailList(&Adapter->TcbBusyQueue[QueueID], &pTcb->List);
544 IncrementTxDescToFill(Adapter, QueueID, pTcb->nDescUsed);
545 Adapter->HalFunc.SetTxDescOWNHandler(Adapter, QueueID, firstDesc);
546 // TODO: should call poll use QueueID
547 Adapter->HalFunc.TxPollingHandler(Adapter, TXCMD_QUEUE);
548#endif
549 }
550 else
551#if DEV_BUS_TYPE!=USB_INTERFACE
552 goto CmdSendPacket_Fail;
553#else
554 {
555 pTcb->bLastInitPacket = bLastInitPacket;
556 RTInsertTailList(&Adapter->TcbWaitQueue[pTcb->SpecifiedQueueID], &pTcb->List);
557 }
558#endif
559
560 return rtStatus;
561
562#if DEV_BUS_TYPE!=USB_INTERFACE
563CmdSendPacket_Fail:
564 rtStatus = RT_STATUS_FAILURE;
565 return rtStatus;
566#endif
567
568}
569#endif
570
571
572
573
574#if 0
575RT_STATUS
576FWSendNullPacket(
577 IN PADAPTER Adapter,
578 IN u4Byte Length
579)
580{
581 RT_STATUS rtStatus = RT_STATUS_SUCCESS;
582
583
584 PRT_TCB pTcb;
585 PRT_TX_LOCAL_BUFFER pBuf;
586 BOOLEAN bLastInitPacket = FALSE;
587
588 PlatformAcquireSpinLock(Adapter, RT_TX_SPINLOCK);
589
590#if DEV_BUS_TYPE==USB_INTERFACE
591 Length += USB_HWDESC_HEADER_LEN;
592#endif
593
594 //Get TCB and local buffer from common pool. (It is shared by CmdQ, MgntQ, and USB coalesce DataQ)
595 if(MgntGetBuffer(Adapter, &pTcb, &pBuf))
596 {
597 PlatformZeroMemory(pBuf->Buffer.VirtualAddress, Length);
598 rtStatus = CmdSendPacket(Adapter, pTcb, pBuf, Length, DESC_PACKET_TYPE_INIT, bLastInitPacket); //0 : always set LastInitPacket to zero
599//#if HAL_CODE_BASE != RTL8190HW
600// // TODO: for test only
601// ReturnTCB(Adapter, pTcb, RT_STATUS_SUCCESS);
602//#endif
603 if(rtStatus == RT_STATUS_FAILURE)
604 goto CmdSendNullPacket_Fail;
605 }else
606 goto CmdSendNullPacket_Fail;
607
608 PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK);
609 return rtStatus;
610
611
612CmdSendNullPacket_Fail:
613 PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK);
614 rtStatus = RT_STATUS_FAILURE;
615 RT_ASSERT(rtStatus == RT_STATUS_SUCCESS, ("CmdSendDownloadCode fail !!\n"));
616 return rtStatus;
617}
618#endif
619
620