forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/wireless/ath/ath10k/usb.c
....@@ -1,19 +1,8 @@
1
+// SPDX-License-Identifier: ISC
12 /*
23 * Copyright (c) 2007-2011 Atheros Communications Inc.
34 * Copyright (c) 2011-2012,2017 Qualcomm Atheros, Inc.
45 * Copyright (c) 2016-2017 Erik Stromdahl <erik.stromdahl@gmail.com>
5
- *
6
- * Permission to use, copy, modify, and/or distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
9
- *
10
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
176 */
187
198 #include <linux/module.h>
....@@ -704,18 +693,8 @@
704693 return 0;
705694 }
706695
707
-/* This op is currently only used by htc_wait_target if the HTC ready
708
- * message times out. It is not applicable for USB since there is nothing
709
- * we can do if the HTC ready message does not arrive in time.
710
- * TODO: Make this op non mandatory by introducing a NULL check in the
711
- * hif op wrapper.
712
- */
713
-static void ath10k_usb_hif_send_complete_check(struct ath10k *ar,
714
- u8 pipe, int force)
715
-{
716
-}
717
-
718
-static int ath10k_usb_hif_power_up(struct ath10k *ar)
696
+static int ath10k_usb_hif_power_up(struct ath10k *ar,
697
+ enum ath10k_firmware_mode fw_mode)
719698 {
720699 return 0;
721700 }
....@@ -747,7 +726,6 @@
747726 .stop = ath10k_usb_hif_stop,
748727 .map_service_to_pipe = ath10k_usb_hif_map_service_to_pipe,
749728 .get_default_pipe = ath10k_usb_hif_get_default_pipe,
750
- .send_complete_check = ath10k_usb_hif_send_complete_check,
751729 .get_free_queue_number = ath10k_usb_hif_get_free_queue_number,
752730 .power_up = ath10k_usb_hif_power_up,
753731 .power_down = ath10k_usb_hif_power_down,
....@@ -846,7 +824,7 @@
846824
847825 ath10k_dbg(ar, ATH10K_DBG_USB, "usb setting up pipes using interface\n");
848826
849
- /* walk decriptors and setup pipes */
827
+ /* walk descriptors and setup pipes */
850828 for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
851829 endpoint = &iface_desc->endpoint[i].desc;
852830
....@@ -997,7 +975,7 @@
997975 struct usb_device *dev = interface_to_usbdev(interface);
998976 int ret, vendor_id, product_id;
999977 enum ath10k_hw_rev hw_rev;
1000
- u32 chip_id;
978
+ struct ath10k_bus_params bus_params = {};
1001979
1002980 /* Assumption: All USB based chipsets (so far) are QCA9377 based.
1003981 * If there will be newer chipsets that does not use the hw reg
....@@ -1032,9 +1010,10 @@
10321010 ar->id.vendor = vendor_id;
10331011 ar->id.device = product_id;
10341012
1013
+ bus_params.dev_type = ATH10K_DEV_TYPE_HL;
10351014 /* TODO: don't know yet how to get chip_id with USB */
1036
- chip_id = 0;
1037
- ret = ath10k_core_register(ar, chip_id);
1015
+ bus_params.chip_id = 0;
1016
+ ret = ath10k_core_register(ar, &bus_params);
10381017 if (ret) {
10391018 ath10k_warn(ar, "failed to register driver core: %d\n", ret);
10401019 goto err_usb_destroy;