diff options
Diffstat (limited to 'drivers/net/wireless/mwifiex/main.h')
-rw-r--r-- | drivers/net/wireless/mwifiex/main.h | 77 |
1 files changed, 63 insertions, 14 deletions
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index fcccf6b1373f..5b32221077c4 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -79,22 +79,32 @@ enum { | |||
79 | 79 | ||
80 | #define SCAN_BEACON_ENTRY_PAD 6 | 80 | #define SCAN_BEACON_ENTRY_PAD 6 |
81 | 81 | ||
82 | #define MWIFIEX_PASSIVE_SCAN_CHAN_TIME 200 | 82 | #define MWIFIEX_PASSIVE_SCAN_CHAN_TIME 110 |
83 | #define MWIFIEX_ACTIVE_SCAN_CHAN_TIME 200 | 83 | #define MWIFIEX_ACTIVE_SCAN_CHAN_TIME 30 |
84 | #define MWIFIEX_SPECIFIC_SCAN_CHAN_TIME 110 | 84 | #define MWIFIEX_SPECIFIC_SCAN_CHAN_TIME 30 |
85 | 85 | ||
86 | #define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI))) | 86 | #define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI))) |
87 | 87 | ||
88 | #define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S) | 88 | #define MWIFIEX_MAX_TOTAL_SCAN_TIME (MWIFIEX_TIMER_10S - MWIFIEX_TIMER_1S) |
89 | 89 | ||
90 | #define MWIFIEX_MAX_SCAN_DELAY_CNT 50 | ||
91 | #define MWIFIEX_SCAN_DELAY_MSEC 20 | ||
92 | |||
90 | #define RSN_GTK_OUI_OFFSET 2 | 93 | #define RSN_GTK_OUI_OFFSET 2 |
91 | 94 | ||
92 | #define MWIFIEX_OUI_NOT_PRESENT 0 | 95 | #define MWIFIEX_OUI_NOT_PRESENT 0 |
93 | #define MWIFIEX_OUI_PRESENT 1 | 96 | #define MWIFIEX_OUI_PRESENT 1 |
94 | 97 | ||
98 | /* | ||
99 | * Do not check for data_received for USB, as data_received | ||
100 | * is handled in mwifiex_usb_recv for USB | ||
101 | */ | ||
95 | #define IS_CARD_RX_RCVD(adapter) (adapter->cmd_resp_received || \ | 102 | #define IS_CARD_RX_RCVD(adapter) (adapter->cmd_resp_received || \ |
96 | adapter->event_received || \ | 103 | adapter->event_received || \ |
97 | adapter->data_received) | 104 | ((adapter->iface_type != MWIFIEX_USB) && \ |
105 | adapter->data_received) || \ | ||
106 | ((adapter->iface_type == MWIFIEX_USB) && \ | ||
107 | !skb_queue_empty(&adapter->usb_rx_data_q))) | ||
98 | 108 | ||
99 | #define MWIFIEX_TYPE_CMD 1 | 109 | #define MWIFIEX_TYPE_CMD 1 |
100 | #define MWIFIEX_TYPE_DATA 0 | 110 | #define MWIFIEX_TYPE_DATA 0 |
@@ -109,6 +119,12 @@ enum { | |||
109 | #define MAX_FREQUENCY_BAND_BG 2484 | 119 | #define MAX_FREQUENCY_BAND_BG 2484 |
110 | 120 | ||
111 | #define MWIFIEX_EVENT_HEADER_LEN 4 | 121 | #define MWIFIEX_EVENT_HEADER_LEN 4 |
122 | #define MWIFIEX_UAP_EVENT_EXTRA_HEADER 2 | ||
123 | |||
124 | #define MWIFIEX_TYPE_LEN 4 | ||
125 | #define MWIFIEX_USB_TYPE_CMD 0xF00DFACE | ||
126 | #define MWIFIEX_USB_TYPE_DATA 0xBEADC0DE | ||
127 | #define MWIFIEX_USB_TYPE_EVENT 0xBEEFFACE | ||
112 | 128 | ||
113 | struct mwifiex_dbg { | 129 | struct mwifiex_dbg { |
114 | u32 num_cmd_host_to_card_failure; | 130 | u32 num_cmd_host_to_card_failure; |
@@ -162,6 +178,7 @@ enum MWIFIEX_PS_STATE { | |||
162 | enum mwifiex_iface_type { | 178 | enum mwifiex_iface_type { |
163 | MWIFIEX_SDIO, | 179 | MWIFIEX_SDIO, |
164 | MWIFIEX_PCIE, | 180 | MWIFIEX_PCIE, |
181 | MWIFIEX_USB | ||
165 | }; | 182 | }; |
166 | 183 | ||
167 | struct mwifiex_add_ba_param { | 184 | struct mwifiex_add_ba_param { |
@@ -260,8 +277,8 @@ struct mwifiex_bssdescriptor { | |||
260 | * BAND_A(0X04): 'a' band | 277 | * BAND_A(0X04): 'a' band |
261 | */ | 278 | */ |
262 | u16 bss_band; | 279 | u16 bss_band; |
263 | u64 network_tsf; | 280 | u64 fw_tsf; |
264 | u8 time_stamp[8]; | 281 | u64 timestamp; |
265 | union ieee_types_phy_param_set phy_param_set; | 282 | union ieee_types_phy_param_set phy_param_set; |
266 | union ieee_types_ss_param_set ss_param_set; | 283 | union ieee_types_ss_param_set ss_param_set; |
267 | u16 cap_info_bitmap; | 284 | u16 cap_info_bitmap; |
@@ -357,6 +374,7 @@ struct mwifiex_private { | |||
357 | u8 bss_role; | 374 | u8 bss_role; |
358 | u8 bss_priority; | 375 | u8 bss_priority; |
359 | u8 bss_num; | 376 | u8 bss_num; |
377 | u8 bss_started; | ||
360 | u8 frame_type; | 378 | u8 frame_type; |
361 | u8 curr_addr[ETH_ALEN]; | 379 | u8 curr_addr[ETH_ALEN]; |
362 | u8 media_connected; | 380 | u8 media_connected; |
@@ -407,6 +425,8 @@ struct mwifiex_private { | |||
407 | struct host_cmd_ds_802_11_key_material aes_key; | 425 | struct host_cmd_ds_802_11_key_material aes_key; |
408 | u8 wapi_ie[256]; | 426 | u8 wapi_ie[256]; |
409 | u8 wapi_ie_len; | 427 | u8 wapi_ie_len; |
428 | u8 *wps_ie; | ||
429 | u8 wps_ie_len; | ||
410 | u8 wmm_required; | 430 | u8 wmm_required; |
411 | u8 wmm_enabled; | 431 | u8 wmm_enabled; |
412 | u8 wmm_qosinfo; | 432 | u8 wmm_qosinfo; |
@@ -455,12 +475,17 @@ struct mwifiex_private { | |||
455 | struct cfg80211_scan_request *scan_request; | 475 | struct cfg80211_scan_request *scan_request; |
456 | struct mwifiex_user_scan_cfg *user_scan_cfg; | 476 | struct mwifiex_user_scan_cfg *user_scan_cfg; |
457 | u8 cfg_bssid[6]; | 477 | u8 cfg_bssid[6]; |
458 | u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; | ||
459 | struct wps wps; | 478 | struct wps wps; |
460 | u8 scan_block; | 479 | u8 scan_block; |
461 | s32 cqm_rssi_thold; | 480 | s32 cqm_rssi_thold; |
462 | u32 cqm_rssi_hyst; | 481 | u32 cqm_rssi_hyst; |
463 | u8 subsc_evt_rssi_state; | 482 | u8 subsc_evt_rssi_state; |
483 | struct mwifiex_ie mgmt_ie[MAX_MGMT_IE_INDEX]; | ||
484 | u16 beacon_idx; | ||
485 | u16 proberesp_idx; | ||
486 | u16 assocresp_idx; | ||
487 | u16 rsn_idx; | ||
488 | struct timer_list scan_delay_timer; | ||
464 | }; | 489 | }; |
465 | 490 | ||
466 | enum mwifiex_ba_status { | 491 | enum mwifiex_ba_status { |
@@ -520,6 +545,11 @@ struct cmd_ctrl_node { | |||
520 | u8 cmd_wait_q_woken; | 545 | u8 cmd_wait_q_woken; |
521 | }; | 546 | }; |
522 | 547 | ||
548 | struct mwifiex_bss_priv { | ||
549 | u8 band; | ||
550 | u64 fw_tsf; | ||
551 | }; | ||
552 | |||
523 | struct mwifiex_if_ops { | 553 | struct mwifiex_if_ops { |
524 | int (*init_if) (struct mwifiex_adapter *); | 554 | int (*init_if) (struct mwifiex_adapter *); |
525 | void (*cleanup_if) (struct mwifiex_adapter *); | 555 | void (*cleanup_if) (struct mwifiex_adapter *); |
@@ -539,6 +569,8 @@ struct mwifiex_if_ops { | |||
539 | void (*cleanup_mpa_buf) (struct mwifiex_adapter *); | 569 | void (*cleanup_mpa_buf) (struct mwifiex_adapter *); |
540 | int (*cmdrsp_complete) (struct mwifiex_adapter *, struct sk_buff *); | 570 | int (*cmdrsp_complete) (struct mwifiex_adapter *, struct sk_buff *); |
541 | int (*event_complete) (struct mwifiex_adapter *, struct sk_buff *); | 571 | int (*event_complete) (struct mwifiex_adapter *, struct sk_buff *); |
572 | int (*data_complete) (struct mwifiex_adapter *, struct sk_buff *); | ||
573 | int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *); | ||
542 | }; | 574 | }; |
543 | 575 | ||
544 | struct mwifiex_adapter { | 576 | struct mwifiex_adapter { |
@@ -549,6 +581,7 @@ struct mwifiex_adapter { | |||
549 | char fw_name[32]; | 581 | char fw_name[32]; |
550 | int winner; | 582 | int winner; |
551 | struct device *dev; | 583 | struct device *dev; |
584 | struct wiphy *wiphy; | ||
552 | bool surprise_removed; | 585 | bool surprise_removed; |
553 | u32 fw_release_number; | 586 | u32 fw_release_number; |
554 | u16 init_wait_q_woken; | 587 | u16 init_wait_q_woken; |
@@ -601,6 +634,7 @@ struct mwifiex_adapter { | |||
601 | struct list_head scan_pending_q; | 634 | struct list_head scan_pending_q; |
602 | /* spin lock for scan_pending_q */ | 635 | /* spin lock for scan_pending_q */ |
603 | spinlock_t scan_pending_q_lock; | 636 | spinlock_t scan_pending_q_lock; |
637 | struct sk_buff_head usb_rx_data_q; | ||
604 | u32 scan_processing; | 638 | u32 scan_processing; |
605 | u16 region_code; | 639 | u16 region_code; |
606 | struct mwifiex_802_11d_domain_reg domain_reg; | 640 | struct mwifiex_802_11d_domain_reg domain_reg; |
@@ -653,6 +687,10 @@ struct mwifiex_adapter { | |||
653 | u8 scan_wait_q_woken; | 687 | u8 scan_wait_q_woken; |
654 | struct cmd_ctrl_node *cmd_queued; | 688 | struct cmd_ctrl_node *cmd_queued; |
655 | spinlock_t queue_lock; /* lock for tx queues */ | 689 | spinlock_t queue_lock; /* lock for tx queues */ |
690 | struct completion fw_load; | ||
691 | u8 country_code[IEEE80211_COUNTRY_STRING_LEN]; | ||
692 | u16 max_mgmt_ie_index; | ||
693 | u8 scan_delay_cnt; | ||
656 | }; | 694 | }; |
657 | 695 | ||
658 | int mwifiex_init_lock_list(struct mwifiex_adapter *adapter); | 696 | int mwifiex_init_lock_list(struct mwifiex_adapter *adapter); |
@@ -736,6 +774,9 @@ int mwifiex_process_rx_packet(struct mwifiex_adapter *adapter, | |||
736 | int mwifiex_sta_prepare_cmd(struct mwifiex_private *, uint16_t cmd_no, | 774 | int mwifiex_sta_prepare_cmd(struct mwifiex_private *, uint16_t cmd_no, |
737 | u16 cmd_action, u32 cmd_oid, | 775 | u16 cmd_action, u32 cmd_oid, |
738 | void *data_buf, void *cmd_buf); | 776 | void *data_buf, void *cmd_buf); |
777 | int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, uint16_t cmd_no, | ||
778 | u16 cmd_action, u32 cmd_oid, | ||
779 | void *data_buf, void *cmd_buf); | ||
739 | int mwifiex_process_sta_cmdresp(struct mwifiex_private *, u16 cmdresp_no, | 780 | int mwifiex_process_sta_cmdresp(struct mwifiex_private *, u16 cmdresp_no, |
740 | struct host_cmd_ds_command *resp); | 781 | struct host_cmd_ds_command *resp); |
741 | int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *, | 782 | int mwifiex_process_sta_rx_packet(struct mwifiex_adapter *, |
@@ -796,6 +837,9 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv, | |||
796 | int is_command_pending(struct mwifiex_adapter *adapter); | 837 | int is_command_pending(struct mwifiex_adapter *adapter); |
797 | void mwifiex_init_priv_params(struct mwifiex_private *priv, | 838 | void mwifiex_init_priv_params(struct mwifiex_private *priv, |
798 | struct net_device *dev); | 839 | struct net_device *dev); |
840 | int mwifiex_set_secure_params(struct mwifiex_private *priv, | ||
841 | struct mwifiex_uap_bss_param *bss_config, | ||
842 | struct cfg80211_ap_settings *params); | ||
799 | 843 | ||
800 | /* | 844 | /* |
801 | * This function checks if the queuing is RA based or not. | 845 | * This function checks if the queuing is RA based or not. |
@@ -909,7 +953,8 @@ int mwifiex_set_radio(struct mwifiex_private *priv, u8 option); | |||
909 | int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel); | 953 | int mwifiex_drv_change_adhoc_chan(struct mwifiex_private *priv, u16 channel); |
910 | 954 | ||
911 | int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key, | 955 | int mwifiex_set_encode(struct mwifiex_private *priv, const u8 *key, |
912 | int key_len, u8 key_index, int disable); | 956 | int key_len, u8 key_index, const u8 *mac_addr, |
957 | int disable); | ||
913 | 958 | ||
914 | int mwifiex_set_gen_ie(struct mwifiex_private *priv, u8 *ie, int ie_len); | 959 | int mwifiex_set_gen_ie(struct mwifiex_private *priv, u8 *ie, int ie_len); |
915 | 960 | ||
@@ -945,18 +990,16 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, | |||
945 | 990 | ||
946 | int mwifiex_main_process(struct mwifiex_adapter *); | 991 | int mwifiex_main_process(struct mwifiex_adapter *); |
947 | 992 | ||
993 | int mwifiex_uap_set_channel(struct mwifiex_private *priv, int channel); | ||
948 | int mwifiex_bss_set_channel(struct mwifiex_private *, | 994 | int mwifiex_bss_set_channel(struct mwifiex_private *, |
949 | struct mwifiex_chan_freq_power *cfp); | 995 | struct mwifiex_chan_freq_power *cfp); |
950 | int mwifiex_get_bss_info(struct mwifiex_private *, | 996 | int mwifiex_get_bss_info(struct mwifiex_private *, |
951 | struct mwifiex_bss_info *); | 997 | struct mwifiex_bss_info *); |
952 | int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv, | 998 | int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv, |
953 | u8 *bssid, s32 rssi, u8 *ie_buf, | 999 | struct cfg80211_bss *bss, |
954 | size_t ie_len, u16 beacon_period, | ||
955 | u16 cap_info_bitmap, u8 band, | ||
956 | struct mwifiex_bssdescriptor *bss_desc); | 1000 | struct mwifiex_bssdescriptor *bss_desc); |
957 | int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, | 1001 | int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, |
958 | struct mwifiex_bssdescriptor *bss_entry, | 1002 | struct mwifiex_bssdescriptor *bss_entry); |
959 | u8 *ie_buf, u32 ie_len); | ||
960 | int mwifiex_check_network_compatibility(struct mwifiex_private *priv, | 1003 | int mwifiex_check_network_compatibility(struct mwifiex_private *priv, |
961 | struct mwifiex_bssdescriptor *bss_desc); | 1004 | struct mwifiex_bssdescriptor *bss_desc); |
962 | 1005 | ||
@@ -965,6 +1008,12 @@ struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy, | |||
965 | u32 *flags, struct vif_params *params); | 1008 | u32 *flags, struct vif_params *params); |
966 | int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev); | 1009 | int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev); |
967 | 1010 | ||
1011 | void mwifiex_set_sys_config_invalid_data(struct mwifiex_uap_bss_param *config); | ||
1012 | |||
1013 | int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, | ||
1014 | struct cfg80211_ap_settings *params); | ||
1015 | int mwifiex_del_mgmt_ies(struct mwifiex_private *priv); | ||
1016 | u8 *mwifiex_11d_code_2_region(u8 code); | ||
968 | 1017 | ||
969 | #ifdef CONFIG_DEBUG_FS | 1018 | #ifdef CONFIG_DEBUG_FS |
970 | void mwifiex_debugfs_init(void); | 1019 | void mwifiex_debugfs_init(void); |