xref: /freebsd/usr.sbin/fwget/pci/pci_network_qca (revision d33f5a0afa54be7f18775f6506f015c7f79a6a5f)
1#-
2# SPDX-License-Identifier: BSD-2-Clause
3#
4# Copyright 2023 Bjoern A. Zeeb
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9# 1. Redistributions of source code must retain the above copyright
10#    notice, this list of conditions and the following disclaimer.
11# 2. Redistributions in binary form must reproduce the above copyright
12#    notice, this list of conditions and the following disclaimer in the
13#    documentation and/or other materials provided with the distribution.
14#
15# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27
28# ath10k
29pci_network_qca_ath10k()
30{
31
32        case "$1" in
33
34	# The case pattern table below is generated by a script also helping
35	# to generate the flavor/firmware Makefile definitions for ports.
36	# { sys/contrib/dev/athk/ath10k/zzz_fw_ports_fwget.sh }
37	### >>>
38
39	0x003c)	addpkg "wifi-firmware-ath10k-kmod-qca988x_hw20"; return 1 ;;
40	0x003e)	addpkg "wifi-firmware-ath10k-kmod-qca6174_hw21"
41		addpkg "wifi-firmware-ath10k-kmod-qca6174_hw30"
42		return 1 ;;
43	0x0040)	addpkg "wifi-firmware-ath10k-kmod-qca99x0_hw20"; return 1 ;;
44	0x0041)	addpkg "wifi-firmware-ath10k-kmod-qca6174_hw21"; return 1 ;;
45	0x0042)	addpkg "wifi-firmware-ath10k-kmod-qca6174_hw30"
46		addpkg "wifi-firmware-ath10k-kmod-qca9377_hw10"
47		return 1 ;;
48	0x0046)	addpkg "wifi-firmware-ath10k-kmod-qca9984_hw10"; return 1 ;;
49	0x0050)	addpkg "wifi-firmware-ath10k-kmod-qca9887_hw10"; return 1 ;;
50	0x0056)	addpkg "wifi-firmware-ath10k-kmod-qca9888_hw20"; return 1 ;;
51
52	### <<<
53	esac
54}
55
56# ath11k
57pci_network_qca_ath11k()
58{
59
60        case "$1" in
61
62	# The case pattern table below is generated by a script also helping
63	# to generate the flavor/firmware Makefile definitions for ports.
64	# { sys/contrib/dev/athk/ath11k/zzz_fw_ports_fwget.sh }
65	### >>>
66
67	0x1101)	addpkg "wifi-firmware-ath11k-kmod-qca6390_hw20"; return 1 ;;
68	0x1103)	addpkg "wifi-firmware-ath11k-kmod-wcn6855_hw20"; return 1 ;;
69	0x1104)	addpkg "wifi-firmware-ath11k-kmod-qcn9074_hw10"; return 1 ;;
70
71	### <<<
72	esac
73}
74
75# ath12k
76pci_network_qca_ath12k()
77{
78
79        case "$1" in
80
81	# The case pattern table below is generated by a script also helping
82	# to generate the flavor/firmware Makefile definitions for ports.
83	# { sys/contrib/dev/athk/ath12k/zzz_fw_ports_fwget.sh }
84	### >>>
85
86	0x1107)	addpkg "wifi-firmware-ath12k-kmod-wcn7850_hw20"; return 1 ;;
87
88	### <<<
89	esac
90}
91
92pci_network_qca()
93{
94
95	for _drv in ath10k ath11k ath12k; do
96		pci_network_qca_${_drv} "$1"
97		case $? in
98		1)	break ;;
99		esac
100	done
101}
102