xref: /linux/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 // SPDX-License-Identifier: ISC
2 /*
3  * Copyright (c) 2016 Broadcom
4  */
5 #ifndef _BRCMF_PNO_H
6 #define _BRCMF_PNO_H
7 
8 #define BRCMF_PNO_SCAN_COMPLETE			1
9 #define BRCMF_PNO_MAX_PFN_COUNT			16
10 #define BRCMF_PNO_SCHED_SCAN_MIN_PERIOD	10
11 #define BRCMF_PNO_SCHED_SCAN_MAX_PERIOD	508
12 
13 /* forward declaration */
14 struct brcmf_pno_info;
15 
16 /**
17  * brcmf_pno_start_sched_scan - initiate scheduled scan on device.
18  *
19  * @ifp: interface object used.
20  * @req: configuration parameters for scheduled scan.
21  */
22 int brcmf_pno_start_sched_scan(struct brcmf_if *ifp,
23 			       struct cfg80211_sched_scan_request *req);
24 
25 /**
26  * brcmf_pno_stop_sched_scan - terminate scheduled scan on device.
27  *
28  * @ifp: interface object used.
29  * @reqid: unique identifier of scan to be stopped.
30  */
31 int brcmf_pno_stop_sched_scan(struct brcmf_if *ifp, u64 reqid);
32 
33 /**
34  * brcmf_pno_wiphy_params - fill scheduled scan parameters in wiphy instance.
35  *
36  * @wiphy: wiphy instance to be used.
37  * @gscan: indicates whether the device has support for g-scan feature.
38  */
39 void brcmf_pno_wiphy_params(struct wiphy *wiphy, bool gscan);
40 
41 /**
42  * brcmf_pno_attach - allocate and attach module information.
43  *
44  * @cfg: cfg80211 context used.
45  */
46 int brcmf_pno_attach(struct brcmf_cfg80211_info *cfg);
47 
48 /**
49  * brcmf_pno_detach - detach and free module information.
50  *
51  * @cfg: cfg80211 context used.
52  */
53 void brcmf_pno_detach(struct brcmf_cfg80211_info *cfg);
54 
55 /**
56  * brcmf_pno_find_reqid_by_bucket - find request id for given bucket index.
57  *
58  * @pi: pno instance used.
59  * @bucket: index of firmware bucket.
60  */
61 u64 brcmf_pno_find_reqid_by_bucket(struct brcmf_pno_info *pi, u32 bucket);
62 
63 /**
64  * brcmf_pno_get_bucket_map - determine bucket map for given netinfo.
65  *
66  * @pi: pno instance used.
67  * @netinfo: netinfo to compare with bucket configuration.
68  */
69 u32 brcmf_pno_get_bucket_map(struct brcmf_pno_info *pi,
70 			     struct brcmf_pno_net_info_le *netinfo);
71 
72 #endif /* _BRCMF_PNO_H */
73