1 2 #ifndef _wl_iapsta_ 3 #define _wl_iapsta_ 4 typedef enum IFMODE { 5 ISTA_MODE = 1, 6 IAP_MODE, 7 IGO_MODE, 8 IGC_MODE, 9 IMESH_MODE 10 } ifmode_t; 11 12 enum wl_if_list { IF_PIF, IF_VIF, IF_VIF2, MAX_IF_NUM }; 13 14 typedef enum WL_PRIO { PRIO_AP, PRIO_MESH, PRIO_P2P, PRIO_STA } wl_prio_t; 15 16 typedef enum APSTAMODE { 17 IUNKNOWN_MODE = 0, 18 ISTAONLY_MODE = 1, 19 IAPONLY_MODE = 2, 20 ISTAAP_MODE = 3, 21 ISTAGO_MODE = 4, 22 ISTASTA_MODE = 5, 23 IDUALAP_MODE = 6, 24 ISTAAPAP_MODE = 7, 25 IMESHONLY_MODE = 8, 26 ISTAMESH_MODE = 9, 27 IMESHAP_MODE = 10, 28 ISTAAPMESH_MODE = 11, 29 IMESHAPAP_MODE = 12 30 } apstamode_t; 31 32 typedef enum BGNMODE { 33 IEEE80211B = 1, 34 IEEE80211G, 35 IEEE80211BG, 36 IEEE80211BGN, 37 IEEE80211BGNAC 38 } bgnmode_t; 39 40 typedef enum AUTHMODE { 41 AUTH_OPEN, 42 AUTH_SHARED, 43 AUTH_WPAPSK, 44 AUTH_WPA2PSK, 45 AUTH_WPAWPA2PSK, 46 AUTH_SAE 47 } authmode_t; 48 49 typedef enum ENCMODE { 50 ENC_NONE, 51 ENC_WEP, 52 ENC_TKIP, 53 ENC_AES, 54 ENC_TKIPAES 55 } encmode_t; 56 57 enum wl_ext_status { 58 WL_EXT_STATUS_DISCONNECTING = 0, 59 WL_EXT_STATUS_DISCONNECTED, 60 WL_EXT_STATUS_SCAN, 61 WL_EXT_STATUS_SCANNING, 62 WL_EXT_STATUS_SCAN_COMPLETE, 63 WL_EXT_STATUS_CONNECTING, 64 WL_EXT_STATUS_CONNECTED, 65 WL_EXT_STATUS_ADD_KEY, 66 WL_EXT_STATUS_AP_ENABLED, 67 WL_EXT_STATUS_DELETE_STA, 68 WL_EXT_STATUS_STA_DISCONNECTED, 69 WL_EXT_STATUS_STA_CONNECTED, 70 WL_EXT_STATUS_AP_DISABLED 71 }; 72 73 #ifdef STA_MGMT 74 typedef struct wl_sta_info { 75 struct wl_sta_info *next; 76 int ifidx; 77 struct ether_addr bssid; 78 } wl_sta_info_t; 79 80 typedef struct wl_sta_list { 81 wl_sta_info_t *sta_info; 82 } wl_sta_list_t; 83 #endif /* STA_MGMT */ 84 85 typedef struct wl_if_info { 86 struct net_device *dev; 87 ifmode_t ifmode; 88 unsigned long status; 89 char prefix; 90 wl_prio_t prio; 91 int ifidx; 92 uint8 bssidx; 93 char ifname[IFNAMSIZ + 1]; 94 char ssid[DOT11_MAX_SSID_LEN]; 95 struct ether_addr bssid; 96 bgnmode_t bgnmode; 97 int hidden; 98 int maxassoc; 99 uint16 channel; 100 authmode_t amode; 101 encmode_t emode; 102 bool vsdb; 103 char key[100]; 104 #ifdef WL_ESCAN 105 #if (defined(WLMESH) || defined(ACS_MONITOR)) 106 struct wl_escan_info *escan; 107 #ifdef WLMESH 108 timer_list_compat_t delay_scan; 109 #endif /* WLMESH */ 110 #ifdef ACS_MONITOR 111 timer_list_compat_t acs_timer; 112 #endif /* ACS_MONITOR */ 113 #endif /* WLMESH || ACS_MONITOR */ 114 #endif /* WL_ESCAN */ 115 struct delayed_work pm_enable_work; 116 struct mutex pm_sync; 117 #ifdef PROPTX_MAXCOUNT 118 int transit_maxcount; 119 #endif /* PROPTX_MAXCOUNT */ 120 uint eapol_status; 121 uint16 prev_channel; 122 uint16 post_channel; 123 #ifdef TPUT_MONITOR 124 unsigned long last_tx; 125 unsigned long last_rx; 126 struct osl_timespec tput_ts; 127 int32 tput_tx; 128 int32 tput_rx; 129 int32 tput_tx_kb; 130 int32 tput_rx_kb; 131 #endif /* TPUT_MONITOR */ 132 timer_list_compat_t connect_timer; 133 } wl_if_info_t; 134 135 typedef struct wl_apsta_params { 136 struct wl_if_info if_info[MAX_IF_NUM]; 137 struct dhd_pub *dhd; 138 int ioctl_ver; 139 bool init; 140 int rsdb; 141 bool vsdb; 142 uint csa; 143 uint acs; 144 #ifdef ACS_MONITOR 145 uint acs_tmo; 146 #endif /* ACS_MONITOR */ 147 bool radar; 148 apstamode_t apstamode; 149 wait_queue_head_t netif_change_event; 150 struct mutex usr_sync; 151 #if defined(WLMESH) && defined(WL_ESCAN) 152 int macs; 153 struct wl_mesh_params mesh_info; 154 #endif /* WLMESH && WL_ESCAN */ 155 struct mutex in4way_sync; 156 int sta_btc_mode; 157 struct osl_timespec sta_disc_ts; 158 struct osl_timespec sta_conn_ts; 159 bool ap_recon_sta; 160 wait_queue_head_t ap_recon_sta_event; 161 struct ether_addr ap_disc_sta_bssid; 162 struct osl_timespec ap_disc_sta_ts; 163 #ifdef TPUT_MONITOR 164 timer_list_compat_t monitor_timer; 165 int32 tput_sum; 166 int32 tput_sum_kb; 167 #endif /* TPUT_MONITOR */ 168 #ifdef SCAN_SUPPRESS 169 struct osl_timespec scan_busy_ts; 170 int scan_busy_cnt; 171 #endif /* SCAN_SUPPRESS */ 172 uint32 linkdown_reason; 173 #ifdef STA_MGMT 174 wl_sta_list_t sta_list; 175 #endif /* STA_MGMT */ 176 } wl_apsta_params_t; 177 178 extern int op_mode; 179 void wl_ext_update_eapol_status(dhd_pub_t *dhd, int ifidx, uint eapol_status); 180 void wl_ext_iapsta_get_vif_macaddr(struct dhd_pub *dhd, int ifidx, 181 u8 *mac_addr); 182 int wl_ext_iapsta_attach_netdev(struct net_device *net, int ifidx, 183 uint8 bssidx); 184 int wl_ext_iapsta_attach_name(struct net_device *net, int ifidx); 185 int wl_ext_iapsta_dettach_netdev(struct net_device *net, int ifidx); 186 int wl_ext_iapsta_update_net_device(struct net_device *net, int ifidx); 187 int wl_ext_iapsta_alive_preinit(struct net_device *dev); 188 int wl_ext_iapsta_alive_postinit(struct net_device *dev); 189 int wl_ext_iapsta_attach(struct net_device *net); 190 void wl_ext_iapsta_dettach(struct net_device *net); 191 int wl_ext_iapsta_enable(struct net_device *dev, char *command, int total_len); 192 int wl_ext_iapsta_disable(struct net_device *dev, char *command, int total_len); 193 int wl_ext_isam_param(struct net_device *dev, char *command, int total_len); 194 int wl_ext_isam_status(struct net_device *dev, char *command, int total_len); 195 int wl_ext_isam_init(struct net_device *dev, char *command, int total_len); 196 int wl_ext_iapsta_config(struct net_device *dev, char *command, int total_len); 197 void wl_ext_add_remove_pm_enable_work(struct net_device *dev, bool add); 198 bool wl_ext_iapsta_other_if_enabled(struct net_device *net); 199 bool wl_ext_sta_connecting(struct net_device *dev); 200 void wl_iapsta_wait_event_complete(struct dhd_pub *dhd); 201 int wl_iapsta_suspend_resume(dhd_pub_t *dhd, int suspend); 202 #ifdef WL_CFG80211 203 int wl_ext_in4way_sync(struct net_device *dev, uint action, 204 enum wl_ext_status status, void *context); 205 void wl_ext_update_extsae_4way(struct net_device *dev, 206 const struct ieee80211_mgmt *mgmt, bool tx); 207 #endif /* WL_CFG80211 */ 208 #ifdef USE_IW 209 int wl_ext_in4way_sync_wext(struct net_device *dev, uint action, 210 enum wl_ext_status status, void *context); 211 #endif /* USE_IW */ 212 #ifdef WLMESH 213 int wl_ext_mesh_peer_status(struct net_device *dev, char *data, char *command, 214 int total_len); 215 int wl_ext_isam_peer_path(struct net_device *dev, char *command, int total_len); 216 #endif 217 #ifdef WL_CFG80211 218 u32 wl_ext_iapsta_update_channel(dhd_pub_t *dhd, struct net_device *dev, 219 u32 channel); 220 void wl_ext_iapsta_update_iftype(struct net_device *net, int ifidx, 221 int wl_iftype); 222 bool wl_ext_iapsta_iftype_enabled(struct net_device *net, int wl_iftype); 223 void wl_ext_iapsta_enable_master_if(struct net_device *dev, bool post); 224 void wl_ext_iapsta_restart_master(struct net_device *dev); 225 void wl_ext_iapsta_ifadding(struct net_device *net, int ifidx); 226 bool wl_ext_iapsta_mesh_creating(struct net_device *net); 227 #ifdef STA_MGMT 228 bool wl_ext_del_sta_info(struct net_device *net, u8 *bssid); 229 bool wl_ext_add_sta_info(struct net_device *net, u8 *bssid); 230 #endif /* STA_MGMT */ 231 #ifdef SCAN_SUPPRESS 232 void wl_ext_populate_scan_channel(dhd_pub_t *dhd, u16 *channel_list, 233 u32 channel, u32 n_channels); 234 uint16 wl_ext_scan_suppress(struct net_device *dev, void *scan_params, 235 bool scan_v2); 236 #endif /* SCAN_SUPPRESS */ 237 #endif 238 #ifdef PROPTX_MAXCOUNT 239 int wl_ext_get_wlfc_maxcount(struct dhd_pub *dhd, int ifidx); 240 #endif /* PROPTX_MAXCOUNT */ 241 #endif 242