Linux 4.19.133
[linux/fpc-iii.git] / drivers / net / wireless / broadcom / brcm80211 / brcmfmac / pno.h
blobcd9e35ae3b21a03053dbfe4cb51331e7e1c185a4
1 /*
2 * Copyright (c) 2016 Broadcom
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #ifndef _BRCMF_PNO_H
17 #define _BRCMF_PNO_H
19 #define BRCMF_PNO_SCAN_COMPLETE 1
20 #define BRCMF_PNO_MAX_PFN_COUNT 16
21 #define BRCMF_PNO_SCHED_SCAN_MIN_PERIOD 10
22 #define BRCMF_PNO_SCHED_SCAN_MAX_PERIOD 508
24 /* forward declaration */
25 struct brcmf_pno_info;
27 /**
28 * brcmf_pno_start_sched_scan - initiate scheduled scan on device.
30 * @ifp: interface object used.
31 * @req: configuration parameters for scheduled scan.
33 int brcmf_pno_start_sched_scan(struct brcmf_if *ifp,
34 struct cfg80211_sched_scan_request *req);
36 /**
37 * brcmf_pno_stop_sched_scan - terminate scheduled scan on device.
39 * @ifp: interface object used.
40 * @reqid: unique identifier of scan to be stopped.
42 int brcmf_pno_stop_sched_scan(struct brcmf_if *ifp, u64 reqid);
44 /**
45 * brcmf_pno_wiphy_params - fill scheduled scan parameters in wiphy instance.
47 * @wiphy: wiphy instance to be used.
48 * @gscan: indicates whether the device has support for g-scan feature.
50 void brcmf_pno_wiphy_params(struct wiphy *wiphy, bool gscan);
52 /**
53 * brcmf_pno_attach - allocate and attach module information.
55 * @cfg: cfg80211 context used.
57 int brcmf_pno_attach(struct brcmf_cfg80211_info *cfg);
59 /**
60 * brcmf_pno_detach - detach and free module information.
62 * @cfg: cfg80211 context used.
64 void brcmf_pno_detach(struct brcmf_cfg80211_info *cfg);
66 /**
67 * brcmf_pno_find_reqid_by_bucket - find request id for given bucket index.
69 * @pi: pno instance used.
70 * @bucket: index of firmware bucket.
72 u64 brcmf_pno_find_reqid_by_bucket(struct brcmf_pno_info *pi, u32 bucket);
74 /**
75 * brcmf_pno_get_bucket_map - determine bucket map for given netinfo.
77 * @pi: pno instance used.
78 * @netinfo: netinfo to compare with bucket configuration.
80 u32 brcmf_pno_get_bucket_map(struct brcmf_pno_info *pi,
81 struct brcmf_pno_net_info_le *netinfo);
83 #endif /* _BRCMF_PNO_H */