1*5113495bSYour Name /*
2*5113495bSYour Name * Copyright (c) 2018 The Linux Foundation. All rights reserved.
3*5113495bSYour Name * Copyright (c) 2021 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 * DOC: qdf_ipa.c
22*5113495bSYour Name *
23*5113495bSYour Name * This source file contains linux specific definitions for QDF IPA APIs
24*5113495bSYour Name */
25*5113495bSYour Name
26*5113495bSYour Name /* Include Files */
27*5113495bSYour Name #include <qdf_ipa.h>
28*5113495bSYour Name #include <qdf_module.h>
29*5113495bSYour Name
__qdf_to_ipa_wlan_event(int qdf_ipa_event)30*5113495bSYour Name static uint8_t __qdf_to_ipa_wlan_event(int qdf_ipa_event)
31*5113495bSYour Name {
32*5113495bSYour Name uint8_t ipa_event;
33*5113495bSYour Name
34*5113495bSYour Name switch (qdf_ipa_event) {
35*5113495bSYour Name case QDF_IPA_CLIENT_CONNECT:
36*5113495bSYour Name ipa_event = WLAN_CLIENT_CONNECT;
37*5113495bSYour Name break;
38*5113495bSYour Name case QDF_IPA_CLIENT_DISCONNECT:
39*5113495bSYour Name ipa_event = WLAN_CLIENT_DISCONNECT;
40*5113495bSYour Name break;
41*5113495bSYour Name case QDF_IPA_AP_CONNECT:
42*5113495bSYour Name ipa_event = WLAN_AP_CONNECT;
43*5113495bSYour Name break;
44*5113495bSYour Name case QDF_IPA_AP_DISCONNECT:
45*5113495bSYour Name ipa_event = WLAN_AP_DISCONNECT;
46*5113495bSYour Name break;
47*5113495bSYour Name case QDF_IPA_STA_CONNECT:
48*5113495bSYour Name ipa_event = WLAN_STA_CONNECT;
49*5113495bSYour Name break;
50*5113495bSYour Name case QDF_IPA_STA_DISCONNECT:
51*5113495bSYour Name ipa_event = WLAN_STA_DISCONNECT;
52*5113495bSYour Name break;
53*5113495bSYour Name case QDF_IPA_CLIENT_CONNECT_EX:
54*5113495bSYour Name ipa_event = WLAN_CLIENT_CONNECT_EX;
55*5113495bSYour Name break;
56*5113495bSYour Name case QDF_SWITCH_TO_SCC:
57*5113495bSYour Name ipa_event = WLAN_SWITCH_TO_SCC;
58*5113495bSYour Name break;
59*5113495bSYour Name case QDF_SWITCH_TO_MCC:
60*5113495bSYour Name ipa_event = WLAN_SWITCH_TO_MCC;
61*5113495bSYour Name break;
62*5113495bSYour Name case QDF_WDI_ENABLE:
63*5113495bSYour Name ipa_event = WLAN_WDI_ENABLE;
64*5113495bSYour Name break;
65*5113495bSYour Name case QDF_WDI_DISABLE:
66*5113495bSYour Name ipa_event = WLAN_WDI_DISABLE;
67*5113495bSYour Name break;
68*5113495bSYour Name case QDF_FWR_SSR_BEFORE_SHUTDOWN:
69*5113495bSYour Name ipa_event = WLAN_FWR_SSR_BEFORE_SHUTDOWN;
70*5113495bSYour Name break;
71*5113495bSYour Name case QDF_IPA_WLAN_EVENT_MAX:
72*5113495bSYour Name default:
73*5113495bSYour Name ipa_event = IPA_WLAN_EVENT_MAX;
74*5113495bSYour Name break;
75*5113495bSYour Name }
76*5113495bSYour Name
77*5113495bSYour Name return ipa_event;
78*5113495bSYour Name }
79*5113495bSYour Name
__qdf_ipa_set_meta_msg_type(__qdf_ipa_msg_meta_t * meta,int type)80*5113495bSYour Name void __qdf_ipa_set_meta_msg_type(__qdf_ipa_msg_meta_t *meta, int type)
81*5113495bSYour Name {
82*5113495bSYour Name meta->msg_type = __qdf_to_ipa_wlan_event(type);
83*5113495bSYour Name }
84*5113495bSYour Name
85*5113495bSYour Name qdf_export_symbol(__qdf_ipa_set_meta_msg_type);
86