1 /*
2 * Copyright (c) 2021 The Linux Foundation. All rights reserved.
3 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for
6 * any purpose with or without fee is hereby granted, provided that the
7 * above copyright notice and this permission notice appear in all
8 * copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 */
19
20 /**
21 * DOC: qal_bridge
22 * QCA driver framework for bridge related APIs prototype
23 */
24
25 #ifndef __QAL_BRIDGE_H
26 #define __QAL_BRIDGE_H
27
28 /* Include Files */
29 #include "qdf_types.h"
30 #include "i_qal_bridge.h"
31
32 typedef __qal_notify_blk_t qal_notify_blk_t;
33 typedef __qal_netdev_t qal_netdev_t;
34 typedef __qal_br_fdb_entry_t qal_br_fdb_entry_t;
35
36 #ifdef ENHANCED_OS_ABSTRACTION
37
38 QDF_STATUS
39 qal_bridge_fdb_register_notify(qal_notify_blk_t nb);
40
41 QDF_STATUS
42 qal_bridge_fdb_unregister_notify(qal_notify_blk_t nb);
43
44 qal_br_fdb_entry_t
45 qal_bridge_fdb_has_entry(qal_netdev_t dev, const char *addr, uint16_t vid);
46
47 QDF_STATUS
48 qal_bridge_fdb_delete_by_netdev(qal_netdev_t dev,
49 const unsigned char *addr, uint16_t vid);
50
51 QDF_STATUS
52 qal_bridge_fdb_update_register_notify(qal_notify_blk_t nb);
53
54 QDF_STATUS
55 qal_bridge_fdb_update_unregister_notify(qal_notify_blk_t nb);
56
57 QDF_STATUS
58 qal_bridge_fdb_add_or_refresh_by_netdev(qal_netdev_t dev,
59 const unsigned char *addr,
60 uint16_t vid,
61 uint16_t state);
62 #else
63 static inline QDF_STATUS
qal_bridge_fdb_register_notify(qal_notify_blk_t nb)64 qal_bridge_fdb_register_notify(qal_notify_blk_t nb)
65 {
66 return __qal_bridge_fdb_register_notify(nb);
67 }
68
69 static inline QDF_STATUS
qal_bridge_fdb_unregister_notify(qal_notify_blk_t nb)70 qal_bridge_fdb_unregister_notify(qal_notify_blk_t nb)
71 {
72 return __qal_bridge_fdb_unregister_notify(nb);
73 }
74
75 static inline qal_br_fdb_entry_t
qal_bridge_fdb_has_entry(qal_netdev_t dev,const char * addr,uint16_t vid)76 qal_bridge_fdb_has_entry(qal_netdev_t dev, const char *addr, uint16_t vid)
77 {
78 return __qal_bridge_fdb_has_entry(dev, addr, vid);
79 }
80
81 static inline QDF_STATUS
qal_bridge_fdb_delete_by_netdev(qal_netdev_t dev,const unsigned char * addr,uint16_t vid)82 qal_bridge_fdb_delete_by_netdev(qal_netdev_t dev,
83 const unsigned char *addr, uint16_t vid)
84 {
85 return __qal_bridge_fdb_delete_by_netdev(dev, addr, vid);
86 }
87
88 static inline QDF_STATUS
qal_bridge_fdb_update_register_notify(qal_notify_blk_t nb)89 qal_bridge_fdb_update_register_notify(qal_notify_blk_t nb)
90 {
91 return __qal_bridge_fdb_update_register_notify(nb);
92 }
93
94 static inline QDF_STATUS
qal_bridge_fdb_update_unregister_notify(qal_notify_blk_t nb)95 qal_bridge_fdb_update_unregister_notify(qal_notify_blk_t nb)
96 {
97 return __qal_bridge_fdb_update_unregister_notify(nb);
98 }
99
100 QDF_STATUS
qal_bridge_fdb_add_or_refresh_by_netdev(qal_netdev_t dev,const unsigned char * addr,uint16_t vid,uint16_t state)101 qal_bridge_fdb_add_or_refresh_by_netdev(qal_netdev_t dev,
102 const unsigned char *addr,
103 uint16_t vid,
104 uint16_t state)
105 {
106 __qal_bridge_fdb_add_or_refresh_by_netdev(dev, addr, vid, state);
107 }
108 #endif
109
110 #endif /* __QAL_BRIDGE_H */
111