xref: /wlan-driver/qcacld-3.0/core/mac/inc/mac_init_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name /*
21*5113495bSYour Name  *
22*5113495bSYour Name  * mac_init_api.c - Header file for mac level init functions
23*5113495bSYour Name  * Author:    Dinesh Upadhyay
24*5113495bSYour Name  * Date:      04/23/2007
25*5113495bSYour Name  * History:-
26*5113495bSYour Name  * Date       Modified by            Modification Information
27*5113495bSYour Name  * --------------------------------------------------------------------------
28*5113495bSYour Name  *
29*5113495bSYour Name  */
30*5113495bSYour Name #ifndef __MAC_INIT_API_H
31*5113495bSYour Name #define __MAC_INIT_API_H
32*5113495bSYour Name 
33*5113495bSYour Name #include "ani_global.h"
34*5113495bSYour Name #include "sir_types.h"
35*5113495bSYour Name 
36*5113495bSYour Name /**
37*5113495bSYour Name  * struct mac_start_params - parameters needed when starting the MAC
38*5113495bSYour Name  * @driver_type: Operating mode of the driver
39*5113495bSYour Name  */
40*5113495bSYour Name struct mac_start_params {
41*5113495bSYour Name 	enum qdf_driver_type driver_type;
42*5113495bSYour Name };
43*5113495bSYour Name 
44*5113495bSYour Name /**
45*5113495bSYour Name  * mac_start() - Start all MAC modules
46*5113495bSYour Name  * @mac_handle: Opaque handle to the MAC context
47*5113495bSYour Name  * @params: Parameters needed to start the MAC
48*5113495bSYour Name  *
49*5113495bSYour Name  * This function is called to start MAC. This function will start all
50*5113495bSYour Name  * the mac modules.
51*5113495bSYour Name  *
52*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS if the MAC was successfully started. Any
53*5113495bSYour Name  *         other value means that there was an issue with starting the
54*5113495bSYour Name  *         MAC and the MAC should not be considered operational.
55*5113495bSYour Name  */
56*5113495bSYour Name QDF_STATUS mac_start(mac_handle_t mac_handle,
57*5113495bSYour Name 		     struct mac_start_params *params);
58*5113495bSYour Name 
59*5113495bSYour Name /**
60*5113495bSYour Name  * mac_stop() - Stop all MAC modules
61*5113495bSYour Name  * @mac_handle: Opaque handle to the MAC context
62*5113495bSYour Name  *
63*5113495bSYour Name  * This function is called to stop MAC. This function will stop all
64*5113495bSYour Name  * the mac modules.
65*5113495bSYour Name  *
66*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS if the MAC was successfully stopped. Any
67*5113495bSYour Name  *         other value means that there was an issue with stopping the
68*5113495bSYour Name  *         MAC, but the caller should still consider the MAC to be
69*5113495bSYour Name  *         stopped.
70*5113495bSYour Name  */
71*5113495bSYour Name QDF_STATUS mac_stop(mac_handle_t mac_handle);
72*5113495bSYour Name 
73*5113495bSYour Name /**
74*5113495bSYour Name  * mac_open() - Open the MAC
75*5113495bSYour Name  * @psoc: SOC global object
76*5113495bSYour Name  * @mac_handle: Pointer to where the MAC handle is to be stored
77*5113495bSYour Name  * @hdd_handle: Opaque handle to the HDD context
78*5113495bSYour Name  * @cds_cfg: Initial configuration
79*5113495bSYour Name  *
80*5113495bSYour Name  * This function will be called during init. This function is suppose
81*5113495bSYour Name  * to allocate all the memory with the global context will be
82*5113495bSYour Name  * allocated here.
83*5113495bSYour Name  *
84*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS if the MAC was successfully opened and a
85*5113495bSYour Name  *         MAC handle was returned to the caller. Any other value
86*5113495bSYour Name  *         means the MAC was not opened.
87*5113495bSYour Name  */
88*5113495bSYour Name QDF_STATUS mac_open(struct wlan_objmgr_psoc *psoc, mac_handle_t *mac_handle,
89*5113495bSYour Name 		    hdd_handle_t hdd_handle, struct cds_config_info *cds_cfg);
90*5113495bSYour Name 
91*5113495bSYour Name /**
92*5113495bSYour Name  * mac_close() - close the MAC
93*5113495bSYour Name  * @mac_handle: Opaque handle to the MAC context returned by mac_open()
94*5113495bSYour Name  *
95*5113495bSYour Name  * This function will be called in shutdown sequence from HDD. All the
96*5113495bSYour Name  * allocated memory with global context will be freed here.
97*5113495bSYour Name  *
98*5113495bSYour Name  * Return: QDF_STATUS_SUCCESS if the MAC was successfully closed. Any
99*5113495bSYour Name  *         other value means that there was an issue with closing the
100*5113495bSYour Name  *         MAC, but the caller should still consider the MAC to be
101*5113495bSYour Name  *         closed.
102*5113495bSYour Name  */
103*5113495bSYour Name QDF_STATUS mac_close(mac_handle_t mac_handle);
104*5113495bSYour Name 
105*5113495bSYour Name /**
106*5113495bSYour Name  * mac_register_session_open_close_cb() - register open/close session cb
107*5113495bSYour Name  * @mac_handle: Opaque handle to the MAC context
108*5113495bSYour Name  * @close_session: callback to be registered with SME for closing the session
109*5113495bSYour Name  * @callback: Common callback to hdd for all modes
110*5113495bSYour Name  */
111*5113495bSYour Name void mac_register_session_open_close_cb(mac_handle_t mac_handle,
112*5113495bSYour Name 					csr_session_close_cb close_session,
113*5113495bSYour Name 					csr_roam_complete_cb callback);
114*5113495bSYour Name 
115*5113495bSYour Name #ifdef WLAN_BCN_RECV_FEATURE
116*5113495bSYour Name /**
117*5113495bSYour Name  * mac_register_bcn_report_send_cb() - Register bcn receive start
118*5113495bSYour Name  * indication handler callback
119*5113495bSYour Name  * @mac: Pointer to Global MAC structure
120*5113495bSYour Name  * @cb: A pointer to store the callback
121*5113495bSYour Name  *
122*5113495bSYour Name  * Once driver gets QCA_NL80211_VENDOR_SUBCMD_BEACON_REPORTING vendor
123*5113495bSYour Name  * command with attribute for start only. MAC layer register a sme
124*5113495bSYour Name  * callback through this function.
125*5113495bSYour Name  *
126*5113495bSYour Name  * Return: None.
127*5113495bSYour Name  */
128*5113495bSYour Name void mac_register_bcn_report_send_cb(struct mac_context *mac,
129*5113495bSYour Name 				     beacon_report_cb cb);
130*5113495bSYour Name #endif /* WLAN_BCN_RECV_FEATURE */
131*5113495bSYour Name #endif /* __MAC_INIT_API_H */
132