aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi/wifi.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rtlwifi/wifi.h')
-rw-r--r--drivers/net/wireless/rtlwifi/wifi.h92
1 files changed, 91 insertions, 1 deletions
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index d4bc7859cded..f1b6bc693b0a 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -135,7 +135,7 @@ enum hardware_type {
135 HARDWARE_TYPE_RTL8192CU, 135 HARDWARE_TYPE_RTL8192CU,
136 HARDWARE_TYPE_RTL8192DE, 136 HARDWARE_TYPE_RTL8192DE,
137 HARDWARE_TYPE_RTL8192DU, 137 HARDWARE_TYPE_RTL8192DU,
138 HARDWARE_TYPE_RTL8723E, 138 HARDWARE_TYPE_RTL8723AE,
139 HARDWARE_TYPE_RTL8723U, 139 HARDWARE_TYPE_RTL8723U,
140 140
141 /* keep it last */ 141 /* keep it last */
@@ -389,6 +389,7 @@ enum rt_enc_alg {
389 RSERVED_ENCRYPTION = 3, 389 RSERVED_ENCRYPTION = 3,
390 AESCCMP_ENCRYPTION = 4, 390 AESCCMP_ENCRYPTION = 4,
391 WEP104_ENCRYPTION = 5, 391 WEP104_ENCRYPTION = 5,
392 AESCMAC_ENCRYPTION = 6, /*IEEE802.11w */
392}; 393};
393 394
394enum rtl_hal_state { 395enum rtl_hal_state {
@@ -873,6 +874,7 @@ struct rtl_phy {
873 u32 adda_backup[16]; 874 u32 adda_backup[16];
874 u32 iqk_mac_backup[IQK_MAC_REG_NUM]; 875 u32 iqk_mac_backup[IQK_MAC_REG_NUM];
875 u32 iqk_bb_backup[10]; 876 u32 iqk_bb_backup[10];
877 bool iqk_initialized;
876 878
877 /* Dual mac */ 879 /* Dual mac */
878 bool need_iqk; 880 bool need_iqk;
@@ -910,6 +912,8 @@ struct rtl_phy {
910#define RTL_AGG_OPERATIONAL 3 912#define RTL_AGG_OPERATIONAL 3
911#define RTL_AGG_OFF 0 913#define RTL_AGG_OFF 0
912#define RTL_AGG_ON 1 914#define RTL_AGG_ON 1
915#define RTL_RX_AGG_START 1
916#define RTL_RX_AGG_STOP 0
913#define RTL_AGG_EMPTYING_HW_QUEUE_ADDBA 2 917#define RTL_AGG_EMPTYING_HW_QUEUE_ADDBA 2
914#define RTL_AGG_EMPTYING_HW_QUEUE_DELBA 3 918#define RTL_AGG_EMPTYING_HW_QUEUE_DELBA 3
915 919
@@ -920,6 +924,7 @@ struct rtl_ht_agg {
920 u64 bitmap; 924 u64 bitmap;
921 u32 rate_n_flags; 925 u32 rate_n_flags;
922 u8 agg_state; 926 u8 agg_state;
927 u8 rx_agg_state;
923}; 928};
924 929
925struct rtl_tid_data { 930struct rtl_tid_data {
@@ -927,11 +932,19 @@ struct rtl_tid_data {
927 struct rtl_ht_agg agg; 932 struct rtl_ht_agg agg;
928}; 933};
929 934
935struct rssi_sta {
936 long undecorated_smoothed_pwdb;
937};
938
930struct rtl_sta_info { 939struct rtl_sta_info {
940 struct list_head list;
931 u8 ratr_index; 941 u8 ratr_index;
932 u8 wireless_mode; 942 u8 wireless_mode;
933 u8 mimo_ps; 943 u8 mimo_ps;
934 struct rtl_tid_data tids[MAX_TID_COUNT]; 944 struct rtl_tid_data tids[MAX_TID_COUNT];
945
946 /* just used for ap adhoc or mesh*/
947 struct rssi_sta rssi_stat;
935} __packed; 948} __packed;
936 949
937struct rtl_priv; 950struct rtl_priv;
@@ -1034,6 +1047,11 @@ struct rtl_mac {
1034struct rtl_hal { 1047struct rtl_hal {
1035 struct ieee80211_hw *hw; 1048 struct ieee80211_hw *hw;
1036 1049
1050 bool up_first_time;
1051 bool first_init;
1052 bool being_init_adapter;
1053 bool bbrf_ready;
1054
1037 enum intf_type interface; 1055 enum intf_type interface;
1038 u16 hw_type; /*92c or 92d or 92s and so on */ 1056 u16 hw_type; /*92c or 92d or 92s and so on */
1039 u8 ic_class; 1057 u8 ic_class;
@@ -1048,6 +1066,7 @@ struct rtl_hal {
1048 u16 fw_subversion; 1066 u16 fw_subversion;
1049 bool h2c_setinprogress; 1067 bool h2c_setinprogress;
1050 u8 last_hmeboxnum; 1068 u8 last_hmeboxnum;
1069 bool fw_ready;
1051 /*Reserve page start offset except beacon in TxQ. */ 1070 /*Reserve page start offset except beacon in TxQ. */
1052 u8 fw_rsvdpage_startoffset; 1071 u8 fw_rsvdpage_startoffset;
1053 u8 h2c_txcmd_seq; 1072 u8 h2c_txcmd_seq;
@@ -1083,6 +1102,8 @@ struct rtl_hal {
1083 bool load_imrandiqk_setting_for2g; 1102 bool load_imrandiqk_setting_for2g;
1084 1103
1085 bool disable_amsdu_8k; 1104 bool disable_amsdu_8k;
1105 bool master_of_dmsp;
1106 bool slave_of_dmsp;
1086}; 1107};
1087 1108
1088struct rtl_security { 1109struct rtl_security {
@@ -1144,6 +1165,9 @@ struct rtl_dm {
1144 bool disable_tx_int; 1165 bool disable_tx_int;
1145 char ofdm_index[2]; 1166 char ofdm_index[2];
1146 char cck_index; 1167 char cck_index;
1168
1169 /* DMSP */
1170 bool supp_phymode_switch;
1147}; 1171};
1148 1172
1149#define EFUSE_MAX_LOGICAL_SIZE 256 1173#define EFUSE_MAX_LOGICAL_SIZE 256
@@ -1337,6 +1361,10 @@ struct rtl_stats {
1337}; 1361};
1338 1362
1339struct rt_link_detect { 1363struct rt_link_detect {
1364 /* count for roaming */
1365 u32 bcn_rx_inperiod;
1366 u32 roam_times;
1367
1340 u32 num_tx_in4period[4]; 1368 u32 num_tx_in4period[4];
1341 u32 num_rx_in4period[4]; 1369 u32 num_rx_in4period[4];
1342 1370
@@ -1344,6 +1372,8 @@ struct rt_link_detect {
1344 u32 num_rx_inperiod; 1372 u32 num_rx_inperiod;
1345 1373
1346 bool busytraffic; 1374 bool busytraffic;
1375 bool tx_busy_traffic;
1376 bool rx_busy_traffic;
1347 bool higher_busytraffic; 1377 bool higher_busytraffic;
1348 bool higher_busyrxtraffic; 1378 bool higher_busyrxtraffic;
1349 1379
@@ -1455,7 +1485,12 @@ struct rtl_hal_ops {
1455 u32 regaddr, u32 bitmask); 1485 u32 regaddr, u32 bitmask);
1456 void (*set_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath, 1486 void (*set_rfreg) (struct ieee80211_hw *hw, enum radio_path rfpath,
1457 u32 regaddr, u32 bitmask, u32 data); 1487 u32 regaddr, u32 bitmask, u32 data);
1488 void (*allow_all_destaddr)(struct ieee80211_hw *hw,
1489 bool allow_all_da, bool write_into_reg);
1458 void (*linked_set_reg) (struct ieee80211_hw *hw); 1490 void (*linked_set_reg) (struct ieee80211_hw *hw);
1491 void (*check_switch_to_dmdp) (struct ieee80211_hw *hw);
1492 void (*dualmac_easy_concurrent) (struct ieee80211_hw *hw);
1493 void (*dualmac_switch_to_dmdp) (struct ieee80211_hw *hw);
1459 bool (*phy_rf6052_config) (struct ieee80211_hw *hw); 1494 bool (*phy_rf6052_config) (struct ieee80211_hw *hw);
1460 void (*phy_rf6052_set_cck_txpower) (struct ieee80211_hw *hw, 1495 void (*phy_rf6052_set_cck_txpower) (struct ieee80211_hw *hw,
1461 u8 *powerlevel); 1496 u8 *powerlevel);
@@ -1475,6 +1510,8 @@ struct rtl_intf_ops {
1475 void (*read_efuse_byte)(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf); 1510 void (*read_efuse_byte)(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf);
1476 int (*adapter_start) (struct ieee80211_hw *hw); 1511 int (*adapter_start) (struct ieee80211_hw *hw);
1477 void (*adapter_stop) (struct ieee80211_hw *hw); 1512 void (*adapter_stop) (struct ieee80211_hw *hw);
1513 bool (*check_buddy_priv)(struct ieee80211_hw *hw,
1514 struct rtl_priv **buddy_priv);
1478 1515
1479 int (*adapter_tx) (struct ieee80211_hw *hw, 1516 int (*adapter_tx) (struct ieee80211_hw *hw,
1480 struct ieee80211_sta *sta, 1517 struct ieee80211_sta *sta,
@@ -1559,11 +1596,16 @@ struct rtl_locks {
1559 spinlock_t h2c_lock; 1596 spinlock_t h2c_lock;
1560 spinlock_t rf_ps_lock; 1597 spinlock_t rf_ps_lock;
1561 spinlock_t rf_lock; 1598 spinlock_t rf_lock;
1599 spinlock_t lps_lock;
1562 spinlock_t waitq_lock; 1600 spinlock_t waitq_lock;
1601 spinlock_t entry_list_lock;
1563 spinlock_t usb_lock; 1602 spinlock_t usb_lock;
1564 1603
1565 /*Dual mac*/ 1604 /*Dual mac*/
1566 spinlock_t cck_and_rw_pagea_lock; 1605 spinlock_t cck_and_rw_pagea_lock;
1606
1607 /*Easy concurrent*/
1608 spinlock_t check_sendpkt_lock;
1567}; 1609};
1568 1610
1569struct rtl_works { 1611struct rtl_works {
@@ -1571,6 +1613,7 @@ struct rtl_works {
1571 1613
1572 /*timer */ 1614 /*timer */
1573 struct timer_list watchdog_timer; 1615 struct timer_list watchdog_timer;
1616 struct timer_list dualmac_easyconcurrent_retrytimer;
1574 1617
1575 /*task */ 1618 /*task */
1576 struct tasklet_struct irq_tasklet; 1619 struct tasklet_struct irq_tasklet;
@@ -1598,6 +1641,31 @@ struct rtl_debug {
1598 char proc_name[20]; 1641 char proc_name[20];
1599}; 1642};
1600 1643
1644#define MIMO_PS_STATIC 0
1645#define MIMO_PS_DYNAMIC 1
1646#define MIMO_PS_NOLIMIT 3
1647
1648struct rtl_dualmac_easy_concurrent_ctl {
1649 enum band_type currentbandtype_backfordmdp;
1650 bool close_bbandrf_for_dmsp;
1651 bool change_to_dmdp;
1652 bool change_to_dmsp;
1653 bool switch_in_process;
1654};
1655
1656struct rtl_dmsp_ctl {
1657 bool activescan_for_slaveofdmsp;
1658 bool scan_for_anothermac_fordmsp;
1659 bool scan_for_itself_fordmsp;
1660 bool writedig_for_anothermacofdmsp;
1661 u32 curdigvalue_for_anothermacofdmsp;
1662 bool changecckpdstate_for_anothermacofdmsp;
1663 u8 curcckpdstate_for_anothermacofdmsp;
1664 bool changetxhighpowerlvl_for_anothermacofdmsp;
1665 u8 curtxhighlvl_for_anothermacofdmsp;
1666 long rssivalmin_for_anothermacofdmsp;
1667};
1668
1601struct ps_t { 1669struct ps_t {
1602 u8 pre_ccastate; 1670 u8 pre_ccastate;
1603 u8 cur_ccasate; 1671 u8 cur_ccasate;
@@ -1657,8 +1725,20 @@ struct dig_t {
1657 char backoffval_range_min; 1725 char backoffval_range_min;
1658}; 1726};
1659 1727
1728struct rtl_global_var {
1729 /* from this list we can get
1730 * other adapter's rtl_priv */
1731 struct list_head glb_priv_list;
1732 spinlock_t glb_list_lock;
1733};
1734
1660struct rtl_priv { 1735struct rtl_priv {
1661 struct completion firmware_loading_complete; 1736 struct completion firmware_loading_complete;
1737 struct list_head list;
1738 struct rtl_priv *buddy_priv;
1739 struct rtl_global_var *glb_var;
1740 struct rtl_dualmac_easy_concurrent_ctl easy_concurrent_ctl;
1741 struct rtl_dmsp_ctl dmsp_ctl;
1662 struct rtl_locks locks; 1742 struct rtl_locks locks;
1663 struct rtl_works works; 1743 struct rtl_works works;
1664 struct rtl_mac mac80211; 1744 struct rtl_mac mac80211;
@@ -1679,6 +1759,9 @@ struct rtl_priv {
1679 1759
1680 struct rtl_rate_priv *rate_priv; 1760 struct rtl_rate_priv *rate_priv;
1681 1761
1762 /* sta entry list for ap adhoc or mesh */
1763 struct list_head entry_list;
1764
1682 struct rtl_debug dbg; 1765 struct rtl_debug dbg;
1683 int max_fw_size; 1766 int max_fw_size;
1684 1767
@@ -2105,4 +2188,11 @@ static inline struct ieee80211_sta *get_sta(struct ieee80211_hw *hw,
2105 return ieee80211_find_sta(vif, bssid); 2188 return ieee80211_find_sta(vif, bssid);
2106} 2189}
2107 2190
2191static inline struct ieee80211_sta *rtl_find_sta(struct ieee80211_hw *hw,
2192 u8 *mac_addr)
2193{
2194 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
2195 return ieee80211_find_sta(mac->vif, mac_addr);
2196}
2197
2108#endif 2198#endif