VoCore2: Port mt7628.ko to LuCI 4

now create simple test script in /lib/netifd/wireless/mt7628.sh

#!/bin/sh
. /lib/netifd/netifd-wireless.sh
. /lib/netifd/hostapd.sh

init_wireless_driver "$@"

drv_mt7628_setup() {
	echo drv_mt7628_setup >> /tmp/wifi.log
}

drv_mt7628_teardown() {
	echo drv_mt7628_teardown >> /tmp/wifi.log
}

drv_mt7628_cleanup() {
        hostapd_common_cleanup
}

drv_mt7628_init_device_config() {
	echo drv_mt7628_init_device_config >> /tmp/wifi.log
}

drv_mt7628_init_iface_config() {
	echo drv_mt7628_init_iface_config >> /tmp/wifi.log
}

add_driver mt7628

other setting file in /etc/config/wireless

config wifi-device 'ra0'
	option type 'mt7628'
	option channel '11'
	option hwmode '11g'
	option path 'platform/10300000.wmac'
	option htmode 'HT20'
	option disabled '0'

config wifi-iface 'default-ap'
	option device 'ra0'
	option network 'lan'
	option mode 'ap'
	option ssid 'VoCore2'
	option encryption 'none'

mt7628 can be replace to others, such as mac80211 etc…this must be same in the file name, the function name and in setting file option type.

reboot and check /tmp/wifi.log

drv_mt7628_init_device_config
drv_mt7628_init_iface_config
drv_mt7628_setup
drv_mt7628_teardown
drv_mt7628_setup
drv_mt7628_teardown
drv_mt7628_setup
drv_mt7628_teardown
drv_mt7628_setup
drv_mt7628_teardown

It is almost done!