1 /*
2 * Copyright (c) 2019 The Linux Foundation. All rights reserved.
3 *
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.
7 *
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
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 /**
18 * DOC: Implements PDEV MLME public APIs
19 */
20
21 #include <wlan_objmgr_pdev_obj.h>
22 #include <wlan_mlme_dbg.h>
23 #include "include/wlan_pdev_mlme.h"
24 #include <wlan_pdev_mlme_api.h>
25 #include <qdf_module.h>
26
wlan_pdev_mlme_get_cmpt_obj(struct wlan_objmgr_pdev * pdev)27 struct pdev_mlme_obj *wlan_pdev_mlme_get_cmpt_obj(struct wlan_objmgr_pdev *pdev)
28 {
29 struct pdev_mlme_obj *pdev_mlme;
30
31 if (!pdev) {
32 mlme_err("pdev is NULL");
33 return NULL;
34 }
35
36 pdev_mlme = wlan_objmgr_pdev_get_comp_private_obj(pdev,
37 WLAN_UMAC_COMP_MLME);
38 if (!pdev_mlme) {
39 mlme_err(" MLME component object is NULL");
40 return NULL;
41 }
42
43 return pdev_mlme;
44 }
45
wlan_pdev_mlme_get_ext_hdl(struct wlan_objmgr_pdev * pdev)46 mlme_pdev_ext_t *wlan_pdev_mlme_get_ext_hdl(struct wlan_objmgr_pdev *pdev)
47 {
48 struct pdev_mlme_obj *pdev_mlme;
49
50 pdev_mlme = wlan_pdev_mlme_get_cmpt_obj(pdev);
51 if (pdev_mlme)
52 return pdev_mlme->ext_pdev_ptr;
53
54 return NULL;
55 }
56
57 qdf_export_symbol(wlan_pdev_mlme_get_ext_hdl);
58
59