Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: rtl8192u: remove dead code

Remove #ifse against older kernel versions;
Remove codes marked with #if 0;
Remove #if 1

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Mauro Carvalho Chehab and committed by
Greg Kroah-Hartman
50a09b3b e406322b

+1 -3831
-157
drivers/staging/rtl8192u/ieee80211.h
··· 27 27 #include <linux/kernel.h> /* ARRAY_SIZE */ 28 28 #include <linux/version.h> 29 29 #include <linux/module.h> 30 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) 31 30 #include <linux/jiffies.h> 32 - #else 33 - #include <linux/jffs.h> 34 - #include <linux/tqueue.h> 35 - #endif 36 31 #include <linux/timer.h> 37 32 #include <linux/sched.h> 38 33 ··· 38 43 #include "ieee80211/rtl819x_BA.h" 39 44 #include "ieee80211/rtl819x_TS.h" 40 45 41 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) 42 - #ifndef bool 43 - typedef enum{false = 0, true} bool; 44 - #endif 45 - #endif 46 46 47 47 #ifndef IW_MODE_MONITOR 48 48 #define IW_MODE_MONITOR 6 ··· 47 57 #define IWEVCUSTOM 0x8c02 48 58 #endif 49 59 50 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 51 - #ifndef __bitwise 52 - #define __bitwise __attribute__((bitwise)) 53 - #endif 54 - typedef __u16 __le16; 55 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)) 56 - struct iw_spy_data{ 57 - /* --- Standard spy support --- */ 58 - int spy_number; 59 - u_char spy_address[IW_MAX_SPY][ETH_ALEN]; 60 - struct iw_quality spy_stat[IW_MAX_SPY]; 61 - /* --- Enhanced spy support (event) */ 62 - struct iw_quality spy_thr_low; /* Low threshold */ 63 - struct iw_quality spy_thr_high; /* High threshold */ 64 - u_char spy_thr_under[IW_MAX_SPY]; 65 - }; 66 - #endif 67 - #endif 68 60 69 61 #ifndef container_of 70 62 /** ··· 397 425 #define IW_QUAL_NOISE_UPDATED 0x4 398 426 #endif 399 427 400 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 401 - static inline void tq_init(struct tq_struct * task, void(*func)(void *), void *data) 402 - { 403 - task->routine = func; 404 - task->data = data; 405 - //task->next = NULL; 406 - INIT_LIST_HEAD(&task->list); 407 - task->sync = 0; 408 - } 409 - #endif 410 428 411 429 // linux under 2.6.9 release may not support it, so modify it for common use 412 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)) 413 - //#define MSECS(t) (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ) 414 - #define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000) 415 - static inline unsigned long msleep_interruptible_rsl(unsigned int msecs) 416 - { 417 - unsigned long timeout = MSECS(msecs) + 1; 418 - 419 - while (timeout) { 420 - set_current_state(TASK_INTERRUPTIBLE); 421 - timeout = schedule_timeout(timeout); 422 - } 423 - return timeout; 424 - } 425 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31)) 426 - static inline void msleep(unsigned int msecs) 427 - { 428 - unsigned long timeout = MSECS(msecs) + 1; 429 - 430 - while (timeout) { 431 - set_current_state(TASK_UNINTERRUPTIBLE); 432 - timeout = schedule_timeout(timeout); 433 - } 434 - } 435 - #endif 436 - #else 437 430 #define MSECS(t) msecs_to_jiffies(t) 438 431 #define msleep_interruptible_rsl msleep_interruptible 439 - #endif 440 432 441 433 #define IEEE80211_DATA_LEN 2304 442 434 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section ··· 862 926 * information for frames received. Not setting these will not cause 863 927 * any adverse affects. */ 864 928 struct ieee80211_rx_stats { 865 - #if 1 866 929 u32 mac_time[2]; 867 930 s8 rssi; 868 931 u8 signal; ··· 923 988 bool bToSelfBA; //cosa add for rssi 924 989 char cck_adc_pwdb[4]; //cosa add for rx path selection 925 990 u16 Seq_Num; 926 - #endif 927 991 928 992 }; 929 993 ··· 1270 1336 #define QOS_OUI_PARAM_SUB_TYPE 1 1271 1337 #define QOS_VERSION_1 1 1272 1338 #define QOS_AIFSN_MIN_VALUE 2 1273 - #if 1 1274 1339 struct ieee80211_qos_information_element { 1275 1340 u8 elementID; 1276 1341 u8 length; ··· 1344 1411 u16 surp_band_allow; 1345 1412 u16 medium_time; 1346 1413 }__attribute__((packed)); 1347 - #endif 1348 1414 enum eap_type { 1349 1415 EAP_PACKET = 0, 1350 1416 EAPOL_START, ··· 1466 1534 1467 1535 //UP Mapping to AC, using in MgntQuery_SequenceNumber() and maybe for DSCP 1468 1536 //#define UP2AC(up) ((up<3) ? ((up==0)?1:0) : (up>>1)) 1469 - #if 1 1470 1537 #define UP2AC(up) ( \ 1471 1538 ((up) < 1) ? WME_AC_BE : \ 1472 1539 ((up) < 3) ? WME_AC_BK : \ 1473 1540 ((up) < 4) ? WME_AC_BE : \ 1474 1541 ((up) < 6) ? WME_AC_VI : \ 1475 1542 WME_AC_VO) 1476 - #endif 1477 1543 //AC Mapping to UP, using in Tx part for selecting the corresponding TX queue 1478 1544 #define AC2UP(_ac) ( \ 1479 1545 ((_ac) == WME_AC_VO) ? 6 : \ ··· 1527 1597 /* Ensure null-terminated for any debug msgs */ 1528 1598 u8 ssid[IW_ESSID_MAX_SIZE + 1]; 1529 1599 u8 ssid_len; 1530 - #if 1 1531 1600 struct ieee80211_qos_data qos_data; 1532 - #else 1533 - // Qos related. Added by Annie, 2005-11-01. 1534 - BSS_QOS BssQos; 1535 - #endif 1536 1601 //added by amy for LEAP 1537 1602 bool bWithAironetIE; 1538 1603 bool bCkipSupported; ··· 1592 1667 struct list_head list; 1593 1668 }; 1594 1669 1595 - #if 1 1596 1670 enum ieee80211_state { 1597 1671 1598 1672 /* the card is not linked at all */ ··· 1630 1706 IEEE80211_LINKED_SCANNING, 1631 1707 1632 1708 }; 1633 - #else 1634 - enum ieee80211_state { 1635 - IEEE80211_UNINITIALIZED = 0, 1636 - IEEE80211_INITIALIZED, 1637 - IEEE80211_ASSOCIATING, 1638 - IEEE80211_ASSOCIATED, 1639 - IEEE80211_AUTHENTICATING, 1640 - IEEE80211_AUTHENTICATED, 1641 - IEEE80211_SHUTDOWN 1642 - }; 1643 - #endif 1644 1709 1645 1710 #define DEFAULT_MAX_SCAN_AGE (15 * HZ) 1646 1711 #define DEFAULT_FTS 2346 ··· 1648 1735 #define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \ 1649 1736 IEEE80211_52GHZ_MIN_CHANNEL + 1) 1650 1737 1651 - #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)) 1652 - extern inline int is_multicast_ether_addr(const u8 *addr) 1653 - { 1654 - return ((addr[0] != 0xff) && (0x01 & addr[0])); 1655 - } 1656 - #endif 1657 1738 1658 - #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13)) 1659 - extern inline int is_broadcast_ether_addr(const u8 *addr) 1660 - { 1661 - return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ 1662 - (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); 1663 - } 1664 - #endif 1665 1739 1666 1740 typedef struct tx_pending_t{ 1667 1741 int frag; ··· 1726 1826 bool bIPSModeBackup; 1727 1827 bool bSwRfProcessing; 1728 1828 RT_RF_POWER_STATE eInactivePowerState; 1729 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1730 1829 struct work_struct InactivePsWorkItem; 1731 - #else 1732 - struct tq_struct InactivePsWorkItem; 1733 - #endif 1734 1830 struct timer_list InactivePsTimer; 1735 1831 1736 1832 // Return point for join action ··· 2091 2195 2092 2196 /* used if IEEE_SOFTMAC_BEACONS is set */ 2093 2197 struct timer_list beacon_timer; 2094 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2095 2198 struct work_struct associate_complete_wq; 2096 2199 struct work_struct associate_procedure_wq; 2097 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 2098 2200 struct delayed_work softmac_scan_wq; 2099 2201 struct delayed_work associate_retry_wq; 2100 2202 struct delayed_work start_ibss_wq; 2101 - #else 2102 - struct work_struct softmac_scan_wq; 2103 - struct work_struct associate_retry_wq; 2104 - struct work_struct start_ibss_wq; 2105 - #endif 2106 2203 struct work_struct wx_sync_scan_wq; 2107 2204 struct workqueue_struct *wq; 2108 - #else 2109 - /* used for periodly scan */ 2110 - struct timer_list scan_timer; 2111 - 2112 - struct tq_struct associate_complete_wq; 2113 - struct tq_struct associate_retry_wq; 2114 - struct tq_struct start_ibss_wq; 2115 - struct tq_struct associate_procedure_wq; 2116 - struct tq_struct softmac_scan_wq; 2117 - struct tq_struct wx_sync_scan_wq; 2118 - 2119 - #endif 2120 2205 // Qos related. Added by Annie, 2005-11-01. 2121 2206 //STA_QOS StaQos; 2122 2207 ··· 2197 2320 void (*ps_request_tx_ack) (struct net_device *dev); 2198 2321 void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl); 2199 2322 short (*ps_is_queue_empty) (struct net_device *dev); 2200 - #if 0 2201 - /* Typical STA methods */ 2202 - int (*handle_auth) (struct net_device * dev, 2203 - struct ieee80211_auth * auth); 2204 - int (*handle_deauth) (struct net_device * dev, 2205 - struct ieee80211_deauth * auth); 2206 - int (*handle_action) (struct net_device * dev, 2207 - struct ieee80211_action * action, 2208 - struct ieee80211_rx_stats * stats); 2209 - int (*handle_disassoc) (struct net_device * dev, 2210 - struct ieee80211_disassoc * assoc); 2211 - #endif 2212 2323 int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network); 2213 - #if 0 2214 - int (*handle_probe_response) (struct net_device * dev, 2215 - struct ieee80211_probe_response * resp, 2216 - struct ieee80211_network * network); 2217 - int (*handle_probe_request) (struct net_device * dev, 2218 - struct ieee80211_probe_request * req, 2219 - struct ieee80211_rx_stats * stats); 2220 - #endif 2221 2324 int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network); 2222 2325 2223 - #if 0 2224 - /* Typical AP methods */ 2225 - int (*handle_assoc_request) (struct net_device * dev); 2226 - int (*handle_reassoc_request) (struct net_device * dev, 2227 - struct ieee80211_reassoc_request * req); 2228 - #endif 2229 2326 2230 2327 /* check whether Tx hw resouce available */ 2231 2328 short (*check_nic_enough_desc)(struct net_device *dev, int queue_index); ··· 2257 2406 2258 2407 static inline void *ieee80211_priv(struct net_device *dev) 2259 2408 { 2260 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2261 2409 return ((struct ieee80211_device *)netdev_priv(dev))->priv; 2262 - #else 2263 - return ((struct ieee80211_device *)dev->priv)->priv; 2264 - #endif 2265 2410 } 2266 2411 2267 2412 extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) ··· 2510 2663 union iwreq_data *wrqu, char *b); 2511 2664 2512 2665 //extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee); 2513 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 2514 2666 extern void ieee80211_wx_sync_scan_wq(struct work_struct *work); 2515 - #else 2516 - extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee); 2517 - #endif 2518 2667 2519 2668 2520 2669 extern int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
-5
drivers/staging/rtl8192u/ieee80211/EndianFree.h
··· 7 7 * 2. Before write integer to IO. 8 8 * 3. After read integer from IO. 9 9 */ 10 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) 11 - #ifndef bool 12 - typedef enum{false = 0, true} bool; 13 - #endif 14 - #endif 15 10 16 11 #define __MACHINE_LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ 17 12 #define __MACHINE_BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net, ppc */
-30
drivers/staging/rtl8192u/ieee80211/crypto_compat.h
··· 30 30 return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes); 31 31 } 32 32 33 - #if 0 34 - /* 35 - * crypto_free_tfm - Free crypto transform 36 - * @tfm: Transform to free 37 - * 38 - * crypto_free_tfm() frees up the transform and any associated resources, 39 - * then drops the refcount on the associated algorithm. 40 - */ 41 - void crypto_free_tfm(struct crypto_tfm *tfm) 42 - { 43 - struct crypto_alg *alg; 44 - int size; 45 - 46 - if (unlikely(!tfm)) 47 - return; 48 - 49 - alg = tfm->__crt_alg; 50 - size = sizeof(*tfm) + alg->cra_ctxsize; 51 - 52 - if (alg->cra_exit) 53 - alg->cra_exit(tfm); 54 - crypto_exit_ops(tfm); 55 - crypto_mod_put(alg); 56 - memset(tfm, 0, size); 57 - kfree(tfm); 58 - } 59 - 60 - #endif 61 - #if 1 62 33 struct crypto_tfm *crypto_alloc_tfm(const char *name, u32 flags) 63 34 { 64 35 struct crypto_tfm *tfm = NULL; ··· 54 83 55 84 return tfm; 56 85 } 57 - #endif 58 86 //EXPORT_SYMBOL_GPL(crypto_alloc_tfm); 59 87 //EXPORT_SYMBOL_GPL(crypto_free_tfm); 60 88
-16
drivers/staging/rtl8192u/ieee80211/dot11d.c
··· 35 35 { 36 36 u32 i; 37 37 PRT_DOT11D_INFO pDot11dInfo = GET_DOT11D_INFO(ieee); 38 - #if 0 39 - if(!pDot11dInfo->bEnabled) 40 - return; 41 - #endif 42 38 // Clear old channel map 43 39 memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1); 44 40 memset(pDot11dInfo->MaxTxPwrDbmList, 0xFF, MAX_CHANNEL_NUMBER+1); ··· 104 108 105 109 pTriple = (PCHNL_TXPOWER_TRIPLE)((u8*)pTriple + 3); 106 110 } 107 - #if 1 108 111 //printk("Dot11d_UpdateCountryIe(): Channel List:\n"); 109 112 printk("Channel List:"); 110 113 for(i=1; i<= MAX_CHANNEL_NUMBER; i++) 111 114 if(pDot11dInfo->channel_map[i] > 0) 112 115 printk(" %d", i); 113 116 printk("\n"); 114 - #endif 115 117 116 118 UPDATE_CIE_SRC(dev, pTaddr); 117 119 ··· 212 218 213 219 return default_chn; 214 220 } 215 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) 216 221 EXPORT_SYMBOL(Dot11d_Init); 217 222 EXPORT_SYMBOL(Dot11d_Reset); 218 223 EXPORT_SYMBOL(Dot11d_UpdateCountryIe); ··· 219 226 EXPORT_SYMBOL(DOT11D_ScanComplete); 220 227 EXPORT_SYMBOL(IsLegalChannel); 221 228 EXPORT_SYMBOL(ToLegalChannel); 222 - #else 223 - EXPORT_SYMBOL_NOVERS(Dot11d_Init); 224 - EXPORT_SYMBOL_NOVERS(Dot11d_Reset); 225 - EXPORT_SYMBOL_NOVERS(Dot11d_UpdateCountryIe); 226 - EXPORT_SYMBOL_NOVERS(DOT11D_GetMaxTxPwrInDbm); 227 - EXPORT_SYMBOL_NOVERS(DOT11D_ScanComplete); 228 - EXPORT_SYMBOL_NOVERS(IsLegalChannel); 229 - EXPORT_SYMBOL_NOVERS(ToLegalChannel); 230 - #endif 231 229 232 230 #endif
-157
drivers/staging/rtl8192u/ieee80211/ieee80211.h
··· 27 27 #include <linux/kernel.h> /* ARRAY_SIZE */ 28 28 #include <linux/version.h> 29 29 #include <linux/module.h> 30 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) 31 30 #include <linux/jiffies.h> 32 - #else 33 - #include <linux/jffs.h> 34 - #include <linux/tqueue.h> 35 - #endif 36 31 #include <linux/timer.h> 37 32 #include <linux/sched.h> 38 33 ··· 38 43 #include "rtl819x_BA.h" 39 44 #include "rtl819x_TS.h" 40 45 41 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) 42 - #ifndef bool 43 - typedef enum{false = 0, true} bool; 44 - #endif 45 - #endif 46 46 47 47 #ifndef IW_MODE_MONITOR 48 48 #define IW_MODE_MONITOR 6 ··· 47 57 #define IWEVCUSTOM 0x8c02 48 58 #endif 49 59 50 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 51 - #ifndef __bitwise 52 - #define __bitwise __attribute__((bitwise)) 53 - #endif 54 - typedef __u16 __le16; 55 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)) 56 - struct iw_spy_data{ 57 - /* --- Standard spy support --- */ 58 - int spy_number; 59 - u_char spy_address[IW_MAX_SPY][ETH_ALEN]; 60 - struct iw_quality spy_stat[IW_MAX_SPY]; 61 - /* --- Enhanced spy support (event) */ 62 - struct iw_quality spy_thr_low; /* Low threshold */ 63 - struct iw_quality spy_thr_high; /* High threshold */ 64 - u_char spy_thr_under[IW_MAX_SPY]; 65 - }; 66 - #endif 67 - #endif 68 60 69 61 #ifndef container_of 70 62 /** ··· 397 425 #define IW_QUAL_NOISE_UPDATED 0x4 398 426 #endif 399 427 400 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 401 - static inline void tq_init(struct tq_struct * task, void(*func)(void *), void *data) 402 - { 403 - task->routine = func; 404 - task->data = data; 405 - //task->next = NULL; 406 - INIT_LIST_HEAD(&task->list); 407 - task->sync = 0; 408 - } 409 - #endif 410 428 411 429 // linux under 2.6.9 release may not support it, so modify it for common use 412 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)) 413 - //#define MSECS(t) (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ) 414 - #define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000) 415 - static inline unsigned long msleep_interruptible_rsl(unsigned int msecs) 416 - { 417 - unsigned long timeout = MSECS(msecs) + 1; 418 - 419 - while (timeout) { 420 - set_current_state(TASK_INTERRUPTIBLE); 421 - timeout = schedule_timeout(timeout); 422 - } 423 - return timeout; 424 - } 425 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31)) 426 - static inline void msleep(unsigned int msecs) 427 - { 428 - unsigned long timeout = MSECS(msecs) + 1; 429 - 430 - while (timeout) { 431 - set_current_state(TASK_UNINTERRUPTIBLE); 432 - timeout = schedule_timeout(timeout); 433 - } 434 - } 435 - #endif 436 - #else 437 430 #define MSECS(t) msecs_to_jiffies(t) 438 431 #define msleep_interruptible_rsl msleep_interruptible 439 - #endif 440 432 441 433 #define IEEE80211_DATA_LEN 2304 442 434 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section ··· 862 926 * information for frames received. Not setting these will not cause 863 927 * any adverse affects. */ 864 928 struct ieee80211_rx_stats { 865 - #if 1 866 929 u32 mac_time[2]; 867 930 s8 rssi; 868 931 u8 signal; ··· 923 988 bool bToSelfBA; //cosa add for rssi 924 989 char cck_adc_pwdb[4]; //cosa add for rx path selection 925 990 u16 Seq_Num; 926 - #endif 927 991 928 992 }; 929 993 ··· 1270 1336 #define QOS_OUI_PARAM_SUB_TYPE 1 1271 1337 #define QOS_VERSION_1 1 1272 1338 #define QOS_AIFSN_MIN_VALUE 2 1273 - #if 1 1274 1339 struct ieee80211_qos_information_element { 1275 1340 u8 elementID; 1276 1341 u8 length; ··· 1344 1411 u16 surp_band_allow; 1345 1412 u16 medium_time; 1346 1413 }__attribute__((packed)); 1347 - #endif 1348 1414 enum eap_type { 1349 1415 EAP_PACKET = 0, 1350 1416 EAPOL_START, ··· 1466 1534 1467 1535 //UP Mapping to AC, using in MgntQuery_SequenceNumber() and maybe for DSCP 1468 1536 //#define UP2AC(up) ((up<3) ? ((up==0)?1:0) : (up>>1)) 1469 - #if 1 1470 1537 #define UP2AC(up) ( \ 1471 1538 ((up) < 1) ? WME_AC_BE : \ 1472 1539 ((up) < 3) ? WME_AC_BK : \ 1473 1540 ((up) < 4) ? WME_AC_BE : \ 1474 1541 ((up) < 6) ? WME_AC_VI : \ 1475 1542 WME_AC_VO) 1476 - #endif 1477 1543 //AC Mapping to UP, using in Tx part for selecting the corresponding TX queue 1478 1544 #define AC2UP(_ac) ( \ 1479 1545 ((_ac) == WME_AC_VO) ? 6 : \ ··· 1527 1597 /* Ensure null-terminated for any debug msgs */ 1528 1598 u8 ssid[IW_ESSID_MAX_SIZE + 1]; 1529 1599 u8 ssid_len; 1530 - #if 1 1531 1600 struct ieee80211_qos_data qos_data; 1532 - #else 1533 - // Qos related. Added by Annie, 2005-11-01. 1534 - BSS_QOS BssQos; 1535 - #endif 1536 1601 1537 1602 //added by amy for LEAP 1538 1603 bool bWithAironetIE; ··· 1593 1668 struct list_head list; 1594 1669 }; 1595 1670 1596 - #if 1 1597 1671 enum ieee80211_state { 1598 1672 1599 1673 /* the card is not linked at all */ ··· 1631 1707 IEEE80211_LINKED_SCANNING, 1632 1708 1633 1709 }; 1634 - #else 1635 - enum ieee80211_state { 1636 - IEEE80211_UNINITIALIZED = 0, 1637 - IEEE80211_INITIALIZED, 1638 - IEEE80211_ASSOCIATING, 1639 - IEEE80211_ASSOCIATED, 1640 - IEEE80211_AUTHENTICATING, 1641 - IEEE80211_AUTHENTICATED, 1642 - IEEE80211_SHUTDOWN 1643 - }; 1644 - #endif 1645 1710 1646 1711 #define DEFAULT_MAX_SCAN_AGE (15 * HZ) 1647 1712 #define DEFAULT_FTS 2346 ··· 1649 1736 #define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \ 1650 1737 IEEE80211_52GHZ_MIN_CHANNEL + 1) 1651 1738 1652 - #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)) 1653 - extern inline int is_multicast_ether_addr(const u8 *addr) 1654 - { 1655 - return ((addr[0] != 0xff) && (0x01 & addr[0])); 1656 - } 1657 - #endif 1658 1739 1659 - #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13)) 1660 - extern inline int is_broadcast_ether_addr(const u8 *addr) 1661 - { 1662 - return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ 1663 - (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); 1664 - } 1665 - #endif 1666 1740 1667 1741 typedef struct tx_pending_t{ 1668 1742 int frag; ··· 1727 1827 bool bIPSModeBackup; 1728 1828 bool bSwRfProcessing; 1729 1829 RT_RF_POWER_STATE eInactivePowerState; 1730 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1731 1830 struct work_struct InactivePsWorkItem; 1732 - #else 1733 - struct tq_struct InactivePsWorkItem; 1734 - #endif 1735 1831 struct timer_list InactivePsTimer; 1736 1832 1737 1833 // Return point for join action ··· 2092 2196 2093 2197 /* used if IEEE_SOFTMAC_BEACONS is set */ 2094 2198 struct timer_list beacon_timer; 2095 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2096 2199 struct work_struct associate_complete_wq; 2097 2200 struct work_struct associate_procedure_wq; 2098 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 2099 2201 struct delayed_work softmac_scan_wq; 2100 2202 struct delayed_work associate_retry_wq; 2101 2203 struct delayed_work start_ibss_wq; 2102 - #else 2103 - struct work_struct softmac_scan_wq; 2104 - struct work_struct associate_retry_wq; 2105 - struct work_struct start_ibss_wq; 2106 - #endif 2107 2204 struct work_struct wx_sync_scan_wq; 2108 2205 struct workqueue_struct *wq; 2109 - #else 2110 - /* used for periodly scan */ 2111 - struct timer_list scan_timer; 2112 - 2113 - struct tq_struct associate_complete_wq; 2114 - struct tq_struct associate_retry_wq; 2115 - struct tq_struct start_ibss_wq; 2116 - struct tq_struct associate_procedure_wq; 2117 - struct tq_struct softmac_scan_wq; 2118 - struct tq_struct wx_sync_scan_wq; 2119 - 2120 - #endif 2121 2206 // Qos related. Added by Annie, 2005-11-01. 2122 2207 //STA_QOS StaQos; 2123 2208 ··· 2198 2321 void (*ps_request_tx_ack) (struct net_device *dev); 2199 2322 void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl); 2200 2323 short (*ps_is_queue_empty) (struct net_device *dev); 2201 - #if 0 2202 - /* Typical STA methods */ 2203 - int (*handle_auth) (struct net_device * dev, 2204 - struct ieee80211_auth * auth); 2205 - int (*handle_deauth) (struct net_device * dev, 2206 - struct ieee80211_deauth * auth); 2207 - int (*handle_action) (struct net_device * dev, 2208 - struct ieee80211_action * action, 2209 - struct ieee80211_rx_stats * stats); 2210 - int (*handle_disassoc) (struct net_device * dev, 2211 - struct ieee80211_disassoc * assoc); 2212 - #endif 2213 2324 int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network); 2214 - #if 0 2215 - int (*handle_probe_response) (struct net_device * dev, 2216 - struct ieee80211_probe_response * resp, 2217 - struct ieee80211_network * network); 2218 - int (*handle_probe_request) (struct net_device * dev, 2219 - struct ieee80211_probe_request * req, 2220 - struct ieee80211_rx_stats * stats); 2221 - #endif 2222 2325 int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network); 2223 2326 2224 - #if 0 2225 - /* Typical AP methods */ 2226 - int (*handle_assoc_request) (struct net_device * dev); 2227 - int (*handle_reassoc_request) (struct net_device * dev, 2228 - struct ieee80211_reassoc_request * req); 2229 - #endif 2230 2327 2231 2328 /* check whether Tx hw resouce available */ 2232 2329 short (*check_nic_enough_desc)(struct net_device *dev, int queue_index); ··· 2258 2407 2259 2408 static inline void *ieee80211_priv(struct net_device *dev) 2260 2409 { 2261 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2262 2410 return ((struct ieee80211_device *)netdev_priv(dev))->priv; 2263 - #else 2264 - return ((struct ieee80211_device *)dev->priv)->priv; 2265 - #endif 2266 2411 } 2267 2412 2268 2413 extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len) ··· 2511 2664 union iwreq_data *wrqu, char *b); 2512 2665 2513 2666 //extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee); 2514 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 2515 2667 extern void ieee80211_wx_sync_scan_wq(struct work_struct *work); 2516 - #else 2517 - extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee); 2518 - #endif 2519 2668 2520 2669 2521 2670 extern int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
-7
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.h
··· 82 82 void ieee80211_crypt_deinit_handler(unsigned long); 83 83 void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, 84 84 struct ieee80211_crypt_data **crypt); 85 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 86 - #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) 87 - #endif 88 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31)) 89 - #define crypto_alloc_tfm crypto_alloc_tfm_rsl 90 - #define crypto_free_tfm crypto_free_tfm_rsl 91 - #endif 92 85 93 86 #endif
-2
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
··· 201 201 int i; 202 202 //struct list_head *p, *q; 203 203 // del_timer_sync(&ieee->SwBwTimer); 204 - #if 1 205 204 if (ieee->pHTInfo != NULL) 206 205 { 207 206 kfree(ieee->pHTInfo); 208 207 ieee->pHTInfo = NULL; 209 208 } 210 - #endif 211 209 RemoveAllTS(ieee); 212 210 ieee80211_softmac_free(ieee); 213 211 del_timer_sync(&ieee->crypt_deinit_timer);
-110
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
··· 55 55 u16 fc = le16_to_cpu(hdr->frame_ctl); 56 56 57 57 skb->dev = ieee->dev; 58 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 59 58 skb_reset_mac_header(skb); 60 - #else 61 - skb->mac.raw = skb->data; 62 - #endif 63 59 64 60 skb_pull(skb, ieee80211_get_hdrlen(fc)); 65 61 skb->pkt_type = PACKET_OTHERHOST; ··· 347 351 348 352 if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) 349 353 return 0; 350 - #if 1 351 354 if (ieee->hwsec_active) 352 355 { 353 356 cb_desc *tcb_desc = (cb_desc *)(skb->cb+ MAX_DEV_ADDR_SIZE); 354 357 tcb_desc->bHwSec = 1; 355 358 } 356 - #endif 357 359 hdr = (struct ieee80211_hdr_4addr *) skb->data; 358 360 hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); 359 361 ··· 528 534 ) 529 535 { 530 536 struct list_head *pList = &pTS->RxPendingPktList; 531 - #if 1 532 537 while(pList->next != &pTS->RxPendingPktList) 533 538 { 534 539 if( SN_LESS(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) ) ··· 543 550 break; 544 551 } 545 552 } 546 - #endif 547 553 pReorderEntry->List.next = pList->next; 548 554 pReorderEntry->List.next->prev = &pReorderEntry->List; 549 555 pReorderEntry->List.prev = pList; ··· 618 626 u8 index = 0; 619 627 bool bMatchWinStart = false, bPktInBuf = false; 620 628 IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): Seq is %d,pTS->RxIndicateSeq is %d, WinSize is %d\n",__FUNCTION__,SeqNum,pTS->RxIndicateSeq,WinSize); 621 - #if 0 622 - if(!list_empty(&ieee->RxReorder_Unused_List)) 623 - IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): ieee->RxReorder_Unused_List is nut NULL\n"); 624 - #endif 625 629 /* Rx Reorder initialize condition.*/ 626 630 if(pTS->RxIndicateSeq == 0xffff) { 627 631 pTS->RxIndicateSeq = SeqNum; ··· 684 696 pReorderEntry->prxb = prxb; 685 697 // IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): pREorderEntry->SeqNum is %d\n",__FUNCTION__,pReorderEntry->SeqNum); 686 698 687 - #if 1 688 699 if(!AddReorderEntry(pTS, pReorderEntry)) { 689 700 IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): Duplicate packet is dropped!! IndicateSeq: %d, NewSeq: %d\n", 690 701 __FUNCTION__, pTS->RxIndicateSeq, SeqNum); ··· 700 713 IEEE80211_DEBUG(IEEE80211_DL_REORDER, 701 714 "Pkt insert into buffer!! IndicateSeq: %d, NewSeq: %d\n",pTS->RxIndicateSeq, SeqNum); 702 715 } 703 - #endif 704 716 } 705 717 else { 706 718 /* ··· 722 736 /* Check if there is any packet need indicate.*/ 723 737 while(!list_empty(&pTS->RxPendingPktList)) { 724 738 IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): start RREORDER indicate\n",__FUNCTION__); 725 - #if 1 726 739 pReorderEntry = (PRX_REORDER_ENTRY)list_entry(pTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List); 727 740 if( SN_LESS(pReorderEntry->SeqNum, pTS->RxIndicateSeq) || 728 741 SN_EQUAL(pReorderEntry->SeqNum, pTS->RxIndicateSeq)) ··· 748 763 bPktInBuf = true; 749 764 break; 750 765 } 751 - #endif 752 766 } 753 767 754 768 /* Handling pending timer. Set this timer to prevent from long time Rx buffering.*/ ··· 764 780 ieee80211_indicate_packets(ieee, prxbIndicateArray, index); 765 781 } 766 782 767 - #if 1 768 783 if(bPktInBuf && pTS->RxTimeoutIndicateSeq==0xffff) { 769 784 // Set new pending timer. 770 785 IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): SET rx timeout timer\n", __FUNCTION__); ··· 773 790 pTS->RxPktPendingTimer.expires = jiffies + MSECS(pHTInfo->RxReorderPendingTime); 774 791 add_timer(&pTS->RxPktPendingTimer); 775 792 } 776 - #endif 777 793 } 778 794 779 795 u8 parse_subframe(struct sk_buff *skb, ··· 839 857 nSubframe_Length = (nSubframe_Length>>8) + (nSubframe_Length<<8); 840 858 841 859 if(skb->len<(ETHERNET_HEADER_SIZE + nSubframe_Length)) { 842 - #if 0//cosa 843 - RT_ASSERT( 844 - (nRemain_Length>=(ETHERNET_HEADER_SIZE + nSubframe_Length)), 845 - ("ParseSubframe(): A-MSDU subframe parse error!! Subframe Length: %d\n", nSubframe_Length) ); 846 - #endif 847 860 printk("%s: A-MSDU parse error!! pRfd->nTotalSubframe : %d\n",\ 848 861 __FUNCTION__,rxb->nr_subframes); 849 862 printk("%s: A-MSDU parse error!! Subframe Length: %d\n",__FUNCTION__, nSubframe_Length); ··· 1035 1058 else 1036 1059 { 1037 1060 PRX_TS_RECORD pRxTS = NULL; 1038 - #if 0 1039 - struct ieee80211_hdr_3addr *hdr; 1040 - u16 fc; 1041 - hdr = (struct ieee80211_hdr_3addr *)skb->data; 1042 - fc = le16_to_cpu(hdr->frame_ctl); 1043 - u8 tmp = (fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS); 1044 - 1045 - u8 tid = (*((u8*)skb->data + (((fc& IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))?30:24)))&0xf; 1046 - printk("====================>fc:%x, tid:%d, tmp:%d\n", fc, tid, tmp); 1047 - //u8 tid = (u8)((frameqos*)(buf + ((fc & IEEE80211_FCTL_TODS)&&(fc & IEEE80211_FCTL_FROMDS))? 30 : 24))->field.tid; 1048 - #endif 1049 1061 //IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): QOS ENABLE AND RECEIVE QOS DATA , we will get Ts, tid:%d\n",__FUNCTION__, tid); 1050 - #if 1 1051 1062 if(GetTs( 1052 1063 ieee, 1053 1064 (PTS_COMMON_INFO*) &pRxTS, ··· 1064 1099 goto rx_dropped; 1065 1100 } 1066 1101 } 1067 - #endif 1068 1102 if (type == IEEE80211_FTYPE_MGMT) { 1069 1103 1070 - #if 0 1071 - if ( stype == IEEE80211_STYPE_AUTH && 1072 - fc & IEEE80211_FCTL_WEP && ieee->host_decrypt && 1073 - (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) 1074 - { 1075 - printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " 1076 - "from " MAC_FMT "\n", dev->name, 1077 - MAC_ARG(hdr->addr2)); 1078 - /* TODO: could inform hostapd about this so that it 1079 - * could send auth failure report */ 1080 - goto rx_dropped; 1081 - } 1082 - #endif 1083 1104 1084 1105 //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); 1085 1106 if (ieee80211_rx_frame_mgmt(ieee, skb, rx_stats, type, stype)) ··· 1287 1336 } 1288 1337 */ 1289 1338 //added by amy for reorder 1290 - #if 1 1291 1339 if(ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data) 1292 1340 && !is_multicast_ether_addr(hdr->addr1) && !is_broadcast_ether_addr(hdr->addr1)) 1293 1341 { ··· 1298 1348 ieee->bis_any_nonbepkts = true; 1299 1349 } 1300 1350 } 1301 - #endif 1302 1351 //added by amy for reorder 1303 1352 /* skb: hdr + (possible reassembled) full plaintext payload */ 1304 1353 payload = skb->data + hdrlen; ··· 1923 1974 1924 1975 } 1925 1976 } 1926 - #if 0 1927 - if (tmp_htcap_len !=0) 1928 - { 1929 - u16 cap_ext = ((PHT_CAPABILITY_ELE)&info_element->data[0])->ExtHTCapInfo; 1930 - if ((cap_ext & 0x0c00) == 0x0c00) 1931 - { 1932 - network->ralink_cap_exist = true; 1933 - } 1934 - } 1935 - #endif 1936 1977 if(info_element->len >= 3 && 1937 1978 info_element->data[0] == 0x00 && 1938 1979 info_element->data[1] == 0x0c && ··· 2095 2156 break; 2096 2157 #endif 2097 2158 /* TODO */ 2098 - #if 0 2099 - /* 802.11h */ 2100 - case MFIE_TYPE_POWER_CONSTRAINT: 2101 - network->power_constraint = info_element->data[0]; 2102 - network->flags |= NETWORK_HAS_POWER_CONSTRAINT; 2103 - break; 2104 - 2105 - case MFIE_TYPE_CSA: 2106 - network->power_constraint = info_element->data[0]; 2107 - network->flags |= NETWORK_HAS_CSA; 2108 - break; 2109 - 2110 - case MFIE_TYPE_QUIET: 2111 - network->quiet.count = info_element->data[0]; 2112 - network->quiet.period = info_element->data[1]; 2113 - network->quiet.duration = info_element->data[2]; 2114 - network->quiet.offset = info_element->data[3]; 2115 - network->flags |= NETWORK_HAS_QUIET; 2116 - break; 2117 - 2118 - case MFIE_TYPE_IBSS_DFS: 2119 - if (network->ibss_dfs) 2120 - break; 2121 - network->ibss_dfs = kmemdup(info_element->data, 2122 - info_element->len, 2123 - GFP_ATOMIC); 2124 - if (!network->ibss_dfs) 2125 - return 1; 2126 - network->flags |= NETWORK_HAS_IBSS_DFS; 2127 - break; 2128 - 2129 - case MFIE_TYPE_TPC_REPORT: 2130 - network->tpc_report.transmit_power = 2131 - info_element->data[0]; 2132 - network->tpc_report.link_margin = info_element->data[1]; 2133 - network->flags |= NETWORK_HAS_TPC_REPORT; 2134 - break; 2135 - #endif 2136 2159 default: 2137 2160 IEEE80211_DEBUG_MGMT 2138 2161 ("Unsupported info element: %s (%d)\n", ··· 2277 2376 if (ieee80211_is_empty_essid(network->ssid, network->ssid_len)) 2278 2377 network->flags |= NETWORK_EMPTY_ESSID; 2279 2378 2280 - #if 1 2281 2379 stats->signal = 30 + (stats->SignalStrength * 70) / 100; 2282 2380 //stats->signal = ieee80211_SignalStrengthTranslate(stats->signal); 2283 2381 stats->noise = ieee80211_translate_todbm((u8)(100-stats->signal)) -25; 2284 - #endif 2285 2382 2286 2383 memcpy(&network->stats, stats, sizeof(network->stats)); 2287 2384 ··· 2387 2488 dst->qos_data.old_param_count = old_param; 2388 2489 2389 2490 /* dst->last_associate is not overwritten */ 2390 - #if 1 2391 2491 dst->wmm_info = src->wmm_info; //sure to exist in beacon or probe response frame. 2392 2492 if(src->wmm_param[0].ac_aci_acm_aifsn|| \ 2393 2493 src->wmm_param[1].ac_aci_acm_aifsn|| \ ··· 2395 2497 memcpy(dst->wmm_param, src->wmm_param, WME_AC_PRAM_LEN); 2396 2498 } 2397 2499 //dst->QoS_Enable = src->QoS_Enable; 2398 - #else 2399 - dst->QoS_Enable = 1;//for Rtl8187 simulation 2400 - #endif 2401 2500 #ifdef THOMAS_TURBO 2402 2501 dst->Turbo_Enable = src->Turbo_Enable; 2403 2502 #endif ··· 2664 2769 } 2665 2770 } 2666 2771 2667 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) 2668 2772 EXPORT_SYMBOL(ieee80211_rx_mgt); 2669 2773 EXPORT_SYMBOL(ieee80211_rx); 2670 - #else 2671 - EXPORT_SYMBOL_NOVERS(ieee80211_rx_mgt); 2672 - EXPORT_SYMBOL_NOVERS(ieee80211_rx); 2673 - #endif
-242
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
··· 503 503 } 504 504 } 505 505 506 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 507 - /* called both by wq with ieee->lock held */ 508 - void ieee80211_softmac_scan(struct ieee80211_device *ieee) 509 - { 510 - #if 0 511 - short watchdog = 0; 512 - do{ 513 - ieee->current_network.channel = 514 - (ieee->current_network.channel + 1) % MAX_CHANNEL_NUMBER; 515 - if (watchdog++ > MAX_CHANNEL_NUMBER) 516 - return; /* no good chans */ 517 506 518 - }while(!ieee->channel_map[ieee->current_network.channel]); 519 - #endif 520 - 521 - schedule_task(&ieee->softmac_scan_wq); 522 - } 523 - #endif 524 - 525 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 526 507 void ieee80211_softmac_scan_wq(struct work_struct *work) 527 508 { 528 509 struct delayed_work *dwork = container_of(work, struct delayed_work, work); 529 510 struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, softmac_scan_wq); 530 - #else 531 - void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee) 532 - { 533 - #endif 534 511 static short watchdog = 0; 535 512 #ifdef ENABLE_DOT11D 536 513 u8 channel_map[MAX_CHANNEL_NUMBER+1]; ··· 544 567 ieee80211_send_probe_requests(ieee); 545 568 546 569 547 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 548 570 queue_delayed_work(ieee->wq, &ieee->softmac_scan_wq, IEEE80211_SOFTMAC_SCAN_TIME); 549 - #else 550 - //ieee->scan_timer.expires = jiffies + MSECS(IEEE80211_SOFTMAC_SCAN_TIME); 551 - if (ieee->scanning == 1) 552 - mod_timer(&ieee->scan_timer,(jiffies + MSECS(IEEE80211_SOFTMAC_SCAN_TIME))); 553 - #endif 554 571 555 572 up(&ieee->scan_sem); 556 573 return; ··· 559 588 up(&ieee->scan_sem); 560 589 } 561 590 562 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 563 - void ieee80211_softmac_scan_cb(unsigned long _dev) 564 - { 565 - unsigned long flags; 566 - struct ieee80211_device *ieee = (struct ieee80211_device *)_dev; 567 - 568 - spin_lock_irqsave(&ieee->lock, flags); 569 - ieee80211_softmac_scan(ieee); 570 - spin_unlock_irqrestore(&ieee->lock, flags); 571 - } 572 - #endif 573 591 574 592 575 593 void ieee80211_beacons_start(struct ieee80211_device *ieee) ··· 616 656 if (ieee->scanning == 1){ 617 657 ieee->scanning = 0; 618 658 619 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 620 659 cancel_delayed_work(&ieee->softmac_scan_wq); 621 - #else 622 - del_timer_sync(&ieee->scan_timer); 623 - #endif 624 660 } 625 661 626 662 // spin_unlock_irqrestore(&ieee->lock, flags); ··· 646 690 if (ieee->softmac_features & IEEE_SOFTMAC_SCAN){ 647 691 if (ieee->scanning == 0){ 648 692 ieee->scanning = 1; 649 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 650 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 651 693 queue_delayed_work(ieee->wq, &ieee->softmac_scan_wq, 0); 652 - #else 653 - 654 - queue_work(ieee->wq, &ieee->softmac_scan_wq); 655 - #endif 656 - #else 657 - ieee80211_softmac_scan(ieee); 658 - #endif 659 694 } 660 695 }else 661 696 ieee->start_scan(ieee->dev); ··· 747 800 else 748 801 atim_len = 0; 749 802 750 - #if 1 751 803 if(ieee80211_is_54g(ieee->current_network)) 752 804 erp_len = 3; 753 805 else 754 806 erp_len = 0; 755 - #else 756 - if((ieee->current_network.mode == IEEE_G) 757 - ||( ieee->current_network.mode == IEEE_N_24G && ieee->pHTInfo->bCurSuppCCK)) { 758 - erp_len = 3; 759 - erpinfo_content = 0; 760 - if(ieee->current_network.buseprotection) 761 - erpinfo_content |= ERP_UseProtection; 762 - } 763 - else 764 - erp_len = 0; 765 - #endif 766 807 767 808 768 809 crypt = ieee->crypt[ieee->tx_keyidx]; ··· 759 824 encrypt = ieee->host_encrypt && crypt && crypt->ops && 760 825 ((0 == strcmp(crypt->ops->name, "WEP") || wpa_ie_len)); 761 826 //HT ralated element 762 - #if 1 763 827 tmp_ht_cap_buf =(u8*) &(ieee->pHTInfo->SelfHTCap); 764 828 tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap); 765 829 tmp_ht_info_buf =(u8*) &(ieee->pHTInfo->SelfHTInfo); ··· 774 840 HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, &tmp_generic_ie_len); 775 841 } 776 842 // printk("===============>tmp_ht_cap_len is %d,tmp_ht_info_len is %d, tmp_generic_ie_len is %d\n",tmp_ht_cap_len,tmp_ht_info_len,tmp_generic_ie_len); 777 - #endif 778 843 beacon_size = sizeof(struct ieee80211_probe_response)+2+ 779 844 ssid_len 780 845 +3 //channel ··· 808 875 cpu_to_le16((beacon_buf->capability |= WLAN_CAPABILITY_SHORT_SLOT)); 809 876 810 877 crypt = ieee->crypt[ieee->tx_keyidx]; 811 - #if 0 812 - encrypt = ieee->host_encrypt && crypt && crypt->ops && 813 - (0 == strcmp(crypt->ops->name, "WEP")); 814 - #endif 815 878 if (encrypt) 816 879 beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); 817 880 ··· 846 917 *(tag++) = 1; 847 918 *(tag++) = erpinfo_content; 848 919 } 849 - #if 0 850 - //Include High Throuput capability 851 - 852 - *(tag++) = MFIE_TYPE_HT_CAP; 853 - *(tag++) = tmp_ht_cap_len - 2; 854 - memcpy(tag, tmp_ht_cap_buf, tmp_ht_cap_len - 2); 855 - tag += tmp_ht_cap_len - 2; 856 - #endif 857 920 if(rate_ex_len){ 858 921 *(tag++) = MFIE_TYPE_RATES_EX; 859 922 *(tag++) = rate_ex_len-2; ··· 853 932 tag+=rate_ex_len-2; 854 933 } 855 934 856 - #if 0 857 - //Include High Throuput info 858 - 859 - *(tag++) = MFIE_TYPE_HT_INFO; 860 - *(tag++) = tmp_ht_info_len - 2; 861 - memcpy(tag, tmp_ht_info_buf, tmp_ht_info_len -2); 862 - tag += tmp_ht_info_len - 2; 863 - #endif 864 935 if (wpa_ie_len) 865 936 { 866 937 if (ieee->iw_mode == IW_MODE_ADHOC) ··· 863 950 tag += wpa_ie_len; 864 951 } 865 952 866 - #if 0 867 - // 868 - // Construct Realtek Proprietary Aggregation mode (Set AMPDU Factor to 2, 32k) 869 - // 870 - if(pHTInfo->bRegRT2RTAggregation) 871 - { 872 - (*tag++) = 0xdd; 873 - (*tag++) = tmp_generic_ie_len - 2; 874 - memcpy(tag,tmp_generic_ie_buf,tmp_generic_ie_len -2); 875 - tag += tmp_generic_ie_len -2; 876 - 877 - } 878 - #endif 879 - #if 0 880 - if(ieee->qos_support) 881 - { 882 - (*tag++) = 0xdd; 883 - (*tag++) = wmm_len; 884 - memcpy(tag,QosOui,wmm_len); 885 - tag += wmm_len; 886 - } 887 - #endif 888 953 //skb->dev = ieee->dev; 889 954 return skb; 890 955 } ··· 1271 1380 1272 1381 ieee->state = IEEE80211_ASSOCIATING_RETRY; 1273 1382 1274 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1275 1383 queue_delayed_work(ieee->wq, &ieee->associate_retry_wq, \ 1276 1384 IEEE80211_SOFTMAC_ASSOC_RETRY_TIME); 1277 - #else 1278 - schedule_task(&ieee->associate_retry_wq); 1279 - #endif 1280 1385 1281 1386 spin_unlock_irqrestore(&ieee->lock, flags); 1282 1387 } ··· 1334 1447 1335 1448 softmac_mgmt_xmit(skb, ieee); 1336 1449 mod_timer(&ieee->associate_timer, jiffies + (HZ/2)); 1337 - #if 0 1338 - ieee->associate_timer.expires = jiffies + (HZ / 2); 1339 - add_timer(&ieee->associate_timer); 1340 - #endif 1341 1450 //dev_kfree_skb_any(skb);//edit by thomas 1342 1451 } 1343 1452 kfree(challenge); ··· 1355 1472 else{ 1356 1473 softmac_mgmt_xmit(skb, ieee); 1357 1474 mod_timer(&ieee->associate_timer, jiffies + (HZ/2)); 1358 - #if 0 1359 - ieee->associate_timer.expires = jiffies + (HZ / 2); 1360 - add_timer(&ieee->associate_timer); 1361 - #endif 1362 1475 //dev_kfree_skb_any(skb);//edit by thomas 1363 1476 } 1364 1477 } 1365 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 1366 1478 void ieee80211_associate_complete_wq(struct work_struct *work) 1367 1479 { 1368 1480 struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_complete_wq); 1369 - #else 1370 - void ieee80211_associate_complete_wq(struct ieee80211_device *ieee) 1371 - { 1372 - #endif 1373 1481 printk(KERN_INFO "Associated successfully\n"); 1374 1482 if(ieee80211_is_54g(ieee->current_network) && 1375 1483 (ieee->modulation & IEEE80211_OFDM_MODULATION)){ ··· 1411 1537 // struct net_device* dev = ieee->dev; 1412 1538 del_timer_sync(&ieee->associate_timer); 1413 1539 1414 - #if 0 1415 - for(i = 0; i < 6; i++) { 1416 - ieee->seq_ctrl[i] = 0; 1417 - } 1418 - #endif 1419 1540 ieee->state = IEEE80211_LINKED; 1420 - #if 0 1421 - if (ieee->pHTInfo->bCurrentHTSupport) 1422 - { 1423 - printk("Successfully associated, ht enabled\n"); 1424 - queue_work(ieee->wq, &ieee->ht_onAssRsp); 1425 - } 1426 - else 1427 - { 1428 - printk("Successfully associated, ht not enabled\n"); 1429 - memset(ieee->dot11HTOperationalRateSet, 0, 16); 1430 - HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); 1431 - } 1432 - #endif 1433 1541 //ieee->UpdateHalRATRTableHandler(dev, ieee->dot11HTOperationalRateSet); 1434 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1435 1542 queue_work(ieee->wq, &ieee->associate_complete_wq); 1436 - #else 1437 - schedule_task(&ieee->associate_complete_wq); 1438 - #endif 1439 1543 } 1440 1544 1441 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 1442 1545 void ieee80211_associate_procedure_wq(struct work_struct *work) 1443 1546 { 1444 1547 struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_procedure_wq); 1445 - #else 1446 - void ieee80211_associate_procedure_wq(struct ieee80211_device *ieee) 1447 - { 1448 - #endif 1449 1548 ieee->sync_scan_hurryup = 1; 1450 1549 down(&ieee->wx_sem); 1451 1550 ··· 1516 1669 } 1517 1670 1518 1671 ieee->state = IEEE80211_ASSOCIATING; 1519 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1520 1672 queue_work(ieee->wq, &ieee->associate_procedure_wq); 1521 - #else 1522 - schedule_task(&ieee->associate_procedure_wq); 1523 - #endif 1524 1673 }else{ 1525 1674 if(ieee80211_is_54g(ieee->current_network) && 1526 1675 (ieee->modulation & IEEE80211_OFDM_MODULATION)){ ··· 1733 1890 1734 1891 printk(KERN_INFO"New client associated: "MAC_FMT"\n", MAC_ARG(dest)); 1735 1892 //FIXME 1736 - #if 0 1737 - spin_lock_irqsave(&ieee->lock,flags); 1738 - add_associate(ieee,dest); 1739 - spin_unlock_irqrestore(&ieee->lock,flags); 1740 - #endif 1741 1893 } 1742 1894 1743 1895 ··· 2017 2179 "Association response status code 0x%x\n", 2018 2180 errcode); 2019 2181 if(ieee->AsocRetryCount < RT_ASOC_RETRY_LIMIT) { 2020 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2021 2182 queue_work(ieee->wq, &ieee->associate_procedure_wq); 2022 - #else 2023 - schedule_task(&ieee->associate_procedure_wq); 2024 - #endif 2025 2183 } else { 2026 2184 ieee80211_associate_abort(ieee); 2027 2185 } ··· 2124 2290 notify_wx_assoc_event(ieee); 2125 2291 //HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); 2126 2292 RemovePeerTS(ieee, header->addr2); 2127 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2128 2293 queue_work(ieee->wq, &ieee->associate_procedure_wq); 2129 - #else 2130 - schedule_task(&ieee->associate_procedure_wq); 2131 - #endif 2132 2294 } 2133 2295 break; 2134 2296 case IEEE80211_STYPE_MANAGE_ACT: ··· 2177 2347 if(tcb_desc->bMulticast) { 2178 2348 ieee->stats.multicast++; 2179 2349 } 2180 - #if 1 2181 2350 /* if xmit available, just xmit it immediately, else just insert it to the wait queue */ 2182 2351 for(i = 0; i < txb->nr_frags; i++) { 2183 2352 #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE ··· 2206 2377 //ieee->dev->trans_start = jiffies; 2207 2378 } 2208 2379 } 2209 - #endif 2210 2380 ieee80211_txb_free(txb); 2211 2381 2212 2382 //exit: ··· 2359 2531 netif_carrier_on(ieee->dev); 2360 2532 } 2361 2533 } 2362 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 2363 2534 void ieee80211_start_ibss_wq(struct work_struct *work) 2364 2535 { 2365 2536 2366 2537 struct delayed_work *dwork = container_of(work, struct delayed_work, work); 2367 2538 struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, start_ibss_wq); 2368 - #else 2369 - void ieee80211_start_ibss_wq(struct ieee80211_device *ieee) 2370 - { 2371 - #endif 2372 2539 /* iwconfig mode ad-hoc will schedule this and return 2373 2540 * on the other hand this will block further iwconfig SET 2374 2541 * operations because of the wx_sem hold. ··· 2473 2650 2474 2651 inline void ieee80211_start_ibss(struct ieee80211_device *ieee) 2475 2652 { 2476 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2477 2653 queue_delayed_work(ieee->wq, &ieee->start_ibss_wq, 150); 2478 - #else 2479 - schedule_task(&ieee->start_ibss_wq); 2480 - #endif 2481 2654 } 2482 2655 2483 2656 /* this is called only in user context, with wx_sem held */ ··· 2538 2719 notify_wx_assoc_event(ieee); 2539 2720 2540 2721 } 2541 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 2542 2722 void ieee80211_associate_retry_wq(struct work_struct *work) 2543 2723 { 2544 2724 struct delayed_work *dwork = container_of(work, struct delayed_work, work); 2545 2725 struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, associate_retry_wq); 2546 - #else 2547 - void ieee80211_associate_retry_wq(struct ieee80211_device *ieee) 2548 - { 2549 - #endif 2550 2726 unsigned long flags; 2551 2727 2552 2728 down(&ieee->wx_sem); ··· 2636 2822 2637 2823 ieee80211_stop_send_beacons(ieee); 2638 2824 del_timer_sync(&ieee->associate_timer); 2639 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2640 2825 cancel_delayed_work(&ieee->associate_retry_wq); 2641 2826 cancel_delayed_work(&ieee->start_ibss_wq); 2642 - #endif 2643 2827 ieee80211_stop_scan(ieee); 2644 2828 2645 2829 ieee80211_disassociate(ieee); ··· 2755 2943 ieee->sta_edca_param[3] = 0x002F3262; 2756 2944 ieee->aggregation = true; 2757 2945 ieee->enable_rx_imm_BA = 1; 2758 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 2759 - init_timer(&ieee->scan_timer); 2760 - ieee->scan_timer.data = (unsigned long)ieee; 2761 - ieee->scan_timer.function = ieee80211_softmac_scan_cb; 2762 - #endif 2763 2946 ieee->tx_pending.txb = NULL; 2764 2947 2765 2948 init_timer(&ieee->associate_timer); ··· 2765 2958 ieee->beacon_timer.data = (unsigned long) ieee; 2766 2959 ieee->beacon_timer.function = ieee80211_send_beacon_cb; 2767 2960 2768 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2769 2961 #ifdef PF_SYNCTHREAD 2770 2962 ieee->wq = create_workqueue(DRV_NAME,0); 2771 2963 #else 2772 2964 ieee->wq = create_workqueue(DRV_NAME); 2773 2965 #endif 2774 - #endif 2775 2966 2776 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2777 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 2778 2967 INIT_DELAYED_WORK(&ieee->start_ibss_wq,ieee80211_start_ibss_wq); 2779 2968 INIT_WORK(&ieee->associate_complete_wq, ieee80211_associate_complete_wq); 2780 2969 INIT_WORK(&ieee->associate_procedure_wq, ieee80211_associate_procedure_wq); ··· 2778 2975 INIT_DELAYED_WORK(&ieee->associate_retry_wq, ieee80211_associate_retry_wq); 2779 2976 INIT_WORK(&ieee->wx_sync_scan_wq,ieee80211_wx_sync_scan_wq); 2780 2977 2781 - #else 2782 - INIT_WORK(&ieee->start_ibss_wq,(void(*)(void*)) ieee80211_start_ibss_wq,ieee); 2783 - INIT_WORK(&ieee->associate_retry_wq,(void(*)(void*)) ieee80211_associate_retry_wq,ieee); 2784 - INIT_WORK(&ieee->associate_complete_wq,(void(*)(void*)) ieee80211_associate_complete_wq,ieee); 2785 - INIT_WORK(&ieee->associate_procedure_wq,(void(*)(void*)) ieee80211_associate_procedure_wq,ieee); 2786 - INIT_WORK(&ieee->softmac_scan_wq,(void(*)(void*)) ieee80211_softmac_scan_wq,ieee); 2787 - INIT_WORK(&ieee->wx_sync_scan_wq,(void(*)(void*)) ieee80211_wx_sync_scan_wq,ieee); 2788 - #endif 2789 2978 2790 - #else 2791 - tq_init(&ieee->start_ibss_wq,(void(*)(void*)) ieee80211_start_ibss_wq,ieee); 2792 - tq_init(&ieee->associate_retry_wq,(void(*)(void*)) ieee80211_associate_retry_wq,ieee); 2793 - tq_init(&ieee->associate_complete_wq,(void(*)(void*)) ieee80211_associate_complete_wq,ieee); 2794 - tq_init(&ieee->associate_procedure_wq,(void(*)(void*)) ieee80211_associate_procedure_wq,ieee); 2795 - tq_init(&ieee->softmac_scan_wq,(void(*)(void*)) ieee80211_softmac_scan_wq,ieee); 2796 - tq_init(&ieee->wx_sync_scan_wq,(void(*)(void*)) ieee80211_wx_sync_scan_wq,ieee); 2797 - #endif 2798 2979 sema_init(&ieee->wx_sem, 1); 2799 2980 sema_init(&ieee->scan_sem, 1); 2800 2981 ··· 2803 3016 #endif 2804 3017 del_timer_sync(&ieee->associate_timer); 2805 3018 2806 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2807 3019 cancel_delayed_work(&ieee->associate_retry_wq); 2808 3020 destroy_workqueue(ieee->wq); 2809 - #endif 2810 3021 2811 3022 up(&ieee->wx_sem); 2812 3023 } ··· 3081 3296 } 3082 3297 memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); 3083 3298 new_crypt->ops = ops; 3084 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) 3085 3299 if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) 3086 - #else 3087 - if (new_crypt->ops && try_inc_mod_count(new_crypt->ops->owner)) 3088 - #endif 3089 3300 new_crypt->priv = 3090 3301 new_crypt->ops->init(param->u.crypt.idx); 3091 3302 ··· 3264 3483 wireless_send_event(ieee->dev, SIOCGIWAP, &wrqu, NULL); 3265 3484 } 3266 3485 3267 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) 3268 3486 EXPORT_SYMBOL(ieee80211_get_beacon); 3269 3487 EXPORT_SYMBOL(ieee80211_wake_queue); 3270 3488 EXPORT_SYMBOL(ieee80211_stop_queue); ··· 3284 3504 EXPORT_SYMBOL(ieee80211_send_probe_requests); 3285 3505 EXPORT_SYMBOL(ieee80211_softmac_scan_syncro); 3286 3506 EXPORT_SYMBOL(ieee80211_start_scan_syncro); 3287 - #else 3288 - EXPORT_SYMBOL_NOVERS(ieee80211_get_beacon); 3289 - EXPORT_SYMBOL_NOVERS(ieee80211_wake_queue); 3290 - EXPORT_SYMBOL_NOVERS(ieee80211_stop_queue); 3291 - EXPORT_SYMBOL_NOVERS(ieee80211_reset_queue); 3292 - EXPORT_SYMBOL_NOVERS(ieee80211_softmac_stop_protocol); 3293 - EXPORT_SYMBOL_NOVERS(ieee80211_softmac_start_protocol); 3294 - EXPORT_SYMBOL_NOVERS(ieee80211_is_shortslot); 3295 - EXPORT_SYMBOL_NOVERS(ieee80211_is_54g); 3296 - EXPORT_SYMBOL_NOVERS(ieee80211_wpa_supplicant_ioctl); 3297 - EXPORT_SYMBOL_NOVERS(ieee80211_ps_tx_ack); 3298 - EXPORT_SYMBOL_NOVERS(ieee80211_softmac_xmit); 3299 - EXPORT_SYMBOL_NOVERS(ieee80211_stop_send_beacons); 3300 - EXPORT_SYMBOL_NOVERS(notify_wx_assoc_event); 3301 - EXPORT_SYMBOL_NOVERS(SendDisassociation); 3302 - EXPORT_SYMBOL_NOVERS(ieee80211_disassociate); 3303 - EXPORT_SYMBOL_NOVERS(ieee80211_start_send_beacons); 3304 - EXPORT_SYMBOL_NOVERS(ieee80211_stop_scan); 3305 - EXPORT_SYMBOL_NOVERS(ieee80211_send_probe_requests); 3306 - EXPORT_SYMBOL_NOVERS(ieee80211_softmac_scan_syncro); 3307 - EXPORT_SYMBOL_NOVERS(ieee80211_start_scan_syncro); 3308 - #endif 3309 3507 //EXPORT_SYMBOL(ieee80211_sta_ps_send_null_frame);
-78
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
··· 234 234 union iwreq_data *wrqu, char *extra) 235 235 { 236 236 u32 tmp_rate; 237 - #if 0 238 - printk("===>mode:%d, halfNmode:%d\n", ieee->mode, ieee->bHalfWirelessN24GMode); 239 - if (ieee->mode & (IEEE_A | IEEE_B | IEEE_G)) 240 - tmp_rate = ieee->rate; 241 - else if (ieee->mode & IEEE_N_5G) 242 - tmp_rate = 580; 243 - else if (ieee->mode & IEEE_N_24G) 244 - { 245 - if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) 246 - tmp_rate = HTHalfMcsToDataRate(ieee, 15); 247 - else 248 - tmp_rate = HTMcsToDataRate(ieee, 15); 249 - } 250 - #else 251 237 tmp_rate = TxCountToDataRate(ieee, ieee->softmac_stats.CurrentShowTxate); 252 238 253 - #endif 254 239 wrqu->bitrate.value = tmp_rate * 500000; 255 240 256 241 return 0; ··· 298 313 return 0; 299 314 } 300 315 301 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 302 316 void ieee80211_wx_sync_scan_wq(struct work_struct *work) 303 317 { 304 318 struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, wx_sync_scan_wq); 305 - #else 306 - void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee) 307 - { 308 - #endif 309 319 short chan; 310 320 HT_EXTCHNL_OFFSET chan_offset=0; 311 321 HT_CHANNEL_WIDTH bandwidth=0; ··· 372 392 } 373 393 374 394 if ( ieee->state == IEEE80211_LINKED){ 375 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 376 395 queue_work(ieee->wq, &ieee->wx_sync_scan_wq); 377 - #else 378 - schedule_task(&ieee->wx_sync_scan_wq); 379 - #endif 380 396 /* intentionally forget to up sem */ 381 397 return 0; 382 398 } ··· 418 442 if (wrqu->essid.flags && wrqu->essid.length) { 419 443 //first flush current network.ssid 420 444 len = ((wrqu->essid.length-1) < IW_ESSID_MAX_SIZE) ? (wrqu->essid.length-1) : IW_ESSID_MAX_SIZE; 421 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) 422 - strncpy(ieee->current_network.ssid, extra, len); 423 - ieee->current_network.ssid_len = len; 424 - #if 0 425 - { 426 - int i; 427 - for (i=0; i<len; i++) 428 - printk("%c ", extra[i]); 429 - printk("\n"); 430 - } 431 - #endif 432 - #else 433 445 strncpy(ieee->current_network.ssid, extra, len+1); 434 446 ieee->current_network.ssid_len = len+1; 435 - #if 0 436 - { 437 - int i; 438 - for (i=0; i<len + 1; i++) 439 - printk("%c ", extra[i]); 440 - printk("\n"); 441 - } 442 - #endif 443 - #endif 444 447 ieee->ssid_set = 1; 445 448 } 446 449 else{ ··· 512 557 union iwreq_data *wrqu, char *extra) 513 558 { 514 559 int ret = 0; 515 - #if 0 516 - if( 517 - (!ieee->sta_wake_up) || 518 - (!ieee->ps_request_tx_ack) || 519 - (!ieee->enter_sleep_state) || 520 - (!ieee->ps_is_queue_empty)){ 521 - 522 - // printk("ERROR. PS mode is tryied to be use but driver missed a callback\n\n"); 523 - 524 - return -1; 525 - } 526 - #endif 527 560 down(&ieee->wx_sem); 528 561 529 562 if (wrqu->power.disabled){ ··· 595 652 return ret; 596 653 597 654 } 598 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) 599 655 EXPORT_SYMBOL(ieee80211_wx_get_essid); 600 656 EXPORT_SYMBOL(ieee80211_wx_set_essid); 601 657 EXPORT_SYMBOL(ieee80211_wx_set_rate); ··· 613 671 EXPORT_SYMBOL(ieee80211_wlan_frequencies); 614 672 EXPORT_SYMBOL(ieee80211_wx_set_rts); 615 673 EXPORT_SYMBOL(ieee80211_wx_get_rts); 616 - #else 617 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_essid); 618 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_essid); 619 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_rate); 620 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_rate); 621 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_wap); 622 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_wap); 623 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_mode); 624 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_mode); 625 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_scan); 626 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_freq); 627 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_freq); 628 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_rawtx); 629 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_name); 630 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_power); 631 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_power); 632 - EXPORT_SYMBOL_NOVERS(ieee80211_wlan_frequencies); 633 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_rts); 634 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_rts); 635 - #endif
-17
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
··· 235 235 //int i; 236 236 if (unlikely(!txb)) 237 237 return; 238 - #if 0 239 - for (i = 0; i < txb->nr_frags; i++) 240 - if (txb->fragments[i]) 241 - dev_kfree_skb_any(txb->fragments[i]); 242 - #endif 243 238 kfree(txb); 244 239 } 245 240 ··· 282 287 return 0; 283 288 284 289 // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); 285 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) 286 290 ip = ip_hdr(skb); 287 - #else 288 - ip = (struct iphdr*)(skb->data + sizeof(struct ether_header)); 289 - #endif 290 291 switch (ip->tos & 0xfc) { 291 292 case 0x20: 292 293 return 2; ··· 325 334 if(!Adapter->HalFunc.GetNmodeSupportBySecCfgHandler(Adapter)) 326 335 return; 327 336 #endif 328 - #if 1 329 337 if(!ieee->GetNmodeSupportBySecCfg(ieee->dev)) 330 338 { 331 339 return; 332 340 } 333 - #endif 334 341 if(pHTInfo->bCurrentAMPDUEnable) 335 342 { 336 343 if (!GetTs(ieee, (PTS_COMMON_INFO*)(&pTxTs), hdr->addr1, skb->priority, TX_DIR, true)) ··· 591 602 592 603 int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) 593 604 { 594 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) 595 605 struct ieee80211_device *ieee = netdev_priv(dev); 596 - #else 597 - struct ieee80211_device *ieee = (struct ieee80211_device *)dev->priv; 598 - #endif 599 606 struct ieee80211_txb *txb = NULL; 600 607 struct ieee80211_hdr_3addrqos *frag_hdr; 601 608 int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size; ··· 863 878 //WB add to fill data tcb_desc here. only first fragment is considered, need to change, and you may remove to other place. 864 879 if (txb) 865 880 { 866 - #if 1 867 881 cb_desc *tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE); 868 882 tcb_desc->bTxEnableFwCalcDur = 1; 869 883 if (is_multicast_ether_addr(header.addr1)) ··· 883 899 ieee80211_query_seqnum(ieee, txb->fragments[0], header.addr1); 884 900 // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, txb->fragments[0]->data, txb->fragments[0]->len); 885 901 //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, tcb_desc, sizeof(cb_desc)); 886 - #endif 887 902 } 888 903 spin_unlock_irqrestore(&ieee->lock, flags); 889 904 dev_kfree_skb_any(skb);
-154
drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
··· 35 35 #include <linux/module.h> 36 36 37 37 #include "ieee80211.h" 38 - #if 0 39 - static const char *ieee80211_modes[] = { 40 - "?", "a", "b", "ab", "g", "ag", "bg", "abg" 41 - }; 42 - #endif 43 38 struct modes_unit { 44 39 char *mode_string; 45 40 int mode_size; ··· 48 53 {"N-5G",4}, 49 54 }; 50 55 51 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 52 - static inline char * 53 - iwe_stream_add_event_rsl(char * stream, /* Stream of events */ 54 - char * ends, /* End of stream */ 55 - struct iw_event *iwe, /* Payload */ 56 - int event_len) /* Real size of payload */ 57 - { 58 - /* Check if it's possible */ 59 - if((stream + event_len) < ends) { 60 - iwe->len = event_len; 61 - ndelay(1); //new 62 - memcpy(stream, (char *) iwe, event_len); 63 - stream += event_len; 64 - } 65 - return stream; 66 - } 67 - #else 68 56 #define iwe_stream_add_event_rsl iwe_stream_add_event 69 - #endif 70 57 71 58 #define MAX_CUSTOM_LEN 64 72 59 static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, ··· 69 92 iwe.cmd = SIOCGIWAP; 70 93 iwe.u.ap_addr.sa_family = ARPHRD_ETHER; 71 94 memcpy(iwe.u.ap_addr.sa_data, network->bssid, ETH_ALEN); 72 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 73 95 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_ADDR_LEN); 74 - #else 75 - start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_ADDR_LEN); 76 - #endif 77 96 /* Remaining entries will be displayed in the order we provide them */ 78 97 79 98 /* Add the ESSID */ ··· 78 105 // if (network->flags & NETWORK_EMPTY_ESSID) { 79 106 if (network->ssid_len == 0) { 80 107 iwe.u.data.length = sizeof("<hidden>"); 81 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 82 108 start = iwe_stream_add_point(info, start, stop, &iwe, "<hidden>"); 83 - #else 84 - start = iwe_stream_add_point(start, stop, &iwe, "<hidden>"); 85 - #endif 86 109 } else { 87 110 iwe.u.data.length = min(network->ssid_len, (u8)32); 88 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 89 111 start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid); 90 - #else 91 - start = iwe_stream_add_point(start, stop, &iwe, network->ssid); 92 - #endif 93 112 } 94 113 /* Add the protocol name */ 95 114 iwe.cmd = SIOCGIWNAME; ··· 93 128 } 94 129 *pname = '\0'; 95 130 snprintf(iwe.u.name, IFNAMSIZ, "IEEE802.11%s", proto_name); 96 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 97 131 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_CHAR_LEN); 98 - #else 99 - start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_CHAR_LEN); 100 - #endif 101 132 /* Add mode */ 102 133 iwe.cmd = SIOCGIWMODE; 103 134 if (network->capability & ··· 102 141 iwe.u.mode = IW_MODE_MASTER; 103 142 else 104 143 iwe.u.mode = IW_MODE_ADHOC; 105 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 106 144 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_UINT_LEN); 107 - #else 108 - start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_UINT_LEN); 109 - #endif 110 145 } 111 146 112 147 /* Add frequency/channel */ ··· 112 155 iwe.u.freq.m = network->channel; 113 156 iwe.u.freq.e = 0; 114 157 iwe.u.freq.i = 0; 115 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 116 158 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_FREQ_LEN); 117 - #else 118 - start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_FREQ_LEN); 119 - #endif 120 159 /* Add encryption capability */ 121 160 iwe.cmd = SIOCGIWENCODE; 122 161 if (network->capability & WLAN_CAPABILITY_PRIVACY) ··· 120 167 else 121 168 iwe.u.data.flags = IW_ENCODE_DISABLED; 122 169 iwe.u.data.length = 0; 123 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 124 170 start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid); 125 - #else 126 - start = iwe_stream_add_point(start, stop, &iwe, network->ssid); 127 - #endif 128 171 /* Add basic and extended rates */ 129 172 max_rate = 0; 130 173 p = custom; ··· 164 215 if (rate > max_rate) 165 216 max_rate = rate; 166 217 } 167 - #if 0 168 - printk("max rate:%d ===basic rate:\n", max_rate); 169 - for (i=0;i<network->rates_len;i++) 170 - printk(" %x", network->rates[i]); 171 - printk("\n=======extend rate\n"); 172 - for (i=0; i<network->rates_ex_len; i++) 173 - printk(" %x", network->rates_ex[i]); 174 - printk("\n"); 175 - #endif 176 218 iwe.cmd = SIOCGIWRATE; 177 219 iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0; 178 220 iwe.u.bitrate.value = max_rate * 500000; 179 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 180 221 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, 181 222 IW_EV_PARAM_LEN); 182 - #else 183 - start = iwe_stream_add_event_rsl(start, stop, &iwe, 184 - IW_EV_PARAM_LEN); 185 - #endif 186 223 iwe.cmd = IWEVCUSTOM; 187 224 iwe.u.data.length = p - custom; 188 225 if (iwe.u.data.length) 189 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 190 226 start = iwe_stream_add_point(info, start, stop, &iwe, custom); 191 - #else 192 - start = iwe_stream_add_point(start, stop, &iwe, custom); 193 - #endif 194 227 /* Add quality statistics */ 195 228 /* TODO: Fix these values... */ 196 229 iwe.cmd = IWEVQUAL; ··· 187 256 if (!(network->stats.mask & IEEE80211_STATMASK_SIGNAL)) 188 257 iwe.u.qual.updated |= IW_QUAL_QUAL_INVALID; 189 258 iwe.u.qual.updated = 7; 190 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 191 259 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_QUAL_LEN); 192 - #else 193 - start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_QUAL_LEN); 194 - #endif 195 260 iwe.cmd = IWEVCUSTOM; 196 261 p = custom; 197 262 198 263 iwe.u.data.length = p - custom; 199 264 if (iwe.u.data.length) 200 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 201 265 start = iwe_stream_add_point(info, start, stop, &iwe, custom); 202 - #else 203 - start = iwe_stream_add_point(start, stop, &iwe, custom); 204 - #endif 205 266 #if (WIRELESS_EXT < 18) 206 267 if (ieee->wpa_enabled && network->wpa_ie_len){ 207 268 char buf[MAX_WPA_IE_LEN * 2 + 30]; ··· 207 284 memset(&iwe, 0, sizeof(iwe)); 208 285 iwe.cmd = IWEVCUSTOM; 209 286 iwe.u.data.length = strlen(buf); 210 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 211 287 start = iwe_stream_add_point(info, start, stop, &iwe, buf); 212 - #else 213 - start = iwe_stream_add_point(start, stop, &iwe, buf); 214 - #endif 215 288 } 216 289 217 290 if (ieee->wpa_enabled && network->rsn_ie_len){ ··· 222 303 memset(&iwe, 0, sizeof(iwe)); 223 304 iwe.cmd = IWEVCUSTOM; 224 305 iwe.u.data.length = strlen(buf); 225 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 226 306 start = iwe_stream_add_point(info, start, stop, &iwe, buf); 227 - #else 228 - start = iwe_stream_add_point(start, stop, &iwe, buf); 229 - #endif 230 307 } 231 308 #else 232 309 memset(&iwe, 0, sizeof(iwe)); ··· 232 317 memcpy(buf, network->wpa_ie, network->wpa_ie_len); 233 318 iwe.cmd = IWEVGENIE; 234 319 iwe.u.data.length = network->wpa_ie_len; 235 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 236 320 start = iwe_stream_add_point(info, start, stop, &iwe, buf); 237 - #else 238 - start = iwe_stream_add_point(start, stop, &iwe, buf); 239 - #endif 240 321 } 241 322 memset(&iwe, 0, sizeof(iwe)); 242 323 if (network->rsn_ie_len) ··· 241 330 memcpy(buf, network->rsn_ie, network->rsn_ie_len); 242 331 iwe.cmd = IWEVGENIE; 243 332 iwe.u.data.length = network->rsn_ie_len; 244 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 245 333 start = iwe_stream_add_point(info, start, stop, &iwe, buf); 246 - #else 247 - start = iwe_stream_add_point(start, stop, &iwe, buf); 248 - #endif 249 334 } 250 335 #endif 251 336 ··· 254 347 " Last beacon: %lums ago", (jiffies - network->last_scanned) / (HZ / 100)); 255 348 iwe.u.data.length = p - custom; 256 349 if (iwe.u.data.length) 257 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 258 350 start = iwe_stream_add_point(info, start, stop, &iwe, custom); 259 - #else 260 - start = iwe_stream_add_point(start, stop, &iwe, custom); 261 - #endif 262 351 263 352 return start; 264 353 } ··· 389 486 request_module("ieee80211_crypt_wep"); 390 487 new_crypt->ops = ieee80211_get_crypto_ops("WEP"); 391 488 } 392 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) 393 489 if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) 394 - #else 395 - if (new_crypt->ops && try_inc_mod_count(new_crypt->ops->owner)) 396 - #endif 397 490 new_crypt->priv = new_crypt->ops->init(key); 398 491 399 492 if (!new_crypt->ops || !new_crypt->priv) { ··· 510 611 erq->flags |= IW_ENCODE_DISABLED; 511 612 return 0; 512 613 } 513 - #if 0 514 - if (strcmp(crypt->ops->name, "WEP") != 0) { 515 - /* only WEP is supported with wireless extensions, so just 516 - * report that encryption is used */ 517 - erq->length = 0; 518 - erq->flags |= IW_ENCODE_ENABLED; 519 - return 0; 520 - } 521 - #endif 522 614 len = crypt->ops->get_key(keybuf, SCM_KEY_LEN, NULL, crypt->priv); 523 615 erq->length = (len >= 0 ? len : 0); 524 616 ··· 528 638 union iwreq_data *wrqu, char *extra) 529 639 { 530 640 int ret = 0; 531 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 532 641 struct net_device *dev = ieee->dev; 533 642 struct iw_point *encoding = &wrqu->encoding; 534 643 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; ··· 591 702 592 703 sec.enabled = 1; 593 704 // sec.encrypt = 1; 594 - #if 0 595 - if (group_key ? !ieee->host_mc_decrypt : 596 - !(ieee->host_encrypt || ieee->host_decrypt || 597 - ieee->host_encrypt_msdu)) 598 - goto skip_host_crypt; 599 - #endif 600 705 switch (ext->alg) { 601 706 case IW_ENCODE_ALG_WEP: 602 707 alg = "WEP"; ··· 630 747 631 748 ieee80211_crypt_delayed_deinit(ieee, crypt); 632 749 633 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)) 634 750 new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL); 635 - #else 636 - new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL); 637 - memset(new_crypt,0,sizeof(*new_crypt)); 638 - #endif 639 751 if (new_crypt == NULL) { 640 752 ret = -ENOMEM; 641 753 goto done; ··· 655 777 ret = -EINVAL; 656 778 goto done; 657 779 } 658 - #if 1 659 780 //skip_host_crypt: 660 781 //printk("skip_host_crypt:ext_flags:%x\n", ext->ext_flags); 661 782 if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { ··· 684 807 if (group_key) 685 808 sec.flags &= ~SEC_LEVEL; 686 809 } 687 - #endif 688 810 done: 689 811 if (ieee->set_security) 690 812 ieee->set_security(ieee->dev, &sec); ··· 694 818 IEEE80211_DEBUG_WX("%s: reset_port failed\n", dev->name); 695 819 return -EINVAL; 696 820 } 697 - #endif 698 821 return ret; 699 822 } 700 823 ··· 756 881 struct iw_request_info *info, 757 882 union iwreq_data *wrqu, char *extra) 758 883 { 759 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 760 884 struct iw_mlme *mlme = (struct iw_mlme *) extra; 761 885 switch (mlme->cmd) { 762 886 case IW_MLME_DEAUTH: ··· 765 891 default: 766 892 return -EOPNOTSUPP; 767 893 } 768 - #endif 769 894 return 0; 770 895 } 771 896 ··· 772 899 struct iw_request_info *info, 773 900 struct iw_param *data, char *extra) 774 901 { 775 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 776 902 switch (data->flags & IW_AUTH_INDEX) { 777 903 case IW_AUTH_WPA_VERSION: 778 904 /*need to support wpa2 here*/ ··· 813 941 //printk("open_wep:%d\n", ieee->open_wep); 814 942 break; 815 943 816 - #if 1 817 944 case IW_AUTH_WPA_ENABLED: 818 945 ieee->wpa_enabled = (data->value)?1:0; 819 946 //printk("enalbe wpa:%d\n", ieee->wpa_enabled); 820 947 break; 821 948 822 - #endif 823 949 case IW_AUTH_RX_UNENCRYPTED_EAPOL: 824 950 ieee->ieee802_1x = data->value; 825 951 break; ··· 827 957 default: 828 958 return -EOPNOTSUPP; 829 959 } 830 - #endif 831 960 return 0; 832 961 } 833 962 #endif 834 - #if 1 835 963 int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len) 836 964 { 837 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 838 - #if 0 839 - printk("====>%s()\n", __FUNCTION__); 840 - { 841 - int i; 842 - for (i=0; i<len; i++) 843 - printk("%2x ", ie[i]&0xff); 844 - printk("\n"); 845 - } 846 - #endif 847 965 u8 *buf; 848 966 849 967 if (len>MAX_WPA_IE_LEN || (len && ie == NULL)) ··· 862 1004 ieee->wpa_ie = NULL; 863 1005 ieee->wpa_ie_len = 0; 864 1006 } 865 - #endif 866 1007 return 0; 867 1008 868 1009 } 869 - #endif 870 1010 871 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) 872 1011 EXPORT_SYMBOL(ieee80211_wx_set_gen_ie); 873 1012 #if (WIRELESS_EXT >= 18) 874 1013 EXPORT_SYMBOL(ieee80211_wx_set_mlme); ··· 876 1021 EXPORT_SYMBOL(ieee80211_wx_get_scan); 877 1022 EXPORT_SYMBOL(ieee80211_wx_set_encode); 878 1023 EXPORT_SYMBOL(ieee80211_wx_get_encode); 879 - #else 880 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_gen_ie); 881 - //EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_mlme); 882 - //EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_auth); 883 - //EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_encode_ext); 884 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_scan); 885 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_encode); 886 - EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_encode); 887 - #endif
-16
drivers/staging/rtl8192u/ieee80211/internal.h
··· 22 22 #include <asm/softirq.h> 23 23 #include <asm/kmap_types.h> 24 24 25 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)) 26 - #define list_for_each_entry(pos, head, member) \ 27 - for (pos = list_entry((head)->next, typeof(*pos), member), \ 28 - prefetch(pos->member.next); \ 29 - &pos->member != (head); \ 30 - pos = list_entry(pos->member.next, typeof(*pos), member), \ 31 - prefetch(pos->member.next)) 32 - 33 - static inline void cond_resched(void) 34 - { 35 - if (need_resched()) { 36 - set_current_state(TASK_RUNNING); 37 - schedule(); 38 - } 39 - } 40 - #endif 41 25 42 26 extern enum km_type crypto_km_types[]; 43 27
-42
drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
··· 174 174 //return NULL; 175 175 } 176 176 177 - #if 0 //I try to merge ADDBA_REQ and ADDBA_RSP frames together.. 178 - /******************************************************************************************************************** 179 - *function: construct ADDBAREQ frame 180 - * input: u8* dst //ADDBARsp frame's destination 181 - * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA_RSP. 182 - * u16 StatusCode //status code. 183 - * output: none 184 - * return: sk_buff* skb //return constructed skb to xmit 185 - ********************************************************************************************************************/ 186 - static struct sk_buff* ieee80211_ADDBA_Rsp( IN struct ieee80211_device* ieee, u8* dst, PBA_RECORD pBA, u16 StatusCode) 187 - { 188 - OCTET_STRING osADDBAFrame, tmp; 189 - 190 - FillOctetString(osADDBAFrame, Buffer, 0); 191 - *pLength = 0; 192 - 193 - ConstructMaFrameHdr( 194 - Adapter, 195 - Addr, 196 - ACT_CAT_BA, 197 - ACT_ADDBARSP, 198 - &osADDBAFrame ); 199 - 200 - // Dialog Token 201 - FillOctetString(tmp, &pBA->DialogToken, 1); 202 - PacketAppendData(&osADDBAFrame, tmp); 203 - 204 - // Status Code 205 - FillOctetString(tmp, &StatusCode, 2); 206 - PacketAppendData(&osADDBAFrame, tmp); 207 - 208 - // BA Parameter Set 209 - FillOctetString(tmp, &pBA->BaParamSet, 2); 210 - PacketAppendData(&osADDBAFrame, tmp); 211 - 212 - // BA Timeout Value 213 - FillOctetString(tmp, &pBA->BaTimeoutValue, 2); 214 - PacketAppendData(&osADDBAFrame, tmp); 215 - 216 - *pLength = osADDBAFrame.Length; 217 - } 218 - #endif 219 177 220 178 /******************************************************************************************************************** 221 179 *function: construct DELBA frame
+1 -258
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
··· 348 348 { 349 349 bool retValue = false; 350 350 struct ieee80211_network* net = &ieee->current_network; 351 - #if 0 352 - if(pMgntInfo->bHalfNMode == false) 353 - retValue = false; 354 - else 355 - #endif 356 351 if((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3)==0) || 357 352 (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3)==0) || 358 353 (memcmp(net->bssid, PCI_RALINK, 3)==0) || ··· 416 421 u8 HTIOTActIsDisableMCS14(struct ieee80211_device* ieee, u8* PeerMacAddr) 417 422 { 418 423 u8 ret = 0; 419 - #if 0 420 - // Apply for 819u only 421 - #if (HAL_CODE_BASE==RTL8192 && DEV_BUS_TYPE==USB_INTERFACE) 422 - if((memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) || 423 - (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) 424 - ) 425 - { 426 - ret = 1; 427 - } 428 - 429 - 430 - if(pHTInfo->bCurrentRT2RTAggregation) 431 - { 432 - // The parameter of pHTInfo->bCurrentRT2RTAggregation must be decided previously 433 - ret = 1; 434 - } 435 - #endif 436 - #endif 437 424 return ret; 438 425 } 439 426 ··· 475 498 476 499 #ifdef TODO 477 500 // Apply for 819u only 478 - //#if (HAL_CODE_BASE==RTL8192) 479 - 480 - //This rule only apply to Belkin(Ralink) AP 481 - if(IS_UNDER_11N_AES_MODE(Adapter)) 482 - { 483 - if((PlatformCompareMemory(PeerMacAddr, BELKINF5D8233V1_RALINK, 3)==0) || 484 - (PlatformCompareMemory(PeerMacAddr, PCI_RALINK, 3)==0) || 485 - (PlatformCompareMemory(PeerMacAddr, EDIMAX_RALINK, 3)==0)) 486 - { 487 - //Set True to disable this function. Disable by default, Emily, 2008.04.23 488 - retValue = false; 489 - } 490 - } 491 - 492 - //#endif 493 501 #endif 494 502 return retValue; 495 503 } ··· 492 530 // Set specific EDCA parameter for different AP in DM handler. 493 531 494 532 return retValue; 495 - #if 0 496 - if((memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0)|| 497 - (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)|| 498 - (memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)|| 499 - (memcmp(PeerMacAddr, NETGEAR834Bv2_BROADCOM, 3)==0)) 500 - 501 - { 502 - retValue = 1; //Linksys disable EDCA turbo mode 503 - } 504 - 505 - return retValue; 506 - #endif 507 533 } 508 534 509 535 /******************************************************************************************************************** ··· 759 809 *len = 6 + 2; 760 810 return; 761 811 #ifdef TODO 762 - #if(HAL_CODE_BASE == RTL8192 && DEV_BUS_TYPE == USB_INTERFACE) 812 + #if (HAL_CODE_BASE == RTL8192 && DEV_BUS_TYPE == USB_INTERFACE) 763 813 /* 764 814 //Emily. If it is required to Ask Realtek AP to send AMPDU during AES mode, enable this 765 815 section of code. ··· 938 988 return true; 939 989 } 940 990 void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset); 941 - #if 0 942 - //I need move this function to other places, such as rx? 943 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 944 - void HTOnAssocRsp_wq(struct work_struct *work) 945 - { 946 - struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, ht_onAssRsp); 947 - #else 948 - void HTOnAssocRsp_wq(struct ieee80211_device *ieee) 949 - { 950 - #endif 951 - #endif 952 991 void HTOnAssocRsp(struct ieee80211_device *ieee) 953 992 { 954 993 PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; ··· 1039 1100 { 1040 1101 // Set MPDU density to 2 to Realtek AP, and set it to 0 for others 1041 1102 // Replace MPDU factor declared in original association response frame format. 2007.08.20 by Emily 1042 - #if 0 1043 - osTmp= PacketGetElement( asocpdu, EID_Vendor, OUI_SUB_REALTEK_AGG, OUI_SUBTYPE_DONT_CARE); 1044 - if(osTmp.Length >= 5) //00:e0:4c:02:00 1045 - #endif 1046 1103 if (ieee->current_network.bssht.bdRT2RTAggregation) 1047 1104 { 1048 1105 if( ieee->pairwise_key_type != KEY_TYPE_NA) ··· 1057 1122 1058 1123 // <2> Set AMPDU Minimum MPDU Start Spacing 1059 1124 // 802.11n 3.0 section 9.7d.3 1060 - #if 1 1061 1125 if(pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity) 1062 1126 pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density; 1063 1127 else 1064 1128 pHTInfo->CurrentMPDUDensity = pPeerHTCap->MPDUDensity; 1065 1129 if(ieee->pairwise_key_type != KEY_TYPE_NA ) 1066 1130 pHTInfo->CurrentMPDUDensity = 7; // 8us 1067 - #else 1068 - if(pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity) 1069 - pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density; 1070 - else 1071 - pHTInfo->CurrentMPDUDensity = pPeerHTCap->MPDUDensity; 1072 - #endif 1073 1131 // Force TX AMSDU 1074 1132 1075 1133 // Lanhsin: mark for tmp to avoid deauth by ap from s3 ··· 1206 1278 pBssHT->bdRT2RTAggregation = false; 1207 1279 pBssHT->bdRT2RTLongSlotTime = false; 1208 1280 } 1209 - #if 0 1210 - //below function has merged into ieee80211_network_init() in ieee80211_rx.c 1211 - void 1212 - HTParsingHTCapElement( 1213 - IN PADAPTER Adapter, 1214 - IN OCTET_STRING HTCapIE, 1215 - OUT PRT_WLAN_BSS pBssDesc 1216 - ) 1217 - { 1218 - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; 1219 - 1220 - if( HTCapIE.Length > sizeof(pBssDesc->BssHT.bdHTCapBuf) ) 1221 - { 1222 - RT_TRACE( COMP_HT, DBG_LOUD, ("HTParsingHTCapElement(): HT Capability Element length is too long!\n") ); 1223 - return; 1224 - } 1225 - 1226 - // TODO: Check the correctness of HT Cap 1227 - //Print each field in detail. Driver should not print out this message by default 1228 - if(!pMgntInfo->mActingAsAp && !pMgntInfo->mAssoc) 1229 - HTDebugHTCapability(DBG_TRACE, Adapter, &HTCapIE, (pu8)"HTParsingHTCapElement()"); 1230 - 1231 - HTCapIE.Length = HTCapIE.Length > sizeof(pBssDesc->BssHT.bdHTCapBuf)?\ 1232 - sizeof(pBssDesc->BssHT.bdHTCapBuf):HTCapIE.Length; //prevent from overflow 1233 - 1234 - CopyMem(pBssDesc->BssHT.bdHTCapBuf, HTCapIE.Octet, HTCapIE.Length); 1235 - pBssDesc->BssHT.bdHTCapLen = HTCapIE.Length; 1236 - 1237 - } 1238 - 1239 - 1240 - void 1241 - HTParsingHTInfoElement( 1242 - PADAPTER Adapter, 1243 - OCTET_STRING HTInfoIE, 1244 - PRT_WLAN_BSS pBssDesc 1245 - ) 1246 - { 1247 - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; 1248 - 1249 - if( HTInfoIE.Length > sizeof(pBssDesc->BssHT.bdHTInfoBuf)) 1250 - { 1251 - RT_TRACE( COMP_HT, DBG_LOUD, ("HTParsingHTInfoElement(): HT Information Element length is too long!\n") ); 1252 - return; 1253 - } 1254 - 1255 - // TODO: Check the correctness of HT Info 1256 - //Print each field in detail. Driver should not print out this message by default 1257 - if(!pMgntInfo->mActingAsAp && !pMgntInfo->mAssoc) 1258 - HTDebugHTInfo(DBG_TRACE, Adapter, &HTInfoIE, (pu8)"HTParsingHTInfoElement()"); 1259 - 1260 - HTInfoIE.Length = HTInfoIE.Length > sizeof(pBssDesc->BssHT.bdHTInfoBuf)?\ 1261 - sizeof(pBssDesc->BssHT.bdHTInfoBuf):HTInfoIE.Length; //prevent from overflow 1262 - 1263 - CopyMem( pBssDesc->BssHT.bdHTInfoBuf, HTInfoIE.Octet, HTInfoIE.Length); 1264 - pBssDesc->BssHT.bdHTInfoLen = HTInfoIE.Length; 1265 - } 1266 - 1267 - /* 1268 - * Get HT related information from beacon and save it in BssDesc 1269 - * 1270 - * (1) Parse HTCap, and HTInfo, and record whether it is 11n AP 1271 - * (2) If peer is HT, but not WMM, call QosSetLegacyWMMParamWithHT() 1272 - * (3) Check whether peer is Realtek AP (for Realtek proprietary aggregation mode). 1273 - * Input: 1274 - * PADAPTER Adapter 1275 - * 1276 - * Output: 1277 - * PRT_TCB BssDesc 1278 - * 1279 - */ 1280 - void HTGetValueFromBeaconOrProbeRsp( 1281 - PADAPTER Adapter, 1282 - POCTET_STRING pSRCmmpdu, 1283 - PRT_WLAN_BSS bssDesc 1284 - ) 1285 - { 1286 - PMGNT_INFO pMgntInfo = &Adapter->MgntInfo; 1287 - PRT_HIGH_THROUGHPUT pHTInfo = GET_HT_INFO(pMgntInfo); 1288 - OCTET_STRING HTCapIE, HTInfoIE, HTRealtekAgg, mmpdu; 1289 - OCTET_STRING BroadcomElement, CiscoElement; 1290 - 1291 - mmpdu.Octet = pSRCmmpdu->Octet; 1292 - mmpdu.Length = pSRCmmpdu->Length; 1293 - 1294 - //2Note: 1295 - // Mark for IOT testing using Linksys WRT350N, This AP does not contain WMM IE when 1296 - // it is configured at pure-N mode. 1297 - // if(bssDesc->BssQos.bdQoSMode & QOS_WMM) 1298 - // 1299 - 1300 - HTInitializeBssDesc (&bssDesc->BssHT); 1301 - 1302 - //2<1> Parse HTCap, and HTInfo 1303 - // Get HT Capability IE: (1) Get IEEE Draft N IE or (2) Get EWC IE 1304 - HTCapIE = PacketGetElement(mmpdu, EID_HTCapability, OUI_SUB_DONT_CARE, OUI_SUBTYPE_DONT_CARE); 1305 - if(HTCapIE.Length == 0) 1306 - { 1307 - HTCapIE = PacketGetElement(mmpdu, EID_Vendor, OUI_SUB_11N_EWC_HT_CAP, OUI_SUBTYPE_DONT_CARE); 1308 - if(HTCapIE.Length != 0) 1309 - bssDesc->BssHT.bdHTSpecVer= HT_SPEC_VER_EWC; 1310 - } 1311 - if(HTCapIE.Length != 0) 1312 - HTParsingHTCapElement(Adapter, HTCapIE, bssDesc); 1313 - 1314 - // Get HT Information IE: (1) Get IEEE Draft N IE or (2) Get EWC IE 1315 - HTInfoIE = PacketGetElement(mmpdu, EID_HTInfo, OUI_SUB_DONT_CARE, OUI_SUBTYPE_DONT_CARE); 1316 - if(HTInfoIE.Length == 0) 1317 - { 1318 - HTInfoIE = PacketGetElement(mmpdu, EID_Vendor, OUI_SUB_11N_EWC_HT_INFO, OUI_SUBTYPE_DONT_CARE); 1319 - if(HTInfoIE.Length != 0) 1320 - bssDesc->BssHT.bdHTSpecVer = HT_SPEC_VER_EWC; 1321 - } 1322 - if(HTInfoIE.Length != 0) 1323 - HTParsingHTInfoElement(Adapter, HTInfoIE, bssDesc); 1324 - 1325 - //2<2>If peer is HT, but not WMM, call QosSetLegacyWMMParamWithHT() 1326 - if(HTCapIE.Length != 0) 1327 - { 1328 - bssDesc->BssHT.bdSupportHT = true; 1329 - if(bssDesc->BssQos.bdQoSMode == QOS_DISABLE) 1330 - QosSetLegacyWMMParamWithHT(Adapter, bssDesc); 1331 - } 1332 - else 1333 - { 1334 - bssDesc->BssHT.bdSupportHT = false; 1335 - } 1336 - 1337 - //2<3>Check whether the peer is Realtek AP/STA 1338 - if(pHTInfo->bRegRT2RTAggregation) 1339 - { 1340 - if(bssDesc->BssHT.bdSupportHT) 1341 - { 1342 - HTRealtekAgg = PacketGetElement(mmpdu, EID_Vendor, OUI_SUB_REALTEK_AGG, OUI_SUBTYPE_DONT_CARE); 1343 - if(HTRealtekAgg.Length >=5 ) 1344 - { 1345 - bssDesc->BssHT.bdRT2RTAggregation = true; 1346 - 1347 - if((HTRealtekAgg.Octet[4]==1) && (HTRealtekAgg.Octet[5] & 0x02)) 1348 - bssDesc->BssHT.bdRT2RTLongSlotTime = true; 1349 - } 1350 - } 1351 - } 1352 - 1353 - // 1354 - // 2008/01/25 MH Get Broadcom AP IE for manamgent frame CCK rate problem. 1355 - // AP can not receive CCK managemtn from from 92E. 1356 - // 1357 - 1358 - // Initialize every new bss broadcom cap exist as false.. 1359 - bssDesc->bBroadcomCapExist= false; 1360 - 1361 - if(HTCapIE.Length != 0 || HTInfoIE.Length != 0) 1362 - { 1363 - u4Byte Length = 0; 1364 - 1365 - FillOctetString(BroadcomElement, NULL, 0); 1366 - 1367 - BroadcomElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_BROADCOM_IE_1, OUI_SUBTYPE_DONT_CARE); 1368 - Length += BroadcomElement.Length; 1369 - BroadcomElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_BROADCOM_IE_2, OUI_SUBTYPE_DONT_CARE); 1370 - Length += BroadcomElement.Length; 1371 - BroadcomElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_BROADCOM_IE_3, OUI_SUBTYPE_DONT_CARE); 1372 - Length += BroadcomElement.Length; 1373 - 1374 - if(Length > 0) 1375 - bssDesc->bBroadcomCapExist = true; 1376 - } 1377 - 1378 - 1379 - // For Cisco IOT issue 1380 - CiscoElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_CISCO_IE, OUI_SUBTYPE_DONT_CARE); 1381 - if(CiscoElement.Length != 0){ // 3: 0x00, 0x40, 0x96 .... 1382 - bssDesc->bCiscoCapExist = true; 1383 - }else{ 1384 - bssDesc->bCiscoCapExist = false; 1385 - } 1386 - } 1387 - 1388 - 1389 - #endif 1390 1281 /******************************************************************************************************************** 1391 1282 *function: initialize Bss HT structure(struct PBSS_HT) 1392 1283 * input: struct ieee80211_device *ieee ··· 1459 1712 pHTInfo->bSwBwInProgress = false; 1460 1713 } 1461 1714 1462 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 1463 - EXPORT_SYMBOL_NOVERS(HTUpdateSelfAndPeerSetting); 1464 - #else 1465 1715 EXPORT_SYMBOL(HTUpdateSelfAndPeerSetting); 1466 - #endif
-166
drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
··· 70 70 }ACK_POLICY,*PACK_POLICY; 71 71 72 72 #define WMM_PARAM_ELEMENT_SIZE (8+(4*AC_PARAM_SIZE)) 73 - #if 0 74 - #define GET_QOS_CTRL(_pStart) ReadEF2Byte((u8 *)(_pStart) + 24) 75 - #define SET_QOS_CTRL(_pStart, _value) WriteEF2Byte((u8 *)(_pStart) + 24, _value) 76 - 77 - // WMM control field. 78 - #define GET_QOS_CTRL_WMM_UP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 0, 3)) 79 - #define SET_QOS_CTRL_WMM_UP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 0, 3, (u8)(_value)) 80 - 81 - #define GET_QOS_CTRL_WMM_EOSP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 4, 1)) 82 - #define SET_QOS_CTRL_WMM_EOSP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 4, 1, (u8)(_value)) 83 - 84 - #define GET_QOS_CTRL_WMM_ACK_POLICY(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 5, 2)) 85 - #define SET_QOS_CTRL_WMM_ACK_POLICY(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 5, 2, (u8)(_value)) 86 - 87 - // 802.11e control field (by STA, data) 88 - #define GET_QOS_CTRL_STA_DATA_TID(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 0, 4)) 89 - #define SET_QOS_CTRL_STA_DATA_TID(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 0, 4, (u8)(_value)) 90 - 91 - #define GET_QOS_CTRL_STA_DATA_QSIZE_FLAG(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 4, 1)) 92 - #define SET_QOS_CTRL_STA_DATA_QSIZE_FLAG(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 4, 1, (u8)(_value)) 93 - 94 - #define GET_QOS_CTRL_STA_DATA_ACK_POLICY(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 5, 2)) 95 - #define SET_QOS_CTRL_STA_DATA_ACK_POLICY(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 5, 2, (u8)(_value)) 96 - 97 - #define GET_QOS_CTRL_STA_DATA_TXOP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 8, 8)) 98 - #define SET_QOS_CTRL_STA_DATA_TXOP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 8, 8, (u8)(_value)) 99 - 100 - #define GET_QOS_CTRL_STA_DATA_QSIZE(_pStart) GET_QOS_CTRL_STA_DATA_TXOP(_pStart) 101 - #define SET_QOS_CTRL_STA_DATA_QSIZE(_pStart, _value) SET_QOS_CTRL_STA_DATA_TXOP(_pStart) 102 - 103 - // 802.11e control field (by HC, data) 104 - #define GET_QOS_CTRL_HC_DATA_TID(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 0, 4)) 105 - #define SET_QOS_CTRL_HC_DATA_TID(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 0, 4, (u8)(_value)) 106 - 107 - #define GET_QOS_CTRL_HC_DATA_EOSP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 4, 1)) 108 - #define SET_QOS_CTRL_HC_DATA_EOSP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 4, 1, (u8)(_value)) 109 - 110 - #define GET_QOS_CTRL_HC_DATA_ACK_POLICY(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 5, 2)) 111 - #define SET_QOS_CTRL_HC_DATA_ACK_POLICY(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 5, 2, (u8)(_value)) 112 - 113 - #define GET_QOS_CTRL_HC_DATA_PS_BUFSTATE(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 8, 8)) 114 - #define SET_QOS_CTRL_HC_DATA_PS_BUFSTATE(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 8, 8, (u8)(_value)) 115 - 116 - // 802.11e control field (by HC, CFP) 117 - #define GET_QOS_CTRL_HC_CFP_TID(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 0, 4)) 118 - #define SET_QOS_CTRL_HC_CFP_TID(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 0, 4, (u8)(_value)) 119 - 120 - #define GET_QOS_CTRL_HC_CFP_EOSP(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 4, 1)) 121 - #define SET_QOS_CTRL_HC_CFP_EOSP(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 4, 1, (u8)(_value)) 122 - 123 - #define GET_QOS_CTRL_HC_CFP_ACK_POLICY(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 5, 2)) 124 - #define SET_QOS_CTRL_HC_CFP_ACK_POLICY(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 5, 2, (u8)(_value)) 125 - 126 - #define GET_QOS_CTRL_HC_CFP_TXOP_LIMIT(_pStart) ((u8)LE_BITS_TO_2BYTE((u8 *)(_pStart)+24, 8, 8)) 127 - #define SET_QOS_CTRL_HC_CFP_TXOP_LIMIT(_pStart, _value) SET_BITS_TO_LE_2BYTE((u8 *)(_pStart)+24, 8, 8, (u8)(_value)) 128 - 129 - #define SET_WMM_QOS_INFO_FIELD(_pStart, _val) WriteEF1Byte(_pStart, _val) 130 - 131 - #define GET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart) LE_BITS_TO_1BYTE(_pStart, 0, 4) 132 - #define SET_WMM_QOS_INFO_FIELD_PARAMETERSET_COUNT(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 0, 4, _val) 133 - 134 - #define GET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 7, 1) 135 - #define SET_WMM_QOS_INFO_FIELD_AP_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 7, 1, _val) 136 - 137 - #define GET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 0, 1) 138 - #define SET_WMM_QOS_INFO_FIELD_STA_AC_VO_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 0, 1, _val) 139 - 140 - #define GET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 1, 1) 141 - #define SET_WMM_QOS_INFO_FIELD_STA_AC_VI_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 1, 1, _val) 142 - 143 - #define GET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 2, 1) 144 - #define SET_WMM_QOS_INFO_FIELD_STA_AC_BE_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 2, 1, _val) 145 - 146 - #define GET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart) LE_BITS_TO_1BYTE(_pStart, 3, 1) 147 - #define SET_WMM_QOS_INFO_FIELD_STA_AC_BK_UAPSD(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 3, 1, _val) 148 - 149 - #define GET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart) LE_BITS_TO_1BYTE(_pStart, 5, 2) 150 - #define SET_WMM_QOS_INFO_FIELD_STA_MAX_SP_LEN(_pStart, _val) SET_BITS_TO_LE_1BYTE(_pStart, 5, 2, _val) 151 - 152 - 153 - #define WMM_INFO_ELEMENT_SIZE 7 154 - 155 - #define GET_WMM_INFO_ELE_OUI(_pStart) ((u8 *)(_pStart)) 156 - #define SET_WMM_INFO_ELE_OUI(_pStart, _pVal) PlatformMoveMemory(_pStart, _pVal, 3); 157 - 158 - #define GET_WMM_INFO_ELE_OUI_TYPE(_pStart) ( EF1Byte( *((u8 *)(_pStart)+3) ) ) 159 - #define SET_WMM_INFO_ELE_OUI_TYPE(_pStart, _val) ( *((u8 *)(_pStart)+3) = EF1Byte(_val) ) 160 - 161 - #define GET_WMM_INFO_ELE_OUI_SUBTYPE(_pStart) ( EF1Byte( *((u8 *)(_pStart)+4) ) ) 162 - #define SET_WMM_INFO_ELE_OUI_SUBTYPE(_pStart, _val) ( *((u8 *)(_pStart)+4) = EF1Byte(_val) ) 163 - 164 - #define GET_WMM_INFO_ELE_VERSION(_pStart) ( EF1Byte( *((u8 *)(_pStart)+5) ) ) 165 - #define SET_WMM_INFO_ELE_VERSION(_pStart, _val) ( *((u8 *)(_pStart)+5) = EF1Byte(_val) ) 166 - 167 - #define GET_WMM_INFO_ELE_QOS_INFO_FIELD(_pStart) ( EF1Byte( *((u8 *)(_pStart)+6) ) ) 168 - #define SET_WMM_INFO_ELE_QOS_INFO_FIELD(_pStart, _val) ( *((u8 *)(_pStart)+6) = EF1Byte(_val) ) 169 - 170 - 171 - 172 - #define GET_WMM_AC_PARAM_AIFSN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 0, 4) ) 173 - #define SET_WMM_AC_PARAM_AIFSN(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 0, 4, _val) 174 - 175 - #define GET_WMM_AC_PARAM_ACM(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 4, 1) ) 176 - #define SET_WMM_AC_PARAM_ACM(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 4, 1, _val) 177 - 178 - #define GET_WMM_AC_PARAM_ACI(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 5, 2) ) 179 - #define SET_WMM_AC_PARAM_ACI(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 5, 2, _val) 180 - 181 - #define GET_WMM_AC_PARAM_ACI_AIFSN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 0, 8) ) 182 - #define SET_WMM_AC_PARAM_ACI_AIFSN(_pStart, _val) SET_BTIS_TO_LE_4BYTE(_pStart, 0, 8, _val) 183 - 184 - #define GET_WMM_AC_PARAM_ECWMIN(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 8, 4) ) 185 - #define SET_WMM_AC_PARAM_ECWMIN(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 8, 4, _val) 186 - 187 - #define GET_WMM_AC_PARAM_ECWMAX(_pStart) ( (u8)LE_BITS_TO_4BYTE(_pStart, 12, 4) ) 188 - #define SET_WMM_AC_PARAM_ECWMAX(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 12, 4, _val) 189 - 190 - #define GET_WMM_AC_PARAM_TXOP_LIMIT(_pStart) ( (u16)LE_BITS_TO_4BYTE(_pStart, 16, 16) ) 191 - #define SET_WMM_AC_PARAM_TXOP_LIMIT(_pStart, _val) SET_BITS_TO_LE_4BYTE(_pStart, 16, 16, _val) 192 - 193 - 194 - 195 - 196 - #define GET_WMM_PARAM_ELE_OUI(_pStart) ((u8 *)(_pStart)) 197 - #define SET_WMM_PARAM_ELE_OUI(_pStart, _pVal) PlatformMoveMemory(_pStart, _pVal, 3) 198 - 199 - #define GET_WMM_PARAM_ELE_OUI_TYPE(_pStart) ( EF1Byte( *((u8 *)(_pStart)+3) ) ) 200 - #define SET_WMM_PARAM_ELE_OUI_TYPE(_pStart, _val) ( *((u8 *)(_pStart)+3) = EF1Byte(_val) ) 201 - 202 - #define GET_WMM_PARAM_ELE_OUI_SUBTYPE(_pStart) ( EF1Byte( *((u8 *)(_pStart)+4) ) ) 203 - #define SET_WMM_PARAM_ELE_OUI_SUBTYPE(_pStart, _val) ( *((u8 *)(_pStart)+4) = EF1Byte(_val) ) 204 - 205 - #define GET_WMM_PARAM_ELE_VERSION(_pStart) ( EF1Byte( *((u8 *)(_pStart)+5) ) ) 206 - #define SET_WMM_PARAM_ELE_VERSION(_pStart, _val) ( *((u8 *)(_pStart)+5) = EF1Byte(_val) ) 207 - 208 - #define GET_WMM_PARAM_ELE_QOS_INFO_FIELD(_pStart) ( EF1Byte( *((u8 *)(_pStart)+6) ) ) 209 - #define SET_WMM_PARAM_ELE_QOS_INFO_FIELD(_pStart, _val) ( *((u8 *)(_pStart)+6) = EF1Byte(_val) ) 210 - 211 - #define GET_WMM_PARAM_ELE_AC_PARAM(_pStart) ( (u8 *)(_pStart)+8 ) 212 - #define SET_WMM_PARAM_ELE_AC_PARAM(_pStart, _pVal) PlatformMoveMemory((_pStart)+8, _pVal, 16) 213 - #endif 214 73 215 74 // 216 75 // QoS Control Field ··· 220 361 221 362 }QOS_INFO_FIELD, *PQOS_INFO_FIELD; 222 363 223 - #if 0 224 - // 225 - // WMM Information Element 226 - // Ref: WMM spec 2.2.1: WME Information Element, p.10. 227 - // 228 - typedef struct _WMM_INFO_ELEMENT{ 229 - // u8 ElementID; 230 - // u8 Length; 231 - u8 OUI[3]; 232 - u8 OUI_Type; 233 - u8 OUI_SubType; 234 - u8 Version; 235 - QOS_INFO_FIELD QosInfo; 236 - }WMM_INFO_ELEMENT, *PWMM_INFO_ELEMENT; 237 - #endif 238 364 239 365 // 240 366 // ACI to AC coding. ··· 494 650 u8 *Octet; 495 651 u16 Length; 496 652 }OCTET_STRING, *POCTET_STRING; 497 - #if 0 498 - #define FillOctetString(_os,_octet,_len) \ 499 - (_os).Octet=(u8 *)(_octet); \ 500 - (_os).Length=(_len); 501 - 502 - #define WMM_ELEM_HDR_LEN 6 503 - #define WMMElemSkipHdr(_osWMMElem) \ 504 - (_osWMMElem).Octet += WMM_ELEM_HDR_LEN; \ 505 - (_osWMMElem).Length -= WMM_ELEM_HDR_LEN; 506 - #endif 507 653 // 508 654 // STA QoS data. 509 655 // Ref: DOT11_QOS in 8185 code. [def. in QoS_mp.h]
-26
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
··· 2 2 #include <linux/etherdevice.h> 3 3 #include "rtl819x_TS.h" 4 4 5 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 6 - #define list_for_each_entry_safe(pos, n, head, member) \ 7 - for (pos = list_entry((head)->next, typeof(*pos), member), \ 8 - n = list_entry(pos->member.next, typeof(*pos), member); \ 9 - &pos->member != (head); \ 10 - pos = n, n = list_entry(n->member.next, typeof(*n), member)) 11 - #endif 12 5 void TsSetupTimeOut(unsigned long data) 13 6 { 14 7 // Not implement yet ··· 21 28 * return: NULL 22 29 * notice: 23 30 ********************************************************************************************************************/ 24 - #if 1 25 31 void RxPktPendingTimeout(unsigned long data) 26 32 { 27 33 PRX_TS_RECORD pRxTs = (PRX_TS_RECORD)data; ··· 94 102 spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); 95 103 //PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK); 96 104 } 97 - #endif 98 105 99 106 /******************************************************************************************************************** 100 107 *function: Add BA timer function ··· 357 366 IEEE80211_DEBUG(IEEE80211_DL_ERR, "get TS for Broadcast or Multicast\n"); 358 367 return false; 359 368 } 360 - #if 0 361 - if(ieee->pStaQos->CurrentQosMode == QOS_DISABLE) 362 - { UP = 0; } //only use one TS 363 - else if(ieee->pStaQos->CurrentQosMode & QOS_WMM) 364 - { 365 - #else 366 369 if (ieee->current_network.qos_data.supported == 0) 367 370 UP = 0; 368 371 else 369 372 { 370 - #endif 371 373 // In WMM case: we use 4 TID only 372 374 if (!IsACValid(TID)) 373 375 { ··· 532 548 { 533 549 PTS_COMMON_INFO pTS, pTmpTS; 534 550 printk("===========>RemovePeerTS,"MAC_FMT"\n", MAC_ARG(Addr)); 535 - #if 1 536 551 list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) 537 552 { 538 553 if (memcmp(pTS->Addr, Addr, 6) == 0) ··· 572 589 list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); 573 590 } 574 591 } 575 - #endif 576 592 } 577 593 578 594 void RemoveAllTS(struct ieee80211_device* ieee) 579 595 { 580 596 PTS_COMMON_INFO pTS, pTmpTS; 581 - #if 1 582 597 list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, List) 583 598 { 584 599 RemoveTsEntry(ieee, pTS, TX_DIR); ··· 604 623 list_del_init(&pTS->List); 605 624 list_add_tail(&pTS->List, &ieee->Rx_TS_Unused_List); 606 625 } 607 - #endif 608 626 } 609 627 610 628 void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS) ··· 611 631 if(pTxTS->bAddBaReqInProgress == false) 612 632 { 613 633 pTxTS->bAddBaReqInProgress = true; 614 - #if 1 615 634 if(pTxTS->bAddBaReqDelayed) 616 635 { 617 636 IEEE80211_DEBUG(IEEE80211_DL_BA, "TsStartAddBaProcess(): Delayed Start ADDBA after 60 sec!!\n"); ··· 621 642 IEEE80211_DEBUG(IEEE80211_DL_BA,"TsStartAddBaProcess(): Immediately Start ADDBA now!!\n"); 622 643 mod_timer(&pTxTS->TsAddBaTimer, jiffies+10); //set 10 ticks 623 644 } 624 - #endif 625 645 } 626 646 else 627 647 IEEE80211_DEBUG(IEEE80211_DL_ERR, "%s()==>BA timer is already added\n", __FUNCTION__); 628 648 } 629 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 630 - EXPORT_SYMBOL_NOVERS(RemovePeerTS); 631 - #else 632 649 EXPORT_SYMBOL(RemovePeerTS); 633 - #endif
-104
drivers/staging/rtl8192u/r8192U.h
··· 39 39 #include <linux/random.h> 40 40 #include <linux/version.h> 41 41 #include <asm/io.h> 42 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) 43 - #include <asm/semaphore.h> 44 - #endif 45 42 #include "ieee80211.h" 46 43 47 44 #define RTL8192U ··· 84 87 85 88 // Rx smooth factor 86 89 #define Rx_Smooth_Factor 20 87 - #if 0 //we need to use RT_TRACE instead DMESG as RT_TRACE will clearly show debug level wb. 88 - #define DMESG(x,a...) printk(KERN_INFO RTL819xU_MODULE_NAME ": " x "\n", ## a) 89 - #define DMESGW(x,a...) printk(KERN_WARNING RTL819xU_MODULE_NAME ": WW:" x "\n", ## a) 90 - #define DMESGE(x,a...) printk(KERN_WARNING RTL819xU_MODULE_NAME ": EE:" x "\n", ## a) 91 - #else 92 90 #define DMESG(x,a...) 93 91 #define DMESGW(x,a...) 94 92 #define DMESGE(x,a...) ··· 133 141 #define COMP_DOWN BIT29 //for rm driver module 134 142 #define COMP_RESET BIT30 //for silent reset 135 143 #define COMP_ERR BIT31 //for error out, always on 136 - #endif 137 144 138 145 #define RTL819x_DEBUG 139 146 #ifdef RTL819x_DEBUG ··· 587 596 588 597 589 598 590 - #if 0 591 - 592 - typedef struct tx_pendingbuf 593 - { 594 - struct ieee80211_txb *txb; 595 - short ispending; 596 - short descfrag; 597 - } tx_pendigbuf; 598 - 599 - #endif 600 599 601 600 typedef struct _rt_9x_tx_rate_history { 602 601 u32 cck[4]; ··· 914 933 spinlock_t irq_lock; 915 934 // spinlock_t irq_th_lock; 916 935 spinlock_t tx_lock; 917 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) 918 - struct semaphore mutex; 919 - #else 920 936 struct mutex mutex; 921 - #endif 922 937 //spinlock_t rf_lock; //used to lock rf write operation added by wb 923 938 924 939 u16 irq_mask; ··· 984 1007 /* modified by davad for Rx process */ 985 1008 struct sk_buff_head rx_queue; 986 1009 struct sk_buff_head skb_queue; 987 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 988 - struct tq_struct qos_activate; 989 - #else 990 1010 struct work_struct qos_activate; 991 - #endif 992 1011 short tx_urb_index; 993 1012 atomic_t tx_pending[0x10];//UART_PRIORITY+1 994 1013 ··· 1014 1041 u16 rts; 1015 1042 1016 1043 struct ChnlAccessSetting ChannelAccessSetting; 1017 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1018 1044 struct work_struct reset_wq; 1019 - #else 1020 - struct tq_struct reset_wq; 1021 - #endif 1022 1045 1023 1046 /**********************************************************/ 1024 1047 //for rtl819xUsb ··· 1163 1194 u16 SifsTime; 1164 1195 1165 1196 //define work item by amy 080526 1166 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1167 1197 1168 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 1169 1198 struct delayed_work update_beacon_wq; 1170 1199 struct delayed_work watch_dog_wq; 1171 1200 struct delayed_work txpower_tracking_wq; 1172 1201 struct delayed_work rfpath_check_wq; 1173 1202 struct delayed_work gpio_change_rf_wq; 1174 1203 struct delayed_work initialgain_operate_wq; 1175 - #else 1176 - struct work_struct update_beacon_wq; 1177 - struct work_struct watch_dog_wq; 1178 - struct work_struct txpower_tracking_wq; 1179 - struct work_struct rfpath_check_wq; 1180 - struct work_struct gpio_change_rf_wq; 1181 - struct work_struct initialgain_operate_wq; 1182 - #endif 1183 1204 struct workqueue_struct *priv_wq; 1184 - #else 1185 - /* used for periodly scan */ 1186 - struct tq_struct update_beacon_wq; 1187 - struct tq_struct txpower_tracking_wq; 1188 - struct tq_struct rfpath_check_wq; 1189 - struct tq_struct watch_dog_wq; 1190 - struct tq_struct gpio_change_rf_wq; 1191 - struct tq_struct initialgain_operate_wq; 1192 - #endif 1193 1205 }r8192_priv; 1194 1206 1195 1207 // for rtl8187 ··· 1209 1259 } nic_t; 1210 1260 1211 1261 1212 - #if 0 //defined in Qos.h 1213 - //typedef u32 AC_CODING; 1214 - #define AC0_BE 0 // ACI: 0x00 // Best Effort 1215 - #define AC1_BK 1 // ACI: 0x01 // Background 1216 - #define AC2_VI 2 // ACI: 0x10 // Video 1217 - #define AC3_VO 3 // ACI: 0x11 // Voice 1218 - #define AC_MAX 4 // Max: define total number; Should not to be used as a real enum. 1219 - 1220 - // 1221 - // ECWmin/ECWmax field. 1222 - // Ref: WMM spec 2.2.2: WME Parameter Element, p.13. 1223 - // 1224 - typedef union _ECW{ 1225 - u8 charData; 1226 - struct 1227 - { 1228 - u8 ECWmin:4; 1229 - u8 ECWmax:4; 1230 - }f; // Field 1231 - }ECW, *PECW; 1232 - 1233 - // 1234 - // ACI/AIFSN Field. 1235 - // Ref: WMM spec 2.2.2: WME Parameter Element, p.12. 1236 - // 1237 - typedef union _ACI_AIFSN{ 1238 - u8 charData; 1239 - 1240 - struct 1241 - { 1242 - u8 AIFSN:4; 1243 - u8 ACM:1; 1244 - u8 ACI:2; 1245 - u8 Reserved:1; 1246 - }f; // Field 1247 - }ACI_AIFSN, *PACI_AIFSN; 1248 - 1249 - // 1250 - // AC Parameters Record Format. 1251 - // Ref: WMM spec 2.2.2: WME Parameter Element, p.12. 1252 - // 1253 - typedef union _AC_PARAM{ 1254 - u32 longData; 1255 - u8 charData[4]; 1256 - 1257 - struct 1258 - { 1259 - ACI_AIFSN AciAifsn; 1260 - ECW Ecw; 1261 - u16 TXOPLimit; 1262 - }f; // Field 1263 - }AC_PARAM, *PAC_PARAM; 1264 - 1265 - #endif 1266 1262 #ifdef JOHN_HWSEC 1267 1263 struct ssid_thread { 1268 1264 struct net_device *dev;
-1083
drivers/staging/rtl8192u/r8192U_core.c
··· 71 71 //#include "r8192xU_phyreg.h" 72 72 #include <linux/usb.h> 73 73 // FIXME: check if 2.6.7 is ok 74 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7)) 75 - #define usb_kill_urb usb_unlink_urb 76 - #endif 77 74 78 75 #ifdef CONFIG_RTL8192_PM 79 76 #include "r8192_pm.h" ··· 124 127 }; 125 128 126 129 MODULE_LICENSE("GPL"); 127 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) 128 130 MODULE_VERSION("V 1.1"); 129 - #endif 130 131 MODULE_DEVICE_TABLE(usb, rtl8192_usb_id_tbl); 131 132 MODULE_DESCRIPTION("Linux driver for Realtek RTL8192 USB WiFi cards"); 132 133 133 134 static char* ifname = "wlan%d"; 134 - #if 0 135 - static int hwseqnum = 0; 136 - static int hwwep = 0; 137 - #endif 138 135 static int hwwep = 1; //default use hw. set 0 to use software security 139 136 static int channels = 0x3fff; 140 137 141 138 142 139 143 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9) 144 140 module_param(ifname, charp, S_IRUGO|S_IWUSR ); 145 141 //module_param(hwseqnum,int, S_IRUGO|S_IWUSR); 146 142 module_param(hwwep,int, S_IRUGO|S_IWUSR); 147 143 module_param(channels,int, S_IRUGO|S_IWUSR); 148 - #else 149 - MODULE_PARM(ifname, "s"); 150 - //MODULE_PARM(hwseqnum,"i"); 151 - MODULE_PARM(hwwep,"i"); 152 - MODULE_PARM(channels,"i"); 153 - #endif 154 144 155 145 MODULE_PARM_DESC(ifname," Net interface name, wlan%d=default"); 156 146 //MODULE_PARM_DESC(hwseqnum," Try to use hardware 802.11 header sequence numbers. Zero=default"); 157 147 MODULE_PARM_DESC(hwwep," Try to use hardware security support. "); 158 148 MODULE_PARM_DESC(channels," Channel bitmask for specific locales. NYI"); 159 149 160 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 161 150 static int __devinit rtl8192_usb_probe(struct usb_interface *intf, 162 151 const struct usb_device_id *id); 163 152 static void __devexit rtl8192_usb_disconnect(struct usb_interface *intf); 164 - #else 165 - static void *__devinit rtl8192_usb_probe(struct usb_device *udev,unsigned int ifnum, 166 - const struct usb_device_id *id); 167 - static void __devexit rtl8192_usb_disconnect(struct usb_device *udev, void *ptr); 168 - #endif 169 153 170 154 171 155 static struct usb_driver rtl8192_usb_driver = { 172 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 15) 173 - .owner = THIS_MODULE, 174 - #endif 175 156 .name = RTL819xU_MODULE_NAME, /* Driver name */ 176 157 .id_table = rtl8192_usb_id_tbl, /* PCI_ID table */ 177 158 .probe = rtl8192_usb_probe, /* probe fn */ 178 159 .disconnect = rtl8192_usb_disconnect, /* remove fn */ 179 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0) 180 160 #ifdef CONFIG_RTL8192_PM 181 161 .suspend = rtl8192_suspend, /* PM suspend fn */ 182 162 .resume = rtl8192_resume, /* PM resume fn */ 183 163 #else 184 164 .suspend = NULL, /* PM suspend fn */ 185 165 .resume = NULL, /* PM resume fn */ 186 - #endif 187 166 #endif 188 167 }; 189 168 ··· 253 280 254 281 void CamResetAllEntry(struct net_device *dev) 255 282 { 256 - #if 1 257 283 u32 ulcommand = 0; 258 284 //2004/02/11 In static WEP, OID_ADD_KEY or OID_ADD_WEP are set before STA associate to AP. 259 285 // However, ResetKey is called on OID_802_11_INFRASTRUCTURE_MODE and MlmeAssociateRequest ··· 265 293 //DbgPrint("========================================\n\n"); 266 294 ulcommand |= BIT31|BIT30; 267 295 write_nic_dword(dev, RWCAM, ulcommand); 268 - #else 269 - for(ucIndex=0;ucIndex<TOTAL_CAM_ENTRY;ucIndex++) 270 - CAM_mark_invalid(dev, ucIndex); 271 - for(ucIndex=0;ucIndex<TOTAL_CAM_ENTRY;ucIndex++) 272 - CAM_empty_entry(dev, ucIndex); 273 - #endif 274 296 275 297 } 276 298 ··· 479 513 static struct net_device_stats *rtl8192_stats(struct net_device *dev); 480 514 void rtl8192_commit(struct net_device *dev); 481 515 //void rtl8192_restart(struct net_device *dev); 482 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 483 516 void rtl8192_restart(struct work_struct *work); 484 517 //void rtl8192_rq_tx_ack(struct work_struct *work); 485 - #else 486 - void rtl8192_restart(struct net_device *dev); 487 - // //void rtl8192_rq_tx_ack(struct net_device *dev); 488 - #endif 489 518 490 519 void watch_dog_timer_callback(unsigned long data); 491 520 ··· 551 590 552 591 // printk("%2x ",read_nic_byte(dev,n)); 553 592 } 554 - #if 1 555 593 len += snprintf(page + len, count - len, 556 594 "\n####################page 1##################\n "); 557 595 for(n=0;n<=max;) ··· 580 620 // printk("%2x ",read_nic_byte(dev,n)); 581 621 } 582 622 583 - #endif 584 623 585 624 len += snprintf(page + len, count - len,"\n"); 586 625 *eof = 1; ··· 588 629 } 589 630 590 631 591 - #if 0 592 - static int proc_get_cck_reg(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 - int i,n; 601 - 602 - int max = 0x5F; 603 - 604 - /* This dump the current register page */ 605 - for(n=0;n<=max;) 606 - { 607 - //printk( "\nD: %2x> ", n); 608 - len += snprintf(page + len, count - len, 609 - "\nD: %2x > ",n); 610 - 611 - for(i=0;i<16 && n<=max;i++,n++) 612 - len += snprintf(page + len, count - len, 613 - "%2x ",read_phy_cck(dev,n)); 614 - 615 - // printk("%2x ",read_nic_byte(dev,n)); 616 - } 617 - len += snprintf(page + len, count - len,"\n"); 618 632 619 633 620 - *eof = 1; 621 - return len; 622 - } 623 - 624 - #endif 625 - 626 - #if 0 627 - static int proc_get_ofdm_reg(char *page, char **start, 628 - off_t offset, int count, 629 - int *eof, void *data) 630 - { 631 - struct net_device *dev = data; 632 - // struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 633 - 634 - int len = 0; 635 - int i,n; 636 - 637 - //int max=0xff; 638 - int max = 0x40; 639 - 640 - /* This dump the current register page */ 641 - for(n=0;n<=max;) 642 - { 643 - //printk( "\nD: %2x> ", n); 644 - len += snprintf(page + len, count - len, 645 - "\nD: %2x > ",n); 646 - 647 - for(i=0;i<16 && n<=max;i++,n++) 648 - len += snprintf(page + len, count - len, 649 - "%2x ",read_phy_ofdm(dev,n)); 650 - 651 - // printk("%2x ",read_nic_byte(dev,n)); 652 - } 653 - len += snprintf(page + len, count - len,"\n"); 654 - 655 - 656 - 657 - *eof = 1; 658 - return len; 659 - } 660 - 661 - #endif 662 - 663 - #if 0 664 - static int proc_get_stats_hw(char *page, char **start, 665 - off_t offset, int count, 666 - int *eof, void *data) 667 - { 668 - struct net_device *dev = data; 669 - struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 670 - 671 - int len = 0; 672 - 673 - len += snprintf(page + len, count - len, 674 - "NIC int: %lu\n" 675 - "Total int: %lu\n", 676 - priv->stats.ints, 677 - priv->stats.shints); 678 - 679 - *eof = 1; 680 - return len; 681 - } 682 - #endif 683 634 684 635 static int proc_get_stats_tx(char *page, char **start, 685 636 off_t offset, int count, ··· 687 818 *eof = 1; 688 819 return len; 689 820 } 690 - #if 0 691 - #if WIRELESS_EXT >= 12 && WIRELESS_EXT < 17 692 - 693 - static struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev) 694 - { 695 - struct r8192_priv *priv = ieee80211_priv(dev); 696 - 697 - return &priv->wstats; 698 - } 699 - #endif 700 - #endif 701 821 void rtl8192_proc_module_init(void) 702 822 { 703 823 RT_TRACE(COMP_INIT, "Initializing proc filesystem"); 704 - #if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) 705 - rtl8192_proc=create_proc_entry(RTL819xU_MODULE_NAME, S_IFDIR, proc_net); 706 - #else 707 824 rtl8192_proc=create_proc_entry(RTL819xU_MODULE_NAME, S_IFDIR, init_net.proc_net); 708 - #endif 709 825 } 710 826 711 827 712 828 void rtl8192_proc_module_remove(void) 713 829 { 714 - #if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) 715 - remove_proc_entry(RTL819xU_MODULE_NAME, proc_net); 716 - #else 717 830 remove_proc_entry(RTL819xU_MODULE_NAME, init_net.proc_net); 718 - #endif 719 831 } 720 832 721 833 ··· 733 883 dev->name); 734 884 return; 735 885 } 736 - #if 0 737 - e = create_proc_read_entry("stats-hw", S_IFREG | S_IRUGO, 738 - priv->dir_dev, proc_get_stats_hw, dev); 739 - 740 - if (!e) { 741 - DMESGE("Unable to initialize " 742 - "/proc/net/rtl8192/%s/stats-hw\n", 743 - dev->name); 744 - } 745 - #endif 746 886 e = create_proc_read_entry("stats-rx", S_IFREG | S_IRUGO, 747 887 priv->dir_dev, proc_get_stats_rx, dev); 748 888 ··· 751 911 "/proc/net/rtl8192/%s/stats-tx\n", 752 912 dev->name); 753 913 } 754 - #if 0 755 - e = create_proc_read_entry("stats-ieee", S_IFREG | S_IRUGO, 756 - priv->dir_dev, proc_get_stats_ieee, dev); 757 - 758 - if (!e) { 759 - DMESGE("Unable to initialize " 760 - "/proc/net/rtl8192/%s/stats-ieee\n", 761 - dev->name); 762 - } 763 - 764 - #endif 765 914 766 915 e = create_proc_read_entry("stats-ap", S_IFREG | S_IRUGO, 767 916 priv->dir_dev, proc_get_stats_ap, dev); ··· 768 939 "/proc/net/rtl8192/%s/registers\n", 769 940 dev->name); 770 941 } 771 - #if 0 772 - e = create_proc_read_entry("cck-registers", S_IFREG | S_IRUGO, 773 - priv->dir_dev, proc_get_cck_reg, dev); 774 - if (!e) { 775 - RT_TRACE(COMP_ERR, "Unable to initialize " 776 - "/proc/net/rtl8192/%s/cck-registers\n", 777 - dev->name); 778 - } 779 - 780 - e = create_proc_read_entry("ofdm-registers", S_IFREG | S_IRUGO, 781 - priv->dir_dev, proc_get_ofdm_reg, dev); 782 - if (!e) { 783 - RT_TRACE(COMP_ERR, "Unable to initialize " 784 - "/proc/net/rtl8192/%s/ofdm-registers\n", 785 - dev->name); 786 - } 787 - #endif 788 942 } 789 943 /**************************************************************************** 790 944 -----------------------------MISC STUFF------------------------- ··· 806 994 struct r8192_priv *priv = ieee80211_priv(dev); 807 995 //rtl8192_commit(dev); 808 996 809 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) 810 997 schedule_work(&priv->reset_wq); 811 - #else 812 - schedule_task(&priv->reset_wq); 813 - #endif 814 998 //DMESG("TXTIMEOUT"); 815 999 } 816 1000 ··· 841 1033 ------------------------------HW STUFF--------------------------- 842 1034 *****************************************************************************/ 843 1035 844 - #if 0 845 - void rtl8192_irq_enable(struct net_device *dev) 846 - { 847 - struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 848 - //priv->irq_enabled = 1; 849 - /* 850 - write_nic_word(dev,INTA_MASK,INTA_RXOK | INTA_RXDESCERR | INTA_RXOVERFLOW |\ 851 - INTA_TXOVERFLOW | INTA_HIPRIORITYDESCERR | INTA_HIPRIORITYDESCOK |\ 852 - INTA_NORMPRIORITYDESCERR | INTA_NORMPRIORITYDESCOK |\ 853 - INTA_LOWPRIORITYDESCERR | INTA_LOWPRIORITYDESCOK | INTA_TIMEOUT); 854 - */ 855 - write_nic_word(dev,INTA_MASK, priv->irq_mask); 856 - } 857 - 858 - 859 - void rtl8192_irq_disable(struct net_device *dev) 860 - { 861 - // struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 862 - 863 - write_nic_word(dev,INTA_MASK,0); 864 - force_pci_posting(dev); 865 - // priv->irq_enabled = 0; 866 - } 867 - #endif 868 1036 869 1037 void rtl8192_set_mode(struct net_device *dev,int mode) 870 1038 { ··· 888 1104 // u32 tx; 889 1105 RT_TRACE(COMP_CH, "=====>%s()====ch:%d\n", __FUNCTION__, ch); 890 1106 priv->chan=ch; 891 - #if 0 892 - if(priv->ieee80211->iw_mode == IW_MODE_ADHOC || 893 - priv->ieee80211->iw_mode == IW_MODE_MASTER){ 894 - 895 - priv->ieee80211->link_state = WLAN_LINK_ASSOCIATED; 896 - priv->ieee80211->master_chan = ch; 897 - rtl8192_update_beacon_ch(dev); 898 - } 899 - #endif 900 1107 901 1108 /* this hack should avoid frame TX during channel setting*/ 902 1109 ··· 907 1132 #endif 908 1133 } 909 1134 910 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) 911 - static void rtl8192_rx_isr(struct urb *urb, struct pt_regs *regs); 912 - #else 913 1135 static void rtl8192_rx_isr(struct urb *urb); 914 - #endif 915 1136 //static void rtl8192_rx_isr(struct urb *rx_urb); 916 1137 917 1138 u32 get_rxpacket_shiftbytes_819xusb(struct ieee80211_rx_stats *pstats) ··· 935 1164 skb = __dev_alloc_skb(RX_URB_SIZE, GFP_KERNEL); 936 1165 if (!skb) 937 1166 break; 938 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 939 1167 entry = usb_alloc_urb(0, GFP_KERNEL); 940 - #else 941 - entry = usb_alloc_urb(0); 942 - #endif 943 1168 if (!entry) { 944 1169 kfree_skb(skb); 945 1170 break; ··· 958 1191 skb = __dev_alloc_skb(RX_URB_SIZE ,GFP_KERNEL); 959 1192 if (!skb) 960 1193 break; 961 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 962 1194 entry = usb_alloc_urb(0, GFP_KERNEL); 963 - #else 964 - entry = usb_alloc_urb(0); 965 - #endif 966 1195 if (!entry) { 967 1196 kfree_skb(skb); 968 1197 break; ··· 1040 1277 rtl8192_rx_initiate(dev); 1041 1278 1042 1279 // rtl8192_set_rxconf(dev); 1043 - #if 0 1044 - if(NIC_8187 == priv->card_8187) { 1045 - cmd=read_nic_byte(dev,CMD); 1046 - write_nic_byte(dev,CMD,cmd | (1<<CMD_RX_ENABLE_SHIFT)); 1047 - } 1048 - else { 1049 - //write_nic_dword(dev, RX_CONF, priv->ReceiveConfig); 1050 - } 1051 - #endif 1052 1280 } 1053 1281 1054 1282 1055 1283 void rtl8192_tx_enable(struct net_device *dev) 1056 1284 { 1057 - #if 0 1058 - u8 cmd; 1059 - u8 byte; 1060 - u32 txconf; 1061 - struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 1062 - //test loopback 1063 - // priv->TransmitConfig |= (TX_LOOPBACK_BASEBAND<<TX_LOOPBACK_SHIFT); 1064 - if(NIC_8187B == priv->card_8187){ 1065 - write_nic_dword(dev, TX_CONF, priv->TransmitConfig); 1066 - byte = read_nic_byte(dev, MSR); 1067 - byte |= MSR_LINK_ENEDCA; 1068 - write_nic_byte(dev, MSR, byte); 1069 - } else { 1070 - byte = read_nic_byte(dev,CW_CONF); 1071 - byte &= ~(1<<CW_CONF_PERPACKET_CW_SHIFT); 1072 - byte &= ~(1<<CW_CONF_PERPACKET_RETRY_SHIFT); 1073 - write_nic_byte(dev, CW_CONF, byte); 1074 - 1075 - byte = read_nic_byte(dev, TX_AGC_CTL); 1076 - byte &= ~(1<<TX_AGC_CTL_PERPACKET_GAIN_SHIFT); 1077 - byte &= ~(1<<TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT); 1078 - byte &= ~(1<<TX_AGC_CTL_FEEDBACK_ANT); 1079 - write_nic_byte(dev, TX_AGC_CTL, byte); 1080 - 1081 - txconf= read_nic_dword(dev,TX_CONF); 1082 - 1083 - 1084 - txconf = txconf &~ TX_LOOPBACK_MASK; 1085 - 1086 - #ifndef LOOP_TEST 1087 - txconf = txconf | (TX_LOOPBACK_NONE<<TX_LOOPBACK_SHIFT); 1088 - #else 1089 - txconf = txconf | (TX_LOOPBACK_BASEBAND<<TX_LOOPBACK_SHIFT); 1090 - #endif 1091 - txconf = txconf &~ TCR_SRL_MASK; 1092 - txconf = txconf &~ TCR_LRL_MASK; 1093 - 1094 - txconf = txconf | (priv->retry_data<<TX_LRLRETRY_SHIFT); // long 1095 - txconf = txconf | (priv->retry_rts<<TX_SRLRETRY_SHIFT); // short 1096 - 1097 - txconf = txconf &~ (1<<TX_NOCRC_SHIFT); 1098 - 1099 - txconf = txconf &~ TCR_MXDMA_MASK; 1100 - txconf = txconf | (TCR_MXDMA_2048<<TCR_MXDMA_SHIFT); 1101 - 1102 - txconf = txconf | TCR_DISReqQsize; 1103 - txconf = txconf | TCR_DISCW; 1104 - txconf = txconf &~ TCR_SWPLCPLEN; 1105 - 1106 - txconf=txconf | (1<<TX_NOICV_SHIFT); 1107 - 1108 - write_nic_dword(dev,TX_CONF,txconf); 1109 - 1110 - #ifdef DEBUG_TX 1111 - DMESG("txconf: %x %x",txconf,read_nic_dword(dev,TX_CONF)); 1112 - #endif 1113 - 1114 - cmd=read_nic_byte(dev,CMD); 1115 - write_nic_byte(dev,CMD,cmd | (1<<CMD_TX_ENABLE_SHIFT)); 1116 - } 1117 - #endif 1118 1285 } 1119 1286 1120 - #if 0 1121 - void rtl8192_beacon_tx_enable(struct net_device *dev) 1122 - { 1123 - struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 1124 - priv->dma_poll_mask &=~(1<<TX_DMA_STOP_BEACON_SHIFT); 1125 - rtl8192_set_mode(dev,EPROM_CMD_CONFIG); 1126 - write_nic_byte(dev,TX_DMA_POLLING,priv->dma_poll_mask); 1127 - rtl8192_set_mode(dev,EPROM_CMD_NORMAL); 1128 - } 1129 - 1130 - 1131 - void rtl8192_ 1132 - _disable(struct net_device *dev) 1133 - { 1134 - struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 1135 - priv->dma_poll_mask |= (1<<TX_DMA_STOP_BEACON_SHIFT); 1136 - rtl8192_set_mode(dev,EPROM_CMD_CONFIG); 1137 - write_nic_byte(dev,TX_DMA_POLLING,priv->dma_poll_mask); 1138 - rtl8192_set_mode(dev,EPROM_CMD_NORMAL); 1139 - } 1140 - 1141 - #endif 1142 1287 1143 1288 1144 1289 void rtl8192_rtx_disable(struct net_device *dev) ··· 1082 1411 1083 1412 int alloc_tx_beacon_desc_ring(struct net_device *dev, int count) 1084 1413 { 1085 - #if 0 1086 - int i; 1087 - u32 *tmp; 1088 - struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 1089 - 1090 - priv->txbeaconring = (u32*)pci_alloc_consistent(priv->pdev, 1091 - sizeof(u32)*8*count, 1092 - &priv->txbeaconringdma); 1093 - if (!priv->txbeaconring) return -1; 1094 - for (tmp=priv->txbeaconring,i=0;i<count;i++){ 1095 - *tmp = *tmp &~ (1<<31); // descriptor empty, owned by the drv 1096 - /* 1097 - *(tmp+2) = (u32)dma_tmp; 1098 - *(tmp+3) = bufsize; 1099 - */ 1100 - if(i+1<count) 1101 - *(tmp+4) = (u32)priv->txbeaconringdma+((i+1)*8*4); 1102 - else 1103 - *(tmp+4) = (u32)priv->txbeaconringdma; 1104 - 1105 - tmp=tmp+8; 1106 - } 1107 - #endif 1108 1414 return 0; 1109 1415 } 1110 1416 1111 - #if 0 1112 - void rtl8192_reset(struct net_device *dev) 1113 - { 1114 - 1115 - //struct r8192_priv *priv = ieee80211_priv(dev); 1116 - //u8 cr; 1117 - 1118 - 1119 - /* make sure the analog power is on before 1120 - * reset, otherwise reset may fail 1121 - */ 1122 - #if 0 1123 - if(NIC_8187 == priv->card_8187) { 1124 - rtl8192_set_anaparam(dev, RTL8225_ANAPARAM_ON); 1125 - rtl8185_set_anaparam2(dev, RTL8225_ANAPARAM2_ON); 1126 - rtl8192_irq_disable(dev); 1127 - mdelay(200); 1128 - write_nic_byte_E(dev,0x18,0x10); 1129 - write_nic_byte_E(dev,0x18,0x11); 1130 - write_nic_byte_E(dev,0x18,0x00); 1131 - mdelay(200); 1132 - } 1133 - #endif 1134 - printk("=====>reset?\n"); 1135 - #if 0 1136 - cr=read_nic_byte(dev,CMD); 1137 - cr = cr & 2; 1138 - cr = cr | (1<<CMD_RST_SHIFT); 1139 - write_nic_byte(dev,CMD,cr); 1140 - 1141 - force_pci_posting(dev); 1142 - 1143 - mdelay(200); 1144 - 1145 - if(read_nic_byte(dev,CMD) & (1<<CMD_RST_SHIFT)) 1146 - RT_TRACE(COMP_ERR, "Card reset timeout!\n"); 1147 - else 1148 - RT_TRACE(COMP_DOWN, "Card successfully reset\n"); 1149 - #endif 1150 - #if 0 1151 - if(NIC_8187 == priv->card_8187) { 1152 - 1153 - printk("This is RTL8187 Reset procedure\n"); 1154 - rtl8192_set_mode(dev,EPROM_CMD_LOAD); 1155 - force_pci_posting(dev); 1156 - mdelay(200); 1157 - 1158 - /* after the eeprom load cycle, make sure we have 1159 - * correct anaparams 1160 - */ 1161 - rtl8192_set_anaparam(dev, RTL8225_ANAPARAM_ON); 1162 - rtl8185_set_anaparam2(dev, RTL8225_ANAPARAM2_ON); 1163 - } 1164 - else 1165 - #endif 1166 - printk("This is RTL8187B Reset procedure\n"); 1167 - 1168 - } 1169 - #endif 1170 1417 inline u16 ieeerate2rtlrate(int rate) 1171 1418 { 1172 1419 switch(rate){ ··· 1126 1537 1127 1538 1128 1539 /* The protype of rx_isr has changed since one verion of Linux Kernel */ 1129 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) 1130 - static void rtl8192_rx_isr(struct urb *urb, struct pt_regs *regs) 1131 - #else 1132 1540 static void rtl8192_rx_isr(struct urb *urb) 1133 - #endif 1134 1541 { 1135 1542 struct sk_buff *skb = (struct sk_buff *) urb->context; 1136 1543 struct rtl8192_rx_info *info = (struct rtl8192_rx_info *)skb->cb; ··· 1144 1559 // printk("%s():rx status err\n",__FUNCTION__); 1145 1560 return; 1146 1561 } 1147 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14) 1148 1562 skb_unlink(skb, &priv->rx_queue); 1149 - #else 1150 - __skb_unlink(skb,&priv->rx_queue); 1151 - #endif 1152 1563 skb_put(skb, urb->actual_length); 1153 1564 1154 1565 skb_queue_tail(&priv->skb_queue, skb); ··· 1199 1618 return status; 1200 1619 } 1201 1620 1202 - #if 0 1203 - void rtl8192_tx_queues_stop(struct net_device *dev) 1204 - { 1205 - //struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 1206 - u8 dma_poll_mask = (1<<TX_DMA_STOP_LOWPRIORITY_SHIFT); 1207 - dma_poll_mask |= (1<<TX_DMA_STOP_HIPRIORITY_SHIFT); 1208 - dma_poll_mask |= (1<<TX_DMA_STOP_NORMPRIORITY_SHIFT); 1209 - dma_poll_mask |= (1<<TX_DMA_STOP_BEACON_SHIFT); 1210 - 1211 - rtl8192_set_mode(dev,EPROM_CMD_CONFIG); 1212 - write_nic_byte(dev,TX_DMA_POLLING,dma_poll_mask); 1213 - rtl8192_set_mode(dev,EPROM_CMD_NORMAL); 1214 - } 1215 - #endif 1216 1621 1217 1622 void rtl8192_data_hard_stop(struct net_device *dev) 1218 1623 { 1219 1624 //FIXME !! 1220 - #if 0 1221 - struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 1222 - priv->dma_poll_mask |= (1<<TX_DMA_STOP_LOWPRIORITY_SHIFT); 1223 - rtl8192_set_mode(dev,EPROM_CMD_CONFIG); 1224 - write_nic_byte(dev,TX_DMA_POLLING,priv->dma_poll_mask); 1225 - rtl8192_set_mode(dev,EPROM_CMD_NORMAL); 1226 - #endif 1227 1625 } 1228 1626 1229 1627 1230 1628 void rtl8192_data_hard_resume(struct net_device *dev) 1231 1629 { 1232 1630 // FIXME !! 1233 - #if 0 1234 - struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 1235 - priv->dma_poll_mask &= ~(1<<TX_DMA_STOP_LOWPRIORITY_SHIFT); 1236 - rtl8192_set_mode(dev,EPROM_CMD_CONFIG); 1237 - write_nic_byte(dev,TX_DMA_POLLING,priv->dma_poll_mask); 1238 - rtl8192_set_mode(dev,EPROM_CMD_NORMAL); 1239 - #endif 1240 1631 } 1241 1632 1242 1633 /* this function TX data frames when the ieee80211 stack requires this. ··· 1292 1739 u8 MapHwQueueToFirmwareQueue(u8 QueueID); 1293 1740 struct sk_buff *DrvAggr_Aggregation(struct net_device *dev, struct ieee80211_drv_agg_txb *pSendList) 1294 1741 { 1295 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) 1296 1742 struct ieee80211_device *ieee = netdev_priv(dev); 1297 - #else 1298 - struct ieee80211_device *ieee = (struct ieee80211_device *)dev->priv; 1299 - #endif 1300 1743 struct r8192_priv *priv = ieee80211_priv(dev); 1301 1744 cb_desc *tcb_desc = NULL; 1302 1745 u8 i; ··· 1403 1854 /*DWORD 1*/ 1404 1855 tx_agg_desc->SecCAMID= 0; 1405 1856 tx_agg_desc->RATid = tcb_desc->RATRIndex; 1406 - #if 0 1407 - /* Fill security related */ 1408 - if( pTcb->bEncrypt && !Adapter->MgntInfo.SecurityInfo.SWTxEncryptFlag) 1409 - { 1410 - EncAlg = SecGetEncryptionOverhead( 1411 - Adapter, 1412 - &EncryptionMPDUHeadOverhead, 1413 - &EncryptionMPDUTailOverhead, 1414 - NULL, 1415 - NULL, 1416 - FALSE, 1417 - FALSE); 1418 - //2004/07/22, kcwu, EncryptionMPDUHeadOverhead has been added in previous code 1419 - //MPDUOverhead = EncryptionMPDUHeadOverhead + EncryptionMPDUTailOverhead; 1420 - MPDUOverhead = EncryptionMPDUTailOverhead; 1421 - tx_agg_desc->NoEnc = 0; 1422 - RT_TRACE(COMP_SEC, DBG_LOUD, ("******We in the loop SecCAMID is %d SecDescAssign is %d The Sec is %d********\n",tx_agg_desc->SecCAMID,tx_agg_desc->SecDescAssign,EncAlg)); 1423 - //CamDumpAll(Adapter); 1424 - } 1425 - else 1426 - #endif 1427 1857 { 1428 1858 //MPDUOverhead = 0; 1429 1859 tx_agg_desc->NoEnc = 1; 1430 1860 } 1431 - #if 0 1432 - switch(EncAlg){ 1433 - case NO_Encryption: 1434 - tx_agg_desc->SecType = 0x0; 1435 - break; 1436 - case WEP40_Encryption: 1437 - case WEP104_Encryption: 1438 - tx_agg_desc->SecType = 0x1; 1439 - break; 1440 - case TKIP_Encryption: 1441 - tx_agg_desc->SecType = 0x2; 1442 - break; 1443 - case AESCCMP_Encryption: 1444 - tx_agg_desc->SecType = 0x3; 1445 - break; 1446 - default: 1447 - tx_agg_desc->SecType = 0x0; 1448 - break; 1449 - } 1450 - #else 1451 1861 tx_agg_desc->SecType = 0x0; 1452 - #endif 1453 1862 1454 1863 if (tcb_desc->bHwSec) { 1455 1864 switch (priv->ieee80211->pairwise_key_type) ··· 1463 1956 u8 DrvAggr_GetAggregatibleList(struct net_device *dev, struct sk_buff *skb, 1464 1957 struct ieee80211_drv_agg_txb *pSendList) 1465 1958 { 1466 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) 1467 1959 struct ieee80211_device *ieee = netdev_priv(dev); 1468 - #else 1469 - struct ieee80211_device *ieee = (struct ieee80211_device *)dev->priv; 1470 - #endif 1471 1960 PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; 1472 1961 u16 nMaxAggrNum = pHTInfo->UsbTxAggrNum; 1473 1962 cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); ··· 1482 1979 } 1483 1980 #endif 1484 1981 1485 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) 1486 - static void rtl8192_tx_isr(struct urb *tx_urb, struct pt_regs *reg) 1487 - #else 1488 1982 static void rtl8192_tx_isr(struct urb *tx_urb) 1489 - #endif 1490 1983 { 1491 1984 struct sk_buff *skb = (struct sk_buff*)tx_urb->context; 1492 1985 struct net_device *dev = NULL; ··· 1518 2019 atomic_dec(&priv->tx_pending[queue_index]); 1519 2020 } 1520 2021 1521 - #if 0 //we need to send zero byte packet just after 512 byte(64 byte)packet is transmitted, or we will halt. It will greatly reduced available page in FW, and ruin our throughput. WB 2008.08.27 1522 - if(BufLen > 0 && ((BufLen % 512 == 0)||(BufLen % 64 == 0))) { 1523 - bToSend0Byte = true; 1524 - } 1525 - 1526 - bToSend0Byte = false; 1527 - // 1528 - // Note that, we at most handle 1 MPDU to send here, either 1529 - // fragment or MPDU in wait queue. 1530 - // 1531 - if(!bToSend0Byte) 1532 - #endif 1533 2022 { 1534 2023 // 1535 2024 // Handle HW Beacon: 1536 2025 // We had transfer our beacon frame to host controler at this moment. 1537 2026 // 1538 - #if 0 1539 - if(tcb_desc->tx_queue == BEACON_QUEUE) 1540 - { 1541 - priv->bSendingBeacon = FALSE; 1542 - } 1543 - #endif 1544 2027 // 1545 2028 // Caution: 1546 2029 // Handling the wait queue of command packets. ··· 1576 2095 if(DrvAggr_GetAggregatibleList(dev, skb, &SendList) > 1) { 1577 2096 skb = DrvAggr_Aggregation(dev, &SendList); 1578 2097 1579 - #if 0 1580 - printk("=============>to send aggregated packet!\n"); 1581 - RT_DEBUG_DATA(COMP_SEND, skb->cb, sizeof(skb->cb)); 1582 - printk("\n=================skb->len = %d\n", skb->len); 1583 - RT_DEBUG_DATA(COMP_SEND, skb->data, skb->len); 1584 - #endif 1585 2098 } 1586 2099 } 1587 2100 priv->ieee80211->softmac_hard_start_xmit(skb, dev); ··· 1585 2110 } 1586 2111 } 1587 2112 1588 - #if 0 1589 - else 1590 - { 1591 - RT_TRACE( COMP_SEND,"HalUsbOutComplete(%d): bToSend0Byte.\n", PipeIndex); 1592 - 1593 - // 1594 - // In this case, we don't return skb now. 1595 - // It will be returned when the 0-byte request completed. 1596 - // 1597 - 1598 - // 1599 - // Bulk out an 0-byte padding transfer. 1600 - // 1601 - HalUsbOut0Byte(pAdapter, PipeIndex, skb); 1602 - } 1603 - 1604 - #endif 1605 2113 } 1606 2114 1607 2115 void rtl8192_beacon_stop(struct net_device *dev) ··· 1722 2264 1723 2265 //temporary hw beacon is not used any more. 1724 2266 //open it when necessary 1725 - #if 1 1726 2267 void rtl819xusb_beacon_tx(struct net_device *dev,u16 tx_rate) 1727 2268 { 1728 2269 1729 - #if 0 1730 - struct r8192_priv *priv = ieee80211_priv(dev); 1731 - struct sk_buff *skb; 1732 - int i = 0; 1733 - //u8 cr; 1734 - 1735 - rtl8192_net_update(dev); 1736 - 1737 - skb = ieee80211_get_beacon(priv->ieee80211); 1738 - if(!skb){ 1739 - DMESG("not enought memory for allocating beacon"); 1740 - return; 1741 - } 1742 - 1743 - 1744 - write_nic_byte(dev, BQREQ, read_nic_byte(dev, BQREQ) | (1<<7)); 1745 - 1746 - i=0; 1747 - //while(!read_nic_byte(dev,BQREQ & (1<<7))) 1748 - while( (read_nic_byte(dev, BQREQ) & (1<<7)) == 0 ) 1749 - { 1750 - msleep_interruptible_rtl(HZ/2); 1751 - if(i++ > 10){ 1752 - DMESGW("get stuck to wait HW beacon to be ready"); 1753 - return ; 1754 - } 1755 - } 1756 - skb->cb[0] = NORM_PRIORITY; 1757 - skb->cb[1] = 0; //morefragment = 0 1758 - skb->cb[2] = ieeerate2rtlrate(tx_rate); 1759 - 1760 - rtl8192_tx(dev,skb); 1761 - 1762 - #endif 1763 2270 } 1764 - #endif 1765 2271 inline u8 rtl8192_IsWirelessBMode(u16 rate) 1766 2272 { 1767 2273 if( ((rate <= 110) && (rate != 60) && (rate != 90)) || (rate == 220) ) ··· 1814 2392 1815 2393 void rtl819xU_cmd_isr(struct urb *tx_cmd_urb, struct pt_regs *regs) 1816 2394 { 1817 - #if 0 1818 - struct net_device *dev = (struct net_device*)tx_cmd_urb->context; 1819 - struct r8192_priv *priv = ieee80211_priv(dev); 1820 - int last_init_packet = 0; 1821 - u8 *ptr_cmd_buf; 1822 - u16 cmd_buf_len; 1823 - 1824 - if(tx_cmd_urb->status != 0) { 1825 - priv->pFirmware.firmware_seg_index = 0; //only begin transter, should it can be set to 1 1826 - } 1827 - 1828 - /* Free the urb and the corresponding buf for common Tx cmd packet, or 1829 - * last segment of each firmware img. 1830 - */ 1831 - if((priv->pFirmware.firmware_seg_index == 0) ||(priv->pFirmware.firmware_seg_index == priv->pFirmware.firmware_seg_maxnum)) { 1832 - priv->pFirmware.firmware_seg_index = 0;//only begin transter, should it can be set to 1 1833 - } else { 1834 - /* prepare for last transfer */ 1835 - /* update some infomation for */ 1836 - /* last segment of the firmware img need indicate to device */ 1837 - priv->pFirmware.firmware_seg_index++; 1838 - if(priv->pFirmware.firmware_seg_index == priv->pFirmware.firmware_seg_maxnum) { 1839 - last_init_packet = 1; 1840 - } 1841 - 1842 - cmd_buf_len = priv->pFirmware.firmware_seg_container[priv->pFirmware.firmware_seg_index-1].seg_size; 1843 - ptr_cmd_buf = priv->pFfirmware.firmware_seg_container[priv->pFfirmware.firmware_seg_index-1].seg_ptr; 1844 - rtl819xU_tx_cmd(dev, ptr_cmd_buf, cmd_buf_len, last_init_packet, DESC_PACKET_TYPE_INIT); 1845 - } 1846 - 1847 - kfree(tx_cmd_urb->transfer_buffer); 1848 - #endif 1849 2395 usb_free_urb(tx_cmd_urb); 1850 2396 } 1851 2397 ··· 1841 2451 1842 2452 //printk("\n %s::queue_index = %d\n",__FUNCTION__, queue_index); 1843 2453 atomic_inc(&priv->tx_pending[queue_index]); 1844 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1845 2454 tx_urb = usb_alloc_urb(0,GFP_ATOMIC); 1846 - #else 1847 - tx_urb = usb_alloc_urb(0); 1848 - #endif 1849 2455 if(!tx_urb){ 1850 2456 dev_kfree_skb(skb); 1851 2457 return -ENOMEM; ··· 1875 2489 usb_fill_bulk_urb(tx_urb,priv->udev, usb_sndbulkpipe(priv->udev,idx_pipe), \ 1876 2490 skb->data, skb->len, rtl8192_tx_isr, skb); 1877 2491 1878 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1879 2492 status = usb_submit_urb(tx_urb, GFP_ATOMIC); 1880 - #else 1881 - status = usb_submit_urb(tx_urb); 1882 - #endif 1883 2493 1884 2494 if (!status){ 1885 2495 return 0; ··· 1994 2612 return tmp_Short; 1995 2613 } 1996 2614 1997 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) 1998 - static void tx_zero_isr(struct urb *tx_urb, struct pt_regs *reg) 1999 - #else 2000 2615 static void tx_zero_isr(struct urb *tx_urb) 2001 - #endif 2002 2616 { 2003 2617 return; 2004 2618 } ··· 2017 2639 //int urb_len; 2018 2640 unsigned int idx_pipe; 2019 2641 // RT_DEBUG_DATA(COMP_SEND, tcb_desc, sizeof(cb_desc)); 2020 - #if 0 2021 - /* Added by Annie for filling Len_Adjust field. 2005-12-14. */ 2022 - RT_ENC_ALG EncAlg = NO_Encryption; 2023 - #endif 2024 2642 // printk("=============> %s\n", __FUNCTION__); 2025 2643 pend = atomic_read(&priv->tx_pending[tcb_desc->queue_index]); 2026 2644 /* we are locked here so the two atomic_read and inc are executed ··· 2024 2650 * !!! For debug purpose 2025 2651 */ 2026 2652 if( pend > MAX_TX_URB){ 2027 - #if 0 2028 - switch (tcb_desc->queue_index) { 2029 - case VO_PRIORITY: 2030 - priv->stats.txvodrop++; 2031 - break; 2032 - case VI_PRIORITY: 2033 - priv->stats.txvidrop++; 2034 - break; 2035 - case BE_PRIORITY: 2036 - priv->stats.txbedrop++; 2037 - break; 2038 - default://BK_PRIORITY 2039 - priv->stats.txbkdrop++; 2040 - break; 2041 - } 2042 - #endif 2043 2653 printk("To discard skb packet!\n"); 2044 2654 dev_kfree_skb_any(skb); 2045 2655 return -1; 2046 2656 } 2047 2657 2048 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2049 2658 tx_urb = usb_alloc_urb(0,GFP_ATOMIC); 2050 - #else 2051 - tx_urb = usb_alloc_urb(0); 2052 - #endif 2053 2659 if(!tx_urb){ 2054 2660 dev_kfree_skb_any(skb); 2055 2661 return -ENOMEM; ··· 2105 2751 /*DWORD 1*/ 2106 2752 tx_desc->SecCAMID= 0; 2107 2753 tx_desc->RATid = tcb_desc->RATRIndex; 2108 - #if 0 2109 - /* Fill security related */ 2110 - if( pTcb->bEncrypt && !Adapter->MgntInfo.SecurityInfo.SWTxEncryptFlag) 2111 - { 2112 - EncAlg = SecGetEncryptionOverhead( 2113 - Adapter, 2114 - &EncryptionMPDUHeadOverhead, 2115 - &EncryptionMPDUTailOverhead, 2116 - NULL, 2117 - NULL, 2118 - FALSE, 2119 - FALSE); 2120 - //2004/07/22, kcwu, EncryptionMPDUHeadOverhead has been added in previous code 2121 - //MPDUOverhead = EncryptionMPDUHeadOverhead + EncryptionMPDUTailOverhead; 2122 - MPDUOverhead = EncryptionMPDUTailOverhead; 2123 - tx_desc->NoEnc = 0; 2124 - RT_TRACE(COMP_SEC, DBG_LOUD, ("******We in the loop SecCAMID is %d SecDescAssign is %d The Sec is %d********\n",tx_desc->SecCAMID,tx_desc->SecDescAssign,EncAlg)); 2125 - //CamDumpAll(Adapter); 2126 - } 2127 - else 2128 - #endif 2129 2754 { 2130 2755 //MPDUOverhead = 0; 2131 2756 tx_desc->NoEnc = 1; 2132 2757 } 2133 - #if 0 2134 - switch(EncAlg){ 2135 - case NO_Encryption: 2136 - tx_desc->SecType = 0x0; 2137 - break; 2138 - case WEP40_Encryption: 2139 - case WEP104_Encryption: 2140 - tx_desc->SecType = 0x1; 2141 - break; 2142 - case TKIP_Encryption: 2143 - tx_desc->SecType = 0x2; 2144 - break; 2145 - case AESCCMP_Encryption: 2146 - tx_desc->SecType = 0x3; 2147 - break; 2148 - default: 2149 - tx_desc->SecType = 0x0; 2150 - break; 2151 - } 2152 - #else 2153 2758 tx_desc->SecType = 0x0; 2154 - #endif 2155 2759 if (tcb_desc->bHwSec) 2156 2760 { 2157 2761 switch (priv->ieee80211->pairwise_key_type) ··· 2142 2830 2143 2831 /* Fill fields that are required to be initialized in all of the descriptors */ 2144 2832 //DWORD 0 2145 - #if 0 2146 - tx_desc->FirstSeg = (tcb_desc->bFirstSeg)? 1:0; 2147 - tx_desc->LastSeg = (tcb_desc->bLastSeg)?1:0; 2148 - #else 2149 2833 tx_desc->FirstSeg = 1; 2150 2834 tx_desc->LastSeg = 1; 2151 - #endif 2152 2835 tx_desc->OWN = 1; 2153 2836 2154 2837 #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE ··· 2170 2863 usb_sndbulkpipe(udev,idx_pipe), skb->data, 2171 2864 skb->len, rtl8192_tx_isr, skb); 2172 2865 2173 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2174 2866 status = usb_submit_urb(tx_urb, GFP_ATOMIC); 2175 - #else 2176 - status = usb_submit_urb(tx_urb); 2177 - #endif 2178 2867 if (!status){ 2179 2868 //we need to send 0 byte packet whenever 512N bytes/64N(HIGN SPEED/NORMAL SPEED) bytes packet has been transmitted. Otherwise, it will be halt to wait for another packet. WB. 2008.08.27 2180 2869 bool bSend0Byte = false; ··· 2187 2884 } 2188 2885 if (bSend0Byte) 2189 2886 { 2190 - #if 1 2191 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2192 2887 tx_urb_zero = usb_alloc_urb(0,GFP_ATOMIC); 2193 - #else 2194 - tx_urb_zero = usb_alloc_urb(0); 2195 - #endif 2196 2888 if(!tx_urb_zero){ 2197 2889 RT_TRACE(COMP_ERR, "can't alloc urb for zero byte\n"); 2198 2890 return -ENOMEM; ··· 2195 2897 usb_fill_bulk_urb(tx_urb_zero,udev, 2196 2898 usb_sndbulkpipe(udev,idx_pipe), &zero, 2197 2899 0, tx_zero_isr, dev); 2198 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2199 2900 status = usb_submit_urb(tx_urb_zero, GFP_ATOMIC); 2200 - #else 2201 - status = usb_submit_urb(tx_urb_zero); 2202 - #endif 2203 2901 if (status){ 2204 2902 RT_TRACE(COMP_ERR, "Error TX URB for zero byte %d, error %d", atomic_read(&priv->tx_pending[tcb_desc->queue_index]), status); 2205 2903 return -1; 2206 2904 } 2207 - #endif 2208 2905 } 2209 2906 dev->trans_start = jiffies; 2210 2907 atomic_inc(&priv->tx_pending[tcb_desc->queue_index]); ··· 2220 2927 #ifndef JACKSON_NEW_RX 2221 2928 for(i=0;i<(MAX_RX_URB+1);i++){ 2222 2929 2223 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2224 2930 priv->rx_urb[i] = usb_alloc_urb(0,GFP_KERNEL); 2225 - #else 2226 - priv->rx_urb[i] = usb_alloc_urb(0); 2227 - #endif 2228 2931 2229 2932 priv->rx_urb[i]->transfer_buffer = kmalloc(RX_URB_SIZE, GFP_KERNEL); 2230 2933 ··· 2339 3050 } 2340 3051 #endif 2341 3052 2342 - #if 0 2343 - void rtl8192_set_rate(struct net_device *dev) 2344 - { 2345 - int i; 2346 - u16 word; 2347 - int basic_rate,min_rr_rate,max_rr_rate; 2348 - 2349 - // struct r8192_priv *priv = ieee80211_priv(dev); 2350 - 2351 - //if (ieee80211_is_54g(priv->ieee80211->current_network) && 2352 - // priv->ieee80211->state == IEEE80211_LINKED){ 2353 - basic_rate = ieeerate2rtlrate(240); 2354 - min_rr_rate = ieeerate2rtlrate(60); 2355 - max_rr_rate = ieeerate2rtlrate(240); 2356 - 2357 - // 2358 - // }else{ 2359 - // basic_rate = ieeerate2rtlrate(20); 2360 - // min_rr_rate = ieeerate2rtlrate(10); 2361 - // max_rr_rate = ieeerate2rtlrate(110); 2362 - // } 2363 - 2364 - write_nic_byte(dev, RESP_RATE, 2365 - max_rr_rate<<MAX_RESP_RATE_SHIFT| min_rr_rate<<MIN_RESP_RATE_SHIFT); 2366 - 2367 - //word = read_nic_word(dev, BRSR); 2368 - word = read_nic_word(dev, BRSR_8187); 2369 - word &= ~BRSR_MBR_8185; 2370 - 2371 - 2372 - for(i=0;i<=basic_rate;i++) 2373 - word |= (1<<i); 2374 - 2375 - //write_nic_word(dev, BRSR, word); 2376 - write_nic_word(dev, BRSR_8187, word); 2377 - //DMESG("RR:%x BRSR: %x", read_nic_byte(dev,RESP_RATE), read_nic_word(dev,BRSR)); 2378 - } 2379 - #endif 2380 3053 extern void rtl8192_update_ratr_table(struct net_device* dev); 2381 3054 void rtl8192_link_change(struct net_device *dev) 2382 3055 { ··· 2351 3100 { 2352 3101 rtl8192_net_update(dev); 2353 3102 rtl8192_update_ratr_table(dev); 2354 - #if 1 2355 3103 //add this as in pure N mode, wep encryption will use software way, but there is no chance to set this as wep will not set group key in wext. WB.2008.07.08 2356 3104 if ((KEY_TYPE_WEP40 == ieee->pairwise_key_type) || (KEY_TYPE_WEP104 == ieee->pairwise_key_type)) 2357 3105 EnableHWSecurityConfig8192(dev); 2358 - #endif 2359 3106 } 2360 3107 /*update timing params*/ 2361 3108 // RT_TRACE(COMP_CH, "========>%s(), chan:%d\n", __FUNCTION__, priv->chan); ··· 2381 3132 }; 2382 3133 2383 3134 2384 - #if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20) 2385 3135 void rtl8192_update_beacon(struct work_struct * work) 2386 3136 { 2387 3137 struct r8192_priv *priv = container_of(work, struct r8192_priv, update_beacon_wq.work); 2388 3138 struct net_device *dev = priv->ieee80211->dev; 2389 - #else 2390 - void rtl8192_update_beacon(struct net_device *dev) 2391 - { 2392 - struct r8192_priv *priv = ieee80211_priv(dev); 2393 - #endif 2394 3139 struct ieee80211_device* ieee = priv->ieee80211; 2395 3140 struct ieee80211_network* net = &ieee->current_network; 2396 3141 ··· 2397 3154 * background support to run QoS activate functionality 2398 3155 */ 2399 3156 int WDCAPARA_ADD[] = {EDCAPARA_BE,EDCAPARA_BK,EDCAPARA_VI,EDCAPARA_VO}; 2400 - #if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20) 2401 3157 void rtl8192_qos_activate(struct work_struct * work) 2402 3158 { 2403 3159 struct r8192_priv *priv = container_of(work, struct r8192_priv, qos_activate); 2404 3160 struct net_device *dev = priv->ieee80211->dev; 2405 - #else 2406 - void rtl8192_qos_activate(struct net_device *dev) 2407 - { 2408 - struct r8192_priv *priv = ieee80211_priv(dev); 2409 - #endif 2410 3161 struct ieee80211_qos_parameters *qos_parameters = &priv->ieee80211->current_network.qos_data.parameters; 2411 3162 u8 mode = priv->ieee80211->current_network.mode; 2412 3163 //u32 size = sizeof(struct ieee80211_qos_parameters); ··· 2411 3174 if (priv == NULL) 2412 3175 return; 2413 3176 2414 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) 2415 - down(&priv->mutex); 2416 - #else 2417 3177 mutex_lock(&priv->mutex); 2418 - #endif 2419 3178 if(priv->ieee80211->state != IEEE80211_LINKED) 2420 3179 goto success; 2421 3180 RT_TRACE(COMP_QOS,"qos active process with associate response received\n"); ··· 2431 3198 } 2432 3199 2433 3200 success: 2434 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) 2435 - up(&priv->mutex); 2436 - #else 2437 3201 mutex_unlock(&priv->mutex); 2438 - #endif 2439 3202 } 2440 3203 2441 3204 static int rtl8192_qos_handle_probe_response(struct r8192_priv *priv, ··· 2458 3229 network->qos_data.param_count)) { 2459 3230 network->qos_data.old_param_count = 2460 3231 network->qos_data.param_count; 2461 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2462 3232 queue_work(priv->priv_wq, &priv->qos_activate); 2463 - #else 2464 - schedule_task(&priv->qos_activate); 2465 - #endif 2466 3233 RT_TRACE (COMP_QOS, "QoS parameters change call " 2467 3234 "qos_activate\n"); 2468 3235 } ··· 2467 3242 &def_qos_parameters, size); 2468 3243 2469 3244 if ((network->qos_data.active == 1) && (active_network == 1)) { 2470 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2471 3245 queue_work(priv->priv_wq, &priv->qos_activate); 2472 - #else 2473 - schedule_task(&priv->qos_activate); 2474 - #endif 2475 3246 RT_TRACE(COMP_QOS, "QoS was disabled call qos_activate \n"); 2476 3247 } 2477 3248 network->qos_data.active = 0; ··· 2485 3264 struct r8192_priv *priv = ieee80211_priv(dev); 2486 3265 2487 3266 rtl8192_qos_handle_probe_response(priv,1,network); 2488 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 2489 3267 queue_delayed_work(priv->priv_wq, &priv->update_beacon_wq, 0); 2490 - #else 2491 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 2492 - schedule_task(&priv->update_beacon_wq); 2493 - #else 2494 - queue_work(priv->priv_wq, &priv->update_beacon_wq); 2495 - #endif 2496 - 2497 - #endif 2498 3268 return 0; 2499 3269 2500 3270 } ··· 2518 3306 &network->qos_data.parameters,\ 2519 3307 sizeof(struct ieee80211_qos_parameters)); 2520 3308 priv->ieee80211->current_network.qos_data.active = 1; 2521 - #if 0 2522 - if((priv->ieee80211->current_network.qos_data.param_count != \ 2523 - network->qos_data.param_count)) 2524 - #endif 2525 3309 { 2526 3310 set_qos_param = 1; 2527 3311 /* update qos parameter for current network */ ··· 2538 3330 2539 3331 RT_TRACE(COMP_QOS, "%s: network->flags = %d,%d\n",__FUNCTION__,network->flags ,priv->ieee80211->current_network.qos_data.active); 2540 3332 if (set_qos_param == 1) 2541 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2542 3333 queue_work(priv->priv_wq, &priv->qos_activate); 2543 - #else 2544 - schedule_task(&priv->qos_activate); 2545 - #endif 2546 3334 2547 3335 2548 3336 return ret; ··· 2608 3404 static u8 ccmp_rsn_ie[4] = {0x00, 0x0f, 0xac, 0x04}; 2609 3405 bool GetNmodeSupportBySecCfg8192(struct net_device*dev) 2610 3406 { 2611 - #if 1 2612 3407 struct r8192_priv* priv = ieee80211_priv(dev); 2613 3408 struct ieee80211_device* ieee = priv->ieee80211; 2614 3409 struct ieee80211_network * network = &ieee->current_network; ··· 2635 3432 return true; 2636 3433 } 2637 3434 2638 - #if 0 2639 - //In here we discuss with SD4 David. He think we still can send TKIP in broadcast group key in MCS rate. 2640 - //We can't force in G mode if Pairwie key is AES and group key is TKIP 2641 - if((pSecInfo->GroupEncAlgorithm == WEP104_Encryption) || (pSecInfo->GroupEncAlgorithm == WEP40_Encryption) || 2642 - (pSecInfo->PairwiseEncAlgorithm == WEP104_Encryption) || 2643 - (pSecInfo->PairwiseEncAlgorithm == WEP40_Encryption) || (pSecInfo->PairwiseEncAlgorithm == TKIP_Encryption)) 2644 - { 2645 - return false; 2646 - } 2647 - else 2648 - return true; 2649 - #endif 2650 3435 return true; 2651 - #endif 2652 3436 } 2653 3437 2654 3438 bool GetHalfNmodeSupportByAPs819xUsb(struct net_device* dev) ··· 2692 3502 struct r8192_priv *priv = ieee80211_priv(dev); 2693 3503 u8 bSupportMode = rtl8192_getSupportedWireleeMode(dev); 2694 3504 2695 - #if 1 2696 3505 if ((wireless_mode == WIRELESS_MODE_AUTO) || ((wireless_mode&bSupportMode)==0)) 2697 3506 { 2698 3507 if(bSupportMode & WIRELESS_MODE_N_24G) ··· 2730 3541 priv->ieee80211->pHTInfo->bEnableHT = 0; 2731 3542 RT_TRACE(COMP_INIT, "Current Wireless Mode is %x\n", wireless_mode); 2732 3543 rtl8192_refresh_supportrate(priv); 2733 - #endif 2734 3544 2735 3545 } 2736 3546 //init priv variables here. only non_zero value should be initialized here. ··· 2867 3679 //spin_lock_init(&priv->rf_lock); 2868 3680 sema_init(&priv->wx_sem,1); 2869 3681 sema_init(&priv->rf_sem,1); 2870 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) 2871 - sema_init(&priv->mutex, 1); 2872 - #else 2873 3682 mutex_init(&priv->mutex); 2874 - #endif 2875 3683 } 2876 3684 2877 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 2878 3685 extern void rtl819x_watchdog_wqcallback(struct work_struct *work); 2879 - #else 2880 - extern void rtl819x_watchdog_wqcallback(struct net_device *dev); 2881 - #endif 2882 3686 2883 3687 void rtl8192_irq_rx_tasklet(struct r8192_priv *priv); 2884 3688 //init tasklet and wait_queue here. only 2.6 above kernel is considered ··· 2879 3699 { 2880 3700 struct r8192_priv *priv = ieee80211_priv(dev); 2881 3701 2882 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2883 3702 #ifdef PF_SYNCTHREAD 2884 3703 priv->priv_wq = create_workqueue(DRV_NAME,0); 2885 3704 #else 2886 3705 priv->priv_wq = create_workqueue(DRV_NAME); 2887 3706 #endif 2888 - #endif 2889 3707 2890 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 2891 3708 INIT_WORK(&priv->reset_wq, rtl8192_restart); 2892 3709 2893 3710 //INIT_DELAYED_WORK(&priv->watch_dog_wq, hal_dm_watchdog); ··· 2897 3720 //INIT_WORK(&priv->SwChnlWorkItem, rtl8192_SwChnl_WorkItem); 2898 3721 //INIT_WORK(&priv->SetBWModeWorkItem, rtl8192_SetBWModeWorkItem); 2899 3722 INIT_WORK(&priv->qos_activate, rtl8192_qos_activate); 2900 - #else 2901 - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 2902 - tq_init(&priv->reset_wq, (void*)rtl8192_restart, dev); 2903 - tq_init(&priv->watch_dog_wq, (void*)rtl819x_watchdog_wqcallback, dev); 2904 - tq_init(&priv->txpower_tracking_wq, (void*)dm_txpower_trackingcallback, dev); 2905 - tq_init(&priv->rfpath_check_wq, (void*)dm_rf_pathcheck_workitemcallback, dev); 2906 - tq_init(&priv->update_beacon_wq, (void*)rtl8192_update_beacon, dev); 2907 - //tq_init(&priv->SwChnlWorkItem, (void*) rtl8192_SwChnl_WorkItem, dev); 2908 - //tq_init(&priv->SetBWModeWorkItem, (void*)rtl8192_SetBWModeWorkItem, dev); 2909 - tq_init(&priv->qos_activate, (void *)rtl8192_qos_activate, dev); 2910 - #else 2911 - INIT_WORK(&priv->reset_wq,(void(*)(void*)) rtl8192_restart,dev); 2912 - //INIT_WORK(&priv->watch_dog_wq, (void(*)(void*)) hal_dm_watchdog,dev); 2913 - INIT_WORK(&priv->watch_dog_wq, (void(*)(void*)) rtl819x_watchdog_wqcallback,dev); 2914 - INIT_WORK(&priv->txpower_tracking_wq, (void(*)(void*)) dm_txpower_trackingcallback,dev); 2915 - // INIT_WORK(&priv->gpio_change_rf_wq, (void(*)(void*)) dm_gpio_change_rf_callback,dev); 2916 - INIT_WORK(&priv->rfpath_check_wq, (void(*)(void*)) dm_rf_pathcheck_workitemcallback,dev); 2917 - INIT_WORK(&priv->update_beacon_wq, (void(*)(void*))rtl8192_update_beacon,dev); 2918 - INIT_WORK(&priv->initialgain_operate_wq, (void(*)(void*))InitialGainOperateWorkItemCallBack,dev); 2919 - //INIT_WORK(&priv->SwChnlWorkItem, (void(*)(void*)) rtl8192_SwChnl_WorkItem, dev); 2920 - //INIT_WORK(&priv->SetBWModeWorkItem, (void(*)(void*)) rtl8192_SetBWModeWorkItem, dev); 2921 - INIT_WORK(&priv->qos_activate, (void(*)(void *))rtl8192_qos_activate, dev); 2922 - #endif 2923 - #endif 2924 3723 2925 3724 tasklet_init(&priv->irq_rx_tasklet, 2926 3725 (void(*)(unsigned long))rtl8192_irq_rx_tasklet, ··· 3371 4218 //config BB. 3372 4219 rtl8192_BBConfig(dev); 3373 4220 3374 - #if 1 3375 4221 //Loopback mode or not 3376 4222 priv->LoopbackMode = RTL819xU_NO_LOOPBACK; 3377 4223 // priv->LoopbackMode = RTL819xU_MAC_LOOPBACK; ··· 3586 4434 write_nic_byte(dev, 0x87, 0x0); 3587 4435 3588 4436 3589 - #endif 3590 4437 return init_status; 3591 4438 } 3592 4439 ··· 3593 4442 * rtl8192_beacon_tx_enable(). rtl8192_beacon_tx_disable() might 3594 4443 * be used to stop beacon transmission 3595 4444 */ 3596 - #if 0 3597 - void rtl8192_start_tx_beacon(struct net_device *dev) 3598 - { 3599 - int i; 3600 - struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 3601 - u16 word; 3602 - DMESG("Enabling beacon TX"); 3603 - //write_nic_byte(dev, TX_CONF,0xe6);// TX_CONF 3604 - //rtl8192_init_beacon(dev); 3605 - //set_nic_txring(dev); 3606 - // rtl8192_prepare_beacon(dev); 3607 - rtl8192_irq_disable(dev); 3608 - // rtl8192_beacon_tx_enable(dev); 3609 - rtl8192_set_mode(dev,EPROM_CMD_CONFIG); 3610 - //write_nic_byte(dev,0x9d,0x20); //DMA Poll 3611 - //write_nic_word(dev,0x7a,0); 3612 - //write_nic_word(dev,0x7a,0x8000); 3613 - 3614 - 3615 - word = read_nic_word(dev, BcnItv); 3616 - word &= ~BcnItv_BcnItv; // clear Bcn_Itv 3617 - write_nic_word(dev, BcnItv, word); 3618 - 3619 - write_nic_word(dev, AtimWnd, 3620 - read_nic_word(dev, AtimWnd) &~ AtimWnd_AtimWnd); 3621 - 3622 - word = read_nic_word(dev, BCN_INTR_ITV); 3623 - word &= ~BCN_INTR_ITV_MASK; 3624 - 3625 - //word |= priv->ieee80211->beacon_interval * 3626 - // ((priv->txbeaconcount > 1)?(priv->txbeaconcount-1):1); 3627 - // FIXME:FIXME check if correct ^^ worked with 0x3e8; 3628 - 3629 - write_nic_word(dev, BCN_INTR_ITV, word); 3630 - 3631 - //write_nic_word(dev,0x2e,0xe002); 3632 - //write_nic_dword(dev,0x30,0xb8c7832e); 3633 - for(i=0; i<ETH_ALEN; i++) 3634 - write_nic_byte(dev, BSSID+i, priv->ieee80211->beacon_cell_ssid[i]); 3635 - 3636 - // rtl8192_update_msr(dev); 3637 - 3638 - 3639 - //write_nic_byte(dev,CONFIG4,3); /* !!!!!!!!!! */ 3640 - 3641 - rtl8192_set_mode(dev, EPROM_CMD_NORMAL); 3642 - 3643 - rtl8192_irq_enable(dev); 3644 - 3645 - /* VV !!!!!!!!!! VV*/ 3646 - /* 3647 - rtl8192_set_mode(dev,EPROM_CMD_CONFIG); 3648 - write_nic_byte(dev,0x9d,0x00); 3649 - rtl8192_set_mode(dev,EPROM_CMD_NORMAL); 3650 - */ 3651 - } 3652 - #endif 3653 4445 /*************************************************************************** 3654 4446 -------------------------------NET STUFF--------------------------- 3655 4447 ***************************************************************************/ ··· 3646 4552 { 3647 4553 if(QueueID == TXCMD_QUEUE) 3648 4554 continue; 3649 - #if 1 3650 4555 #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE 3651 4556 if((skb_queue_len(&priv->ieee80211->skb_waitQ[QueueID]) == 0) && (skb_queue_len(&priv->ieee80211->skb_aggQ[QueueID]) == 0) && (skb_queue_len(&priv->ieee80211->skb_drv_aggQ[QueueID]) == 0)) 3652 4557 #else 3653 4558 if((skb_queue_len(&priv->ieee80211->skb_waitQ[QueueID]) == 0) && (skb_queue_len(&priv->ieee80211->skb_aggQ[QueueID]) == 0)) 3654 4559 #endif 3655 4560 continue; 3656 - #endif 3657 4561 3658 4562 bCheckFwTxCnt = true; 3659 4563 } 3660 4564 // PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK); 3661 4565 // spin_unlock_irqrestore(&priv->ieee80211->lock,flags); 3662 4566 // RT_TRACE(COMP_RESET,"bCheckFwTxCnt is %d\n",bCheckFwTxCnt); 3663 - #if 1 3664 4567 if(bCheckFwTxCnt) 3665 4568 { 3666 4569 if(HalTxCheckStuck819xUsb(dev)) ··· 3666 4575 return RESET_TYPE_SILENT; 3667 4576 } 3668 4577 } 3669 - #endif 3670 4578 return RESET_TYPE_NORESET; 3671 4579 } 3672 4580 ··· 3784 4694 rfState = priv->ieee80211->eRFPowerState; 3785 4695 3786 4696 TxResetType = TxCheckStuck(dev); 3787 - #if 1 3788 4697 if( rfState != eRfOff || 3789 4698 /*ADAPTER_TEST_STATUS_FLAG(Adapter, ADAPTER_STATUS_FW_DOWNLOAD_FAILURE)) &&*/ 3790 4699 (priv->ieee80211->iw_mode != IW_MODE_ADHOC)) ··· 3798 4709 // set, STA cannot hear any packet a all. Emily, 2008.04.12 3799 4710 RxResetType = RxCheckStuck(dev); 3800 4711 } 3801 - #endif 3802 4712 if(TxResetType==RESET_TYPE_NORMAL || RxResetType==RESET_TYPE_NORMAL) 3803 4713 return RESET_TYPE_NORMAL; 3804 4714 else if(TxResetType==RESET_TYPE_SILENT || RxResetType==RESET_TYPE_SILENT){ ··· 3977 4889 // Set the variable for reset. 3978 4890 priv->ResetProgress = RESET_TYPE_SILENT; 3979 4891 // rtl8192_close(dev); 3980 - #if 1 3981 4892 down(&priv->wx_sem); 3982 4893 if(priv->up == 0) 3983 4894 { ··· 4001 4914 printk("ieee->state is IEEE80211_LINKED\n"); 4002 4915 ieee80211_stop_send_beacons(priv->ieee80211); 4003 4916 del_timer_sync(&ieee->associate_timer); 4004 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 4005 4917 cancel_delayed_work(&ieee->associate_retry_wq); 4006 - #endif 4007 4918 ieee80211_stop_scan(ieee); 4008 4919 netif_carrier_off(dev); 4009 4920 up(&ieee->wx_sem); ··· 4028 4943 RT_TRACE(COMP_ERR," ERR!!! %s(): Reset Failed!!\n", __FUNCTION__); 4029 4944 } 4030 4945 } 4031 - #endif 4032 4946 ieee->is_silent_reset = 1; 4033 - #if 1 4034 4947 EnableHWSecurityConfig8192(dev); 4035 - #if 1 4036 4948 if(ieee->state == IEEE80211_LINKED && ieee->iw_mode == IW_MODE_INFRA) 4037 4949 { 4038 4950 ieee->set_chan(ieee->dev, ieee->current_network.channel); 4039 4951 4040 - #if 1 4041 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 4042 4952 queue_work(ieee->wq, &ieee->associate_complete_wq); 4043 - #else 4044 - schedule_task(&ieee->associate_complete_wq); 4045 - #endif 4046 - #endif 4047 4953 4048 4954 } 4049 4955 else if(ieee->state == IEEE80211_LINKED && ieee->iw_mode == IW_MODE_ADHOC) ··· 4050 4974 ieee->data_hard_resume(ieee->dev); 4051 4975 netif_carrier_on(ieee->dev); 4052 4976 } 4053 - #endif 4054 4977 4055 4978 CamRestoreAllEntry(dev); 4056 4979 ··· 4062 4987 // For test --> force write UFWP. 4063 4988 write_nic_byte(dev, UFWP, 1); 4064 4989 RT_TRACE(COMP_RESET, "Reset finished!! ====>[%d]\n", priv->reset_count); 4065 - #endif 4066 4990 } 4067 4991 } 4068 4992 ··· 4084 5010 4085 5011 //Check polling bit is clear 4086 5012 // mdelay(1); 4087 - #if 1 4088 5013 while((i--)>=0) 4089 5014 { 4090 5015 ulStatus = read_nic_dword(dev, RWCAM); ··· 4094 5021 break; 4095 5022 } 4096 5023 } 4097 - #endif 4098 5024 write_nic_dword(dev, RWCAM, target_command); 4099 5025 RT_TRACE(COMP_SEC,"CAM_read_entry(): WRITE A0: %x \n",target_command); 4100 5026 // printk("CAM_read_entry(): WRITE A0: %lx \n",target_command); ··· 4126 5054 } 4127 5055 4128 5056 4129 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 4130 5057 extern void rtl819x_watchdog_wqcallback(struct work_struct *work) 4131 5058 { 4132 5059 struct delayed_work *dwork = container_of(work,struct delayed_work,work); 4133 5060 struct r8192_priv *priv = container_of(dwork,struct r8192_priv,watch_dog_wq); 4134 5061 struct net_device *dev = priv->ieee80211->dev; 4135 - #else 4136 - extern void rtl819x_watchdog_wqcallback(struct net_device *dev) 4137 - { 4138 - struct r8192_priv *priv = ieee80211_priv(dev); 4139 - #endif 4140 5062 struct ieee80211_device* ieee = priv->ieee80211; 4141 5063 RESET_TYPE ResetType = RESET_TYPE_NORESET; 4142 5064 static u8 check_reset_cnt=0; ··· 4172 5106 notify_wx_assoc_event(priv->ieee80211); 4173 5107 RemovePeerTS(priv->ieee80211,priv->ieee80211->current_network.bssid); 4174 5108 priv->ieee80211->link_change(dev); 4175 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 4176 5109 queue_work(priv->ieee80211->wq, &priv->ieee80211->associate_procedure_wq); 4177 - #else 4178 - schedule_task(&priv->ieee80211->associate_procedure_wq); 4179 - #endif 4180 5110 4181 5111 } 4182 5112 } ··· 4188 5126 //DbgPrint("Start to check silent reset\n"); 4189 5127 } 4190 5128 // RT_TRACE(COMP_RESET,"%s():priv->force_reset is %d,priv->ResetProgress is %d, priv->bForcedSilentReset is %d,priv->bDisableNormalResetCheck is %d,ResetType is %d\n",__FUNCTION__,priv->force_reset,priv->ResetProgress,priv->bForcedSilentReset,priv->bDisableNormalResetCheck,ResetType); 4191 - #if 1 4192 5129 if( (priv->force_reset) || (priv->ResetProgress==RESET_TYPE_NORESET && 4193 5130 (priv->bForcedSilentReset || 4194 5131 (!priv->bDisableNormalResetCheck && ResetType==RESET_TYPE_SILENT)))) // This is control by OID set in Pomelo ··· 4195 5134 RT_TRACE(COMP_RESET,"%s():priv->force_reset is %d,priv->ResetProgress is %d, priv->bForcedSilentReset is %d,priv->bDisableNormalResetCheck is %d,ResetType is %d\n",__FUNCTION__,priv->force_reset,priv->ResetProgress,priv->bForcedSilentReset,priv->bDisableNormalResetCheck,ResetType); 4196 5135 rtl819x_ifsilentreset(dev); 4197 5136 } 4198 - #endif 4199 5137 priv->force_reset = false; 4200 5138 priv->bForcedSilentReset = false; 4201 5139 priv->bResetInProgress = false; ··· 4206 5146 { 4207 5147 struct r8192_priv *priv = ieee80211_priv((struct net_device *) data); 4208 5148 //printk("===============>watch_dog timer\n"); 4209 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 4210 5149 queue_delayed_work(priv->priv_wq,&priv->watch_dog_wq, 0); 4211 - #else 4212 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 4213 - schedule_task(&priv->watch_dog_wq); 4214 - #else 4215 - queue_work(priv->priv_wq,&priv->watch_dog_wq); 4216 - #endif 4217 - #endif 4218 5150 mod_timer(&priv->watch_dog_timer, jiffies + MSECS(IEEE80211_WATCH_DOG_TIME)); 4219 - #if 0 4220 - priv->watch_dog_timer.expires = jiffies + MSECS(IEEE80211_WATCH_DOG_TIME); 4221 - add_timer(&priv->watch_dog_timer); 4222 - #endif 4223 5151 } 4224 5152 int _rtl8192_up(struct net_device *dev) 4225 5153 { ··· 4346 5298 { 4347 5299 struct r8192_priv *priv = ieee80211_priv(dev); 4348 5300 */ 4349 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 4350 5301 void rtl8192_restart(struct work_struct *work) 4351 5302 { 4352 5303 struct r8192_priv *priv = container_of(work, struct r8192_priv, reset_wq); 4353 5304 struct net_device *dev = priv->ieee80211->dev; 4354 - #else 4355 - void rtl8192_restart(struct net_device *dev) 4356 - { 4357 - 4358 - struct r8192_priv *priv = ieee80211_priv(dev); 4359 - #endif 4360 5305 4361 5306 down(&priv->wx_sem); 4362 5307 ··· 4388 5347 4389 5348 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); 4390 5349 4391 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) 4392 5350 schedule_work(&priv->reset_wq); 4393 - #else 4394 - schedule_task(&priv->reset_wq); 4395 - #endif 4396 5351 up(&priv->wx_sem); 4397 5352 4398 5353 return 0; ··· 4641 5604 bcheck = true; 4642 5605 }else 4643 5606 { 4644 - #if 0 4645 - // if previous packet is aggregated packet, and current packet 4646 - // (1) is not AMPDU 4647 - // (2) is the first packet of one AMPDU 4648 - // that means the previous packet is the last one aggregated packet 4649 - if( !pcurrent_stats->bIsAMPDU || pcurrent_stats->bFirstMPDU) 4650 - bcheck = true; 4651 - #endif 4652 5607 } 4653 5608 4654 5609 ··· 4757 5728 priv->undecorated_smoothed_pwdb = pprevious_stats->RxPWDBAll; 4758 5729 //DbgPrint("First pwdb initialize \n"); 4759 5730 } 4760 - #if 1 4761 5731 if(pprevious_stats->RxPWDBAll > (u32)priv->undecorated_smoothed_pwdb) 4762 5732 { 4763 5733 priv->undecorated_smoothed_pwdb = ··· 4770 5742 ( ((priv->undecorated_smoothed_pwdb)*(Rx_Smooth_Factor-1)) + 4771 5743 (pprevious_stats->RxPWDBAll)) /(Rx_Smooth_Factor); 4772 5744 } 4773 - #else 4774 - //Fixed by Jacken 2008-03-20 4775 - if(pPreviousRfd->Status.RxPWDBAll > (u32)pHalData->UndecoratedSmoothedPWDB) 4776 - { 4777 - pHalData->UndecoratedSmoothedPWDB = 4778 - ( ((pHalData->UndecoratedSmoothedPWDB)* 5) + (pPreviousRfd->Status.RxPWDBAll)) / 6; 4779 - pHalData->UndecoratedSmoothedPWDB = pHalData->UndecoratedSmoothedPWDB + 1; 4780 - } 4781 - else 4782 - { 4783 - pHalData->UndecoratedSmoothedPWDB = 4784 - ( ((pHalData->UndecoratedSmoothedPWDB)* 5) + (pPreviousRfd->Status.RxPWDBAll)) / 6; 4785 - } 4786 - #endif 4787 5745 4788 5746 } 4789 5747 ··· 5147 6133 rx_evmX /= 2; //dbm 5148 6134 5149 6135 evm = rtl819x_evm_dbtopercentage(rx_evmX); 5150 - #if 0 5151 - EVM = SignalScaleMapping(EVM);//make it good looking, from 0~100 5152 - #endif 5153 6136 //if(bpacket_match_bssid) 5154 6137 { 5155 6138 if(i==0) // Fill value in RFD, Get the first spatial stream only ··· 5227 6216 && (!pstats->bHwError) && (!pstats->bCRC)&& (!pstats->bICV)); 5228 6217 bpacket_toself = bpacket_match_bssid & (eqMacAddr(praddr, priv->ieee80211->dev->dev_addr)); 5229 6218 5230 - #if 1//cosa 5231 6219 if(WLAN_FC_GET_FRAMETYPE(fc)== IEEE80211_STYPE_BEACON) 5232 6220 { 5233 6221 bPacketBeacon = true; ··· 5239 6229 //DbgPrint("BlockAck, MatchBSSID = %d, ToSelf = %d \n", bPacketMatchBSSID, bPacketToSelf); 5240 6230 } 5241 6231 5242 - #endif 5243 6232 5244 6233 5245 6234 if(bpacket_match_bssid) ··· 5425 6416 5426 6417 stats->bIsAMPDU = (driver_info->PartAggr==1); 5427 6418 stats->bFirstMPDU = (driver_info->PartAggr==1) && (driver_info->FirstAGGR==1); 5428 - #if 0 5429 - // TODO: it is debug only. It should be disabled in released driver. 2007.1.12 by Joseph 5430 - UpdateRxAMPDUHistogramStatistics8190(Adapter, pRfd); 5431 - #endif 5432 6419 stats->TimeStampLow = driver_info->TSFL; 5433 6420 // xiong mask it, 070514 5434 6421 //pRfd->Status.TimeStampHigh = PlatformEFIORead4Byte(Adapter, TSFR+4); ··· 5457 6452 } 5458 6453 #endif 5459 6454 /* for debug 2008.5.29 */ 5460 - #if 0 5461 - { 5462 - int i; 5463 - printk("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); 5464 - for(i = 0; i < skb->len; i++) { 5465 - if(i % 10 == 0) printk("\n"); 5466 - printk("%02x ", skb->data[i]); 5467 - } 5468 - printk("\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); 5469 - } 5470 - #endif 5471 6455 5472 6456 //added by vivi, for MP, 20080108 5473 6457 stats->RxIs40MHzPacket = driver_info->BW; ··· 5747 6753 ; 5748 6754 5749 6755 5750 - #if 0 5751 - desc = (u32*)(skb->data); 5752 - cmd = (desc[0] >> 30) & 0x03; 5753 - 5754 - if(cmd == 0x00) {//beacon interrupt 5755 - //send beacon packet 5756 - skb = ieee80211_get_beacon(priv->ieee80211); 5757 - 5758 - if(!skb){ 5759 - DMESG("not enought memory for allocating beacon"); 5760 - return; 5761 - } 5762 - skb->cb[0] = BEACON_PRIORITY; 5763 - skb->cb[1] = 0; 5764 - skb->cb[2] = ieeerate2rtlrate(priv->ieee80211->basic_rate); 5765 - ret = rtl8192_tx(dev, skb); 5766 - 5767 - if( ret != 0 ){ 5768 - printk(KERN_ALERT "tx beacon packet error : %d !\n", ret); 5769 - } 5770 - dev_kfree_skb_any(skb); 5771 - } else {//0x00 5772 - //{ log the device information 5773 - // At present, It is not implemented just now. 5774 - //} 5775 - } 5776 - #endif 5777 6756 } 5778 6757 5779 6758 void rtl8192_irq_rx_tasklet(struct r8192_priv *priv) ··· 5800 6833 ---------------------------- USB_STUFF--------------------------- 5801 6834 *****************************************************************************/ 5802 6835 5803 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 5804 6836 static int __devinit rtl8192_usb_probe(struct usb_interface *intf, 5805 6837 const struct usb_device_id *id) 5806 - #else 5807 - static void * __devinit rtl8192_usb_probe(struct usb_device *udev, 5808 - unsigned int ifnum, 5809 - const struct usb_device_id *id) 5810 - #endif 5811 6838 { 5812 6839 // unsigned long ioaddr = 0; 5813 6840 struct net_device *dev = NULL; 5814 6841 struct r8192_priv *priv= NULL; 5815 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 5816 6842 struct usb_device *udev = interface_to_usbdev(intf); 5817 - #endif 5818 6843 RT_TRACE(COMP_INIT, "Oops: i'm coming\n"); 5819 6844 5820 6845 dev = alloc_ieee80211(sizeof(struct r8192_priv)); 5821 6846 5822 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) 5823 - SET_MODULE_OWNER(dev); 5824 - #endif 5825 6847 5826 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 5827 6848 usb_set_intfdata(intf, dev); 5828 6849 SET_NETDEV_DEV(dev, &intf->dev); 5829 - #endif 5830 6850 priv = ieee80211_priv(dev); 5831 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 5832 6851 priv->ieee80211 = netdev_priv(dev); 5833 - #else 5834 - priv->ieee80211 = (struct net_device *)dev->priv; 5835 - #endif 5836 6852 priv->udev=udev; 5837 6853 5838 6854 dev->netdev_ops = &rtl8192_netdev_ops; ··· 5838 6888 } 5839 6889 5840 6890 RT_TRACE(COMP_INIT, "Driver probe completed1\n"); 5841 - #if 1 5842 6891 if(rtl8192_init(dev)!=0){ 5843 6892 RT_TRACE(COMP_ERR, "Initialization failed"); 5844 6893 goto fail; 5845 6894 } 5846 - #endif 5847 6895 netif_carrier_off(dev); 5848 6896 netif_stop_queue(dev); 5849 6897 ··· 5851 6903 5852 6904 5853 6905 RT_TRACE(COMP_INIT, "Driver probe completed\n"); 5854 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 5855 - return dev; 5856 - #else 5857 6906 return 0; 5858 - #endif 5859 6907 5860 6908 5861 6909 fail: 5862 6910 free_ieee80211(dev); 5863 6911 5864 6912 RT_TRACE(COMP_ERR, "wlan driver load failed\n"); 5865 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 5866 - return NULL; 5867 - #else 5868 6913 return -ENODEV; 5869 - #endif 5870 6914 5871 6915 } 5872 6916 ··· 5866 6926 void rtl8192_cancel_deferred_work(struct r8192_priv* priv) 5867 6927 { 5868 6928 5869 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) 5870 6929 cancel_work_sync(&priv->reset_wq); 5871 6930 cancel_delayed_work(&priv->watch_dog_wq); 5872 6931 cancel_delayed_work(&priv->update_beacon_wq); 5873 6932 cancel_work_sync(&priv->qos_activate); 5874 6933 //cancel_work_sync(&priv->SetBWModeWorkItem); 5875 6934 //cancel_work_sync(&priv->SwChnlWorkItem); 5876 - #else 5877 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 5878 - // cancel_delayed_work(&priv->reset_wq); 5879 - cancel_delayed_work(&priv->watch_dog_wq); 5880 - cancel_delayed_work(&priv->update_beacon_wq); 5881 - // cancel_delayed_work(&priv->qos_activate); 5882 - //cancel_delayed_work(&priv->SetBWModeWorkItem); 5883 - //cancel_delayed_work(&priv->SwChnlWorkItem); 5884 - #endif 5885 - #endif 5886 6935 5887 6936 } 5888 6937 5889 6938 5890 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 5891 6939 static void __devexit rtl8192_usb_disconnect(struct usb_interface *intf) 5892 - #else 5893 - static void __devexit rtl8192_usb_disconnect(struct usb_device *udev, void *ptr) 5894 - #endif 5895 6940 { 5896 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 5897 6941 struct net_device *dev = usb_get_intfdata(intf); 5898 - #else 5899 - struct net_device *dev = (struct net_device *)ptr; 5900 - #endif 5901 6942 5902 6943 struct r8192_priv *priv = ieee80211_priv(dev); 5903 6944 if(dev){ ··· 5897 6976 // priv->rf_close(dev); 5898 6977 // rtl8192_SetRFPowerState(dev, eRfOff); 5899 6978 rtl8192_usb_deleteendpoints(dev); 5900 - #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) 5901 6979 destroy_workqueue(priv->priv_wq); 5902 - #endif 5903 6980 //rtl8192_irq_disable(dev); 5904 6981 //rtl8192_reset(dev); 5905 6982 mdelay(10); ··· 5994 7075 struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 5995 7076 struct ieee80211_device* ieee = priv->ieee80211; 5996 7077 SECR_value = SCR_TxEncEnable | SCR_RxDecEnable; 5997 - #if 1 5998 7078 if (((KEY_TYPE_WEP40 == ieee->pairwise_key_type) || (KEY_TYPE_WEP104 == ieee->pairwise_key_type)) && (priv->ieee80211->auth_mode != 2)) 5999 7079 { 6000 7080 SECR_value |= SCR_RxUseDK; ··· 6004 7086 SECR_value |= SCR_RxUseDK; 6005 7087 SECR_value |= SCR_TxUseDK; 6006 7088 } 6007 - #endif 6008 7089 //add HWSec active enable here. 6009 7090 //default using hwsec. when peer AP is in N mode only and pairwise_key_type is none_aes(which HT_IOT_ACT_PURE_N_MODE indicates it), use software security. when peer AP is in b,g,n mode mixed and pairwise_key_type is none_aes, use g mode hw security. WB on 2008.7.4 6010 7091
-288
drivers/staging/rtl8192u/r8192U_dm.c
··· 24 24 // 25 25 // Indicate different AP vendor for IOT issue. 26 26 // 27 - #if 0 28 - typedef enum _HT_IOT_PEER 29 - { 30 - HT_IOT_PEER_UNKNOWN = 0, 31 - HT_IOT_PEER_REALTEK = 1, 32 - HT_IOT_PEER_BROADCOM = 2, 33 - HT_IOT_PEER_RALINK = 3, 34 - HT_IOT_PEER_ATHEROS = 4, 35 - HT_IOT_PEER_CISCO = 5, 36 - HT_IOT_PEER_MAX = 6 37 - }HT_IOT_PEER_E, *PHTIOT_PEER_E; 38 - #endif 39 - #if 1 40 27 static u32 edca_setting_DL[HT_IOT_PEER_MAX] = 41 28 { 0x5e4322, 0x5e4322, 0x5e4322, 0x604322, 0xa44f, 0x5ea44f}; 42 29 static u32 edca_setting_UL[HT_IOT_PEER_MAX] = 43 30 { 0x5e4322, 0xa44f, 0x5e4322, 0x604322, 0x5ea44f, 0x5ea44f}; 44 31 45 - #endif 46 32 47 33 #define RTK_UL_EDCA 0xa44f 48 34 #define RTK_DL_EDCA 0x5e4322 ··· 57 71 58 72 59 73 extern void init_rate_adaptive(struct net_device *dev); 60 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 61 74 extern void dm_txpower_trackingcallback(struct work_struct *work); 62 - #else 63 - extern void dm_txpower_trackingcallback(struct net_device *dev); 64 - #endif 65 75 66 76 extern void dm_cck_txpower_adjust(struct net_device *dev,bool binch14); 67 77 extern void dm_restore_dynamic_mechanism_state(struct net_device *dev); ··· 73 91 u32 force_value); 74 92 extern void dm_init_edca_turbo(struct net_device *dev); 75 93 extern void dm_rf_operation_test_callback(unsigned long data); 76 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 77 94 extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work); 78 - #else 79 - extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev); 80 - #endif 81 95 extern void dm_fsync_timer_callback(unsigned long data); 82 - #if 0 83 - extern bool dm_check_lbus_status(struct net_device *dev); 84 - #endif 85 96 extern void dm_check_fsync(struct net_device *dev); 86 97 extern void dm_shadow_init(struct net_device *dev); 87 98 ··· 473 498 } 474 499 475 500 // 2008.04.01 476 - #if 1 477 501 // For RTL819X, if pairwisekey = wep/tkip, we support only MCS0~7. 478 502 if(priv->ieee80211->GetHalfNmodeSupportByAPsHandler(dev)) 479 503 targetRATR &= 0xf00fffff; 480 - #endif 481 504 482 505 // 483 506 // Check whether updating of RATR0 is required ··· 857 884 858 885 //========================== 859 886 // this is only for test, should be masked 860 - #if 0 861 - { 862 - //UINT32 eRFPath; 863 - //UINT32 start_rf, end_rf; 864 - UINT32 curr_addr; 865 - //UINT32 reg_addr; 866 - //UINT32 reg_addr_end; 867 - UINT32 reg_value; 868 - //start_rf = RF90_PATH_A; 869 - //end_rf = RF90_PATH_B;//RF90_PATH_MAX; 870 - //reg_addr = 0x0; 871 - //reg_addr_end = 0x2F; 872 - 873 - for (curr_addr = 0; curr_addr < 0x2d; curr_addr++) 874 - { 875 - reg_value = PHY_QueryRFReg( Adapter, (RF90_RADIO_PATH_E)RF90_PATH_A, 876 - curr_addr, bMaskDWord); 877 - } 878 - 879 - pHalData->TXPowercount = 0; 880 - return; 881 - } 882 - #endif 883 887 //========================== 884 888 885 889 // read and filter out unreasonable value ··· 931 981 priv->txpower_count = 0; 932 982 } 933 983 934 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 935 984 extern void dm_txpower_trackingcallback(struct work_struct *work) 936 985 { 937 986 struct delayed_work *dwork = container_of(work,struct delayed_work,work); 938 987 struct r8192_priv *priv = container_of(dwork,struct r8192_priv,txpower_tracking_wq); 939 988 struct net_device *dev = priv->ieee80211->dev; 940 - #else 941 - extern void dm_txpower_trackingcallback(struct net_device *dev) 942 - { 943 - struct r8192_priv *priv = ieee80211_priv(dev); 944 - #endif 945 989 946 990 #ifdef RTL8190P 947 991 dm_TXPowerTrackingCallback_TSSI(dev); ··· 1494 1550 { 1495 1551 if((tx_power_track_counter % 30 == 0)&&(tx_power_track_counter != 0)) 1496 1552 { 1497 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 1498 1553 queue_delayed_work(priv->priv_wq,&priv->txpower_tracking_wq,0); 1499 - #else 1500 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 1501 - schedule_task(&priv->txpower_tracking_wq); 1502 - #else 1503 - queue_work(priv->priv_wq,&priv->txpower_tracking_wq); 1504 - #endif 1505 - #endif 1506 1554 } 1507 1555 tx_power_track_counter++; 1508 1556 } ··· 1506 1570 { 1507 1571 struct r8192_priv *priv = ieee80211_priv(dev); 1508 1572 static u8 TM_Trigger=0; 1509 - #if 0 1510 - u1Byte i; 1511 - u4Byte tmpRegA; 1512 - for(i=0; i<50; i++) 1513 - { 1514 - tmpRegA = PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x12, 0x078); // 0x12: RF Reg[10:7] 1515 - PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4d); 1516 - //delay_us(100); 1517 - PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4f); 1518 - //delay_us(100); 1519 - } 1520 - DbgPrint("Trigger and readback ThermalMeter, write RF reg0x2 = 0x4d to 0x4f for 50 times\n"); 1521 - #else 1522 1573 //DbgPrint("dm_CheckTXPowerTracking() \n"); 1523 1574 if(!priv->btxpower_tracking) 1524 1575 return; ··· 1533 1610 else 1534 1611 { 1535 1612 //DbgPrint("Schedule TxPowerTrackingWorkItem\n"); 1536 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 1537 1613 queue_delayed_work(priv->priv_wq,&priv->txpower_tracking_wq,0); 1538 - #else 1539 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 1540 - schedule_task(&priv->txpower_tracking_wq); 1541 - #else 1542 - queue_work(priv->priv_wq,&priv->txpower_tracking_wq); 1543 - #endif 1544 - #endif 1545 1614 TM_Trigger = 0; 1546 1615 } 1547 - #endif 1548 1616 } 1549 1617 1550 1618 ··· 1743 1829 //cosa PlatformEFIOWrite4Byte(Adapter, RATR0, ((pu4Byte)(val))[0]); 1744 1830 write_nic_dword(dev, RATR0, ratr_value); 1745 1831 write_nic_byte(dev, UFWP, 1); 1746 - #if 0 // Disable old code. 1747 - u1Byte index; 1748 - u4Byte input_value; 1749 - index = (u1Byte)((((pu4Byte)(val))[0]) >> 28); 1750 - input_value = (((pu4Byte)(val))[0]) & 0x0fffffff; 1751 - // TODO: Correct it. Emily 2007.01.11 1752 - PlatformEFIOWrite4Byte(Adapter, RATR0+index*4, input_value); 1753 - #endif 1754 1832 } 1755 1833 //Resore TX Power Tracking Index 1756 1834 if(priv->btxpower_trackingInit && priv->btxpower_tracking){ ··· 2005 2099 } 2006 2100 } 2007 2101 2008 - #if 0 2009 - extern void dm_force_tx_fw_info(struct net_device *dev, 2010 - u32 force_type, 2011 - u32 force_value) 2012 - { 2013 - struct r8192_priv *priv = ieee80211_priv(dev); 2014 - 2015 - if (force_type == 0) // don't force TxSC 2016 - { 2017 - //DbgPrint("Set Force SubCarrier Off\n"); 2018 - priv->tx_fwinfo_force_subcarriermode = 0; 2019 - } 2020 - else if(force_type == 1) //force 2021 - { 2022 - //DbgPrint("Set Force SubCarrier On\n"); 2023 - priv->tx_fwinfo_force_subcarriermode = 1; 2024 - if(force_value > 3) 2025 - force_value = 3; 2026 - priv->tx_fwinfo_force_subcarrierval = (u8)force_value; 2027 - } 2028 - } 2029 - #endif 2030 2102 2031 2103 /*----------------------------------------------------------------------------- 2032 2104 * Function: dm_dig_init() ··· 2643 2759 priv->bis_cur_rdlstate = false; 2644 2760 } // dm_init_edca_turbo 2645 2761 2646 - #if 1 2647 2762 static void dm_check_edca_turbo( 2648 2763 struct net_device * dev) 2649 2764 { ··· 2660 2777 // Do not be Turbo if it's under WiFi config and Qos Enabled, because the EDCA parameters 2661 2778 // should follow the settings from QAP. By Bruce, 2007-12-07. 2662 2779 // 2663 - #if 1 2664 2780 if(priv->ieee80211->state != IEEE80211_LINKED) 2665 2781 goto dm_CheckEdcaTurbo_EXIT; 2666 - #endif 2667 2782 // We do not turn on EDCA turbo mode for some AP that has IOT issue 2668 2783 if(priv->ieee80211->pHTInfo->IOTAction & HT_IOT_ACT_DISABLE_EDCA_TURBO) 2669 2784 goto dm_CheckEdcaTurbo_EXIT; ··· 2752 2871 lastTxOkCnt = priv->stats.txbytesunicast; 2753 2872 lastRxOkCnt = priv->stats.rxbytesunicast; 2754 2873 } // dm_CheckEdcaTurbo 2755 - #endif 2756 2874 2757 2875 extern void DM_CTSToSelfSetting(struct net_device * dev,u32 DM_Type, u32 DM_Value) 2758 2876 { ··· 2812 2932 } 2813 2933 else //uplink 2814 2934 { 2815 - #if 1 2816 2935 pHTInfo->IOTAction |= HT_IOT_ACT_FORCED_CTS2SELF; 2817 - #else 2818 - if(priv->undecorated_smoothed_pwdb < priv->ieee80211->CTSToSelfTH) // disable CTS to self 2819 - { 2820 - pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF; 2821 - //DbgPrint("dm_CTSToSelf() ==> CTS to self disabled\n"); 2822 - } 2823 - else if(priv->undecorated_smoothed_pwdb >= (priv->ieee80211->CTSToSelfTH+5)) // enable CTS to self 2824 - { 2825 - pHTInfo->IOTAction |= HT_IOT_ACT_FORCED_CTS2SELF; 2826 - //DbgPrint("dm_CTSToSelf() ==> CTS to self enabled\n"); 2827 - } 2828 - #endif 2829 2936 } 2830 2937 2831 2938 lastTxOkCnt = priv->stats.txbytesunicast; ··· 2820 2953 } 2821 2954 } 2822 2955 2823 - 2824 - #if 0 2825 - /*----------------------------------------------------------------------------- 2826 - * Function: dm_rf_operation_test_callback() 2827 - * 2828 - * Overview: Only for RF operation test now. 2829 - * 2830 - * Input: NONE 2831 - * 2832 - * Output: NONE 2833 - * 2834 - * Return: NONE 2835 - * 2836 - * Revised History: 2837 - * When Who Remark 2838 - * 05/29/2008 amy Create Version 0 porting from windows code. 2839 - * 2840 - *---------------------------------------------------------------------------*/ 2841 - extern void dm_rf_operation_test_callback(unsigned long dev) 2842 - { 2843 - // struct r8192_priv *priv = ieee80211_priv((struct net_device *)dev); 2844 - u8 erfpath; 2845 - 2846 - 2847 - for(erfpath=0; erfpath<4; erfpath++) 2848 - { 2849 - //DbgPrint("Set RF-%d\n\r", eRFPath); 2850 - //PHY_SetRFReg(Adapter, (RF90_RADIO_PATH_E)eRFPath, 0x2c, bMask12Bits, 0x3d7); 2851 - udelay(100); 2852 - } 2853 - 2854 - { 2855 - //PlatformSetPeriodicTimer(Adapter, &pHalData->RfTest1Timer, 500); 2856 - } 2857 - 2858 - // For test 2859 - { 2860 - //u8 i; 2861 - //PlatformSetPeriodicTimer(Adapter, &pHalData->RfTest1Timer, 500); 2862 - #if 0 2863 - for(i=0; i<50; i++) 2864 - { 2865 - // Write Test 2866 - PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4d); 2867 - //delay_us(100); 2868 - PHY_SetRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits, 0x4f); 2869 - //delay_us(100); 2870 - PHY_SetRFReg(Adapter, RF90_PATH_C, 0x02, bMask12Bits, 0x4d); 2871 - //delay_us(100); 2872 - PHY_SetRFReg(Adapter, RF90_PATH_C, 0x02, bMask12Bits, 0x4f); 2873 - //delay_us(100); 2874 - 2875 - #if 0 2876 - // Read test 2877 - PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits); 2878 - //delay_us(100); 2879 - PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x02, bMask12Bits); 2880 - //delay_us(100); 2881 - PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x12, bMask12Bits); 2882 - //delay_us(100); 2883 - PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x12, bMask12Bits); 2884 - //delay_us(100); 2885 - PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x21, bMask12Bits); 2886 - //delay_us(100); 2887 - PHY_QueryRFReg(Adapter, RF90_PATH_A, 0x21, bMask12Bits); 2888 - //delay_us(100); 2889 - #endif 2890 - } 2891 - #endif 2892 - } 2893 - 2894 - } /* DM_RfOperationTestCallBack */ 2895 - #endif 2896 2956 2897 2957 /*----------------------------------------------------------------------------- 2898 2958 * Function: dm_check_rfctrl_gpio() ··· 2837 3043 * 05/28/2008 amy Create Version 0 porting from windows code. 2838 3044 * 2839 3045 *---------------------------------------------------------------------------*/ 2840 - #if 1 2841 3046 static void dm_check_rfctrl_gpio(struct net_device * dev) 2842 3047 { 2843 3048 //struct r8192_priv *priv = ieee80211_priv(dev); ··· 2853 3060 return; 2854 3061 #endif 2855 3062 #ifdef RTL8192E 2856 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 2857 3063 queue_delayed_work(priv->priv_wq,&priv->gpio_change_rf_wq,0); 2858 - #else 2859 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 2860 - schedule_task(&priv->gpio_change_rf_wq); 2861 - #else 2862 - queue_work(priv->priv_wq,&priv->gpio_change_rf_wq); 2863 - #endif 2864 - #endif 2865 3064 #endif 2866 3065 2867 3066 } /* dm_CheckRfCtrlGPIO */ 2868 3067 2869 - #endif 2870 3068 /*----------------------------------------------------------------------------- 2871 3069 * Function: dm_check_pbc_gpio() 2872 3070 * ··· 2913 3129 * 02/21/2008 MHC Create Version 0. 2914 3130 * 2915 3131 *---------------------------------------------------------------------------*/ 2916 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 2917 3132 extern void dm_gpio_change_rf_callback(struct work_struct *work) 2918 3133 { 2919 3134 struct delayed_work *dwork = container_of(work,struct delayed_work,work); 2920 3135 struct r8192_priv *priv = container_of(dwork,struct r8192_priv,gpio_change_rf_wq); 2921 3136 struct net_device *dev = priv->ieee80211->dev; 2922 - #else 2923 - extern void dm_gpio_change_rf_callback(struct net_device *dev) 2924 - { 2925 - struct r8192_priv *priv = ieee80211_priv(dev); 2926 - #endif 2927 3137 u8 tmp1byte; 2928 3138 RT_RF_POWER_STATE eRfPowerStateToSet; 2929 3139 bool bActuallySet = false; ··· 2985 3207 * 01/30/2008 MHC Create Version 0. 2986 3208 * 2987 3209 *---------------------------------------------------------------------------*/ 2988 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 2989 3210 extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work) 2990 3211 { 2991 3212 struct delayed_work *dwork = container_of(work,struct delayed_work,work); 2992 3213 struct r8192_priv *priv = container_of(dwork,struct r8192_priv,rfpath_check_wq); 2993 3214 struct net_device *dev =priv->ieee80211->dev; 2994 - #else 2995 - extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev) 2996 - { 2997 - struct r8192_priv *priv = ieee80211_priv(dev); 2998 - #endif 2999 3215 //bool bactually_set = false; 3000 3216 u8 rfpath = 0, i; 3001 3217 ··· 3314 3542 static void dm_check_rx_path_selection(struct net_device *dev) 3315 3543 { 3316 3544 struct r8192_priv *priv = ieee80211_priv(dev); 3317 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 3318 3545 queue_delayed_work(priv->priv_wq,&priv->rfpath_check_wq,0); 3319 - #else 3320 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 3321 - schedule_task(&priv->rfpath_check_wq); 3322 - #else 3323 - queue_work(priv->priv_wq,&priv->rfpath_check_wq); 3324 - #endif 3325 - #endif 3326 3546 } /* dm_CheckRxRFPath */ 3327 3547 3328 3548 ··· 3662 3898 #endif 3663 3899 3664 3900 reg_c38_State = RegC38_NonFsync_Other_AP; 3665 - #if 0//cosa 3666 - if (Adapter->HardwareType == HARDWARE_TYPE_RTL8190P) 3667 - DbgPrint("Fsync is idle, rssi<=35, write 0xc38 = 0x%x \n", 0x10); 3668 - else 3669 - DbgPrint("Fsync is idle, rssi<=35, write 0xc38 = 0x%x \n", 0x90); 3670 - #endif 3671 3901 } 3672 3902 } 3673 3903 else if(priv->undecorated_smoothed_pwdb >= (RegC38_TH+5)) ··· 3706 3948 } 3707 3949 } 3708 3950 3709 - #if 0 3710 - /*----------------------------------------------------------------------------- 3711 - * Function: DM_CheckLBusStatus() 3712 - * 3713 - * Overview: For 9x series, we must make sure LBUS is active for IO. 3714 - * 3715 - * Input: NONE 3716 - * 3717 - * Output: NONE 3718 - * 3719 - * Return: NONE 3720 - * 3721 - * Revised History: 3722 - * When Who Remark 3723 - * 02/22/2008 MHC Create Version 0. 3724 - * 3725 - *---------------------------------------------------------------------------*/ 3726 - extern s1Byte DM_CheckLBusStatus(IN PADAPTER Adapter) 3727 - { 3728 - PMGNT_INFO pMgntInfo=&Adapter->MgntInfo; 3729 - 3730 - #if (HAL_CODE_BASE & RTL819X) 3731 - 3732 - #if (HAL_CODE_BASE == RTL8192) 3733 - 3734 - #if( DEV_BUS_TYPE==PCI_INTERFACE) 3735 - //return (pMgntInfo->bLbusEnable); // For debug only 3736 - return TRUE; 3737 - #endif 3738 - 3739 - #if( DEV_BUS_TYPE==USB_INTERFACE) 3740 - return TRUE; 3741 - #endif 3742 - 3743 - #endif // #if (HAL_CODE_BASE == RTL8192) 3744 - 3745 - #if (HAL_CODE_BASE == RTL8190) 3746 - return TRUE; 3747 - #endif // #if (HAL_CODE_BASE == RTL8190) 3748 - 3749 - #endif // #if (HAL_CODE_BASE & RTL819X) 3750 - } /* DM_CheckLBusStatus */ 3751 - 3752 - #endif 3753 3951 3754 3952 /*----------------------------------------------------------------------------- 3755 3953 * Function: dm_shadow_init() ··· 3878 4164 // 0x1e0(byte) to botify driver. 3879 4165 write_nic_byte(dev, DRIVER_RSSI, (u8)priv->undecorated_smoothed_pwdb); 3880 4166 return; 3881 - #if 1 3882 4167 tx_cmd.Op = TXCMD_SET_RX_RSSI; 3883 4168 tx_cmd.Length = 4; 3884 4169 tx_cmd.Value = priv->undecorated_smoothed_pwdb; 3885 4170 3886 4171 cmpk_message_handle_tx(dev, (u8*)&tx_cmd, 3887 4172 DESC_PACKET_TYPE_INIT, sizeof(DCMD_TXCMD_T)); 3888 - #endif 3889 4173 } 3890 4174 3891 4175 /*---------------------------Define function prototype------------------------*/
-55
drivers/staging/rtl8192u/r8192U_dm.h
··· 62 62 #define Initial_Tx_Rate_Reg 0x1b9 63 63 #define Tx_Retry_Count_Reg 0x1ac 64 64 #define RegC38_TH 20 65 - #if 0 66 - //---------------------------------------------------------------------------- 67 - // 8190 Rate Adaptive Table Register (offset 0x320, 4 byte) 68 - //---------------------------------------------------------------------------- 69 - 70 - //CCK 71 - #define RATR_1M 0x00000001 72 - #define RATR_2M 0x00000002 73 - #define RATR_55M 0x00000004 74 - #define RATR_11M 0x00000008 75 - //OFDM 76 - #define RATR_6M 0x00000010 77 - #define RATR_9M 0x00000020 78 - #define RATR_12M 0x00000040 79 - #define RATR_18M 0x00000080 80 - #define RATR_24M 0x00000100 81 - #define RATR_36M 0x00000200 82 - #define RATR_48M 0x00000400 83 - #define RATR_54M 0x00000800 84 - //MCS 1 Spatial Stream 85 - #define RATR_MCS0 0x00001000 86 - #define RATR_MCS1 0x00002000 87 - #define RATR_MCS2 0x00004000 88 - #define RATR_MCS3 0x00008000 89 - #define RATR_MCS4 0x00010000 90 - #define RATR_MCS5 0x00020000 91 - #define RATR_MCS6 0x00040000 92 - #define RATR_MCS7 0x00080000 93 - //MCS 2 Spatial Stream 94 - #define RATR_MCS8 0x00100000 95 - #define RATR_MCS9 0x00200000 96 - #define RATR_MCS10 0x00400000 97 - #define RATR_MCS11 0x00800000 98 - #define RATR_MCS12 0x01000000 99 - #define RATR_MCS13 0x02000000 100 - #define RATR_MCS14 0x04000000 101 - #define RATR_MCS15 0x08000000 102 - // ALL CCK Rate 103 - #define RATE_ALL_CCK RATR_1M|RATR_2M|RATR_55M|RATR_11M 104 - #define RATE_ALL_OFDM_AG RATR_6M|RATR_9M|RATR_12M|RATR_18M|RATR_24M\ 105 - |RATR_36M|RATR_48M|RATR_54M 106 - #define RATE_ALL_OFDM_2SS RATR_MCS8|RATR_MCS9 |RATR_MCS10|RATR_MCS11| \ 107 - RATR_MCS12|RATR_MCS13|RATR_MCS14|RATR_MCS15 108 - #endif 109 65 /*--------------------------Define Parameters-------------------------------*/ 110 66 111 67 ··· 231 275 extern void hal_dm_watchdog(struct net_device *dev); 232 276 233 277 extern void init_rate_adaptive(struct net_device *dev); 234 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 235 278 extern void dm_txpower_trackingcallback(struct work_struct *work); 236 - #else 237 - extern void dm_txpower_trackingcallback(struct net_device *dev); 238 - #endif 239 279 extern void dm_restore_dynamic_mechanism_state(struct net_device *dev); 240 280 extern void dm_backup_dynamic_mechanism_state(struct net_device *dev); 241 281 extern void dm_change_dynamic_initgain_thresh(struct net_device *dev, ··· 239 287 extern void dm_force_tx_fw_info(struct net_device *dev,u32 force_type, u32 force_value); 240 288 extern void dm_init_edca_turbo(struct net_device *dev); 241 289 extern void dm_rf_operation_test_callback(unsigned long data); 242 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 243 290 extern void dm_rf_pathcheck_workitemcallback(struct work_struct *work); 244 - #else 245 - extern void dm_rf_pathcheck_workitemcallback(struct net_device *dev); 246 - #endif 247 291 extern void dm_fsync_timer_callback(unsigned long data); 248 292 extern void dm_cck_txpower_adjust(struct net_device *dev,bool binch14); 249 - #if 0 250 - extern char dm_check_lbus_status(IN PADAPTER Adapter); 251 - #endif 252 293 extern void dm_shadow_init(struct net_device *dev); 253 294 extern void dm_initialize_txpower_tracking(struct net_device *dev); 254 295 /*--------------------------Exported Function prototype---------------------*/
-335
drivers/staging/rtl8192u/r8192U_hw.h
··· 39 39 BaseBand_Config_PHY_REG = 0, //Radio Path A 40 40 BaseBand_Config_AGC_TAB = 1, //Radio Path B 41 41 }BaseBand_Config_Type, *PBaseBand_Config_Type; 42 - #if 0 43 - typedef enum _RT_RF_TYPE_819xU{ 44 - RF_TYPE_MIN = 0, 45 - RF_8225, 46 - RF_8256, 47 - RF_8258, 48 - RF_PSEUDO_11N = 4, 49 - }RT_RF_TYPE_819xU, *PRT_RF_TYPE_819xU; 50 - #endif 51 42 #define RTL8187_REQT_READ 0xc0 52 43 #define RTL8187_REQT_WRITE 0x40 53 44 #define RTL8187_REQ_GET_REGS 0x05 ··· 399 408 MAC4 = 0x004, 400 409 MAC5 = 0x005, 401 410 402 - #if 0 403 - /* 0x0006 - 0x0007 - reserved */ 404 - RXFIFOCOUNT = 0x010, 405 - TXFIFOCOUNT = 0x012, 406 - BQREQ = 0x013, 407 - /* 0x0010 - 0x0017 - reserved */ 408 - TSFTR = 0x018, 409 - TLPDA = 0x020, 410 - TNPDA = 0x024, 411 - THPDA = 0x028, 412 - BSSID = 0x02E, 413 - RESP_RATE = 0x034, 414 - CMD = 0x037, 415 - #define CMD_RST_SHIFT 4 416 - #define CMD_RESERVED_MASK ((1<<1) | (1<<5) | (1<<6) | (1<<7)) 417 - #define CMD_RX_ENABLE_SHIFT 3 418 - #define CMD_TX_ENABLE_SHIFT 2 419 - #define CR_RST ((1<< 4)) 420 - #define CR_RE ((1<< 3)) 421 - #define CR_TE ((1<< 2)) 422 - #define CR_MulRW ((1<< 0)) 423 - 424 - INTA_MASK = 0x03c, 425 - INTA = 0x03e, 426 - #define INTA_TXOVERFLOW (1<<15) 427 - #define INTA_TIMEOUT (1<<14) 428 - #define INTA_BEACONTIMEOUT (1<<13) 429 - #define INTA_ATIM (1<<12) 430 - #define INTA_BEACONDESCERR (1<<11) 431 - #define INTA_BEACONDESCOK (1<<10) 432 - #define INTA_HIPRIORITYDESCERR (1<<9) 433 - #define INTA_HIPRIORITYDESCOK (1<<8) 434 - #define INTA_NORMPRIORITYDESCERR (1<<7) 435 - #define INTA_NORMPRIORITYDESCOK (1<<6) 436 - #define INTA_RXOVERFLOW (1<<5) 437 - #define INTA_RXDESCERR (1<<4) 438 - #define INTA_LOWPRIORITYDESCERR (1<<3) 439 - #define INTA_LOWPRIORITYDESCOK (1<<2) 440 - #define INTA_RXCRCERR (1<<1) 441 - #define INTA_RXOK (1) 442 - TX_CONF = 0x040, 443 - #define TX_CONF_HEADER_AUTOICREMENT_SHIFT 30 444 - #define TX_LOOPBACK_SHIFT 17 445 - #define TX_LOOPBACK_MAC 1 446 - #define TX_LOOPBACK_BASEBAND 2 447 - #define TX_LOOPBACK_NONE 0 448 - #define TX_LOOPBACK_CONTINUE 3 449 - #define TX_LOOPBACK_MASK ((1<<17)|(1<<18)) 450 - #define TX_LRLRETRY_SHIFT 0 451 - #define TX_SRLRETRY_SHIFT 8 452 - #define TX_NOICV_SHIFT 19 453 - #define TX_NOCRC_SHIFT 16 454 - #define TCR_DurProcMode ((1<<30)) 455 - #define TCR_DISReqQsize ((1<<28)) 456 - #define TCR_HWVERID_MASK ((1<<27)|(1<<26)|(1<<25)) 457 - #define TCR_HWVERID_SHIFT 25 458 - #define TCR_SWPLCPLEN ((1<<24)) 459 - #define TCR_PLCP_LEN TCR_SAT // rtl8180 460 - #define TCR_MXDMA_MASK ((1<<23)|(1<<22)|(1<<21)) 461 - #define TCR_MXDMA_1024 6 462 - #define TCR_MXDMA_2048 7 463 - #define TCR_MXDMA_SHIFT 21 464 - #define TCR_DISCW ((1<<20)) 465 - #define TCR_ICV ((1<<19)) 466 - #define TCR_LBK ((1<<18)|(1<<17)) 467 - #define TCR_LBK1 ((1<<18)) 468 - #define TCR_LBK0 ((1<<17)) 469 - #define TCR_CRC ((1<<16)) 470 - #define TCR_SRL_MASK ((1<<15)|(1<<14)|(1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)|(1<<8)) 471 - #define TCR_LRL_MASK ((1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)) 472 - #define TCR_PROBE_NOTIMESTAMP_SHIFT 29 //rtl8185 473 - RX_CONF = 0x044, 474 - #define MAC_FILTER_MASK ((1<<0) | (1<<1) | (1<<2) | (1<<3) | (1<<5) | \ 475 - (1<<12) | (1<<18) | (1<<19) | (1<<20) | (1<<21) | (1<<22) | (1<<23)) 476 - #define RX_CHECK_BSSID_SHIFT 23 477 - #define ACCEPT_PWR_FRAME_SHIFT 22 478 - #define ACCEPT_MNG_FRAME_SHIFT 20 479 - #define ACCEPT_CTL_FRAME_SHIFT 19 480 - #define ACCEPT_DATA_FRAME_SHIFT 18 481 - #define ACCEPT_ICVERR_FRAME_SHIFT 12 482 - #define ACCEPT_CRCERR_FRAME_SHIFT 5 483 - #define ACCEPT_BCAST_FRAME_SHIFT 3 484 - #define ACCEPT_MCAST_FRAME_SHIFT 2 485 - #define ACCEPT_ALLMAC_FRAME_SHIFT 0 486 - #define ACCEPT_NICMAC_FRAME_SHIFT 1 487 - #define RX_FIFO_THRESHOLD_MASK ((1<<13) | (1<<14) | (1<<15)) 488 - #define RX_FIFO_THRESHOLD_SHIFT 13 489 - #define RX_FIFO_THRESHOLD_128 3 490 - #define RX_FIFO_THRESHOLD_256 4 491 - #define RX_FIFO_THRESHOLD_512 5 492 - #define RX_FIFO_THRESHOLD_1024 6 493 - #define RX_FIFO_THRESHOLD_NONE 7 494 - #define RX_AUTORESETPHY_SHIFT 28 495 - #define MAX_RX_DMA_MASK ((1<<8) | (1<<9) | (1<<10)) 496 - #define MAX_RX_DMA_2048 7 497 - #define MAX_RX_DMA_1024 6 498 - #define MAX_RX_DMA_SHIFT 10 499 - #define RCR_ONLYERLPKT ((1<<31)) 500 - #define RCR_CS_SHIFT 29 501 - #define RCR_CS_MASK ((1<<30) | (1<<29)) 502 - #define RCR_ENMARP ((1<<28)) 503 - #define RCR_CBSSID ((1<<23)) 504 - #define RCR_APWRMGT ((1<<22)) 505 - #define RCR_ADD3 ((1<<21)) 506 - #define RCR_AMF ((1<<20)) 507 - #define RCR_ACF ((1<<19)) 508 - #define RCR_ADF ((1<<18)) 509 - #define RCR_RXFTH ((1<<15)|(1<<14)|(1<<13)) 510 - #define RCR_RXFTH2 ((1<<15)) 511 - #define RCR_RXFTH1 ((1<<14)) 512 - #define RCR_RXFTH0 ((1<<13)) 513 - #define RCR_AICV ((1<<12)) 514 - #define RCR_MXDMA ((1<<10)|(1<< 9)|(1<< 8)) 515 - #define RCR_MXDMA2 ((1<<10)) 516 - #define RCR_MXDMA1 ((1<< 9)) 517 - #define RCR_MXDMA0 ((1<< 8)) 518 - #define RCR_9356SEL ((1<< 6)) 519 - #define RCR_ACRC32 ((1<< 5)) 520 - #define RCR_AB ((1<< 3)) 521 - #define RCR_AM ((1<< 2)) 522 - #define RCR_APM ((1<< 1)) 523 - #define RCR_AAP ((1<< 0)) 524 - INT_TIMEOUT = 0x048, 525 - TX_BEACON_RING_ADDR = 0x04c, 526 - EPROM_CMD = 0x58, 527 - #define EPROM_CMD_RESERVED_MASK ((1<<5)|(1<<4)) 528 - #define EPROM_CMD_OPERATING_MODE_SHIFT 6 529 - #define EPROM_CMD_OPERATING_MODE_MASK ((1<<7)|(1<<6)) 530 - #define EPROM_CMD_CONFIG 0x3 531 - #define EPROM_CMD_NORMAL 0 532 - #define EPROM_CMD_LOAD 1 533 - #define EPROM_CMD_PROGRAM 2 534 - #define EPROM_CS_SHIFT 3 535 - #define EPROM_CK_SHIFT 2 536 - #define EPROM_W_SHIFT 1 537 - #define EPROM_R_SHIFT 0 538 - CONFIG0 = 0x051, 539 - #define CONFIG0_WEP104 ((1<<6)) 540 - #define CONFIG0_LEDGPO_En ((1<<4)) 541 - #define CONFIG0_Aux_Status ((1<<3)) 542 - #define CONFIG0_GL ((1<<1)|(1<<0)) 543 - #define CONFIG0_GL1 ((1<<1)) 544 - #define CONFIG0_GL0 ((1<<0)) 545 - CONFIG1 = 0x052, 546 - #define CONFIG1_LEDS ((1<<7)|(1<<6)) 547 - #define CONFIG1_LEDS1 ((1<<7)) 548 - #define CONFIG1_LEDS0 ((1<<6)) 549 - #define CONFIG1_LWACT ((1<<4)) 550 - #define CONFIG1_MEMMAP ((1<<3)) 551 - #define CONFIG1_IOMAP ((1<<2)) 552 - #define CONFIG1_VPD ((1<<1)) 553 - #define CONFIG1_PMEn ((1<<0)) 554 - CONFIG2 = 0x053, 555 - #define CONFIG2_LCK ((1<<7)) 556 - #define CONFIG2_ANT ((1<<6)) 557 - #define CONFIG2_DPS ((1<<3)) 558 - #define CONFIG2_PAPE_sign ((1<<2)) 559 - #define CONFIG2_PAPE_time ((1<<1)|(1<<0)) 560 - #define CONFIG2_PAPE_time1 ((1<<1)) 561 - #define CONFIG2_PAPE_time0 ((1<<0)) 562 - ANA_PARAM = 0x054, 563 - CONFIG3 = 0x059, 564 - #define CONFIG3_GNTSel ((1<<7)) 565 - #define CONFIG3_PARM_En ((1<<6)) 566 - #define CONFIG3_Magic ((1<<5)) 567 - #define CONFIG3_CardB_En ((1<<3)) 568 - #define CONFIG3_CLKRUN_En ((1<<2)) 569 - #define CONFIG3_FuncRegEn ((1<<1)) 570 - #define CONFIG3_FBtbEn ((1<<0)) 571 - #define CONFIG3_CLKRUN_SHIFT 2 572 - #define CONFIG3_ANAPARAM_W_SHIFT 6 573 - CONFIG4 = 0x05a, 574 - #define CONFIG4_VCOPDN ((1<<7)) 575 - #define CONFIG4_PWROFF ((1<<6)) 576 - #define CONFIG4_PWRMGT ((1<<5)) 577 - #define CONFIG4_LWPME ((1<<4)) 578 - #define CONFIG4_LWPTN ((1<<2)) 579 - #define CONFIG4_RFTYPE ((1<<1)|(1<<0)) 580 - #define CONFIG4_RFTYPE1 ((1<<1)) 581 - #define CONFIG4_RFTYPE0 ((1<<0)) 582 - TESTR = 0x05b, 583 - #define TFPC_AC 0x05C 584 - 585 - #define SCR 0x05F 586 - PGSELECT = 0x05e, 587 - #define PGSELECT_PG_SHIFT 0 588 - SECURITY = 0x05f, 589 - #define SECURITY_WEP_TX_ENABLE_SHIFT 1 590 - #define SECURITY_WEP_RX_ENABLE_SHIFT 0 591 - #define SECURITY_ENCRYP_104 1 592 - #define SECURITY_ENCRYP_SHIFT 4 593 - #define SECURITY_ENCRYP_MASK ((1<<4)|(1<<5)) 594 - ANA_PARAM2 = 0x060, 595 - BEACON_INTERVAL = 0x070, 596 - #define BEACON_INTERVAL_MASK ((1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)| \ 597 - (1<<6)|(1<<7)|(1<<8)|(1<<9)) 598 - ATIM_WND = 0x072, 599 - #define ATIM_WND_MASK (0x01FF) 600 - BCN_INTR_ITV = 0x074, 601 - #define BCN_INTR_ITV_MASK (0x01FF) 602 - ATIM_INTR_ITV = 0x076, 603 - #define ATIM_INTR_ITV_MASK (0x01FF) 604 - AckTimeOutReg = 0x079, //ACK timeout register, in unit of 4 us. 605 - PHY_ADR = 0x07c, 606 - PHY_READ = 0x07e, 607 - RFPinsOutput = 0x080, 608 - RFPinsEnable = 0x082, 609 - 610 - //Page 0 611 - RFPinsSelect = 0x084, 612 - #define SW_CONTROL_GPIO 0x400 613 - RFPinsInput = 0x086, 614 - RF_PARA = 0x088, 615 - RF_TIMING = 0x08c, 616 - GP_ENABLE = 0x090, 617 - GPIO = 0x091, 618 - TX_AGC_CTL = 0x09c, 619 - #define TX_AGC_CTL_PER_PACKET_TXAGC 0x01 620 - #define TX_AGC_CTL_PERPACKET_GAIN_SHIFT 0 621 - #define TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT 1 622 - #define TX_AGC_CTL_FEEDBACK_ANT 2 623 - #define TXAGC_CTL_PER_PACKET_ANT_SEL 0x02 624 - OFDM_TXAGC = 0x09e, 625 - ANTSEL = 0x09f, 626 - WPA_CONFIG = 0x0b0, 627 - SIFS = 0x0b4, 628 - DIFS = 0x0b5, 629 - SLOT = 0x0b6, 630 - CW_CONF = 0x0bc, 631 - #define CW_CONF_PERPACKET_RETRY_LIMIT 0x02 632 - #define CW_CONF_PERPACKET_CW 0x01 633 - #define CW_CONF_PERPACKET_RETRY_SHIFT 1 634 - #define CW_CONF_PERPACKET_CW_SHIFT 0 635 - CW_VAL = 0x0bd, 636 - RATE_FALLBACK = 0x0be, 637 - #define MAX_RESP_RATE_SHIFT 4 638 - #define MIN_RESP_RATE_SHIFT 0 639 - #define RATE_FALLBACK_CTL_ENABLE 0x80 640 - #define RATE_FALLBACK_CTL_AUTO_STEP0 0x00 641 - ACM_CONTROL = 0x0BF, // ACM Control Registe 642 - //---------------------------------------------------------------------------- 643 - // 8187B ACM_CONTROL bits (Offset 0xBF, 1 Byte) 644 - //---------------------------------------------------------------------------- 645 - #define VOQ_ACM_EN (0x01 << 7) //BIT7 646 - #define VIQ_ACM_EN (0x01 << 6) //BIT6 647 - #define BEQ_ACM_EN (0x01 << 5) //BIT5 648 - #define ACM_HW_EN (0x01 << 4) //BIT4 649 - #define TXOPSEL (0x01 << 3) //BIT3 650 - #define VOQ_ACM_CTL (0x01 << 2) //BIT2 // Set to 1 when AC_VO used time reaches or exceeds the admitted time 651 - #define VIQ_ACM_CTL (0x01 << 1) //BIT1 // Set to 1 when AC_VI used time reaches or exceeds the admitted time 652 - #define BEQ_ACM_CTL (0x01 << 0) //BIT0 // Set to 1 when AC_BE used time reaches or exceeds the admitted time 653 - CONFIG5 = 0x0D8, 654 - #define CONFIG5_TX_FIFO_OK ((1<<7)) 655 - #define CONFIG5_RX_FIFO_OK ((1<<6)) 656 - #define CONFIG5_CALON ((1<<5)) 657 - #define CONFIG5_EACPI ((1<<2)) 658 - #define CONFIG5_LANWake ((1<<1)) 659 - #define CONFIG5_PME_STS ((1<<0)) 660 - TX_DMA_POLLING = 0x0d9, 661 - #define TX_DMA_POLLING_BEACON_SHIFT 7 662 - #define TX_DMA_POLLING_HIPRIORITY_SHIFT 6 663 - #define TX_DMA_POLLING_NORMPRIORITY_SHIFT 5 664 - #define TX_DMA_POLLING_LOWPRIORITY_SHIFT 4 665 - #define TX_DMA_STOP_BEACON_SHIFT 3 666 - #define TX_DMA_STOP_HIPRIORITY_SHIFT 2 667 - #define TX_DMA_STOP_NORMPRIORITY_SHIFT 1 668 - #define TX_DMA_STOP_LOWPRIORITY_SHIFT 0 669 - CWR = 0x0DC, 670 - RetryCTR = 0x0DE, 671 - INT_MIG = 0x0E2, // Interrupt Migration (0xE2 ~ 0xE3) 672 - TID_AC_MAP = 0x0E8, // TID to AC Mapping Register 673 - ANA_PARAM3 = 0x0EE, 674 - 675 - 676 - //page 1 677 - Wakeup0 = 0x084, 678 - Wakeup1 = 0x08C, 679 - Wakeup2LD = 0x094, 680 - Wakeup2HD = 0x09C, 681 - Wakeup3LD = 0x0A4, 682 - Wakeup3HD = 0x0AC, 683 - Wakeup4LD = 0x0B4, 684 - Wakeup4HD = 0x0BC, 685 - CRC0 = 0x0C4, 686 - CRC1 = 0x0C6, 687 - CRC2 = 0x0C8, 688 - CRC3 = 0x0CA, 689 - CRC4 = 0x0CC, 690 - /* 0x00CE - 0x00D3 - reserved */ 691 - 692 - RFSW_CTRL = 0x272, // 0x272-0x273. 693 - 694 - //Reg Diff between rtl8187 and rtl8187B 695 - /**************************************************************************/ 696 - BRSR_8187 = 0x02C, 697 - BRSR_8187B = 0x034, 698 - #define BRSR_BPLCP ((1<< 8)) 699 - #define BRSR_MBR ((1<< 1)|(1<< 0)) 700 - #define BRSR_MBR_8185 ((1<< 11)|(1<< 10)|(1<< 9)|(1<< 8)|(1<< 7)|(1<< 6)|(1<< 5)|(1<< 4)|(1<< 3)|(1<< 2)|(1<< 1)|(1<< 0)) 701 - #define BRSR_MBR0 ((1<< 0)) 702 - #define BRSR_MBR1 ((1<< 1)) 703 - 704 - /**************************************************************************/ 705 - EIFS_8187 = 0x035, 706 - EIFS_8187B = 0x02D, 707 - 708 - /**************************************************************************/ 709 - FER = 0x0F0, 710 - FEMR = 0x0F4, 711 - FPSR = 0x0F8, 712 - FFER = 0x0FC, 713 - 714 - AC_VO_PARAM = 0x0F0, // AC_VO Parameters Record 715 - AC_VI_PARAM = 0x0F4, // AC_VI Parameters Record 716 - AC_BE_PARAM = 0x0F8, // AC_BE Parameters Record 717 - AC_BK_PARAM = 0x0FC, // AC_BK Parameters Record 718 - TALLY_SEL = 0x0fc, 719 - //---------------------------------------------------------------------------- 720 - // 8187B AC_XX_PARAM bits 721 - //---------------------------------------------------------------------------- 722 - #define AC_PARAM_TXOP_LIMIT_OFFSET 16 723 - #define AC_PARAM_ECW_MAX_OFFSET 12 724 - #define AC_PARAM_ECW_MIN_OFFSET 8 725 - #define AC_PARAM_AIFS_OFFSET 0 726 - 727 - #endif 728 411 }; 729 412 //---------------------------------------------------------------------------- 730 413 // 818xB AnaParm & AnaParm2 Register
-82
drivers/staging/rtl8192u/r8192U_wx.c
··· 44 44 } 45 45 46 46 47 - #if 0 48 - 49 - static int r8192_wx_set_beaconinterval(struct net_device *dev, struct iw_request_info *aa, 50 - union iwreq_data *wrqu, char *b) 51 - { 52 - int *parms = (int *)b; 53 - int bi = parms[0]; 54 - 55 - struct r8192_priv *priv = ieee80211_priv(dev); 56 - 57 - down(&priv->wx_sem); 58 - DMESG("setting beacon interval to %x",bi); 59 - 60 - priv->ieee80211->beacon_interval=bi; 61 - rtl8180_commit(dev); 62 - up(&priv->wx_sem); 63 - 64 - return 0; 65 - } 66 - 67 - 68 - static int r8192_wx_set_forceassociate(struct net_device *dev, struct iw_request_info *aa, 69 - union iwreq_data *wrqu, char *extra) 70 - { 71 - struct r8192_priv *priv=ieee80211_priv(dev); 72 - int *parms = (int *)extra; 73 - 74 - priv->ieee80211->force_associate = (parms[0] > 0); 75 - 76 - 77 - return 0; 78 - } 79 - 80 - #endif 81 47 static int r8192_wx_get_mode(struct net_device *dev, struct iw_request_info *a, 82 48 union iwreq_data *wrqu, char *b) 83 49 { ··· 181 215 { 182 216 struct r8192_priv *priv = ieee80211_priv(dev); 183 217 u8 databb; 184 - #if 0 185 - int i; 186 - for(i=0;i<12;i++) printk("%8x\n", read_cam(dev, i) ); 187 - #endif 188 218 189 219 down(&priv->wx_sem); 190 220 ··· 278 316 279 317 280 318 281 - #endif 282 - #if 0 283 - static int r8192_wx_null(struct net_device *dev, 284 - struct iw_request_info *info, 285 - union iwreq_data *wrqu, char *extra) 286 - { 287 - return 0; 288 - } 289 319 #endif 290 320 static int r8192_wx_force_reset(struct net_device *dev, 291 321 struct iw_request_info *info, ··· 891 937 } 892 938 893 939 #if (WIRELESS_EXT >= 18) 894 - #if 0 895 - static int r8192_wx_get_enc_ext(struct net_device *dev, 896 - struct iw_request_info *info, 897 - union iwreq_data *wrqu, char *extra) 898 - { 899 - struct r8192_priv *priv = ieee80211_priv(dev); 900 - int ret = 0; 901 - ret = ieee80211_wx_get_encode_ext(priv->ieee80211, info, wrqu, extra); 902 - return ret; 903 - } 904 - #endif 905 940 //hw security need to reorganized. 906 941 static int r8192_wx_set_enc_ext(struct net_device *dev, 907 942 struct iw_request_info *info, 908 943 union iwreq_data *wrqu, char *extra) 909 944 { 910 945 int ret=0; 911 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 912 946 struct r8192_priv *priv = ieee80211_priv(dev); 913 947 struct ieee80211_device* ieee = priv->ieee80211; 914 948 //printk("===>%s()\n", __FUNCTION__); ··· 911 969 u32 key[4] = {0}; 912 970 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; 913 971 struct iw_point *encoding = &wrqu->encoding; 914 - #if 0 915 - static u8 CAM_CONST_ADDR[4][6] = { 916 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 917 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x01}, 918 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x02}, 919 - {0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}; 920 - #endif 921 972 u8 idx = 0, alg = 0, group = 0; 922 973 if ((encoding->flags & IW_ENCODE_DISABLED) || 923 974 ext->alg == IW_ENCODE_ALG_NONE) //none is not allowed to use hwsec WB 2008.07.01 ··· 970 1035 end_hw_sec: 971 1036 972 1037 up(&priv->wx_sem); 973 - #endif 974 1038 return ret; 975 1039 976 1040 } ··· 978 1044 union iwreq_data *data, char *extra) 979 1045 { 980 1046 int ret=0; 981 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 982 1047 //printk("====>%s()\n", __FUNCTION__); 983 1048 struct r8192_priv *priv = ieee80211_priv(dev); 984 1049 down(&priv->wx_sem); 985 1050 ret = ieee80211_wx_set_auth(priv->ieee80211, info, &(data->param), extra); 986 1051 up(&priv->wx_sem); 987 - #endif 988 1052 return ret; 989 1053 } 990 1054 ··· 993 1061 //printk("====>%s()\n", __FUNCTION__); 994 1062 995 1063 int ret=0; 996 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 997 1064 struct r8192_priv *priv = ieee80211_priv(dev); 998 1065 down(&priv->wx_sem); 999 1066 ret = ieee80211_wx_set_mlme(priv->ieee80211, info, wrqu, extra); 1000 1067 1001 1068 up(&priv->wx_sem); 1002 - #endif 1003 1069 return ret; 1004 1070 } 1005 1071 #endif ··· 1007 1077 { 1008 1078 //printk("====>%s(), len:%d\n", __FUNCTION__, data->length); 1009 1079 int ret=0; 1010 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1011 1080 struct r8192_priv *priv = ieee80211_priv(dev); 1012 1081 down(&priv->wx_sem); 1013 - #if 1 1014 1082 ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, data->data.length); 1015 - #endif 1016 1083 up(&priv->wx_sem); 1017 1084 //printk("<======%s(), ret:%d\n", __FUNCTION__, ret); 1018 - #endif 1019 1085 return ret; 1020 1086 1021 1087 ··· 1197 1271 wstats->qual.qual = 0; 1198 1272 wstats->qual.level = 0; 1199 1273 wstats->qual.noise = 0; 1200 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)) 1201 1274 wstats->qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM; 1202 - #else 1203 - wstats->qual.updated = 0x0f; 1204 - #endif 1205 1275 return wstats; 1206 1276 } 1207 1277 ··· 1209 1287 wstats->qual.level = tmp_level; 1210 1288 wstats->qual.qual = tmp_qual; 1211 1289 wstats->qual.noise = tmp_noise; 1212 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)) 1213 1290 wstats->qual.updated = IW_QUAL_ALL_UPDATED| IW_QUAL_DBM; 1214 - #else 1215 - wstats->qual.updated = 0x0f; 1216 - #endif 1217 1291 return wstats; 1218 1292 } 1219 1293 //#endif
-31
drivers/staging/rtl8192u/r819xU_cmdpkt.c
··· 318 318 /* It seems that FW use big endian(MIPS) and DRV use little endian in 319 319 windows OS. So we have to read the content byte by byte or transfer 320 320 endian type before copy the message copy. */ 321 - #if 0 // The TX FEEDBACK packet element address 322 - //rx_tx_fb.Element_ID = pMsg[0]; 323 - //rx_tx_fb.Length = pMsg[1]; 324 - rx_tx_fb.TOK = pMsg[2]>>7; 325 - rx_tx_fb.Fail_Reason = (pMsg[2] & 0x70) >> 4; 326 - rx_tx_fb.TID = (pMsg[2] & 0x0F); 327 - rx_tx_fb.Qos_Pkt = pMsg[3] >> 7; 328 - rx_tx_fb.Bandwidth = (pMsg[3] & 0x40) >> 6; 329 - rx_tx_fb.Retry_Cnt = pMsg[5]; 330 - rx_tx_fb.Pkt_ID = (pMsg[6] << 8) | pMsg[7]; 331 - rx_tx_fb.Seq_Num = (pMsg[8] << 8) | pMsg[9]; 332 - rx_tx_fb.S_Rate = pMsg[10]; 333 - rx_tx_fb.F_Rate = pMsg[11]; 334 - rx_tx_fb.S_RTS_Rate = pMsg[12]; 335 - rx_tx_fb.F_RTS_Rate = pMsg[13]; 336 - rx_tx_fb.pkt_length = (pMsg[14] << 8) | pMsg[15]; 337 - #endif 338 321 /* 2007/07/05 MH Use pointer to transfer structure memory. */ 339 322 //memcpy((UINT8 *)&rx_tx_fb, pMsg, sizeof(CMPK_TXFB_T)); 340 323 memcpy((u8*)&rx_tx_fb, pmsg, sizeof(cmpk_txfb_t)); 341 324 /* 2. Use tx feedback info to count TX statistics. */ 342 325 cmpk_count_txstatistic(dev, &rx_tx_fb); 343 - #if 0 344 - /* 2007/07/11 MH Assign current operate rate. */ 345 - if (pAdapter->RegWirelessMode == WIRELESS_MODE_A || 346 - pAdapter->RegWirelessMode == WIRELESS_MODE_B || 347 - pAdapter->RegWirelessMode == WIRELESS_MODE_G) 348 - { 349 - pMgntInfo->CurrentOperaRate = (rx_tx_fb.F_Rate & 0x7F); 350 - } 351 - else if (pAdapter->RegWirelessMode == WIRELESS_MODE_N_24G || 352 - pAdapter->RegWirelessMode == WIRELESS_MODE_N_5G) 353 - { 354 - pMgntInfo->HTCurrentOperaRate = (rx_tx_fb.F_Rate & 0x8F); 355 - } 356 - #endif 357 326 /* 2007/01/17 MH Comment previous method for TX statistic function. */ 358 327 /* Collect info TX feedback packet to fill TCB. */ 359 328 /* We can not know the packet length and transmit type: broadcast or uni
-10
drivers/staging/rtl8192u/r819xU_cmdpkt.h
··· 13 13 #define ISR_TxBcnErr BIT26 // Transmit Beacon Error 14 14 #define ISR_BcnTimerIntr BIT13 // Beacon Timer Interrupt 15 15 16 - #if 0 17 - /* Define packet type. */ 18 - typedef enum tag_packet_type 19 - { 20 - PACKET_BROADCAST, 21 - PACKET_MULTICAST, 22 - PACKET_UNICAST, 23 - PACKET_TYPE_MAX 24 - }cmpk_pkt_type_e; 25 - #endif 26 16 27 17 /* Define element ID of command packet. */ 28 18
-266
drivers/staging/rtl8192u/r819xU_firmware.c
··· 16 16 #include "r8192U_hw.h" 17 17 #include "r819xU_firmware_img.h" 18 18 #include "r819xU_firmware.h" 19 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 20 19 #include <linux/firmware.h> 21 - #endif 22 20 void firmware_init_param(struct net_device *dev) 23 21 { 24 22 struct r8192_priv *priv = ieee80211_priv(dev); ··· 105 107 106 108 return rt_status; 107 109 108 - #if 0 109 - cmdsend_downloadcode_fail: 110 - rt_status = false; 111 - RT_TRACE(COMP_ERR, "CmdSendDownloadCode fail !!\n"); 112 - return rt_status; 113 - #endif 114 110 } 115 111 116 112 bool ··· 146 154 return rtStatus; 147 155 } 148 156 149 - #if 0 150 - /* 151 - * Procedure : Download code into IMEM or DMEM 152 - * Description: This routine will intialize firmware. If any error occurs during the initialization 153 - * process, the routine shall terminate immediately and return fail. 154 - * The routine copy virtual address get from opening of file into shared memory 155 - * allocated during initialization. If code size larger than a conitneous shared 156 - * memory may contain, the code should be divided into several section. 157 - * !!!NOTES This finction should only be called during MPInitialization because 158 - * A NIC driver should call NdisOpenFile only from MiniportInitialize. 159 - * Arguments : The pointer of the adapter 160 - * Code address (Virtual address, should fill descriptor with physical address) 161 - * Code size 162 - * Returns : 163 - * RT_STATUS_FAILURE - the following initialization process should be terminated 164 - * RT_STATUS_SUCCESS - if firmware initialization process success 165 - */ 166 - bool fwsend_download_code(struct net_device *dev) 167 - { 168 - struct r8192_priv *priv = ieee80211_priv(dev); 169 - rt_firmware *pfirmware = (rt_firmware*)(&priv->firmware); 170 - 171 - bool rt_status = true; 172 - u16 length = 0; 173 - u16 offset = 0; 174 - u16 frag_threhold; 175 - bool last_init_packet = false; 176 - u32 check_txcmdwait_queueemptytime = 100000; 177 - u16 cmd_buf_len; 178 - u8 *ptr_cmd_buf; 179 - 180 - /* reset to 0 for first segment of img download */ 181 - pfirmware->firmware_seg_index = 1; 182 - 183 - if(pfirmware->firmware_seg_index == pfirmware->firmware_seg_maxnum) { 184 - last_init_packet = 1; 185 - } 186 - 187 - cmd_buf_len = pfirmware->firmware_seg_container[pfirmware->firmware_seg_index-1].seg_size; 188 - ptr_cmd_buf = pfirmware->firmware_seg_container[pfirmware->firmware_seg_index-1].seg_ptr; 189 - rtl819xU_tx_cmd(dev, ptr_cmd_buf, cmd_buf_len, last_init_packet, DESC_PACKET_TYPE_INIT); 190 - 191 - rt_status = true; 192 - return rt_status; 193 - } 194 - #endif 195 157 196 158 //----------------------------------------------------------------------------- 197 159 // Procedure: Check whether main code is download OK. If OK, turn on CPU ··· 284 338 * Download boot, main, and data image for System reset. 285 339 * Download data image for firmware reseta 286 340 */ 287 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 288 - priv->firmware_source = FW_SOURCE_HEADER_FILE; 289 - #else 290 341 priv->firmware_source = FW_SOURCE_IMG_FILE; 291 - #endif 292 342 for(init_step = starting_state; init_step <= FW_INIT_STEP2_DATA; init_step++) { 293 343 /* 294 344 * Open Image file, and map file to contineous memory if open file success. ··· 293 351 if(rst_opt == OPT_SYSTEM_RESET) { 294 352 switch(priv->firmware_source) { 295 353 case FW_SOURCE_IMG_FILE: 296 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 297 354 rc = request_firmware(&fw_entry, fw_name[init_step],&priv->udev->dev); 298 355 if(rc < 0 ) { 299 356 RT_TRACE(COMP_ERR, "request firmware fail!\n"); ··· 321 380 #endif 322 381 } 323 382 pfirmware->firmware_buf_size = file_length; 324 - #endif 325 383 break; 326 384 327 385 case FW_SOURCE_HEADER_FILE: ··· 351 411 * and Tx descriptor info 352 412 * */ 353 413 rt_status = fw_download_code(dev,mapped_file,file_length); 354 - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 355 414 if(rst_opt == OPT_SYSTEM_RESET) { 356 415 release_firmware(fw_entry); 357 416 } 358 - #endif 359 417 360 418 if(rt_status != TRUE) { 361 419 goto download_firmware_fail; ··· 425 487 426 488 } 427 489 428 - #if 0 429 - /* 430 - * Procedure: (1) Transform firmware code from little endian to big endian if required. 431 - * (2) Number of bytes in Firmware downloading should be multiple 432 - * of 4 bytes. If length is not multiple of 4 bytes, appending of zeros is required 433 - * 434 - */ 435 - void CmdAppendZeroAndEndianTransform( 436 - u1Byte *pDst, 437 - u1Byte *pSrc, 438 - u2Byte *pLength) 439 - { 440 - 441 - u2Byte ulAppendBytes = 0, i; 442 - u2Byte ulLength = *pLength; 443 - 444 - //test only 445 - //memset(pDst, 0xcc, 12); 446 - 447 - 448 - /* Transform from little endian to big endian */ 449 - //#if DEV_BUS_TYPE==PCI_INTERFACE 450 - #if 0 451 - for( i=0 ; i<(*pLength) ; i+=4) 452 - { 453 - if((i+3) < (*pLength)) pDst[i+0] = pSrc[i+3]; 454 - if((i+2) < (*pLength)) pDst[i+1] = pSrc[i+2]; 455 - if((i+1) < (*pLength)) pDst[i+2] = pSrc[i+1]; 456 - if((i+0) < (*pLength)) pDst[i+3] = pSrc[i+0]; 457 - } 458 - #else 459 - pDst += USB_HWDESC_HEADER_LEN; 460 - ulLength -= USB_HWDESC_HEADER_LEN; 461 - 462 - for( i=0 ; i<ulLength ; i+=4) { 463 - if((i+3) < ulLength) pDst[i+0] = pSrc[i+3]; 464 - if((i+2) < ulLength) pDst[i+1] = pSrc[i+2]; 465 - if((i+1) < ulLength) pDst[i+2] = pSrc[i+1]; 466 - if((i+0) < ulLength) pDst[i+3] = pSrc[i+0]; 467 - 468 - } 469 - #endif 470 - 471 - //1(2) Append Zero 472 - if( ((*pLength) % 4) >0) 473 - { 474 - ulAppendBytes = 4-((*pLength) % 4); 475 - 476 - for(i=0 ; i<ulAppendBytes; i++) 477 - pDst[ 4*((*pLength)/4) + i ] = 0x0; 478 - 479 - *pLength += ulAppendBytes; 480 - } 481 - } 482 - #endif 483 - 484 - #if 0 485 - RT_STATUS 486 - CmdSendPacket( 487 - PADAPTER Adapter, 488 - PRT_TCB pTcb, 489 - PRT_TX_LOCAL_BUFFER pBuf, 490 - u4Byte BufferLen, 491 - u4Byte PacketType, 492 - BOOLEAN bLastInitPacket 493 - ) 494 - { 495 - s2Byte i; 496 - u1Byte QueueID; 497 - u2Byte firstDesc,curDesc = 0; 498 - u2Byte FragIndex=0, FragBufferIndex=0; 499 - 500 - RT_STATUS rtStatus = RT_STATUS_SUCCESS; 501 - 502 - CmdInitTCB(Adapter, pTcb, pBuf, BufferLen); 503 - 504 - 505 - if(CmdCheckFragment(Adapter, pTcb, pBuf)) 506 - CmdFragmentTCB(Adapter, pTcb); 507 - else 508 - pTcb->FragLength[0] = (u2Byte)pTcb->BufferList[0].Length; 509 - 510 - QueueID=pTcb->SpecifiedQueueID; 511 - #if DEV_BUS_TYPE!=USB_INTERFACE 512 - firstDesc=curDesc=Adapter->NextTxDescToFill[QueueID]; 513 - #endif 514 - 515 - #if DEV_BUS_TYPE!=USB_INTERFACE 516 - if(VacancyTxDescNum(Adapter, QueueID) > pTcb->BufferCount) 517 - #else 518 - if(PlatformIsTxQueueAvailable(Adapter, QueueID, pTcb->BufferCount) && 519 - RTIsListEmpty(&Adapter->TcbWaitQueue[QueueID])) 520 - #endif 521 - { 522 - pTcb->nDescUsed=0; 523 - 524 - for(i=0 ; i<pTcb->BufferCount ; i++) 525 - { 526 - Adapter->HalFunc.TxFillCmdDescHandler( 527 - Adapter, 528 - pTcb, 529 - QueueID, //QueueIndex 530 - curDesc, //index 531 - FragBufferIndex==0, //bFirstSeg 532 - FragBufferIndex==(pTcb->FragBufCount[FragIndex]-1), //bLastSeg 533 - pTcb->BufferList[i].VirtualAddress, //VirtualAddress 534 - pTcb->BufferList[i].PhysicalAddressLow, //PhyAddressLow 535 - pTcb->BufferList[i].Length, //BufferLen 536 - i!=0, //bSetOwnBit 537 - (i==(pTcb->BufferCount-1)) && bLastInitPacket, //bLastInitPacket 538 - PacketType, //DescPacketType 539 - pTcb->FragLength[FragIndex] //PktLen 540 - ); 541 - 542 - if(FragBufferIndex==(pTcb->FragBufCount[FragIndex]-1)) 543 - { // Last segment of the fragment. 544 - pTcb->nFragSent++; 545 - } 546 - 547 - FragBufferIndex++; 548 - if(FragBufferIndex==pTcb->FragBufCount[FragIndex]) 549 - { 550 - FragIndex++; 551 - FragBufferIndex=0; 552 - } 553 - 554 - #if DEV_BUS_TYPE!=USB_INTERFACE 555 - curDesc=(curDesc+1)%Adapter->NumTxDesc[QueueID]; 556 - #endif 557 - pTcb->nDescUsed++; 558 - } 559 - 560 - #if DEV_BUS_TYPE!=USB_INTERFACE 561 - RTInsertTailList(&Adapter->TcbBusyQueue[QueueID], &pTcb->List); 562 - IncrementTxDescToFill(Adapter, QueueID, pTcb->nDescUsed); 563 - Adapter->HalFunc.SetTxDescOWNHandler(Adapter, QueueID, firstDesc); 564 - // TODO: should call poll use QueueID 565 - Adapter->HalFunc.TxPollingHandler(Adapter, TXCMD_QUEUE); 566 - #endif 567 - } 568 - else 569 - #if DEV_BUS_TYPE!=USB_INTERFACE 570 - goto CmdSendPacket_Fail; 571 - #else 572 - { 573 - pTcb->bLastInitPacket = bLastInitPacket; 574 - RTInsertTailList(&Adapter->TcbWaitQueue[pTcb->SpecifiedQueueID], &pTcb->List); 575 - } 576 - #endif 577 - 578 - return rtStatus; 579 - 580 - #if DEV_BUS_TYPE!=USB_INTERFACE 581 - CmdSendPacket_Fail: 582 - rtStatus = RT_STATUS_FAILURE; 583 - return rtStatus; 584 - #endif 585 - 586 - } 587 - #endif 588 490 589 491 590 492 591 493 592 - #if 0 593 - RT_STATUS 594 - FWSendNullPacket( 595 - IN PADAPTER Adapter, 596 - IN u4Byte Length 597 - ) 598 - { 599 - RT_STATUS rtStatus = RT_STATUS_SUCCESS; 600 494 601 - 602 - PRT_TCB pTcb; 603 - PRT_TX_LOCAL_BUFFER pBuf; 604 - BOOLEAN bLastInitPacket = FALSE; 605 - 606 - PlatformAcquireSpinLock(Adapter, RT_TX_SPINLOCK); 607 - 608 - #if DEV_BUS_TYPE==USB_INTERFACE 609 - Length += USB_HWDESC_HEADER_LEN; 610 - #endif 611 - 612 - //Get TCB and local buffer from common pool. (It is shared by CmdQ, MgntQ, and USB coalesce DataQ) 613 - if(MgntGetBuffer(Adapter, &pTcb, &pBuf)) 614 - { 615 - PlatformZeroMemory(pBuf->Buffer.VirtualAddress, Length); 616 - rtStatus = CmdSendPacket(Adapter, pTcb, pBuf, Length, DESC_PACKET_TYPE_INIT, bLastInitPacket); //0 : always set LastInitPacket to zero 617 - //#if HAL_CODE_BASE != RTL8190HW 618 - // // TODO: for test only 619 - // ReturnTCB(Adapter, pTcb, RT_STATUS_SUCCESS); 620 - //#endif 621 - if(rtStatus == RT_STATUS_FAILURE) 622 - goto CmdSendNullPacket_Fail; 623 - }else 624 - goto CmdSendNullPacket_Fail; 625 - 626 - PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK); 627 - return rtStatus; 628 - 629 - 630 - CmdSendNullPacket_Fail: 631 - PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK); 632 - rtStatus = RT_STATUS_FAILURE; 633 - RT_ASSERT(rtStatus == RT_STATUS_SUCCESS, ("CmdSendDownloadCode fail !!\n")); 634 - return rtStatus; 635 - } 636 - #endif 637 495 638 496
-41
drivers/staging/rtl8192u/r819xU_firmware.h
··· 23 23 OPT_FIRMWARE_RESET = 1, 24 24 }opt_rst_type_e; 25 25 26 - #if 0 27 - /* CPU related */ 28 - RT_STATUS 29 - CPUCheckMainCodeOKAndTurnOnCPU( 30 - IN PADAPTER Adapter 31 - ); 32 - 33 - RT_STATUS 34 - CPUCheckFirmwareReady( 35 - IN PADAPTER Adapter 36 - ); 37 - 38 - /* Firmware related */ 39 - VOID 40 - FWInitializeParameters( 41 - IN PADAPTER Adapter 42 - ); 43 - 44 - RT_STATUS 45 - FWSendDownloadCode( 46 - IN PADAPTER Adapter, 47 - IN pu1Byte CodeVirtualAddrress, 48 - IN u4Byte BufferLen 49 - ); 50 - 51 - RT_STATUS 52 - FWSendNullPacket( 53 - IN PADAPTER Adapter, 54 - IN u4Byte Length 55 - ); 56 - 57 - RT_STATUS 58 - CmdSendPacket( 59 - PADAPTER Adapter, 60 - PRT_TCB pTcb, 61 - PRT_TX_LOCAL_BUFFER pBuf, 62 - u4Byte BufferLen, 63 - u4Byte PacketType, 64 - BOOLEAN bLastInitPacket 65 - ); 66 - #endif 67 26 #endif 68 27
-49
drivers/staging/rtl8192u/r819xU_phy.c
··· 1079 1079 switch( eRFPowerState ) 1080 1080 { 1081 1081 case eRfOn: 1082 - #if 0 1083 - rtl8192_setBBreg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x1); // 0x860[4] 1084 - rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0x300, 0x3); // 0x88c[4] 1085 - rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x60, 0x3); // 0x880[6:5] 1086 - rtl8192_setBBreg(dev, rOFDM0_TRxPathEnable, 0xf, 0x3); // 0xc04[3:0] 1087 - rtl8192_setBBreg(dev, rOFDM1_TRxPathEnable, 0xf, 0x3); // 0xd04[3:0] 1088 - rtl8192_setBBreg(dev, rFPGA0_AnalogParameter2, 0x7000, 0x3); // 0x884[14:12] 1089 - // for(eRFPath = 0; eRFPath <pHalData->NumTotalRFPath; eRFPath++) 1090 - // PHY_SetRFReg(Adapter, (RF90_RADIO_PATH_E)eRFPath, 0x4, 0xC00, 0x2); 1091 - 1092 - //SwChnl(Adapter->ChannelID); 1093 - #endif 1094 1082 //RF-A, RF-B 1095 1083 //enable RF-Chip A/B 1096 1084 rtl8192_setBBreg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x1); // 0x860[4] ··· 1100 1112 break; 1101 1113 1102 1114 case eRfOff: 1103 - #if 0 1104 - rtl8192_setBBreg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x0); // 0x860[4] 1105 - rtl8192_setBBreg(dev, rFPGA0_AnalogParameter4, 0x300, 0x0); // 0x88c[4] 1106 - rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x60, 0x0); // 0x880[6:5] 1107 - rtl8192_setBBreg(dev, rOFDM0_TRxPathEnable, 0xf, 0); // 0xc04[3:0] 1108 - rtl8192_setBBreg(dev, rOFDM1_TRxPathEnable, 0xf, 0); // 0xd04[3:0] 1109 - rtl8192_setBBreg(dev, rFPGA0_AnalogParameter2, 0x7000, 0x0); // 0x884[14:12] 1110 - // for(eRFPath = 0; eRFPath <pHalData->NumTotalRFPath; eRFPath++) 1111 - // PHY_SetRFReg(Adapter, (RF90_RADIO_PATH_E)eRFPath, 0x4, 0xC00, 0x0); 1112 - #endif 1113 1115 //RF-A, RF-B 1114 1116 //disable RF-Chip A/B 1115 1117 rtl8192_setBBreg(dev, rFPGA0_XA_RFInterfaceOE, BIT4, 0x0); // 0x860[4] ··· 1560 1582 rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x00100000, 1); 1561 1583 1562 1584 // Correct the tx power for CCK rate in 20M. Suggest by YN, 20071207 1563 - #if 0 1564 - write_nic_dword(dev, rCCK0_TxFilter1, 0x1a1b0000); 1565 - write_nic_dword(dev, rCCK0_TxFilter2, 0x090e1317); 1566 - write_nic_dword(dev, rCCK0_DebugPort, 0x00000204); 1567 - #endif 1568 1585 priv->cck_present_attentuation = 1569 1586 priv->cck_present_attentuation_20Mdefault + priv->cck_present_attentuation_difference; 1570 1587 ··· 1590 1617 rtl8192_setBBreg(dev, rCCK0_System, bCCKSideBand, (priv->nCur40MhzPrimeSC>>1)); 1591 1618 rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x00100000, 0); 1592 1619 rtl8192_setBBreg(dev, rOFDM1_LSTF, 0xC00, priv->nCur40MhzPrimeSC); 1593 - #if 0 1594 - // Correct the tx power for CCK rate in 40M. Suggest by YN, 20071207 1595 - write_nic_dword(dev, rCCK0_TxFilter1, 0x35360000); 1596 - write_nic_dword(dev, rCCK0_TxFilter2, 0x121c252e); 1597 - write_nic_dword(dev, rCCK0_DebugPort, 0x00000409); 1598 - #endif 1599 1620 priv->cck_present_attentuation = 1600 1621 priv->cck_present_attentuation_40Mdefault + priv->cck_present_attentuation_difference; 1601 1622 ··· 1620 1653 } 1621 1654 //Skip over setting of J-mode in BB register here. Default value is "None J mode". Emily 20070315 1622 1655 1623 - #if 1 1624 1656 //<3>Set RF related register 1625 1657 switch( priv->rf_chip ) 1626 1658 { ··· 1645 1679 RT_TRACE(COMP_ERR, "Unknown RFChipID: %d\n", priv->rf_chip); 1646 1680 break; 1647 1681 } 1648 - #endif 1649 1682 priv->SetBWModeInProgress= false; 1650 1683 1651 1684 RT_TRACE(COMP_SWBW, "<==SetBWMode819xUsb(), %d", atomic_read(&(priv->ieee80211->atm_swbw)) ); ··· 1691 1726 1692 1727 if(priv->up) 1693 1728 { 1694 - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 1695 1729 queue_delayed_work(priv->priv_wq,&priv->initialgain_operate_wq,0); 1696 - #else 1697 - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 1698 - schedule_task(&priv->initialgain_operate_wq); 1699 - #else 1700 - queue_work(priv->priv_wq,&priv->initialgain_operate_wq); 1701 - #endif 1702 - #endif 1703 1730 } 1704 1731 } 1705 1732 1706 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 1707 1733 extern void InitialGainOperateWorkItemCallBack(struct work_struct *work) 1708 1734 { 1709 1735 struct delayed_work *dwork = container_of(work,struct delayed_work,work); 1710 1736 struct r8192_priv *priv = container_of(dwork,struct r8192_priv,initialgain_operate_wq); 1711 1737 struct net_device *dev = priv->ieee80211->dev; 1712 - #else 1713 - extern void InitialGainOperateWorkItemCallBack(struct net_device *dev) 1714 - { 1715 - struct r8192_priv *priv = ieee80211_priv(dev); 1716 - #endif 1717 1738 #define SCAN_RX_INITIAL_GAIN 0x17 1718 1739 #define POWER_DETECTION_TH 0x08 1719 1740 u32 BitMask;
-4
drivers/staging/rtl8192u/r819xU_phy.h
··· 85 85 //added by amy 86 86 extern void InitialGain819xUsb(struct net_device *dev, u8 Operation); 87 87 88 - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 89 88 extern void InitialGainOperateWorkItemCallBack(struct work_struct *work); 90 - #else 91 - extern void InitialGainOperateWorkItemCallBack(struct net_device *dev); 92 - #endif 93 89 94 90 #endif