1*78e28062SEliad Peller /* 2*78e28062SEliad Peller * This file is part of wl18xx 3*78e28062SEliad Peller * 4*78e28062SEliad Peller * Copyright (C) 2012 Texas Instruments. All rights reserved. 5*78e28062SEliad Peller * 6*78e28062SEliad Peller * This program is free software; you can redistribute it and/or 7*78e28062SEliad Peller * modify it under the terms of the GNU General Public License 8*78e28062SEliad Peller * version 2 as published by the Free Software Foundation. 9*78e28062SEliad Peller * 10*78e28062SEliad Peller * This program is distributed in the hope that it will be useful, but 11*78e28062SEliad Peller * WITHOUT ANY WARRANTY; without even the implied warranty of 12*78e28062SEliad Peller * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13*78e28062SEliad Peller * General Public License for more details. 14*78e28062SEliad Peller * 15*78e28062SEliad Peller * You should have received a copy of the GNU General Public License 16*78e28062SEliad Peller * along with this program; if not, write to the Free Software 17*78e28062SEliad Peller * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18*78e28062SEliad Peller * 02110-1301 USA 19*78e28062SEliad Peller * 20*78e28062SEliad Peller */ 21*78e28062SEliad Peller 22*78e28062SEliad Peller #ifndef __WL18XX_SCAN_H__ 23*78e28062SEliad Peller #define __WL18XX_SCAN_H__ 24*78e28062SEliad Peller 25*78e28062SEliad Peller #include "../wlcore/wlcore.h" 26*78e28062SEliad Peller #include "../wlcore/cmd.h" 27*78e28062SEliad Peller #include "../wlcore/scan.h" 28*78e28062SEliad Peller 29*78e28062SEliad Peller struct tracking_ch_params { 30*78e28062SEliad Peller struct conn_scan_ch_params channel; 31*78e28062SEliad Peller 32*78e28062SEliad Peller __le32 bssid_lsb; 33*78e28062SEliad Peller __le16 bssid_msb; 34*78e28062SEliad Peller 35*78e28062SEliad Peller u8 padding[2]; 36*78e28062SEliad Peller } __packed; 37*78e28062SEliad Peller 38*78e28062SEliad Peller enum 39*78e28062SEliad Peller { 40*78e28062SEliad Peller SCAN_TYPE_SEARCH = 0, 41*78e28062SEliad Peller SCAN_TYPE_PERIODIC = 1, 42*78e28062SEliad Peller SCAN_TYPE_TRACKING = 2, 43*78e28062SEliad Peller }; 44*78e28062SEliad Peller 45*78e28062SEliad Peller /* probe request rate */ 46*78e28062SEliad Peller enum 47*78e28062SEliad Peller { 48*78e28062SEliad Peller WL18XX_SCAN_RATE_1 = 0, 49*78e28062SEliad Peller WL18XX_SCAN_RATE_5_5 = 1, 50*78e28062SEliad Peller WL18XX_SCAN_RATE_6 = 2, 51*78e28062SEliad Peller }; 52*78e28062SEliad Peller 53*78e28062SEliad Peller struct wl18xx_cmd_scan_params { 54*78e28062SEliad Peller struct wl1271_cmd_header header; 55*78e28062SEliad Peller 56*78e28062SEliad Peller u8 role_id; 57*78e28062SEliad Peller u8 scan_type; 58*78e28062SEliad Peller 59*78e28062SEliad Peller s8 rssi_threshold; /* for filtering (in dBm) */ 60*78e28062SEliad Peller s8 snr_threshold; /* for filtering (in dB) */ 61*78e28062SEliad Peller 62*78e28062SEliad Peller u8 bss_type; /* for filtering */ 63*78e28062SEliad Peller u8 ssid_from_list; /* use ssid from configured ssid list */ 64*78e28062SEliad Peller u8 filter; /* forward only results with matching ssids */ 65*78e28062SEliad Peller 66*78e28062SEliad Peller /* 67*78e28062SEliad Peller * add broadcast ssid in addition to the configured ssids. 68*78e28062SEliad Peller * the driver should add dummy entry for it (?). 69*78e28062SEliad Peller */ 70*78e28062SEliad Peller u8 add_broadcast; 71*78e28062SEliad Peller 72*78e28062SEliad Peller u8 urgency; 73*78e28062SEliad Peller u8 protect; /* ??? */ 74*78e28062SEliad Peller u8 n_probe_reqs; /* Number of probes requests per channel */ 75*78e28062SEliad Peller u8 terminate_after; /* early terminate scan operation */ 76*78e28062SEliad Peller 77*78e28062SEliad Peller u8 passive[SCAN_MAX_BANDS]; /* number of passive scan channels */ 78*78e28062SEliad Peller u8 active[SCAN_MAX_BANDS]; /* number of active scan channels */ 79*78e28062SEliad Peller u8 dfs; /* number of dfs channels in 5ghz */ 80*78e28062SEliad Peller u8 passive_active; /* number of passive before active channels 2.4ghz */ 81*78e28062SEliad Peller 82*78e28062SEliad Peller __le16 short_cycles_sec; 83*78e28062SEliad Peller __le16 long_cycles_sec; 84*78e28062SEliad Peller u8 short_cycles_count; 85*78e28062SEliad Peller u8 total_cycles; /* 0 - infinite */ 86*78e28062SEliad Peller u8 rate; 87*78e28062SEliad Peller u8 padding[1]; 88*78e28062SEliad Peller 89*78e28062SEliad Peller union { 90*78e28062SEliad Peller struct { 91*78e28062SEliad Peller struct conn_scan_ch_params channels_2[MAX_CHANNELS_2GHZ]; 92*78e28062SEliad Peller struct conn_scan_ch_params channels_5[MAX_CHANNELS_5GHZ]; 93*78e28062SEliad Peller struct conn_scan_ch_params channels_4[MAX_CHANNELS_4GHZ]; 94*78e28062SEliad Peller }; 95*78e28062SEliad Peller struct tracking_ch_params channels_tracking[WL1271_SCAN_MAX_CHANNELS]; 96*78e28062SEliad Peller } ; 97*78e28062SEliad Peller 98*78e28062SEliad Peller u8 ssid[IEEE80211_MAX_SSID_LEN]; 99*78e28062SEliad Peller u8 ssid_len; /* For SCAN_SSID_FILTER_SPECIFIC */ 100*78e28062SEliad Peller u8 tag; 101*78e28062SEliad Peller u8 padding1[2]; 102*78e28062SEliad Peller } __packed; 103*78e28062SEliad Peller 104*78e28062SEliad Peller struct wl18xx_cmd_scan_stop { 105*78e28062SEliad Peller struct wl1271_cmd_header header; 106*78e28062SEliad Peller 107*78e28062SEliad Peller u8 role_id; 108*78e28062SEliad Peller u8 scan_type; 109*78e28062SEliad Peller u8 padding[2]; 110*78e28062SEliad Peller } __packed; 111*78e28062SEliad Peller 112*78e28062SEliad Peller int wl18xx_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif, 113*78e28062SEliad Peller struct cfg80211_scan_request *req); 114*78e28062SEliad Peller int wl18xx_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif); 115*78e28062SEliad Peller void wl18xx_scan_completed(struct wl1271 *wl, struct wl12xx_vif *wlvif); 116*78e28062SEliad Peller int wl18xx_sched_scan_start(struct wl1271 *wl, struct wl12xx_vif *wlvif, 117*78e28062SEliad Peller struct cfg80211_sched_scan_request *req, 118*78e28062SEliad Peller struct ieee80211_sched_scan_ies *ies); 119*78e28062SEliad Peller void wl18xx_scan_sched_scan_stop(struct wl1271 *wl, struct wl12xx_vif *wlvif); 120*78e28062SEliad Peller #endif 121