From 0f520ceee2b1fcb3ca943a621d7b5a569e6fca38 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 14 May 2024 18:07:33 +0100 Subject: [PATCH] create cdc-ncm module --- examples/l2tp.nix | 2 +- modules/cdc-ncm/default.nix | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 modules/cdc-ncm/default.nix diff --git a/examples/l2tp.nix b/examples/l2tp.nix index 6aa983a..e755a89 100644 --- a/examples/l2tp.nix +++ b/examples/l2tp.nix @@ -20,7 +20,7 @@ in rec { }; imports = [ -# ../modules/wlan.nix + ../modules/cdc-ncm ../modules/network ../modules/vlan ../modules/ssh diff --git a/modules/cdc-ncm/default.nix b/modules/cdc-ncm/default.nix new file mode 100644 index 0000000..0e030f2 --- /dev/null +++ b/modules/cdc-ncm/default.nix @@ -0,0 +1,22 @@ +{ config, ... }: +{ + config = { + kernel.config = { + USB_NET_HUAWEI_CDC_NCM = "y"; + USB_USBNET = "y"; + USB_SERIAL = "y"; + USB_SERIAL_OPTION = "y"; + }; + + # an ncm ethernet adaptor does + # * usb modeswitch + # * AT commands + # and then behaves like a link. + + # we could identify by vid:pid but that's a bit awkward + # if there's more than one present. IMEI? + + # https://stackoverflow.com/questions/5477882/how-to-i-detect-whether-a-tty-belonging-to-a-gsm-3g-modem-is-a-data-or-control-p + }; +} +