1#- 2# SPDX-License-Identifier: BSD-2-Clause 3# 4# Copyright 2023 Bjoern A. Zeeb 5# Copyright (c) 2024 The FreeBSD Foundation 6# 7# Portions of this software were developed by Björn Zeeb 8# under sponsorship from the FreeBSD Foundation. 9# 10# Redistribution and use in source and binary forms, with or without 11# modification, are permitted provided that the following conditions 12# are met: 13# 1. Redistributions of source code must retain the above copyright 14# notice, this list of conditions and the following disclaimer. 15# 2. Redistributions in binary form must reproduce the above copyright 16# notice, this list of conditions and the following disclaimer in the 17# documentation and/or other materials provided with the distribution. 18# 19# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 20# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 23# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29# SUCH DAMAGE. 30# 31 32pci_network_mediatek_mt76() 33{ 34 35 case "$1" in 36 # The case pattern table below is generated by a script also helping 37 # to generate the flavor/firmware Makefile definitions for ports. 38 # { sys/contrib/dev/mediatek/mt76/zzz_fw_ports_fwget.sh } 39 ### >>> 40 41 0x0608) addpkg "wifi-firmware-mediatek-kmod-mt792x"; return 1 ;; 42 0x0616) addpkg "wifi-firmware-mediatek-kmod-mt792x"; return 1 ;; 43 0x0717) addpkg "wifi-firmware-mediatek-kmod-mt792x"; return 1 ;; 44 0x7906) addpkg "wifi-firmware-mediatek-kmod-mt7915"; return 1 ;; 45 0x790a) addpkg "wifi-firmware-mediatek-kmod-mt7915"; return 1 ;; 46 0x7915) addpkg "wifi-firmware-mediatek-kmod-mt7915"; return 1 ;; 47 0x7916) addpkg "wifi-firmware-mediatek-kmod-mt7915"; return 1 ;; 48 0x7922) addpkg "wifi-firmware-mediatek-kmod-mt792x"; return 1 ;; 49 0x7925) addpkg "wifi-firmware-mediatek-kmod-mt792x"; return 1 ;; 50 0x7961) addpkg "wifi-firmware-mediatek-kmod-mt792x"; return 1 ;; 51 0x7990) addpkg "wifi-firmware-mediatek-kmod-mt7996"; return 1 ;; 52 0x7991) addpkg "wifi-firmware-mediatek-kmod-mt7996"; return 1 ;; 53 0x7992) addpkg "wifi-firmware-mediatek-kmod-mt7996"; return 1 ;; 54 0x799a) addpkg "wifi-firmware-mediatek-kmod-mt7996"; return 1 ;; 55 56 ### <<< 57 esac 58} 59 60pci_network_mediatek() 61{ 62 63 for _drv in mt76; do 64 pci_network_mediatek_${_drv} "$1" 65 case $? in 66 1) break ;; 67 esac 68 done 69} 70