From 79e7857642e4b394b05e04c99f90e67322ef80c9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 17 May 2016 19:29:40 +0200 Subject: force sierra wireless to qmi --- hel.nix | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/hel.nix b/hel.nix index 82730878..156a35f9 100644 --- a/hel.nix +++ b/hel.nix @@ -54,18 +54,9 @@ shadow (callPackage ./custom/thinklight.nix { thinklight = "kbd_backlight"; }) (callPackage ./utils/nix/rebuild-system.nix {}) - libmbim libqmi ]; nixpkgs.config.packageOverrides = pkgs: rec { - libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { - patches = [ ./patches/attachment-0003.patch ./patches/attachment.patch ]; - buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.autoconf ]; - }); - libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { - patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; - buildInputs = attrs.buildInputs ++ [ pkgs.automake pkgs.autoconf ]; - }); }; services = { @@ -161,6 +152,38 @@ uucp unix - n n - - pipe flags=Fqhu user=uucp argv=/var/setuid-wrappers/uux -z -a$sender - $nexthop!rmail ($recipient) ''; }; + + udev.extraRules = '' + ACTION!="add|change", GOTO="mbim_to_qmi_rules_end" + SUBSYSTEM!="usb|drivers", GOTO="mbim_to_qmi_rules_end" + + # load qmi_wwan module + SUBSYSTEM=="usb", \ + ATTR{idVendor}=="1199", ATTR{idProduct}=="9079", \ + RUN+="/sbin/modprobe -b qmi_wwan" + + # force Sierra Wireless EM7455 to configuration #1 + SUBSYSTEM=="usb", \ + ATTR{idVendor}=="1199", ATTR{idProduct}=="9079", \ + ATTR{bConfigurationValue}="1" + + # add the new id in the qmi_wwan driver + SUBSYSTEM=="drivers", \ + ENV{DEVPATH}=="/bus/usb/drivers/qmi_wwan", \ + ATTR{new_id}="1199 9079" + + # load qcserial module + SUBSYSTEM=="usb", \ + ATTR{idVendor}=="1199", ATTR{idProduct}=="9079", \ + RUN+="/sbin/modprobe -b qcserial" + + # add the new id in the qcserial driver + SUBSYSTEM=="drivers", \ + ENV{DEVPATH}=="/bus/usb-serial/drivers/qcserial", \ + ATTR{new_id}="1199 9079" + + LABEL="mbim_to_qmi_rules_end" + ''; }; users = { -- cgit v1.2.3