xref: /linux/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.h (revision efc2c1fa8e145b60a7805fa9b6c92ac0746fccc3)
1ac55136fSArend Van Spriel /*
2ac55136fSArend Van Spriel  * Copyright (c) 2016 Broadcom
3ac55136fSArend Van Spriel  *
4ac55136fSArend Van Spriel  * Permission to use, copy, modify, and/or distribute this software for any
5ac55136fSArend Van Spriel  * purpose with or without fee is hereby granted, provided that the above
6ac55136fSArend Van Spriel  * copyright notice and this permission notice appear in all copies.
7ac55136fSArend Van Spriel  *
8ac55136fSArend Van Spriel  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9ac55136fSArend Van Spriel  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10ac55136fSArend Van Spriel  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11ac55136fSArend Van Spriel  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12ac55136fSArend Van Spriel  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13ac55136fSArend Van Spriel  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14ac55136fSArend Van Spriel  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15ac55136fSArend Van Spriel  */
16ac55136fSArend Van Spriel #ifndef _BRCMF_PNO_H
17ac55136fSArend Van Spriel #define _BRCMF_PNO_H
18ac55136fSArend Van Spriel 
19ac55136fSArend Van Spriel #define BRCMF_PNO_SCAN_COMPLETE			1
20ac55136fSArend Van Spriel #define BRCMF_PNO_MAX_PFN_COUNT			16
21c6989fd5SArend Van Spriel #define BRCMF_PNO_SCHED_SCAN_MIN_PERIOD	10
22c6989fd5SArend Van Spriel #define BRCMF_PNO_SCHED_SCAN_MAX_PERIOD	508
23ac55136fSArend Van Spriel 
24*efc2c1faSArend Van Spriel /* forward declaration */
25*efc2c1faSArend Van Spriel struct brcmf_pno_info;
26ac55136fSArend Van Spriel 
27ac55136fSArend Van Spriel /**
283e48611dSArend Van Spriel  * brcmf_pno_start_sched_scan - initiate scheduled scan on device.
29ac55136fSArend Van Spriel  *
30ac55136fSArend Van Spriel  * @ifp: interface object used.
313e48611dSArend Van Spriel  * @req: configuration parameters for scheduled scan.
32ac55136fSArend Van Spriel  */
333e48611dSArend Van Spriel int brcmf_pno_start_sched_scan(struct brcmf_if *ifp,
343e48611dSArend Van Spriel 			       struct cfg80211_sched_scan_request *req);
353e2e86abSArend Van Spriel 
3694ed6ffbSArend Van Spriel /**
37*efc2c1faSArend Van Spriel  * brcmf_pno_stop_sched_scan - terminate scheduled scan on device.
38*efc2c1faSArend Van Spriel  *
39*efc2c1faSArend Van Spriel  * @ifp: interface object used.
40*efc2c1faSArend Van Spriel  * @reqid: unique identifier of scan to be stopped.
41*efc2c1faSArend Van Spriel  */
42*efc2c1faSArend Van Spriel int brcmf_pno_stop_sched_scan(struct brcmf_if *ifp, u64 reqid);
43*efc2c1faSArend Van Spriel 
44*efc2c1faSArend Van Spriel /**
4594ed6ffbSArend Van Spriel  * brcmf_pno_wiphy_params - fill scheduled scan parameters in wiphy instance.
4694ed6ffbSArend Van Spriel  *
4794ed6ffbSArend Van Spriel  * @wiphy: wiphy instance to be used.
4894ed6ffbSArend Van Spriel  * @gscan: indicates whether the device has support for g-scan feature.
4994ed6ffbSArend Van Spriel  */
5094ed6ffbSArend Van Spriel void brcmf_pno_wiphy_params(struct wiphy *wiphy, bool gscan);
5194ed6ffbSArend Van Spriel 
52*efc2c1faSArend Van Spriel /**
53*efc2c1faSArend Van Spriel  * brcmf_pno_attach - allocate and attach module information.
54*efc2c1faSArend Van Spriel  *
55*efc2c1faSArend Van Spriel  * @cfg: cfg80211 context used.
56*efc2c1faSArend Van Spriel  */
57*efc2c1faSArend Van Spriel int brcmf_pno_attach(struct brcmf_cfg80211_info *cfg);
58*efc2c1faSArend Van Spriel 
59*efc2c1faSArend Van Spriel /**
60*efc2c1faSArend Van Spriel  * brcmf_pno_detach - detach and free module information.
61*efc2c1faSArend Van Spriel  *
62*efc2c1faSArend Van Spriel  * @cfg: cfg80211 context used.
63*efc2c1faSArend Van Spriel  */
64*efc2c1faSArend Van Spriel void brcmf_pno_detach(struct brcmf_cfg80211_info *cfg);
65*efc2c1faSArend Van Spriel 
66*efc2c1faSArend Van Spriel /**
67*efc2c1faSArend Van Spriel  * brcmf_pno_find_reqid_by_bucket - find request id for given bucket index.
68*efc2c1faSArend Van Spriel  *
69*efc2c1faSArend Van Spriel  * @pi: pno instance used.
70*efc2c1faSArend Van Spriel  * @bucket: index of firmware bucket.
71*efc2c1faSArend Van Spriel  */
72*efc2c1faSArend Van Spriel u64 brcmf_pno_find_reqid_by_bucket(struct brcmf_pno_info *pi, u32 bucket);
73*efc2c1faSArend Van Spriel 
74*efc2c1faSArend Van Spriel /**
75*efc2c1faSArend Van Spriel  * brcmf_pno_get_bucket_map - determine bucket map for given netinfo.
76*efc2c1faSArend Van Spriel  *
77*efc2c1faSArend Van Spriel  * @pi: pno instance used.
78*efc2c1faSArend Van Spriel  * @netinfo: netinfo to compare with bucket configuration.
79*efc2c1faSArend Van Spriel  */
80*efc2c1faSArend Van Spriel u32 brcmf_pno_get_bucket_map(struct brcmf_pno_info *pi,
81*efc2c1faSArend Van Spriel 			     struct brcmf_pno_net_info_le *netinfo);
82*efc2c1faSArend Van Spriel 
83ac55136fSArend Van Spriel #endif /* _BRCMF_PNO_H */
84