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