forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/wireless/ath/ath10k/htt.c
....@@ -1,18 +1,7 @@
1
+// SPDX-License-Identifier: ISC
12 /*
23 * Copyright (c) 2005-2011 Atheros Communications Inc.
34 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
4
- *
5
- * Permission to use, copy, modify, and/or distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
8
- *
9
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
165 */
176
187 #include <linux/slab.h>
....@@ -21,6 +10,7 @@
2110 #include "htt.h"
2211 #include "core.h"
2312 #include "debug.h"
13
+#include "hif.h"
2414
2515 static const enum htt_t2h_msg_type htt_main_t2h_msg_types[] = {
2616 [HTT_MAIN_T2H_MSG_TYPE_VERSION_CONF] = HTT_T2H_MSG_TYPE_VERSION_CONF,
....@@ -145,6 +135,8 @@
145135 {
146136 struct ath10k_htc_svc_conn_req conn_req;
147137 struct ath10k_htc_svc_conn_resp conn_resp;
138
+ struct ath10k *ar = htt->ar;
139
+ struct ath10k_htc_ep *ep;
148140 int status;
149141
150142 memset(&conn_req, 0, sizeof(conn_req));
....@@ -152,6 +144,7 @@
152144
153145 conn_req.ep_ops.ep_tx_complete = ath10k_htt_htc_tx_complete;
154146 conn_req.ep_ops.ep_rx_complete = ath10k_htt_htc_t2h_msg_handler;
147
+ conn_req.ep_ops.ep_tx_credits = ath10k_htt_op_ep_tx_credits;
155148
156149 /* connect to control service */
157150 conn_req.service_id = ATH10K_HTC_SVC_ID_HTT_DATA_MSG;
....@@ -164,6 +157,15 @@
164157
165158 htt->eid = conn_resp.eid;
166159
160
+ if (ar->bus_param.dev_type == ATH10K_DEV_TYPE_HL) {
161
+ ep = &ar->htc.endpoint[htt->eid];
162
+ ath10k_htc_setup_tx_req(ep);
163
+ }
164
+
165
+ htt->disable_tx_comp = ath10k_hif_get_htt_tx_complete(htt->ar);
166
+ if (htt->disable_tx_comp)
167
+ ath10k_htc_change_tx_credit_flow(&htt->ar->htc, htt->eid, true);
168
+
167169 return 0;
168170 }
169171