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