xref: /wlan-driver/qca-wifi-host-cmn/os_if/linux/mlme/src/wlan_cfg80211_vdev_mlme.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2019 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * DOC: wlan_cfg80211_vdev_mlme.c
21  *
22  * This file provide API definitions for osif layer
23  * to get and set vdev mgr mlme structure parameters
24  */
25 
26 #include <wlan_cfg80211_vdev_mlme.h>
27 
28 int
wlan_cfg80211_vdev_mlme_get_param_ssid(struct wlan_objmgr_vdev * vdev,uint8_t * ssid,uint8_t * ssid_len)29 wlan_cfg80211_vdev_mlme_get_param_ssid(struct wlan_objmgr_vdev *vdev,
30 				       uint8_t *ssid,
31 				       uint8_t *ssid_len)
32 {
33 	if (!vdev) {
34 		osif_err("VDEV is NULL!!!!");
35 		return qdf_status_to_os_return(QDF_STATUS_E_FAILURE);
36 	}
37 
38 	ucfg_wlan_vdev_mgr_get_param_ssid(vdev, ssid, ssid_len);
39 	return qdf_status_to_os_return(QDF_STATUS_SUCCESS);
40 }
41 
42 int
wlan_cfg80211_vdev_mlme_get_trans_bssid(struct wlan_objmgr_vdev * vdev,uint8_t * addr)43 wlan_cfg80211_vdev_mlme_get_trans_bssid(struct wlan_objmgr_vdev *vdev,
44 					uint8_t *addr)
45 {
46 	if (!vdev) {
47 		osif_err("VDEV is NULL!!!!");
48 		return qdf_status_to_os_return(QDF_STATUS_E_FAILURE);
49 	}
50 
51 	ucfg_wlan_vdev_mlme_get_trans_bssid(vdev, addr);
52 	return qdf_status_to_os_return(QDF_STATUS_SUCCESS);
53 }
54 
55 void
wlan_cfg80211_vdev_mlme_set_param(struct wlan_objmgr_vdev * vdev,enum wlan_mlme_cfg_id param_id,struct wlan_vdev_mgr_cfg mlme_cfg)56 wlan_cfg80211_vdev_mlme_set_param(struct wlan_objmgr_vdev *vdev,
57 				  enum wlan_mlme_cfg_id param_id,
58 				  struct wlan_vdev_mgr_cfg mlme_cfg)
59 {
60 	if (!vdev) {
61 		osif_err("VDEV is NULL!!!!");
62 		return;
63 	}
64 
65 	ucfg_wlan_vdev_mgr_set_param(vdev, param_id, mlme_cfg);
66 }
67 
68 void
wlan_cfg80211_vdev_mlme_get_param(struct wlan_objmgr_vdev * vdev,enum wlan_mlme_cfg_id param_id,uint32_t * value)69 wlan_cfg80211_vdev_mlme_get_param(struct wlan_objmgr_vdev *vdev,
70 				  enum wlan_mlme_cfg_id param_id,
71 				  uint32_t *value)
72 {
73 	if (!vdev) {
74 		osif_err("VDEV is NULL!!!!");
75 		return;
76 	}
77 
78 	ucfg_wlan_vdev_mgr_get_param(vdev, param_id, value);
79 }
80