.. | .. |
---|
1 | | -/****************************************************************************** |
---|
2 | | - * |
---|
3 | | - * Copyright(c) 2009-2012 Realtek Corporation. |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify it |
---|
6 | | - * under the terms of version 2 of the GNU General Public License as |
---|
7 | | - * published by the Free Software Foundation. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
---|
10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
12 | | - * more details. |
---|
13 | | - * |
---|
14 | | - * The full GNU General Public License is included in this distribution in the |
---|
15 | | - * file called LICENSE. |
---|
16 | | - * |
---|
17 | | - * Contact Information: |
---|
18 | | - * wlanfae <wlanfae@realtek.com> |
---|
19 | | - * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, |
---|
20 | | - * Hsinchu 300, Taiwan. |
---|
21 | | - * |
---|
22 | | - * Larry Finger <Larry.Finger@lwfinger.net> |
---|
23 | | - * |
---|
24 | | - *****************************************************************************/ |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
---|
| 2 | +/* Copyright(c) 2009-2012 Realtek Corporation.*/ |
---|
25 | 3 | |
---|
26 | 4 | #ifndef __RTL_WIFI_H__ |
---|
27 | 5 | #define __RTL_WIFI_H__ |
---|
.. | .. |
---|
35 | 13 | #include <linux/usb.h> |
---|
36 | 14 | #include <net/mac80211.h> |
---|
37 | 15 | #include <linux/completion.h> |
---|
| 16 | +#include <linux/bitfield.h> |
---|
38 | 17 | #include "debug.h" |
---|
39 | 18 | |
---|
40 | 19 | #define MASKBYTE0 0xff |
---|
.. | .. |
---|
263 | 242 | u8 date; |
---|
264 | 243 | u8 hour; |
---|
265 | 244 | u8 minute; |
---|
266 | | - __le16 ramcodeSize; |
---|
| 245 | + __le16 ramcodesize; |
---|
267 | 246 | __le16 rsvd2; |
---|
268 | 247 | __le32 svnindex; |
---|
269 | 248 | __le32 rsvd3; |
---|
.. | .. |
---|
435 | 414 | HW_VAR_MULTICAST_REG = 0x1, |
---|
436 | 415 | HW_VAR_BASIC_RATE = 0x2, |
---|
437 | 416 | HW_VAR_BSSID = 0x3, |
---|
438 | | - HW_VAR_MEDIA_STATUS= 0x4, |
---|
439 | | - HW_VAR_SECURITY_CONF= 0x5, |
---|
| 417 | + HW_VAR_MEDIA_STATUS = 0x4, |
---|
| 418 | + HW_VAR_SECURITY_CONF = 0x5, |
---|
440 | 419 | HW_VAR_BEACON_INTERVAL = 0x6, |
---|
441 | 420 | HW_VAR_ATIM_WINDOW = 0x7, |
---|
442 | 421 | HW_VAR_LISTEN_INTERVAL = 0x8, |
---|
.. | .. |
---|
453 | 432 | HW_VAR_ACK_PREAMBLE = 0x13, |
---|
454 | 433 | HW_VAR_CW_CONFIG = 0x14, |
---|
455 | 434 | HW_VAR_CW_VALUES = 0x15, |
---|
456 | | - HW_VAR_RATE_FALLBACK_CONTROL= 0x16, |
---|
| 435 | + HW_VAR_RATE_FALLBACK_CONTROL = 0x16, |
---|
457 | 436 | HW_VAR_CONTENTION_WINDOW = 0x17, |
---|
458 | 437 | HW_VAR_RETRY_COUNT = 0x18, |
---|
459 | 438 | HW_VAR_TR_SWITCH = 0x19, |
---|
.. | .. |
---|
465 | 444 | HW_VAR_MCS_RATE_AVAILABLE = 0x1f, |
---|
466 | 445 | HW_VAR_AC_PARAM = 0x20, |
---|
467 | 446 | HW_VAR_ACM_CTRL = 0x21, |
---|
468 | | - HW_VAR_DIS_Req_Qsize = 0x22, |
---|
| 447 | + HW_VAR_DIS_REQ_QSIZE = 0x22, |
---|
469 | 448 | HW_VAR_CCX_CHNL_LOAD = 0x23, |
---|
470 | 449 | HW_VAR_CCX_NOISE_HISTOGRAM = 0x24, |
---|
471 | 450 | HW_VAR_CCX_CLM_NHM = 0x25, |
---|
472 | | - HW_VAR_TxOPLimit = 0x26, |
---|
| 451 | + HW_VAR_TXOPLIMIT = 0x26, |
---|
473 | 452 | HW_VAR_TURBO_MODE = 0x27, |
---|
474 | 453 | HW_VAR_RF_STATE = 0x28, |
---|
475 | 454 | HW_VAR_RF_OFF_BY_HW = 0x29, |
---|
.. | .. |
---|
522 | 501 | HW_VAR_BCN_VALID = 0x55, |
---|
523 | 502 | HW_VAR_FWLPS_RF_ON = 0x56, |
---|
524 | 503 | HW_VAR_DUAL_TSF_RST = 0x57, |
---|
525 | | - HW_VAR_SWITCH_EPHY_WoWLAN = 0x58, |
---|
| 504 | + HW_VAR_SWITCH_EPHY_WOWLAN = 0x58, |
---|
526 | 505 | HW_VAR_INT_MIGRATION = 0x59, |
---|
527 | 506 | HW_VAR_INT_AC = 0x5a, |
---|
528 | 507 | HW_VAR_RF_TIMING = 0x5b, |
---|
.. | .. |
---|
619 | 598 | HT_CHANNEL_WIDTH_MAX, |
---|
620 | 599 | }; |
---|
621 | 600 | |
---|
622 | | -/* Ref: 802.11i sepc D10.0 7.3.2.25.1 |
---|
623 | | -Cipher Suites Encryption Algorithms */ |
---|
| 601 | +/* Ref: 802.11i spec D10.0 7.3.2.25.1 |
---|
| 602 | + * Cipher Suites Encryption Algorithms |
---|
| 603 | + */ |
---|
624 | 604 | enum rt_enc_alg { |
---|
625 | 605 | NO_ENCRYPTION = 0, |
---|
626 | 606 | WEP40_ENCRYPTION = 1, |
---|
.. | .. |
---|
770 | 750 | RTL_IMR_ROK, /*Receive DMA OK Interrupt */ |
---|
771 | 751 | RTL_IMR_HSISR_IND, /*HSISR Interrupt*/ |
---|
772 | 752 | RTL_IBSS_INT_MASKS, /*(RTL_IMR_BCNINT | RTL_IMR_TBDOK | |
---|
773 | | - * RTL_IMR_TBDER) */ |
---|
| 753 | + * RTL_IMR_TBDER) |
---|
| 754 | + */ |
---|
774 | 755 | RTL_IMR_C2HCMD, /*fw interrupt*/ |
---|
775 | 756 | |
---|
776 | 757 | /*CCK Rates, TxHT = 0 */ |
---|
.. | .. |
---|
814 | 795 | FW_PS_UAPSD_MODE = 6, |
---|
815 | 796 | FW_PS_IBSS_MODE = 7, |
---|
816 | 797 | FW_PS_WWLAN_MODE = 8, |
---|
817 | | - FW_PS_PM_Radio_Off = 9, |
---|
818 | | - FW_PS_PM_Card_Disable = 10, |
---|
| 798 | + FW_PS_PM_RADIO_OFF = 9, |
---|
| 799 | + FW_PS_PM_CARD_DISABLE = 10, |
---|
819 | 800 | }; |
---|
820 | 801 | |
---|
821 | 802 | enum rt_psmode { |
---|
.. | .. |
---|
849 | 830 | /*QoS related.*/ |
---|
850 | 831 | /*acm implementation method.*/ |
---|
851 | 832 | enum acm_method { |
---|
852 | | - eAcmWay0_SwAndHw = 0, |
---|
853 | | - eAcmWay1_HW = 1, |
---|
| 833 | + EACMWAY0_SWANDHW = 0, |
---|
| 834 | + EACMWAY1_HW = 1, |
---|
854 | 835 | EACMWAY2_SW = 2, |
---|
855 | 836 | }; |
---|
856 | 837 | |
---|
.. | .. |
---|
867 | 848 | BANDMAX |
---|
868 | 849 | }; |
---|
869 | 850 | |
---|
870 | | -/*aci/aifsn Field. |
---|
871 | | -Ref: WMM spec 2.2.2: WME Parameter Element, p.12.*/ |
---|
| 851 | +/* aci/aifsn Field. |
---|
| 852 | + * Ref: WMM spec 2.2.2: WME Parameter Element, p.12. |
---|
| 853 | + */ |
---|
872 | 854 | union aci_aifsn { |
---|
873 | 855 | u8 char_data; |
---|
874 | 856 | |
---|
.. | .. |
---|
1069 | 1051 | u8 addr2[ETH_ALEN]; |
---|
1070 | 1052 | u8 addr3[ETH_ALEN]; |
---|
1071 | 1053 | __le16 seq_ctl; |
---|
1072 | | - u8 payload[0]; |
---|
| 1054 | + u8 payload[]; |
---|
1073 | 1055 | } __packed; |
---|
1074 | 1056 | |
---|
1075 | 1057 | struct rtl_info_element { |
---|
1076 | 1058 | u8 id; |
---|
1077 | 1059 | u8 len; |
---|
1078 | | - u8 data[0]; |
---|
| 1060 | + u8 data[]; |
---|
1079 | 1061 | } __packed; |
---|
1080 | 1062 | |
---|
1081 | 1063 | struct rtl_probe_rsp { |
---|
.. | .. |
---|
1084 | 1066 | __le16 beacon_interval; |
---|
1085 | 1067 | __le16 capability; |
---|
1086 | 1068 | /*SSID, supported rates, FH params, DS params, |
---|
1087 | | - CF params, IBSS params, TIM (if beacon), RSN */ |
---|
1088 | | - struct rtl_info_element info_element[0]; |
---|
| 1069 | + * CF params, IBSS params, TIM (if beacon), RSN |
---|
| 1070 | + */ |
---|
| 1071 | + struct rtl_info_element info_element[]; |
---|
1089 | 1072 | } __packed; |
---|
1090 | 1073 | |
---|
1091 | 1074 | /*LED related.*/ |
---|
.. | .. |
---|
1158 | 1141 | |
---|
1159 | 1142 | long rx_snr_db[4]; |
---|
1160 | 1143 | /*Correct smoothed ss in Dbm, only used |
---|
1161 | | - in driver to report real power now. */ |
---|
| 1144 | + * in driver to report real power now. |
---|
| 1145 | + */ |
---|
1162 | 1146 | long recv_signal_power; |
---|
1163 | 1147 | long signal_quality; |
---|
1164 | 1148 | long last_sigstrength_inpercent; |
---|
.. | .. |
---|
1166 | 1150 | u32 rssi_calculate_cnt; |
---|
1167 | 1151 | u32 pwdb_all_cnt; |
---|
1168 | 1152 | |
---|
1169 | | - /*Transformed, in dbm. Beautified signal |
---|
1170 | | - strength for UI, not correct. */ |
---|
| 1153 | + /* Transformed, in dbm. Beautified signal |
---|
| 1154 | + * strength for UI, not correct. |
---|
| 1155 | + */ |
---|
1171 | 1156 | long signal_strength; |
---|
1172 | 1157 | |
---|
1173 | 1158 | u8 rx_rssi_percentage[4]; |
---|
.. | .. |
---|
1478 | 1463 | /*PCI IO map */ |
---|
1479 | 1464 | unsigned long pci_base_addr; /*device I/O address */ |
---|
1480 | 1465 | |
---|
1481 | | - void (*write8_async) (struct rtl_priv *rtlpriv, u32 addr, u8 val); |
---|
1482 | | - void (*write16_async) (struct rtl_priv *rtlpriv, u32 addr, u16 val); |
---|
1483 | | - void (*write32_async) (struct rtl_priv *rtlpriv, u32 addr, u32 val); |
---|
1484 | | - void (*writeN_sync) (struct rtl_priv *rtlpriv, u32 addr, void *buf, |
---|
1485 | | - u16 len); |
---|
| 1466 | + void (*write8_async)(struct rtl_priv *rtlpriv, u32 addr, u8 val); |
---|
| 1467 | + void (*write16_async)(struct rtl_priv *rtlpriv, u32 addr, u16 val); |
---|
| 1468 | + void (*write32_async)(struct rtl_priv *rtlpriv, u32 addr, u32 val); |
---|
| 1469 | + void (*writen_sync)(struct rtl_priv *rtlpriv, u32 addr, void *buf, |
---|
| 1470 | + u16 len); |
---|
1486 | 1471 | |
---|
1487 | | - u8(*read8_sync) (struct rtl_priv *rtlpriv, u32 addr); |
---|
1488 | | - u16(*read16_sync) (struct rtl_priv *rtlpriv, u32 addr); |
---|
1489 | | - u32(*read32_sync) (struct rtl_priv *rtlpriv, u32 addr); |
---|
| 1472 | + u8 (*read8_sync)(struct rtl_priv *rtlpriv, u32 addr); |
---|
| 1473 | + u16 (*read16_sync)(struct rtl_priv *rtlpriv, u32 addr); |
---|
| 1474 | + u32 (*read32_sync)(struct rtl_priv *rtlpriv, u32 addr); |
---|
1490 | 1475 | |
---|
1491 | 1476 | }; |
---|
1492 | 1477 | |
---|
.. | .. |
---|
1711 | 1696 | bool during_mac1init_radioa; |
---|
1712 | 1697 | bool reloadtxpowerindex; |
---|
1713 | 1698 | /* True if IMR or IQK have done |
---|
1714 | | - for 2.4G in scan progress */ |
---|
| 1699 | + * for 2.4G in scan progress |
---|
| 1700 | + */ |
---|
1715 | 1701 | bool load_imrandiqk_setting_for2g; |
---|
1716 | 1702 | |
---|
1717 | 1703 | bool disable_amsdu_8k; |
---|
.. | .. |
---|
1750 | 1736 | u32 hwsec_cam_bitmap; |
---|
1751 | 1737 | u8 hwsec_cam_sta_addr[TOTAL_CAM_ENTRY][ETH_ALEN]; |
---|
1752 | 1738 | /*local Key buffer, indx 0 is for |
---|
1753 | | - pairwise key 1-4 is for agoup key. */ |
---|
| 1739 | + * pairwise key 1-4 is for agoup key. |
---|
| 1740 | + */ |
---|
1754 | 1741 | u8 key_buf[KEY_BUF_SIZE][MAX_KEY_LEN]; |
---|
1755 | 1742 | u8 key_len[KEY_BUF_SIZE]; |
---|
1756 | 1743 | |
---|
1757 | 1744 | /*The pointer of Pairwise Key, |
---|
1758 | | - it always points to KeyBuf[4] */ |
---|
| 1745 | + * it always points to KeyBuf[4] |
---|
| 1746 | + */ |
---|
1759 | 1747 | u8 *pairwise_key; |
---|
1760 | 1748 | }; |
---|
1761 | 1749 | |
---|
.. | .. |
---|
1898 | 1886 | |
---|
1899 | 1887 | struct rtl_efuse { |
---|
1900 | 1888 | const struct rtl_efuse_ops *efuse_ops; |
---|
1901 | | - bool autoLoad_ok; |
---|
| 1889 | + bool autoload_ok; |
---|
1902 | 1890 | bool bootfromefuse; |
---|
1903 | 1891 | u16 max_physical_size; |
---|
1904 | 1892 | |
---|
1905 | 1893 | u8 efuse_map[2][EFUSE_MAX_LOGICAL_SIZE]; |
---|
1906 | 1894 | u16 efuse_usedbytes; |
---|
1907 | 1895 | u8 efuse_usedpercentage; |
---|
1908 | | -#ifdef EFUSE_REPG_WORKAROUND |
---|
1909 | | - bool efuse_re_pg_sec1flag; |
---|
1910 | | - u8 efuse_re_pg_data[8]; |
---|
1911 | | -#endif |
---|
1912 | 1896 | |
---|
1913 | 1897 | u8 autoload_failflag; |
---|
1914 | 1898 | u8 autoload_status; |
---|
.. | .. |
---|
1982 | 1966 | |
---|
1983 | 1967 | u8 txpwr_safetyflag; /* Band edge enable flag */ |
---|
1984 | 1968 | u16 eeprom_txpowerdiff; |
---|
1985 | | - u8 legacy_httxpowerdiff; /* Legacy to HT rate power diff */ |
---|
1986 | 1969 | u8 antenna_txpwdiff[3]; |
---|
1987 | 1970 | |
---|
1988 | 1971 | u8 eeprom_regulatory; |
---|
.. | .. |
---|
2023 | 2006 | bool rfchange_inprogress; |
---|
2024 | 2007 | bool swrf_processing; |
---|
2025 | 2008 | bool hwradiooff; |
---|
2026 | | - /* |
---|
2027 | | - * just for PCIE ASPM |
---|
| 2009 | + /* just for PCIE ASPM |
---|
2028 | 2010 | * If it supports ASPM, Offset[560h] = 0x40, |
---|
2029 | 2011 | * otherwise Offset[560h] = 0x00. |
---|
2030 | | - * */ |
---|
| 2012 | + */ |
---|
2031 | 2013 | bool support_aspm; |
---|
2032 | 2014 | bool support_backdoor; |
---|
2033 | 2015 | |
---|
.. | .. |
---|
2107 | 2089 | u8 nic_type; |
---|
2108 | 2090 | u16 length; |
---|
2109 | 2091 | u8 signalquality; /*in 0-100 index. */ |
---|
2110 | | - /* |
---|
2111 | | - * Real power in dBm for this packet, |
---|
| 2092 | + /* Real power in dBm for this packet, |
---|
2112 | 2093 | * no beautification and aggregation. |
---|
2113 | | - * */ |
---|
| 2094 | + */ |
---|
2114 | 2095 | s32 recvsignalpower; |
---|
2115 | 2096 | s8 rxpower; /*in dBm Translate from PWdB */ |
---|
2116 | 2097 | u8 signalstrength; /*in 0-100 index. */ |
---|
.. | .. |
---|
2129 | 2110 | u8 rx_bufshift; |
---|
2130 | 2111 | bool isampdu; |
---|
2131 | 2112 | bool isfirst_ampdu; |
---|
2132 | | - bool rx_is40Mhzpacket; |
---|
| 2113 | + bool rx_is40mhzpacket; |
---|
2133 | 2114 | u8 rx_packet_bw; |
---|
2134 | 2115 | u32 rx_pwdb_all; |
---|
2135 | 2116 | u8 rx_mimo_signalstrength[4]; /*in 0~100 index */ |
---|
.. | .. |
---|
2157 | 2138 | u8 packet_report_type; |
---|
2158 | 2139 | |
---|
2159 | 2140 | u32 macid; |
---|
2160 | | - u8 wake_match; |
---|
2161 | 2141 | u32 bt_rx_rssi_percentage; |
---|
2162 | 2142 | u32 macid_valid_entry[2]; |
---|
2163 | 2143 | }; |
---|
2164 | | - |
---|
2165 | 2144 | |
---|
2166 | 2145 | struct rt_link_detect { |
---|
2167 | 2146 | /* count for roaming */ |
---|
.. | .. |
---|
2236 | 2215 | }; |
---|
2237 | 2216 | |
---|
2238 | 2217 | struct rtl_hal_ops { |
---|
2239 | | - int (*init_sw_vars) (struct ieee80211_hw *hw); |
---|
2240 | | - void (*deinit_sw_vars) (struct ieee80211_hw *hw); |
---|
| 2218 | + int (*init_sw_vars)(struct ieee80211_hw *hw); |
---|
| 2219 | + void (*deinit_sw_vars)(struct ieee80211_hw *hw); |
---|
2241 | 2220 | void (*read_chip_version)(struct ieee80211_hw *hw); |
---|
2242 | | - void (*read_eeprom_info) (struct ieee80211_hw *hw); |
---|
2243 | | - void (*interrupt_recognized) (struct ieee80211_hw *hw, |
---|
2244 | | - struct rtl_int *intvec); |
---|
2245 | | - int (*hw_init) (struct ieee80211_hw *hw); |
---|
2246 | | - void (*hw_disable) (struct ieee80211_hw *hw); |
---|
2247 | | - void (*hw_suspend) (struct ieee80211_hw *hw); |
---|
2248 | | - void (*hw_resume) (struct ieee80211_hw *hw); |
---|
2249 | | - void (*enable_interrupt) (struct ieee80211_hw *hw); |
---|
2250 | | - void (*disable_interrupt) (struct ieee80211_hw *hw); |
---|
2251 | | - int (*set_network_type) (struct ieee80211_hw *hw, |
---|
2252 | | - enum nl80211_iftype type); |
---|
| 2221 | + void (*read_eeprom_info)(struct ieee80211_hw *hw); |
---|
| 2222 | + void (*interrupt_recognized)(struct ieee80211_hw *hw, |
---|
| 2223 | + struct rtl_int *intvec); |
---|
| 2224 | + int (*hw_init)(struct ieee80211_hw *hw); |
---|
| 2225 | + void (*hw_disable)(struct ieee80211_hw *hw); |
---|
| 2226 | + void (*hw_suspend)(struct ieee80211_hw *hw); |
---|
| 2227 | + void (*hw_resume)(struct ieee80211_hw *hw); |
---|
| 2228 | + void (*enable_interrupt)(struct ieee80211_hw *hw); |
---|
| 2229 | + void (*disable_interrupt)(struct ieee80211_hw *hw); |
---|
| 2230 | + int (*set_network_type)(struct ieee80211_hw *hw, |
---|
| 2231 | + enum nl80211_iftype type); |
---|
2253 | 2232 | void (*set_chk_bssid)(struct ieee80211_hw *hw, |
---|
2254 | | - bool check_bssid); |
---|
2255 | | - void (*set_bw_mode) (struct ieee80211_hw *hw, |
---|
2256 | | - enum nl80211_channel_type ch_type); |
---|
2257 | | - u8(*switch_channel) (struct ieee80211_hw *hw); |
---|
2258 | | - void (*set_qos) (struct ieee80211_hw *hw, int aci); |
---|
2259 | | - void (*set_bcn_reg) (struct ieee80211_hw *hw); |
---|
2260 | | - void (*set_bcn_intv) (struct ieee80211_hw *hw); |
---|
2261 | | - void (*update_interrupt_mask) (struct ieee80211_hw *hw, |
---|
2262 | | - u32 add_msr, u32 rm_msr); |
---|
2263 | | - void (*get_hw_reg) (struct ieee80211_hw *hw, u8 variable, u8 *val); |
---|
2264 | | - void (*set_hw_reg) (struct ieee80211_hw *hw, u8 variable, u8 *val); |
---|
2265 | | - void (*update_rate_tbl) (struct ieee80211_hw *hw, |
---|
2266 | | - struct ieee80211_sta *sta, u8 rssi_leve, |
---|
2267 | | - bool update_bw); |
---|
| 2233 | + bool check_bssid); |
---|
| 2234 | + void (*set_bw_mode)(struct ieee80211_hw *hw, |
---|
| 2235 | + enum nl80211_channel_type ch_type); |
---|
| 2236 | + u8 (*switch_channel)(struct ieee80211_hw *hw); |
---|
| 2237 | + void (*set_qos)(struct ieee80211_hw *hw, int aci); |
---|
| 2238 | + void (*set_bcn_reg)(struct ieee80211_hw *hw); |
---|
| 2239 | + void (*set_bcn_intv)(struct ieee80211_hw *hw); |
---|
| 2240 | + void (*update_interrupt_mask)(struct ieee80211_hw *hw, |
---|
| 2241 | + u32 add_msr, u32 rm_msr); |
---|
| 2242 | + void (*get_hw_reg)(struct ieee80211_hw *hw, u8 variable, u8 *val); |
---|
| 2243 | + void (*set_hw_reg)(struct ieee80211_hw *hw, u8 variable, u8 *val); |
---|
| 2244 | + void (*update_rate_tbl)(struct ieee80211_hw *hw, |
---|
| 2245 | + struct ieee80211_sta *sta, u8 rssi_leve, |
---|
| 2246 | + bool update_bw); |
---|
2268 | 2247 | void (*pre_fill_tx_bd_desc)(struct ieee80211_hw *hw, u8 *tx_bd_desc, |
---|
2269 | 2248 | u8 *desc, u8 queue_index, |
---|
2270 | 2249 | struct sk_buff *skb, dma_addr_t addr); |
---|
2271 | | - void (*update_rate_mask) (struct ieee80211_hw *hw, u8 rssi_level); |
---|
| 2250 | + void (*update_rate_mask)(struct ieee80211_hw *hw, u8 rssi_level); |
---|
2272 | 2251 | u16 (*rx_desc_buff_remained_cnt)(struct ieee80211_hw *hw, |
---|
2273 | 2252 | u8 queue_index); |
---|
2274 | 2253 | void (*rx_check_dma_ok)(struct ieee80211_hw *hw, u8 *header_desc, |
---|
2275 | 2254 | u8 queue_index); |
---|
2276 | | - void (*fill_tx_desc) (struct ieee80211_hw *hw, |
---|
2277 | | - struct ieee80211_hdr *hdr, u8 *pdesc_tx, |
---|
2278 | | - u8 *pbd_desc_tx, |
---|
2279 | | - struct ieee80211_tx_info *info, |
---|
2280 | | - struct ieee80211_sta *sta, |
---|
2281 | | - struct sk_buff *skb, u8 hw_queue, |
---|
2282 | | - struct rtl_tcb_desc *ptcb_desc); |
---|
2283 | | - void (*fill_fake_txdesc) (struct ieee80211_hw *hw, u8 *pDesc, |
---|
2284 | | - u32 buffer_len, bool bIsPsPoll); |
---|
2285 | | - void (*fill_tx_cmddesc) (struct ieee80211_hw *hw, u8 *pdesc, |
---|
2286 | | - bool firstseg, bool lastseg, |
---|
2287 | | - struct sk_buff *skb); |
---|
| 2255 | + void (*fill_tx_desc)(struct ieee80211_hw *hw, |
---|
| 2256 | + struct ieee80211_hdr *hdr, u8 *pdesc_tx, |
---|
| 2257 | + u8 *pbd_desc_tx, |
---|
| 2258 | + struct ieee80211_tx_info *info, |
---|
| 2259 | + struct ieee80211_sta *sta, |
---|
| 2260 | + struct sk_buff *skb, u8 hw_queue, |
---|
| 2261 | + struct rtl_tcb_desc *ptcb_desc); |
---|
| 2262 | + void (*fill_fake_txdesc)(struct ieee80211_hw *hw, u8 *pdesc, |
---|
| 2263 | + u32 buffer_len, bool bsspspoll); |
---|
| 2264 | + void (*fill_tx_cmddesc)(struct ieee80211_hw *hw, u8 *pdesc, |
---|
| 2265 | + bool firstseg, bool lastseg, |
---|
| 2266 | + struct sk_buff *skb); |
---|
2288 | 2267 | void (*fill_tx_special_desc)(struct ieee80211_hw *hw, |
---|
2289 | 2268 | u8 *pdesc, u8 *pbd_desc, |
---|
2290 | 2269 | struct sk_buff *skb, u8 hw_queue); |
---|
2291 | | - bool (*query_rx_desc) (struct ieee80211_hw *hw, |
---|
2292 | | - struct rtl_stats *stats, |
---|
2293 | | - struct ieee80211_rx_status *rx_status, |
---|
2294 | | - u8 *pdesc, struct sk_buff *skb); |
---|
2295 | | - void (*set_channel_access) (struct ieee80211_hw *hw); |
---|
2296 | | - bool (*radio_onoff_checking) (struct ieee80211_hw *hw, u8 *valid); |
---|
2297 | | - void (*dm_watchdog) (struct ieee80211_hw *hw); |
---|
2298 | | - void (*scan_operation_backup) (struct ieee80211_hw *hw, u8 operation); |
---|
2299 | | - bool (*set_rf_power_state) (struct ieee80211_hw *hw, |
---|
2300 | | - enum rf_pwrstate rfpwr_state); |
---|
2301 | | - void (*led_control) (struct ieee80211_hw *hw, |
---|
2302 | | - enum led_ctl_mode ledaction); |
---|
| 2270 | + bool (*query_rx_desc)(struct ieee80211_hw *hw, |
---|
| 2271 | + struct rtl_stats *stats, |
---|
| 2272 | + struct ieee80211_rx_status *rx_status, |
---|
| 2273 | + u8 *pdesc, struct sk_buff *skb); |
---|
| 2274 | + void (*set_channel_access)(struct ieee80211_hw *hw); |
---|
| 2275 | + bool (*radio_onoff_checking)(struct ieee80211_hw *hw, u8 *valid); |
---|
| 2276 | + void (*dm_watchdog)(struct ieee80211_hw *hw); |
---|
| 2277 | + void (*scan_operation_backup)(struct ieee80211_hw *hw, u8 operation); |
---|
| 2278 | + bool (*set_rf_power_state)(struct ieee80211_hw *hw, |
---|
| 2279 | + enum rf_pwrstate rfpwr_state); |
---|
| 2280 | + void (*led_control)(struct ieee80211_hw *hw, |
---|
| 2281 | + enum led_ctl_mode ledaction); |
---|
2303 | 2282 | void (*set_desc)(struct ieee80211_hw *hw, u8 *pdesc, bool istx, |
---|
2304 | 2283 | u8 desc_name, u8 *val); |
---|
2305 | 2284 | u64 (*get_desc)(struct ieee80211_hw *hw, u8 *pdesc, bool istx, |
---|
2306 | 2285 | u8 desc_name); |
---|
2307 | | - bool (*is_tx_desc_closed) (struct ieee80211_hw *hw, |
---|
2308 | | - u8 hw_queue, u16 index); |
---|
2309 | | - void (*tx_polling) (struct ieee80211_hw *hw, u8 hw_queue); |
---|
2310 | | - void (*enable_hw_sec) (struct ieee80211_hw *hw); |
---|
2311 | | - void (*set_key) (struct ieee80211_hw *hw, u32 key_index, |
---|
2312 | | - u8 *macaddr, bool is_group, u8 enc_algo, |
---|
2313 | | - bool is_wepkey, bool clear_all); |
---|
2314 | | - void (*init_sw_leds) (struct ieee80211_hw *hw); |
---|
2315 | | - void (*deinit_sw_leds) (struct ieee80211_hw *hw); |
---|
2316 | | - u32 (*get_bbreg) (struct ieee80211_hw *hw, u32 regaddr, u32 bitmask); |
---|
2317 | | - void (*set_bbreg) (struct ieee80211_hw *hw, u32 regaddr, u32 bitmask, |
---|
2318 | | - u32 data); |
---|
2319 | | - u32 (*get_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath, |
---|
2320 | | - u32 regaddr, u32 bitmask); |
---|
2321 | | - void (*set_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath, |
---|
2322 | | - u32 regaddr, u32 bitmask, u32 data); |
---|
2323 | | - void (*linked_set_reg) (struct ieee80211_hw *hw); |
---|
2324 | | - void (*chk_switch_dmdp) (struct ieee80211_hw *hw); |
---|
2325 | | - void (*dualmac_easy_concurrent) (struct ieee80211_hw *hw); |
---|
2326 | | - void (*dualmac_switch_to_dmdp) (struct ieee80211_hw *hw); |
---|
2327 | | - bool (*phy_rf6052_config) (struct ieee80211_hw *hw); |
---|
2328 | | - void (*phy_rf6052_set_cck_txpower) (struct ieee80211_hw *hw, |
---|
2329 | | - u8 *powerlevel); |
---|
2330 | | - void (*phy_rf6052_set_ofdm_txpower) (struct ieee80211_hw *hw, |
---|
2331 | | - u8 *ppowerlevel, u8 channel); |
---|
2332 | | - bool (*config_bb_with_headerfile) (struct ieee80211_hw *hw, |
---|
2333 | | - u8 configtype); |
---|
2334 | | - bool (*config_bb_with_pgheaderfile) (struct ieee80211_hw *hw, |
---|
2335 | | - u8 configtype); |
---|
2336 | | - void (*phy_lc_calibrate) (struct ieee80211_hw *hw, bool is2t); |
---|
2337 | | - void (*phy_set_bw_mode_callback) (struct ieee80211_hw *hw); |
---|
2338 | | - void (*dm_dynamic_txpower) (struct ieee80211_hw *hw); |
---|
2339 | | - void (*c2h_command_handle) (struct ieee80211_hw *hw); |
---|
2340 | | - void (*bt_wifi_media_status_notify) (struct ieee80211_hw *hw, |
---|
2341 | | - bool mstate); |
---|
2342 | | - void (*bt_coex_off_before_lps) (struct ieee80211_hw *hw); |
---|
2343 | | - void (*fill_h2c_cmd) (struct ieee80211_hw *hw, u8 element_id, |
---|
2344 | | - u32 cmd_len, u8 *p_cmdbuffer); |
---|
| 2286 | + bool (*is_tx_desc_closed)(struct ieee80211_hw *hw, |
---|
| 2287 | + u8 hw_queue, u16 index); |
---|
| 2288 | + void (*tx_polling)(struct ieee80211_hw *hw, u8 hw_queue); |
---|
| 2289 | + void (*enable_hw_sec)(struct ieee80211_hw *hw); |
---|
| 2290 | + void (*set_key)(struct ieee80211_hw *hw, u32 key_index, |
---|
| 2291 | + u8 *macaddr, bool is_group, u8 enc_algo, |
---|
| 2292 | + bool is_wepkey, bool clear_all); |
---|
| 2293 | + void (*init_sw_leds)(struct ieee80211_hw *hw); |
---|
| 2294 | + void (*deinit_sw_leds)(struct ieee80211_hw *hw); |
---|
| 2295 | + u32 (*get_bbreg)(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask); |
---|
| 2296 | + void (*set_bbreg)(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask, |
---|
| 2297 | + u32 data); |
---|
| 2298 | + u32 (*get_rfreg)(struct ieee80211_hw *hw, enum radio_path rfpath, |
---|
| 2299 | + u32 regaddr, u32 bitmask); |
---|
| 2300 | + void (*set_rfreg)(struct ieee80211_hw *hw, enum radio_path rfpath, |
---|
| 2301 | + u32 regaddr, u32 bitmask, u32 data); |
---|
| 2302 | + void (*linked_set_reg)(struct ieee80211_hw *hw); |
---|
| 2303 | + void (*chk_switch_dmdp)(struct ieee80211_hw *hw); |
---|
| 2304 | + void (*dualmac_easy_concurrent)(struct ieee80211_hw *hw); |
---|
| 2305 | + void (*dualmac_switch_to_dmdp)(struct ieee80211_hw *hw); |
---|
| 2306 | + bool (*phy_rf6052_config)(struct ieee80211_hw *hw); |
---|
| 2307 | + void (*phy_rf6052_set_cck_txpower)(struct ieee80211_hw *hw, |
---|
| 2308 | + u8 *powerlevel); |
---|
| 2309 | + void (*phy_rf6052_set_ofdm_txpower)(struct ieee80211_hw *hw, |
---|
| 2310 | + u8 *ppowerlevel, u8 channel); |
---|
| 2311 | + bool (*config_bb_with_headerfile)(struct ieee80211_hw *hw, |
---|
| 2312 | + u8 configtype); |
---|
| 2313 | + bool (*config_bb_with_pgheaderfile)(struct ieee80211_hw *hw, |
---|
| 2314 | + u8 configtype); |
---|
| 2315 | + void (*phy_lc_calibrate)(struct ieee80211_hw *hw, bool is2t); |
---|
| 2316 | + void (*phy_set_bw_mode_callback)(struct ieee80211_hw *hw); |
---|
| 2317 | + void (*dm_dynamic_txpower)(struct ieee80211_hw *hw); |
---|
| 2318 | + void (*c2h_command_handle)(struct ieee80211_hw *hw); |
---|
| 2319 | + void (*bt_wifi_media_status_notify)(struct ieee80211_hw *hw, |
---|
| 2320 | + bool mstate); |
---|
| 2321 | + void (*bt_coex_off_before_lps)(struct ieee80211_hw *hw); |
---|
| 2322 | + void (*fill_h2c_cmd)(struct ieee80211_hw *hw, u8 element_id, |
---|
| 2323 | + u32 cmd_len, u8 *p_cmdbuffer); |
---|
2345 | 2324 | void (*set_default_port_id_cmd)(struct ieee80211_hw *hw); |
---|
2346 | | - bool (*get_btc_status) (void); |
---|
| 2325 | + bool (*get_btc_status)(void); |
---|
2347 | 2326 | bool (*is_fw_header)(struct rtlwifi_firmware_header *hdr); |
---|
2348 | 2327 | void (*add_wowlan_pattern)(struct ieee80211_hw *hw, |
---|
2349 | 2328 | struct rtl_wow_pattern *rtl_pattern, |
---|
.. | .. |
---|
2356 | 2335 | struct rtl_intf_ops { |
---|
2357 | 2336 | /*com */ |
---|
2358 | 2337 | void (*read_efuse_byte)(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf); |
---|
2359 | | - int (*adapter_start) (struct ieee80211_hw *hw); |
---|
2360 | | - void (*adapter_stop) (struct ieee80211_hw *hw); |
---|
| 2338 | + int (*adapter_start)(struct ieee80211_hw *hw); |
---|
| 2339 | + void (*adapter_stop)(struct ieee80211_hw *hw); |
---|
2361 | 2340 | bool (*check_buddy_priv)(struct ieee80211_hw *hw, |
---|
2362 | 2341 | struct rtl_priv **buddy_priv); |
---|
2363 | 2342 | |
---|
2364 | | - int (*adapter_tx) (struct ieee80211_hw *hw, |
---|
2365 | | - struct ieee80211_sta *sta, |
---|
2366 | | - struct sk_buff *skb, |
---|
2367 | | - struct rtl_tcb_desc *ptcb_desc); |
---|
| 2343 | + int (*adapter_tx)(struct ieee80211_hw *hw, |
---|
| 2344 | + struct ieee80211_sta *sta, |
---|
| 2345 | + struct sk_buff *skb, |
---|
| 2346 | + struct rtl_tcb_desc *ptcb_desc); |
---|
2368 | 2347 | void (*flush)(struct ieee80211_hw *hw, u32 queues, bool drop); |
---|
2369 | | - int (*reset_trx_ring) (struct ieee80211_hw *hw); |
---|
2370 | | - bool (*waitq_insert) (struct ieee80211_hw *hw, |
---|
2371 | | - struct ieee80211_sta *sta, |
---|
2372 | | - struct sk_buff *skb); |
---|
| 2348 | + int (*reset_trx_ring)(struct ieee80211_hw *hw); |
---|
| 2349 | + bool (*waitq_insert)(struct ieee80211_hw *hw, |
---|
| 2350 | + struct ieee80211_sta *sta, |
---|
| 2351 | + struct sk_buff *skb); |
---|
2373 | 2352 | |
---|
2374 | 2353 | /*pci */ |
---|
2375 | | - void (*disable_aspm) (struct ieee80211_hw *hw); |
---|
2376 | | - void (*enable_aspm) (struct ieee80211_hw *hw); |
---|
| 2354 | + void (*disable_aspm)(struct ieee80211_hw *hw); |
---|
| 2355 | + void (*enable_aspm)(struct ieee80211_hw *hw); |
---|
2377 | 2356 | |
---|
2378 | 2357 | /*usb */ |
---|
2379 | 2358 | }; |
---|
.. | .. |
---|
2451 | 2430 | enum rtl_spec_ver spec_ver; |
---|
2452 | 2431 | |
---|
2453 | 2432 | /*this map used for some registers or vars |
---|
2454 | | - defined int HAL but used in MAIN */ |
---|
| 2433 | + * defined int HAL but used in MAIN |
---|
| 2434 | + */ |
---|
2455 | 2435 | u32 maps[RTL_VAR_MAP_MAX]; |
---|
2456 | 2436 | |
---|
2457 | 2437 | }; |
---|
.. | .. |
---|
2613 | 2593 | |
---|
2614 | 2594 | struct rtl_global_var { |
---|
2615 | 2595 | /* from this list we can get |
---|
2616 | | - * other adapter's rtl_priv */ |
---|
| 2596 | + * other adapter's rtl_priv |
---|
| 2597 | + */ |
---|
2617 | 2598 | struct list_head glb_priv_list; |
---|
2618 | 2599 | spinlock_t glb_list_lock; |
---|
2619 | 2600 | }; |
---|
.. | .. |
---|
2692 | 2673 | }; |
---|
2693 | 2674 | |
---|
2694 | 2675 | struct rtl_btc_ops { |
---|
2695 | | - void (*btc_init_variables) (struct rtl_priv *rtlpriv); |
---|
| 2676 | + void (*btc_init_variables)(struct rtl_priv *rtlpriv); |
---|
2696 | 2677 | void (*btc_init_variables_wifi_only)(struct rtl_priv *rtlpriv); |
---|
2697 | 2678 | void (*btc_deinit_variables)(struct rtl_priv *rtlpriv); |
---|
2698 | | - void (*btc_init_hal_vars) (struct rtl_priv *rtlpriv); |
---|
| 2679 | + void (*btc_init_hal_vars)(struct rtl_priv *rtlpriv); |
---|
2699 | 2680 | void (*btc_power_on_setting)(struct rtl_priv *rtlpriv); |
---|
2700 | | - void (*btc_init_hw_config) (struct rtl_priv *rtlpriv); |
---|
| 2681 | + void (*btc_init_hw_config)(struct rtl_priv *rtlpriv); |
---|
2701 | 2682 | void (*btc_init_hw_config_wifi_only)(struct rtl_priv *rtlpriv); |
---|
2702 | | - void (*btc_ips_notify) (struct rtl_priv *rtlpriv, u8 type); |
---|
| 2683 | + void (*btc_ips_notify)(struct rtl_priv *rtlpriv, u8 type); |
---|
2703 | 2684 | void (*btc_lps_notify)(struct rtl_priv *rtlpriv, u8 type); |
---|
2704 | | - void (*btc_scan_notify) (struct rtl_priv *rtlpriv, u8 scantype); |
---|
| 2685 | + void (*btc_scan_notify)(struct rtl_priv *rtlpriv, u8 scantype); |
---|
2705 | 2686 | void (*btc_scan_notify_wifi_only)(struct rtl_priv *rtlpriv, |
---|
2706 | 2687 | u8 scantype); |
---|
2707 | | - void (*btc_connect_notify) (struct rtl_priv *rtlpriv, u8 action); |
---|
2708 | | - void (*btc_mediastatus_notify) (struct rtl_priv *rtlpriv, |
---|
2709 | | - enum rt_media_status mstatus); |
---|
2710 | | - void (*btc_periodical) (struct rtl_priv *rtlpriv); |
---|
| 2688 | + void (*btc_connect_notify)(struct rtl_priv *rtlpriv, u8 action); |
---|
| 2689 | + void (*btc_mediastatus_notify)(struct rtl_priv *rtlpriv, |
---|
| 2690 | + enum rt_media_status mstatus); |
---|
| 2691 | + void (*btc_periodical)(struct rtl_priv *rtlpriv); |
---|
2711 | 2692 | void (*btc_halt_notify)(struct rtl_priv *rtlpriv); |
---|
2712 | | - void (*btc_btinfo_notify) (struct rtl_priv *rtlpriv, |
---|
2713 | | - u8 *tmp_buf, u8 length); |
---|
| 2693 | + void (*btc_btinfo_notify)(struct rtl_priv *rtlpriv, |
---|
| 2694 | + u8 *tmp_buf, u8 length); |
---|
2714 | 2695 | void (*btc_btmpinfo_notify)(struct rtl_priv *rtlpriv, |
---|
2715 | 2696 | u8 *tmp_buf, u8 length); |
---|
2716 | | - bool (*btc_is_limited_dig) (struct rtl_priv *rtlpriv); |
---|
2717 | | - bool (*btc_is_disable_edca_turbo) (struct rtl_priv *rtlpriv); |
---|
2718 | | - bool (*btc_is_bt_disabled) (struct rtl_priv *rtlpriv); |
---|
| 2697 | + bool (*btc_is_limited_dig)(struct rtl_priv *rtlpriv); |
---|
| 2698 | + bool (*btc_is_disable_edca_turbo)(struct rtl_priv *rtlpriv); |
---|
| 2699 | + bool (*btc_is_bt_disabled)(struct rtl_priv *rtlpriv); |
---|
2719 | 2700 | void (*btc_special_packet_notify)(struct rtl_priv *rtlpriv, |
---|
2720 | 2701 | u8 pkt_type); |
---|
2721 | 2702 | void (*btc_switch_band_notify)(struct rtl_priv *rtlpriv, u8 type, |
---|
.. | .. |
---|
2801 | 2782 | struct rtl_debug dbg; |
---|
2802 | 2783 | int max_fw_size; |
---|
2803 | 2784 | |
---|
2804 | | - /* |
---|
2805 | | - *hal_cfg : for diff cards |
---|
2806 | | - *intf_ops : for diff interrface usb/pcie |
---|
| 2785 | + /* hal_cfg : for diff cards |
---|
| 2786 | + * intf_ops : for diff interrface usb/pcie |
---|
2807 | 2787 | */ |
---|
2808 | 2788 | struct rtl_hal_cfg *cfg; |
---|
2809 | 2789 | const struct rtl_intf_ops *intf_ops; |
---|
2810 | 2790 | |
---|
2811 | | - /*this var will be set by set_bit, |
---|
2812 | | - and was used to indicate status of |
---|
2813 | | - interface or hardware */ |
---|
| 2791 | + /* this var will be set by set_bit, |
---|
| 2792 | + * and was used to indicate status of |
---|
| 2793 | + * interface or hardware |
---|
| 2794 | + */ |
---|
2814 | 2795 | unsigned long status; |
---|
2815 | 2796 | |
---|
2816 | 2797 | /* tables for dm */ |
---|
.. | .. |
---|
2846 | 2827 | #ifdef CONFIG_PM |
---|
2847 | 2828 | struct wiphy_wowlan_support wowlan; |
---|
2848 | 2829 | #endif |
---|
2849 | | - /*This must be the last item so |
---|
2850 | | - that it points to the data allocated |
---|
2851 | | - beyond this structure like: |
---|
2852 | | - rtl_pci_priv or rtl_usb_priv */ |
---|
| 2830 | + /* This must be the last item so |
---|
| 2831 | + * that it points to the data allocated |
---|
| 2832 | + * beyond this structure like: |
---|
| 2833 | + * rtl_pci_priv or rtl_usb_priv |
---|
| 2834 | + */ |
---|
2853 | 2835 | u8 priv[0] __aligned(sizeof(void *)); |
---|
2854 | 2836 | }; |
---|
2855 | 2837 | |
---|
.. | .. |
---|
2859 | 2841 | #define rtl_efuse(rtlpriv) (&((rtlpriv)->efuse)) |
---|
2860 | 2842 | #define rtl_psc(rtlpriv) (&((rtlpriv)->psc)) |
---|
2861 | 2843 | |
---|
2862 | | - |
---|
2863 | | -/*************************************** |
---|
2864 | | - Bluetooth Co-existence Related |
---|
2865 | | -****************************************/ |
---|
| 2844 | +/* Bluetooth Co-existence Related */ |
---|
2866 | 2845 | |
---|
2867 | 2846 | enum bt_ant_num { |
---|
2868 | 2847 | ANT_X2 = 0, |
---|
.. | .. |
---|
2911 | 2890 | BT_RADIO_INDIVIDUAL = 1, |
---|
2912 | 2891 | }; |
---|
2913 | 2892 | |
---|
2914 | | - |
---|
2915 | 2893 | /**************************************** |
---|
2916 | | - mem access macro define start |
---|
2917 | | - Call endian free function when |
---|
2918 | | - 1. Read/write packet content. |
---|
2919 | | - 2. Before write integer to IO. |
---|
2920 | | - 3. After read integer from IO. |
---|
2921 | | -****************************************/ |
---|
2922 | | -/* Convert little data endian to host ordering */ |
---|
2923 | | -#define EF1BYTE(_val) \ |
---|
2924 | | - ((u8)(_val)) |
---|
2925 | | -#define EF2BYTE(_val) \ |
---|
2926 | | - (le16_to_cpu(_val)) |
---|
2927 | | -#define EF4BYTE(_val) \ |
---|
2928 | | - (le32_to_cpu(_val)) |
---|
2929 | | - |
---|
2930 | | -/* Read data from memory */ |
---|
2931 | | -#define READEF1BYTE(_ptr) \ |
---|
2932 | | - EF1BYTE(*((u8 *)(_ptr))) |
---|
2933 | | -/* Read le16 data from memory and convert to host ordering */ |
---|
2934 | | -#define READEF2BYTE(_ptr) \ |
---|
2935 | | - EF2BYTE(*(_ptr)) |
---|
2936 | | -#define READEF4BYTE(_ptr) \ |
---|
2937 | | - EF4BYTE(*(_ptr)) |
---|
2938 | | - |
---|
2939 | | -/* Create a bit mask |
---|
2940 | | - * Examples: |
---|
2941 | | - * BIT_LEN_MASK_32(0) => 0x00000000 |
---|
2942 | | - * BIT_LEN_MASK_32(1) => 0x00000001 |
---|
2943 | | - * BIT_LEN_MASK_32(2) => 0x00000003 |
---|
2944 | | - * BIT_LEN_MASK_32(32) => 0xFFFFFFFF |
---|
2945 | | - */ |
---|
2946 | | -#define BIT_LEN_MASK_32(__bitlen) \ |
---|
2947 | | - (0xFFFFFFFF >> (32 - (__bitlen))) |
---|
2948 | | -#define BIT_LEN_MASK_16(__bitlen) \ |
---|
2949 | | - (0xFFFF >> (16 - (__bitlen))) |
---|
2950 | | -#define BIT_LEN_MASK_8(__bitlen) \ |
---|
2951 | | - (0xFF >> (8 - (__bitlen))) |
---|
2952 | | - |
---|
2953 | | -/* Create an offset bit mask |
---|
2954 | | - * Examples: |
---|
2955 | | - * BIT_OFFSET_LEN_MASK_32(0, 2) => 0x00000003 |
---|
2956 | | - * BIT_OFFSET_LEN_MASK_32(16, 2) => 0x00030000 |
---|
2957 | | - */ |
---|
2958 | | -#define BIT_OFFSET_LEN_MASK_32(__bitoffset, __bitlen) \ |
---|
2959 | | - (BIT_LEN_MASK_32(__bitlen) << (__bitoffset)) |
---|
2960 | | -#define BIT_OFFSET_LEN_MASK_16(__bitoffset, __bitlen) \ |
---|
2961 | | - (BIT_LEN_MASK_16(__bitlen) << (__bitoffset)) |
---|
2962 | | -#define BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen) \ |
---|
2963 | | - (BIT_LEN_MASK_8(__bitlen) << (__bitoffset)) |
---|
2964 | | - |
---|
2965 | | -/*Description: |
---|
2966 | | - * Return 4-byte value in host byte ordering from |
---|
2967 | | - * 4-byte pointer in little-endian system. |
---|
2968 | | - */ |
---|
2969 | | -#define LE_P4BYTE_TO_HOST_4BYTE(__pstart) \ |
---|
2970 | | - (EF4BYTE(*((__le32 *)(__pstart)))) |
---|
2971 | | -#define LE_P2BYTE_TO_HOST_2BYTE(__pstart) \ |
---|
2972 | | - (EF2BYTE(*((__le16 *)(__pstart)))) |
---|
2973 | | -#define LE_P1BYTE_TO_HOST_1BYTE(__pstart) \ |
---|
2974 | | - (EF1BYTE(*((u8 *)(__pstart)))) |
---|
2975 | | - |
---|
2976 | | -/*Description: |
---|
2977 | | -Translate subfield (continuous bits in little-endian) of 4-byte |
---|
2978 | | -value to host byte ordering.*/ |
---|
2979 | | -#define LE_BITS_TO_4BYTE(__pstart, __bitoffset, __bitlen) \ |
---|
2980 | | - ( \ |
---|
2981 | | - (LE_P4BYTE_TO_HOST_4BYTE(__pstart) >> (__bitoffset)) & \ |
---|
2982 | | - BIT_LEN_MASK_32(__bitlen) \ |
---|
2983 | | - ) |
---|
2984 | | -#define LE_BITS_TO_2BYTE(__pstart, __bitoffset, __bitlen) \ |
---|
2985 | | - ( \ |
---|
2986 | | - (LE_P2BYTE_TO_HOST_2BYTE(__pstart) >> (__bitoffset)) & \ |
---|
2987 | | - BIT_LEN_MASK_16(__bitlen) \ |
---|
2988 | | - ) |
---|
2989 | | -#define LE_BITS_TO_1BYTE(__pstart, __bitoffset, __bitlen) \ |
---|
2990 | | - ( \ |
---|
2991 | | - (LE_P1BYTE_TO_HOST_1BYTE(__pstart) >> (__bitoffset)) & \ |
---|
2992 | | - BIT_LEN_MASK_8(__bitlen) \ |
---|
2993 | | - ) |
---|
2994 | | - |
---|
2995 | | -/* Description: |
---|
2996 | | - * Mask subfield (continuous bits in little-endian) of 4-byte value |
---|
2997 | | - * and return the result in 4-byte value in host byte ordering. |
---|
2998 | | - */ |
---|
2999 | | -#define LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) \ |
---|
3000 | | - ( \ |
---|
3001 | | - LE_P4BYTE_TO_HOST_4BYTE(__pstart) & \ |
---|
3002 | | - (~BIT_OFFSET_LEN_MASK_32(__bitoffset, __bitlen)) \ |
---|
3003 | | - ) |
---|
3004 | | -#define LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) \ |
---|
3005 | | - ( \ |
---|
3006 | | - LE_P2BYTE_TO_HOST_2BYTE(__pstart) & \ |
---|
3007 | | - (~BIT_OFFSET_LEN_MASK_16(__bitoffset, __bitlen)) \ |
---|
3008 | | - ) |
---|
3009 | | -#define LE_BITS_CLEARED_TO_1BYTE(__pstart, __bitoffset, __bitlen) \ |
---|
3010 | | - ( \ |
---|
3011 | | - LE_P1BYTE_TO_HOST_1BYTE(__pstart) & \ |
---|
3012 | | - (~BIT_OFFSET_LEN_MASK_8(__bitoffset, __bitlen)) \ |
---|
3013 | | - ) |
---|
3014 | | - |
---|
3015 | | -/* Description: |
---|
3016 | | - * Set subfield of little-endian 4-byte value to specified value. |
---|
3017 | | - */ |
---|
3018 | | -#define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \ |
---|
3019 | | - *((__le32 *)(__pstart)) = \ |
---|
3020 | | - cpu_to_le32( \ |
---|
3021 | | - LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \ |
---|
3022 | | - ((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \ |
---|
3023 | | - ) |
---|
3024 | | -#define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \ |
---|
3025 | | - *((__le16 *)(__pstart)) = \ |
---|
3026 | | - cpu_to_le16( \ |
---|
3027 | | - LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) | \ |
---|
3028 | | - ((((u16)__val) & BIT_LEN_MASK_16(__bitlen)) << (__bitoffset)) \ |
---|
3029 | | - ) |
---|
3030 | | -#define SET_BITS_TO_LE_1BYTE(__pstart, __bitoffset, __bitlen, __val) \ |
---|
3031 | | - *((u8 *)(__pstart)) = EF1BYTE \ |
---|
3032 | | - ( \ |
---|
3033 | | - LE_BITS_CLEARED_TO_1BYTE(__pstart, __bitoffset, __bitlen) | \ |
---|
3034 | | - ((((u8)__val) & BIT_LEN_MASK_8(__bitlen)) << (__bitoffset)) \ |
---|
3035 | | - ) |
---|
| 2894 | + * mem access macro define start |
---|
| 2895 | + * Call endian free function when |
---|
| 2896 | + * 1. Read/write packet content. |
---|
| 2897 | + * 2. Before write integer to IO. |
---|
| 2898 | + * 3. After read integer from IO. |
---|
| 2899 | + ****************************************/ |
---|
3036 | 2900 | |
---|
3037 | 2901 | #define N_BYTE_ALIGMENT(__value, __aligment) ((__aligment == 1) ? \ |
---|
3038 | 2902 | (__value) : (((__value + __aligment - 1) / __aligment) * __aligment)) |
---|
3039 | 2903 | |
---|
3040 | | -/**************************************** |
---|
3041 | | - mem access macro define end |
---|
3042 | | -****************************************/ |
---|
| 2904 | +/* mem access macro define end */ |
---|
3043 | 2905 | |
---|
3044 | 2906 | #define byte(x, n) ((x >> (8 * n)) & 0xff) |
---|
3045 | 2907 | |
---|
.. | .. |
---|
3072 | 2934 | (ppsc->cur_ps_level &= (~(_ps_flg))) |
---|
3073 | 2935 | #define RT_SET_PS_LEVEL(ppsc, _ps_flg) \ |
---|
3074 | 2936 | (ppsc->cur_ps_level |= _ps_flg) |
---|
3075 | | - |
---|
3076 | | -#define container_of_dwork_rtl(x, y, z) \ |
---|
3077 | | - container_of(to_delayed_work(x), y, z) |
---|
3078 | 2937 | |
---|
3079 | 2938 | #define FILL_OCTET_STRING(_os, _octet, _len) \ |
---|
3080 | 2939 | (_os).octet = (u8 *)(_octet); \ |
---|
.. | .. |
---|
3174 | 3033 | } |
---|
3175 | 3034 | |
---|
3176 | 3035 | static inline void rtl_set_bbreg_with_dwmask(struct ieee80211_hw *hw, |
---|
3177 | | - u32 regaddr, u32 data) |
---|
| 3036 | + u32 regaddr, u32 data) |
---|
3178 | 3037 | { |
---|
3179 | 3038 | rtl_set_bbreg(hw, regaddr, 0xffffffff, data); |
---|
3180 | 3039 | } |
---|
.. | .. |
---|
3245 | 3104 | } |
---|
3246 | 3105 | |
---|
3247 | 3106 | static inline struct ieee80211_sta *rtl_find_sta(struct ieee80211_hw *hw, |
---|
3248 | | - u8 *mac_addr) |
---|
| 3107 | + u8 *mac_addr) |
---|
3249 | 3108 | { |
---|
3250 | 3109 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); |
---|
| 3110 | + |
---|
3251 | 3111 | return ieee80211_find_sta(mac->vif, mac_addr); |
---|
3252 | 3112 | } |
---|
3253 | 3113 | |
---|