add 5866 support

This commit is contained in:
fujr 2024-11-14 23:50:44 +08:00
parent 1b4df2073b
commit 260f5aba1b

View File

@ -27,7 +27,7 @@ modem_settings()
uci set qmodem.pcie0.alias="wwan1" uci set qmodem.pcie0.alias="wwan1"
uci commit qmodem uci commit qmodem
;; ;;
HC,HC-G80) HC,HC-G80*)
#mini pci slot #mini pci slot
uci set qmodem.mini_pci="modem-slot" uci set qmodem.mini_pci="modem-slot"
uci set qmodem.mini_pci.slot="1-1.4" uci set qmodem.mini_pci.slot="1-1.4"
@ -50,48 +50,73 @@ modem_settings()
huasifei,ws3006) huasifei,ws3006)
#m2 usb3.0 #m2 usb3.0
#(slot 2) #(slot 2)
add_slot_cfg "5g1" "2-1.2" "usb" "5g1" "green:5g2" "green:sim2" "" "m2_reset_2" "1" "0" "5" add_usb_slot_cfg "5g1" "2-1.2" "5g1" "green:5g2" "green:sim2" "m2_reset_2" "1" "0" "5"
#(slot 1) #(slot 1)
add_slot_cfg "5g0" "2-1.4" "usb" "5g0" "green:5g1" "green:sim1" "" "m2_reset_1" "1" "0" "6" add_usb_slot_cfg "5g0" "2-1.4" "5g0" "green:5g1" "green:sim1" "m2_reset_1" "1" "0" "6"
#m2 usb2.0 #m2 usb2.0
#(slot 2) #(slot 2)
add_slot_cfg "4g3" "1-1.1" "usb" "4g3" "green:5g2" "green:sim2" "" "m2_reset_2" "1" "0" "20" add_usb_slot_cfg "4g3" "1-1.1" "4g3" "green:5g2" "green:sim2" "m2_reset_2" "1" "0" "20"
#(slot 1) #(slot 1)
add_slot_cfg "4g2" "1-1.4" "usb" "4g2" "green:5g1" "green:5g1" "" "m2_reset_1" "1" "0" "21" add_usb_slot_cfg "4g2" "1-1.4" "4g2" "green:5g1" "green:5g1" "m2_reset_1" "1" "0" "21"
#mini pci slot #mini pci slot
#(slot 2) #(slot 2)
add_slot_cfg "4g1" "1-1.2" "usb" "4g1" "green:5g2" "green:5g2" "" "" "" "" "22" add_usb_slot_cfg "4g1" "1-1.2" "4g1" "green:5g2" "green:sim2" "" "" "" "22"
#(slot 1) #(slot 1)
add_slot_cfg "4g0" "1-1.3" "usb" "4g0" "green:5g1" "green:5g1" "" "" "" "" "23" add_usb_slot_cfg "4g0" "1-1.3" "4g0" "green:5g1" "green:sim1" "" "" "" "23"
uci commit qmodem
;;
sagemcom,5866t)
add_usb_slot_cfg "5g_usb" "1-1" "5g_usb" "LED5_G" "LED4_G" "" "" "" "10"
add_pcie_slot_cfg "5g_pcie" "0000:01:00.0" "5g_pcie" "LED5_G" "LED4_G" "1-1" "" "" "" "10"
uci commit qmodem uci commit qmodem
;; ;;
cyber,cyber3588-aib) cyber,cyber3588-aib)
uci batch << EOF add_usb_slot_cfg "5g_usb0" "8-1" "5g_usb0" "blue:status" "green:status" "" "" "" "10"
set qmodem.m2_0=modem-slot add_pcie_slot_cfg "5g_pcie0" "0001:11:00.0" "5g_pcie0" "blue:status" "green:status" "8-1" "" "" "" "10"
set qmodem.m2_0.type='pcie' uci commit qmodem
set qmodem.m2_0.slot='0001:11:00.0' ;;
set qmodem.m2_0.net_led='blue:status'
set qmodem.m2_0.associated_usb='8-1'
set qmodem.m2_0.sim_led='green:status'
commit qmodem
EOF
esac esac
} }
add_slot_cfg() add_usb_slot_cfg()
{ {
cfg=$1 cfg=$1
cfg_slot=$2 cfg_slot=$2
cfg_type=$3 alias=$3
alias=$4 net_led=$4
net_led=$5 sim_led=$5
sim_led=$6 gpio=$6
associated_usb=$7 gpio_up=$7
gpio=$8 gpio_down=$8
gpio_up=$9 default_metric=$9
gpio_down=${10} uci set qmodem.${cfg}=modem-slot
default_metric=${11} [ -n "$cfg_type" ] && uci set qmodem.${cfg}.type=usb
[ -n "$cfg_type" ] && uci set qmodem.${cfg}.type=${cfg_type} [ -n "$cfg_slot" ] && uci set qmodem.${cfg}.slot=${cfg_slot}
[ -n "$net_led" ] && uci set qmodem.${cfg}.net_led=${net_led}
[ -n "$alias" ] && uci set qmodem.${cfg}.alias=${alias}
[ -n "$sim_led" ] && uci set qmodem.${cfg}.sim_led=${sim_led}
[ -n "$associated_usb" ] && uci set qmodem.${cfg}.associated_usb=${associated_usb}
[ -n "$gpio" ] && uci set qmodem.${cfg}.gpio=${gpio}
[ -n "$gpio_up" ] && uci set qmodem.${cfg}.gpio_up=${gpio_up}
[ -n "$gpio_down" ] && uci set qmodem.${cfg}.gpio_down=${gpio_down}
[ -n "$default_metric" ] && uci set qmodem.${cfg}.default_metric=${default_metric}
}
add_pcie_slot_cfg()
{
cfg=$1
cfg_slot=$2
alias=$3
net_led=$4
sim_led=$5
associated_usb=$6
gpio=$7
gpio_up=$8
gpio_down=${9}
default_metric=${10}
uci set qmodem.${cfg}=modem-slot
[ -n "$cfg_type" ] && uci set qmodem.${cfg}.type=pcie
[ -n "$cfg_slot" ] && uci set qmodem.${cfg}.slot=${cfg_slot} [ -n "$cfg_slot" ] && uci set qmodem.${cfg}.slot=${cfg_slot}
[ -n "$net_led" ] && uci set qmodem.${cfg}.net_led=${net_led} [ -n "$net_led" ] && uci set qmodem.${cfg}.net_led=${net_led}
[ -n "$alias" ] && uci set qmodem.${cfg}.alias=${alias} [ -n "$alias" ] && uci set qmodem.${cfg}.alias=${alias}