wwan config
This commit is contained in:
parent
bab51dc705
commit
31a65be242
2
TODO.md
2
TODO.md
|
@ -5,7 +5,7 @@
|
|||
|
||||
- user settings:
|
||||
- wifi networks
|
||||
- wwan enabled/disabled, plus apn
|
||||
- ✓ wwan enabled/disabled, plus apn
|
||||
- screen brightness level
|
||||
|
||||
- squeak
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
; Pinephone:
|
||||
<require-service <qmi-wwan "/dev/cdc-wdm0">>
|
||||
<depends-on <qmi-wwan "/dev/cdc-wdm0"> <service-state <daemon eg25-manager> up>>
|
||||
<daemon eg25-manager "eg25-manager">
|
||||
|
||||
; More generally:
|
||||
|
||||
? <user-setting <mobile-data-enabled>> [
|
||||
? <user-setting <mobile-data-apn ?apn>> [
|
||||
? <run-service <qmi-wwan ?dev>> [
|
||||
<require-service <daemon <qmi-wwan-manager $dev $apn>>>
|
||||
$log ! <log "-" { line: "starting wwan manager", dev: $dev, apn: $apn }>
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
? <run-service <daemon <qmi-wwan-manager ?dev ?apn>>> [
|
||||
<daemon <qmi-wwan-manager $dev $apn> ["/usr/lib/synit/qmi-wwan-manager" $dev $apn]>
|
||||
]
|
|
@ -42,6 +42,9 @@
|
|||
$machine ? <interface ?ifname _ normal up up carrier _> [
|
||||
$config <configure-interface $ifname <dhcp>>
|
||||
]
|
||||
$machine ? <interface ?ifname _ normal up unknown carrier _> [
|
||||
$config <configure-interface $ifname <dhcp>>
|
||||
]
|
||||
|
||||
$machine ? <route ?addressFamily default _ _ _ _> [
|
||||
$config <default-route $addressFamily>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
dev="$1"
|
||||
apn="$2"
|
||||
echo "Starting QMI manager for device $dev, APN $apn"
|
||||
|
||||
netdev=$(qmicli --device=$dev --device-open-proxy --get-wwan-iface)
|
||||
echo "QMI network device for $dev is $netdev"
|
||||
|
||||
if qmicli --device=$dev --device-open-proxy --wda-get-data-format | grep 'Link layer protocol' | grep -q raw-ip
|
||||
then
|
||||
echo "Setting raw-ip mode for $netdev"
|
||||
ip link set dev $netdev down
|
||||
echo Y > /sys/class/net/$netdev/qmi/raw_ip
|
||||
ip link set dev $netdev up
|
||||
fi
|
||||
|
||||
echo "Starting network for $netdev"
|
||||
exec qmicli --device=$dev --device-open-proxy --wds-start-network="ip-type=4,apn=$apn" --wds-follow-network
|
Loading…
Reference in New Issue