b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | # Copyright (C) 2016 Velocloud Inc |
| 3 | # Copyright (C) 2016 Aleksander Morgado <aleksander@aleksander.es> |
| 4 | |
| 5 | # Load common utilities |
| 6 | . /usr/share/ModemManager/modemmanager.common |
| 7 | |
| 8 | # We require a interface name |
| 9 | [ -n "${INTERFACE}" ] || exit |
| 10 | |
| 11 | # Always make sure the rundir exists |
| 12 | mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}" |
| 13 | |
| 14 | # Report network interface |
| 15 | mm_log "${ACTION} network interface ${INTERFACE}: event processed" |
| 16 | mm_report_event "${ACTION}" "${INTERFACE}" "net" "/sys${DEVPATH}" |
| 17 | |
| 18 | # Look for an associated cdc-wdm interface |
| 19 | |
| 20 | cdcwdm="" |
| 21 | |
| 22 | case "${ACTION}" in |
| 23 | "add") cdcwdm=$(mm_track_cdcwdm "${INTERFACE}") ;; |
| 24 | "remove") cdcwdm=$(mm_untrack_cdcwdm "${INTERFACE}") ;; |
| 25 | esac |
| 26 | |
| 27 | # Report cdc-wdm device, if any |
| 28 | [ -n "${cdcwdm}" ] && { |
| 29 | mm_log "${ACTION} cdc interface ${cdcwdm}: custom event processed" |
| 30 | mm_report_event "${ACTION}" "${cdcwdm}" "usbmisc" "/sys${DEVPATH}" |
| 31 | } |