diff options
| author | David S. Miller <davem@davemloft.net> | 2011-05-05 17:09:28 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2011-05-05 17:09:28 -0400 |
| commit | 90864fbc7639d7a2300c67a18c9fb9fbcf7d51d2 (patch) | |
| tree | 6951c8d0e529dbfc7c4cec75d4cec63350e39b7c /drivers/net/wireless/rtlwifi/wifi.h | |
| parent | 228e548e602061b08ee8e8966f567c12aa079682 (diff) | |
| parent | a70171dce9cd44cb06c7d299eba9fa87a8933045 (diff) | |
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/rtlwifi/wifi.h')
| -rw-r--r-- | drivers/net/wireless/rtlwifi/wifi.h | 155 |
1 files changed, 144 insertions, 11 deletions
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h index 2713efe07ce5..693395ee98f9 100644 --- a/drivers/net/wireless/rtlwifi/wifi.h +++ b/drivers/net/wireless/rtlwifi/wifi.h | |||
| @@ -68,6 +68,8 @@ | |||
| 68 | #define QBSS_LOAD_SIZE 5 | 68 | #define QBSS_LOAD_SIZE 5 |
| 69 | #define MAX_WMMELE_LENGTH 64 | 69 | #define MAX_WMMELE_LENGTH 64 |
| 70 | 70 | ||
| 71 | #define TOTAL_CAM_ENTRY 32 | ||
| 72 | |||
| 71 | /*slot time for 11g. */ | 73 | /*slot time for 11g. */ |
| 72 | #define RTL_SLOT_TIME_9 9 | 74 | #define RTL_SLOT_TIME_9 9 |
| 73 | #define RTL_SLOT_TIME_20 20 | 75 | #define RTL_SLOT_TIME_20 20 |
| @@ -94,8 +96,10 @@ | |||
| 94 | #define CHANNEL_GROUP_MAX_5G 9 | 96 | #define CHANNEL_GROUP_MAX_5G 9 |
| 95 | #define CHANNEL_MAX_NUMBER_2G 14 | 97 | #define CHANNEL_MAX_NUMBER_2G 14 |
| 96 | #define AVG_THERMAL_NUM 8 | 98 | #define AVG_THERMAL_NUM 8 |
| 99 | #define MAX_TID_COUNT 9 | ||
| 97 | 100 | ||
| 98 | /* for early mode */ | 101 | /* for early mode */ |
| 102 | #define FCS_LEN 4 | ||
| 99 | #define EM_HDR_LEN 8 | 103 | #define EM_HDR_LEN 8 |
| 100 | enum intf_type { | 104 | enum intf_type { |
| 101 | INTF_PCI = 0, | 105 | INTF_PCI = 0, |
| @@ -159,6 +163,8 @@ enum hardware_type { | |||
| 159 | (IS_HARDWARE_TYPE_8192DE(rtlhal) || IS_HARDWARE_TYPE_8192DU(rtlhal)) | 163 | (IS_HARDWARE_TYPE_8192DE(rtlhal) || IS_HARDWARE_TYPE_8192DU(rtlhal)) |
| 160 | #define IS_HARDWARE_TYPE_8723(rtlhal) \ | 164 | #define IS_HARDWARE_TYPE_8723(rtlhal) \ |
| 161 | (IS_HARDWARE_TYPE_8723E(rtlhal) || IS_HARDWARE_TYPE_8723U(rtlhal)) | 165 | (IS_HARDWARE_TYPE_8723E(rtlhal) || IS_HARDWARE_TYPE_8723U(rtlhal)) |
| 166 | #define IS_HARDWARE_TYPE_8723U(rtlhal) \ | ||
| 167 | (rtlhal->hw_type == HARDWARE_TYPE_RTL8723U) | ||
| 162 | 168 | ||
| 163 | enum scan_operation_backup_opt { | 169 | enum scan_operation_backup_opt { |
| 164 | SCAN_OPT_BACKUP = 0, | 170 | SCAN_OPT_BACKUP = 0, |
| @@ -297,6 +303,9 @@ enum hw_variables { | |||
| 297 | HW_VAR_DATA_FILTER, | 303 | HW_VAR_DATA_FILTER, |
| 298 | }; | 304 | }; |
| 299 | 305 | ||
| 306 | #define HWSET_MAX_SIZE 128 | ||
| 307 | #define EFUSE_MAX_SECTION 16 | ||
| 308 | |||
| 300 | enum _RT_MEDIA_STATUS { | 309 | enum _RT_MEDIA_STATUS { |
| 301 | RT_MEDIA_DISCONNECT = 0, | 310 | RT_MEDIA_DISCONNECT = 0, |
| 302 | RT_MEDIA_CONNECT = 1 | 311 | RT_MEDIA_CONNECT = 1 |
| @@ -843,6 +852,7 @@ struct rtl_phy { | |||
| 843 | bool apk_done; | 852 | bool apk_done; |
| 844 | u32 reg_rf3c[2]; /* pathA / pathB */ | 853 | u32 reg_rf3c[2]; /* pathA / pathB */ |
| 845 | 854 | ||
| 855 | /* bfsync */ | ||
| 846 | u8 framesync; | 856 | u8 framesync; |
| 847 | u32 framesync_c34; | 857 | u32 framesync_c34; |
| 848 | 858 | ||
| @@ -852,6 +862,10 @@ struct rtl_phy { | |||
| 852 | }; | 862 | }; |
| 853 | 863 | ||
| 854 | #define MAX_TID_COUNT 9 | 864 | #define MAX_TID_COUNT 9 |
| 865 | #define RTL_AGG_STOP 0 | ||
| 866 | #define RTL_AGG_PROGRESS 1 | ||
| 867 | #define RTL_AGG_START 2 | ||
| 868 | #define RTL_AGG_OPERATIONAL 3 | ||
| 855 | #define RTL_AGG_OFF 0 | 869 | #define RTL_AGG_OFF 0 |
| 856 | #define RTL_AGG_ON 1 | 870 | #define RTL_AGG_ON 1 |
| 857 | #define RTL_AGG_EMPTYING_HW_QUEUE_ADDBA 2 | 871 | #define RTL_AGG_EMPTYING_HW_QUEUE_ADDBA 2 |
| @@ -871,6 +885,13 @@ struct rtl_tid_data { | |||
| 871 | struct rtl_ht_agg agg; | 885 | struct rtl_ht_agg agg; |
| 872 | }; | 886 | }; |
| 873 | 887 | ||
| 888 | struct rtl_sta_info { | ||
| 889 | u8 ratr_index; | ||
| 890 | u8 wireless_mode; | ||
| 891 | u8 mimo_ps; | ||
| 892 | struct rtl_tid_data tids[MAX_TID_COUNT]; | ||
| 893 | } __packed; | ||
| 894 | |||
| 874 | struct rtl_priv; | 895 | struct rtl_priv; |
| 875 | struct rtl_io { | 896 | struct rtl_io { |
| 876 | struct device *dev; | 897 | struct device *dev; |
| @@ -894,6 +915,7 @@ struct rtl_io { | |||
| 894 | u32(*read32_sync) (struct rtl_priv *rtlpriv, u32 addr); | 915 | u32(*read32_sync) (struct rtl_priv *rtlpriv, u32 addr); |
| 895 | int (*readN_sync) (struct rtl_priv *rtlpriv, u32 addr, u16 len, | 916 | int (*readN_sync) (struct rtl_priv *rtlpriv, u32 addr, u16 len, |
| 896 | u8 *pdata); | 917 | u8 *pdata); |
| 918 | |||
| 897 | }; | 919 | }; |
| 898 | 920 | ||
| 899 | struct rtl_mac { | 921 | struct rtl_mac { |
| @@ -916,6 +938,8 @@ struct rtl_mac { | |||
| 916 | int n_channels; | 938 | int n_channels; |
| 917 | int n_bitrates; | 939 | int n_bitrates; |
| 918 | 940 | ||
| 941 | bool offchan_deley; | ||
| 942 | |||
| 919 | /*filters */ | 943 | /*filters */ |
| 920 | u32 rx_conf; | 944 | u32 rx_conf; |
| 921 | u16 rx_mgt_filter; | 945 | u16 rx_mgt_filter; |
| @@ -1032,7 +1056,9 @@ struct rtl_security { | |||
| 1032 | enum rt_enc_alg pairwise_enc_algorithm; | 1056 | enum rt_enc_alg pairwise_enc_algorithm; |
| 1033 | /*Encryption Algorithm for Brocast/Multicast */ | 1057 | /*Encryption Algorithm for Brocast/Multicast */ |
| 1034 | enum rt_enc_alg group_enc_algorithm; | 1058 | enum rt_enc_alg group_enc_algorithm; |
| 1035 | 1059 | /*Cam Entry Bitmap */ | |
| 1060 | u32 hwsec_cam_bitmap; | ||
| 1061 | u8 hwsec_cam_sta_addr[TOTAL_CAM_ENTRY][ETH_ALEN]; | ||
| 1036 | /*local Key buffer, indx 0 is for | 1062 | /*local Key buffer, indx 0 is for |
| 1037 | pairwise key 1-4 is for agoup key. */ | 1063 | pairwise key 1-4 is for agoup key. */ |
| 1038 | u8 key_buf[KEY_BUF_SIZE][MAX_KEY_LEN]; | 1064 | u8 key_buf[KEY_BUF_SIZE][MAX_KEY_LEN]; |
| @@ -1053,7 +1079,7 @@ struct rtl_dm { | |||
| 1053 | bool current_turbo_edca; | 1079 | bool current_turbo_edca; |
| 1054 | bool is_any_nonbepkts; /*out dm */ | 1080 | bool is_any_nonbepkts; /*out dm */ |
| 1055 | bool is_cur_rdlstate; | 1081 | bool is_cur_rdlstate; |
| 1056 | bool txpower_trackingInit; | 1082 | bool txpower_trackinginit; |
| 1057 | bool disable_framebursting; | 1083 | bool disable_framebursting; |
| 1058 | bool cck_inch14; | 1084 | bool cck_inch14; |
| 1059 | bool txpower_tracking; | 1085 | bool txpower_tracking; |
| @@ -1079,7 +1105,6 @@ struct rtl_dm { | |||
| 1079 | bool disable_tx_int; | 1105 | bool disable_tx_int; |
| 1080 | char ofdm_index[2]; | 1106 | char ofdm_index[2]; |
| 1081 | char cck_index; | 1107 | char cck_index; |
| 1082 | u8 power_index_backup[6]; | ||
| 1083 | }; | 1108 | }; |
| 1084 | 1109 | ||
| 1085 | #define EFUSE_MAX_LOGICAL_SIZE 256 | 1110 | #define EFUSE_MAX_LOGICAL_SIZE 256 |
| @@ -1175,6 +1200,7 @@ struct rtl_ps_ctl { | |||
| 1175 | * otherwise Offset[560h] = 0x00. | 1200 | * otherwise Offset[560h] = 0x00. |
| 1176 | * */ | 1201 | * */ |
| 1177 | bool support_aspm; | 1202 | bool support_aspm; |
| 1203 | |||
| 1178 | bool support_backdoor; | 1204 | bool support_backdoor; |
| 1179 | 1205 | ||
| 1180 | /*for LPS */ | 1206 | /*for LPS */ |
| @@ -1201,7 +1227,6 @@ struct rtl_ps_ctl { | |||
| 1201 | 1227 | ||
| 1202 | /*just for PCIE ASPM */ | 1228 | /*just for PCIE ASPM */ |
| 1203 | u8 const_amdpci_aspm; | 1229 | u8 const_amdpci_aspm; |
| 1204 | |||
| 1205 | bool pwrdown_mode; | 1230 | bool pwrdown_mode; |
| 1206 | 1231 | ||
| 1207 | enum rf_pwrstate inactive_pwrstate; | 1232 | enum rf_pwrstate inactive_pwrstate; |
| @@ -1282,6 +1307,10 @@ struct rt_link_detect { | |||
| 1282 | bool busytraffic; | 1307 | bool busytraffic; |
| 1283 | bool higher_busytraffic; | 1308 | bool higher_busytraffic; |
| 1284 | bool higher_busyrxtraffic; | 1309 | bool higher_busyrxtraffic; |
| 1310 | |||
| 1311 | u32 tidtx_in4period[MAX_TID_COUNT][4]; | ||
| 1312 | u32 tidtx_inperiod[MAX_TID_COUNT]; | ||
| 1313 | bool higher_busytxtraffic[MAX_TID_COUNT]; | ||
| 1285 | }; | 1314 | }; |
| 1286 | 1315 | ||
| 1287 | struct rtl_tcb_desc { | 1316 | struct rtl_tcb_desc { |
| @@ -1344,13 +1373,15 @@ struct rtl_hal_ops { | |||
| 1344 | u32 add_msr, u32 rm_msr); | 1373 | u32 add_msr, u32 rm_msr); |
| 1345 | void (*get_hw_reg) (struct ieee80211_hw *hw, u8 variable, u8 *val); | 1374 | void (*get_hw_reg) (struct ieee80211_hw *hw, u8 variable, u8 *val); |
| 1346 | void (*set_hw_reg) (struct ieee80211_hw *hw, u8 variable, u8 *val); | 1375 | void (*set_hw_reg) (struct ieee80211_hw *hw, u8 variable, u8 *val); |
| 1347 | void (*update_rate_table) (struct ieee80211_hw *hw); | 1376 | void (*update_rate_tbl) (struct ieee80211_hw *hw, |
| 1377 | struct ieee80211_sta *sta, u8 rssi_level); | ||
| 1348 | void (*update_rate_mask) (struct ieee80211_hw *hw, u8 rssi_level); | 1378 | void (*update_rate_mask) (struct ieee80211_hw *hw, u8 rssi_level); |
| 1349 | void (*fill_tx_desc) (struct ieee80211_hw *hw, | 1379 | void (*fill_tx_desc) (struct ieee80211_hw *hw, |
| 1350 | struct ieee80211_hdr *hdr, u8 *pdesc_tx, | 1380 | struct ieee80211_hdr *hdr, u8 *pdesc_tx, |
| 1351 | struct ieee80211_tx_info *info, | 1381 | struct ieee80211_tx_info *info, |
| 1352 | struct sk_buff *skb, unsigned int queue_index); | 1382 | struct sk_buff *skb, u8 hw_queue, |
| 1353 | void (*fill_fake_txdesc) (struct ieee80211_hw *hw, u8 * pDesc, | 1383 | struct rtl_tcb_desc *ptcb_desc); |
| 1384 | void (*fill_fake_txdesc) (struct ieee80211_hw *hw, u8 *pDesc, | ||
| 1354 | u32 buffer_len, bool bIsPsPoll); | 1385 | u32 buffer_len, bool bIsPsPoll); |
| 1355 | void (*fill_tx_cmddesc) (struct ieee80211_hw *hw, u8 *pdesc, | 1386 | void (*fill_tx_cmddesc) (struct ieee80211_hw *hw, u8 *pdesc, |
| 1356 | bool firstseg, bool lastseg, | 1387 | bool firstseg, bool lastseg, |
| @@ -1370,10 +1401,10 @@ struct rtl_hal_ops { | |||
| 1370 | enum led_ctl_mode ledaction); | 1401 | enum led_ctl_mode ledaction); |
| 1371 | void (*set_desc) (u8 *pdesc, bool istx, u8 desc_name, u8 *val); | 1402 | void (*set_desc) (u8 *pdesc, bool istx, u8 desc_name, u8 *val); |
| 1372 | u32 (*get_desc) (u8 *pdesc, bool istx, u8 desc_name); | 1403 | u32 (*get_desc) (u8 *pdesc, bool istx, u8 desc_name); |
| 1373 | void (*tx_polling) (struct ieee80211_hw *hw, unsigned int hw_queue); | 1404 | void (*tx_polling) (struct ieee80211_hw *hw, u8 hw_queue); |
| 1374 | void (*enable_hw_sec) (struct ieee80211_hw *hw); | 1405 | void (*enable_hw_sec) (struct ieee80211_hw *hw); |
| 1375 | void (*set_key) (struct ieee80211_hw *hw, u32 key_index, | 1406 | void (*set_key) (struct ieee80211_hw *hw, u32 key_index, |
| 1376 | u8 *p_macaddr, bool is_group, u8 enc_algo, | 1407 | u8 *macaddr, bool is_group, u8 enc_algo, |
| 1377 | bool is_wepkey, bool clear_all); | 1408 | bool is_wepkey, bool clear_all); |
| 1378 | void (*init_sw_leds) (struct ieee80211_hw *hw); | 1409 | void (*init_sw_leds) (struct ieee80211_hw *hw); |
| 1379 | void (*deinit_sw_leds) (struct ieee80211_hw *hw); | 1410 | void (*deinit_sw_leds) (struct ieee80211_hw *hw); |
| @@ -1384,6 +1415,7 @@ struct rtl_hal_ops { | |||
| 1384 | u32 regaddr, u32 bitmask); | 1415 | u32 regaddr, u32 bitmask); |
| 1385 | void (*set_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath, | 1416 | void (*set_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath, |
| 1386 | u32 regaddr, u32 bitmask, u32 data); | 1417 | u32 regaddr, u32 bitmask, u32 data); |
| 1418 | void (*linked_set_reg) (struct ieee80211_hw *hw); | ||
| 1387 | bool (*phy_rf6052_config) (struct ieee80211_hw *hw); | 1419 | bool (*phy_rf6052_config) (struct ieee80211_hw *hw); |
| 1388 | void (*phy_rf6052_set_cck_txpower) (struct ieee80211_hw *hw, | 1420 | void (*phy_rf6052_set_cck_txpower) (struct ieee80211_hw *hw, |
| 1389 | u8 *powerlevel); | 1421 | u8 *powerlevel); |
| @@ -1404,7 +1436,9 @@ struct rtl_intf_ops { | |||
| 1404 | int (*adapter_start) (struct ieee80211_hw *hw); | 1436 | int (*adapter_start) (struct ieee80211_hw *hw); |
| 1405 | void (*adapter_stop) (struct ieee80211_hw *hw); | 1437 | void (*adapter_stop) (struct ieee80211_hw *hw); |
| 1406 | 1438 | ||
| 1407 | int (*adapter_tx) (struct ieee80211_hw *hw, struct sk_buff *skb); | 1439 | int (*adapter_tx) (struct ieee80211_hw *hw, struct sk_buff *skb, |
| 1440 | struct rtl_tcb_desc *ptcb_desc); | ||
| 1441 | void (*flush)(struct ieee80211_hw *hw, bool drop); | ||
| 1408 | int (*reset_trx_ring) (struct ieee80211_hw *hw); | 1442 | int (*reset_trx_ring) (struct ieee80211_hw *hw); |
| 1409 | bool (*waitq_insert) (struct ieee80211_hw *hw, struct sk_buff *skb); | 1443 | bool (*waitq_insert) (struct ieee80211_hw *hw, struct sk_buff *skb); |
| 1410 | 1444 | ||
| @@ -1418,6 +1452,15 @@ struct rtl_intf_ops { | |||
| 1418 | struct rtl_mod_params { | 1452 | struct rtl_mod_params { |
| 1419 | /* default: 0 = using hardware encryption */ | 1453 | /* default: 0 = using hardware encryption */ |
| 1420 | int sw_crypto; | 1454 | int sw_crypto; |
| 1455 | |||
| 1456 | /* default: 1 = using no linked power save */ | ||
| 1457 | bool inactiveps; | ||
| 1458 | |||
| 1459 | /* default: 1 = using linked sw power save */ | ||
| 1460 | bool swctrl_lps; | ||
| 1461 | |||
| 1462 | /* default: 1 = using linked fw power save */ | ||
| 1463 | bool fwctrl_lps; | ||
| 1421 | }; | 1464 | }; |
| 1422 | 1465 | ||
| 1423 | struct rtl_hal_usbint_cfg { | 1466 | struct rtl_hal_usbint_cfg { |
| @@ -1445,6 +1488,7 @@ struct rtl_hal_usbint_cfg { | |||
| 1445 | 1488 | ||
| 1446 | struct rtl_hal_cfg { | 1489 | struct rtl_hal_cfg { |
| 1447 | u8 bar_id; | 1490 | u8 bar_id; |
| 1491 | bool write_readback; | ||
| 1448 | char *name; | 1492 | char *name; |
| 1449 | char *fw_name; | 1493 | char *fw_name; |
| 1450 | struct rtl_hal_ops *ops; | 1494 | struct rtl_hal_ops *ops; |
| @@ -1469,7 +1513,6 @@ struct rtl_locks { | |||
| 1469 | spinlock_t rf_lock; | 1513 | spinlock_t rf_lock; |
| 1470 | spinlock_t lps_lock; | 1514 | spinlock_t lps_lock; |
| 1471 | spinlock_t waitq_lock; | 1515 | spinlock_t waitq_lock; |
| 1472 | spinlock_t tx_urb_lock; | ||
| 1473 | 1516 | ||
| 1474 | /*Dual mac*/ | 1517 | /*Dual mac*/ |
| 1475 | spinlock_t cck_and_rw_pagea_lock; | 1518 | spinlock_t cck_and_rw_pagea_lock; |
| @@ -1653,13 +1696,23 @@ struct bt_coexist_info { | |||
| 1653 | #define EF4BYTE(_val) \ | 1696 | #define EF4BYTE(_val) \ |
| 1654 | (le32_to_cpu(_val)) | 1697 | (le32_to_cpu(_val)) |
| 1655 | 1698 | ||
| 1699 | /* Read data from memory */ | ||
| 1700 | #define READEF1BYTE(_ptr) \ | ||
| 1701 | EF1BYTE(*((u8 *)(_ptr))) | ||
| 1656 | /* Read le16 data from memory and convert to host ordering */ | 1702 | /* Read le16 data from memory and convert to host ordering */ |
| 1657 | #define READEF2BYTE(_ptr) \ | 1703 | #define READEF2BYTE(_ptr) \ |
| 1658 | EF2BYTE(*((u16 *)(_ptr))) | 1704 | EF2BYTE(*((u16 *)(_ptr))) |
| 1705 | #define READEF4BYTE(_ptr) \ | ||
| 1706 | EF4BYTE(*((u32 *)(_ptr))) | ||
| 1659 | 1707 | ||
| 1708 | /* Write data to memory */ | ||
| 1709 | #define WRITEEF1BYTE(_ptr, _val) \ | ||
| 1710 | (*((u8 *)(_ptr))) = EF1BYTE(_val) | ||
| 1660 | /* Write le16 data to memory in host ordering */ | 1711 | /* Write le16 data to memory in host ordering */ |
| 1661 | #define WRITEEF2BYTE(_ptr, _val) \ | 1712 | #define WRITEEF2BYTE(_ptr, _val) \ |
| 1662 | (*((u16 *)(_ptr))) = EF2BYTE(_val) | 1713 | (*((u16 *)(_ptr))) = EF2BYTE(_val) |
| 1714 | #define WRITEEF4BYTE(_ptr, _val) \ | ||
| 1715 | (*((u16 *)(_ptr))) = EF2BYTE(_val) | ||
| 1663 | 1716 | ||
| 1664 | /* Create a bit mask | 1717 | /* Create a bit mask |
| 1665 | * Examples: | 1718 | * Examples: |
| @@ -1698,6 +1751,25 @@ struct bt_coexist_info { | |||
| 1698 | #define LE_P1BYTE_TO_HOST_1BYTE(__pstart) \ | 1751 | #define LE_P1BYTE_TO_HOST_1BYTE(__pstart) \ |
| 1699 | (EF1BYTE(*((u8 *)(__pstart)))) | 1752 | (EF1BYTE(*((u8 *)(__pstart)))) |
| 1700 | 1753 | ||
| 1754 | /*Description: | ||
| 1755 | Translate subfield (continuous bits in little-endian) of 4-byte | ||
| 1756 | value to host byte ordering.*/ | ||
| 1757 | #define LE_BITS_TO_4BYTE(__pstart, __bitoffset, __bitlen) \ | ||
| 1758 | ( \ | ||
| 1759 | (LE_P4BYTE_TO_HOST_4BYTE(__pstart) >> (__bitoffset)) & \ | ||
| 1760 | BIT_LEN_MASK_32(__bitlen) \ | ||
| 1761 | ) | ||
| 1762 | #define LE_BITS_TO_2BYTE(__pstart, __bitoffset, __bitlen) \ | ||
| 1763 | ( \ | ||
| 1764 | (LE_P2BYTE_TO_HOST_2BYTE(__pstart) >> (__bitoffset)) & \ | ||
| 1765 | BIT_LEN_MASK_16(__bitlen) \ | ||
| 1766 | ) | ||
| 1767 | #define LE_BITS_TO_1BYTE(__pstart, __bitoffset, __bitlen) \ | ||
| 1768 | ( \ | ||
| 1769 | (LE_P1BYTE_TO_HOST_1BYTE(__pstart) >> (__bitoffset)) & \ | ||
| 1770 | BIT_LEN_MASK_8(__bitlen) \ | ||
| 1771 | ) | ||
| 1772 | |||
| 1701 | /* Description: | 1773 | /* Description: |
| 1702 | * Mask subfield (continuous bits in little-endian) of 4-byte value | 1774 | * Mask subfield (continuous bits in little-endian) of 4-byte value |
| 1703 | * and return the result in 4-byte value in host byte ordering. | 1775 | * and return the result in 4-byte value in host byte ordering. |
| @@ -1721,6 +1793,18 @@ struct bt_coexist_info { | |||
| 1721 | /* Description: | 1793 | /* Description: |
| 1722 | * Set subfield of little-endian 4-byte value to specified value. | 1794 | * Set subfield of little-endian 4-byte value to specified value. |
| 1723 | */ | 1795 | */ |
| 1796 | #define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \ | ||
| 1797 | *((u32 *)(__pstart)) = EF4BYTE \ | ||
| 1798 | ( \ | ||
| 1799 | LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \ | ||
| 1800 | ((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \ | ||
| 1801 | ); | ||
| 1802 | #define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \ | ||
| 1803 | *((u16 *)(__pstart)) = EF2BYTE \ | ||
| 1804 | ( \ | ||
| 1805 | LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) | \ | ||
| 1806 | ((((u16)__val) & BIT_LEN_MASK_16(__bitlen)) << (__bitoffset)) \ | ||
| 1807 | ); | ||
| 1724 | #define SET_BITS_TO_LE_1BYTE(__pstart, __bitoffset, __bitlen, __val) \ | 1808 | #define SET_BITS_TO_LE_1BYTE(__pstart, __bitoffset, __bitlen, __val) \ |
| 1725 | *((u8 *)(__pstart)) = EF1BYTE \ | 1809 | *((u8 *)(__pstart)) = EF1BYTE \ |
| 1726 | ( \ | 1810 | ( \ |
| @@ -1728,12 +1812,16 @@ struct bt_coexist_info { | |||
| 1728 | ((((u8)__val) & BIT_LEN_MASK_8(__bitlen)) << (__bitoffset)) \ | 1812 | ((((u8)__val) & BIT_LEN_MASK_8(__bitlen)) << (__bitoffset)) \ |
| 1729 | ); | 1813 | ); |
| 1730 | 1814 | ||
| 1815 | #define N_BYTE_ALIGMENT(__value, __aligment) ((__aligment == 1) ? \ | ||
| 1816 | (__value) : (((__value + __aligment - 1) / __aligment) * __aligment)) | ||
| 1817 | |||
| 1731 | /**************************************** | 1818 | /**************************************** |
| 1732 | mem access macro define end | 1819 | mem access macro define end |
| 1733 | ****************************************/ | 1820 | ****************************************/ |
| 1734 | 1821 | ||
| 1735 | #define byte(x, n) ((x >> (8 * n)) & 0xff) | 1822 | #define byte(x, n) ((x >> (8 * n)) & 0xff) |
| 1736 | 1823 | ||
| 1824 | #define packet_get_type(_packet) (EF1BYTE((_packet).octet[0]) & 0xFC) | ||
| 1737 | #define RTL_WATCH_DOG_TIME 2000 | 1825 | #define RTL_WATCH_DOG_TIME 2000 |
| 1738 | #define MSECS(t) msecs_to_jiffies(t) | 1826 | #define MSECS(t) msecs_to_jiffies(t) |
| 1739 | #define WLAN_FC_GET_VERS(fc) (le16_to_cpu(fc) & IEEE80211_FCTL_VERS) | 1827 | #define WLAN_FC_GET_VERS(fc) (le16_to_cpu(fc) & IEEE80211_FCTL_VERS) |
| @@ -1768,6 +1856,15 @@ struct bt_coexist_info { | |||
| 1768 | #define container_of_dwork_rtl(x, y, z) \ | 1856 | #define container_of_dwork_rtl(x, y, z) \ |
| 1769 | container_of(container_of(x, struct delayed_work, work), y, z) | 1857 | container_of(container_of(x, struct delayed_work, work), y, z) |
| 1770 | 1858 | ||
| 1859 | #define FILL_OCTET_STRING(_os, _octet, _len) \ | ||
| 1860 | (_os).octet = (u8 *)(_octet); \ | ||
| 1861 | (_os).length = (_len); | ||
| 1862 | |||
| 1863 | #define CP_MACADDR(des, src) \ | ||
| 1864 | ((des)[0] = (src)[0], (des)[1] = (src)[1],\ | ||
| 1865 | (des)[2] = (src)[2], (des)[3] = (src)[3],\ | ||
| 1866 | (des)[4] = (src)[4], (des)[5] = (src)[5]) | ||
| 1867 | |||
| 1771 | static inline u8 rtl_read_byte(struct rtl_priv *rtlpriv, u32 addr) | 1868 | static inline u8 rtl_read_byte(struct rtl_priv *rtlpriv, u32 addr) |
| 1772 | { | 1869 | { |
| 1773 | return rtlpriv->io.read8_sync(rtlpriv, addr); | 1870 | return rtlpriv->io.read8_sync(rtlpriv, addr); |
| @@ -1786,17 +1883,26 @@ static inline u32 rtl_read_dword(struct rtl_priv *rtlpriv, u32 addr) | |||
| 1786 | static inline void rtl_write_byte(struct rtl_priv *rtlpriv, u32 addr, u8 val8) | 1883 | static inline void rtl_write_byte(struct rtl_priv *rtlpriv, u32 addr, u8 val8) |
| 1787 | { | 1884 | { |
| 1788 | rtlpriv->io.write8_async(rtlpriv, addr, val8); | 1885 | rtlpriv->io.write8_async(rtlpriv, addr, val8); |
| 1886 | |||
| 1887 | if (rtlpriv->cfg->write_readback) | ||
| 1888 | rtlpriv->io.read8_sync(rtlpriv, addr); | ||
| 1789 | } | 1889 | } |
| 1790 | 1890 | ||
| 1791 | static inline void rtl_write_word(struct rtl_priv *rtlpriv, u32 addr, u16 val16) | 1891 | static inline void rtl_write_word(struct rtl_priv *rtlpriv, u32 addr, u16 val16) |
| 1792 | { | 1892 | { |
| 1793 | rtlpriv->io.write16_async(rtlpriv, addr, val16); | 1893 | rtlpriv->io.write16_async(rtlpriv, addr, val16); |
| 1894 | |||
| 1895 | if (rtlpriv->cfg->write_readback) | ||
| 1896 | rtlpriv->io.read16_sync(rtlpriv, addr); | ||
| 1794 | } | 1897 | } |
| 1795 | 1898 | ||
| 1796 | static inline void rtl_write_dword(struct rtl_priv *rtlpriv, | 1899 | static inline void rtl_write_dword(struct rtl_priv *rtlpriv, |
| 1797 | u32 addr, u32 val32) | 1900 | u32 addr, u32 val32) |
| 1798 | { | 1901 | { |
| 1799 | rtlpriv->io.write32_async(rtlpriv, addr, val32); | 1902 | rtlpriv->io.write32_async(rtlpriv, addr, val32); |
| 1903 | |||
| 1904 | if (rtlpriv->cfg->write_readback) | ||
| 1905 | rtlpriv->io.read32_sync(rtlpriv, addr); | ||
| 1800 | } | 1906 | } |
| 1801 | 1907 | ||
| 1802 | static inline u32 rtl_get_bbreg(struct ieee80211_hw *hw, | 1908 | static inline u32 rtl_get_bbreg(struct ieee80211_hw *hw, |
| @@ -1855,4 +1961,31 @@ static inline u8 get_rf_type(struct rtl_phy *rtlphy) | |||
| 1855 | return rtlphy->rf_type; | 1961 | return rtlphy->rf_type; |
| 1856 | } | 1962 | } |
| 1857 | 1963 | ||
| 1964 | static inline struct ieee80211_hdr *rtl_get_hdr(struct sk_buff *skb) | ||
| 1965 | { | ||
| 1966 | return (struct ieee80211_hdr *)(skb->data); | ||
| 1967 | } | ||
| 1968 | |||
| 1969 | static inline __le16 rtl_get_fc(struct sk_buff *skb) | ||
| 1970 | { | ||
| 1971 | return rtl_get_hdr(skb)->frame_control; | ||
| 1972 | } | ||
| 1973 | |||
| 1974 | static inline u16 rtl_get_tid_h(struct ieee80211_hdr *hdr) | ||
| 1975 | { | ||
| 1976 | return (ieee80211_get_qos_ctl(hdr))[0] & IEEE80211_QOS_CTL_TID_MASK; | ||
| 1977 | } | ||
| 1978 | |||
| 1979 | static inline u16 rtl_get_tid(struct sk_buff *skb) | ||
| 1980 | { | ||
| 1981 | return rtl_get_tid_h(rtl_get_hdr(skb)); | ||
| 1982 | } | ||
| 1983 | |||
| 1984 | static inline struct ieee80211_sta *get_sta(struct ieee80211_hw *hw, | ||
| 1985 | struct ieee80211_vif *vif, | ||
| 1986 | u8 *bssid) | ||
| 1987 | { | ||
| 1988 | return ieee80211_find_sta(vif, bssid); | ||
| 1989 | } | ||
| 1990 | |||
| 1858 | #endif | 1991 | #endif |
