1 /*
2 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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: contains MLO manager operation functionality
19 */
20 #include <wlan_cmn.h>
21 #include <wlan_cm_public_struct.h>
22 #include "wlan_mlo_mgr_cmn.h"
23 #include "wlan_mlo_mgr_main.h"
24 #include "wlan_mlo_mgr_public_structs.h"
25 #include "wlan_mlo_mgr_op.h"
26 #include "wlan_mlo_mgr_sta.h"
27
28 #ifdef WLAN_FEATURE_11BE_MLO
wlan_mlo_set_cu_bpcc(struct wlan_objmgr_vdev * vdev,uint8_t bpcc)29 QDF_STATUS wlan_mlo_set_cu_bpcc(struct wlan_objmgr_vdev *vdev, uint8_t bpcc)
30 {
31 uint8_t vdev_id;
32
33 if (!vdev) {
34 mlo_err("vdev is NULL");
35 return QDF_STATUS_E_INVAL;
36 }
37
38 vdev_id = wlan_vdev_get_id(vdev);
39 return mlo_set_cu_bpcc(vdev, vdev_id, bpcc);
40 }
41
wlan_mlo_get_cu_bpcc(struct wlan_objmgr_vdev * vdev,uint8_t * bpcc)42 QDF_STATUS wlan_mlo_get_cu_bpcc(struct wlan_objmgr_vdev *vdev, uint8_t *bpcc)
43 {
44 uint8_t vdev_id;
45
46 if (!vdev || !bpcc) {
47 mlo_err("vdev or bpcc is NULL");
48 return QDF_STATUS_E_INVAL;
49 }
50
51 vdev_id = wlan_vdev_get_id(vdev);
52 return mlo_get_cu_bpcc(vdev, vdev_id, bpcc);
53 }
54
wlan_mlo_init_cu_bpcc(struct wlan_objmgr_vdev * vdev)55 void wlan_mlo_init_cu_bpcc(struct wlan_objmgr_vdev *vdev)
56 {
57 struct wlan_mlo_dev_context *mlo_dev_ctx;
58 uint8_t vdev_id;
59
60 if (!vdev) {
61 mlo_err("vdev is NULL");
62 return;
63 }
64
65 vdev_id = wlan_vdev_get_id(vdev);
66 mlo_dev_ctx = vdev->mlo_dev_ctx;
67 if (!mlo_dev_ctx) {
68 mlo_err("ML dev ctx is NULL");
69 return;
70 }
71
72 mlo_init_cu_bpcc(mlo_dev_ctx, vdev_id);
73 }
74 #endif
75