Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wireless interface not showing up for ralink usb #30422

Closed
bmabsout opened this issue Oct 14, 2017 · 10 comments
Closed

wireless interface not showing up for ralink usb #30422

bmabsout opened this issue Oct 14, 2017 · 10 comments

Comments

@bmabsout
Copy link

bmabsout commented Oct 14, 2017

I have a ralink rt5370 wireless usb adapter.
the interface does not show up in ifconfig -a nor in iw dev
i tried setting

hardware.enableAllFirmware = true;
hardware.enableRedistributableFirmware = true;
boot.kernelModules = [ "rt2800usb" ];

after that when I lsmod | grep rt2800 it shows up but the interface still doesn't.
if i modinfo rt2800usb | grep 5370 nothing gets returned meaning the 5370 driver is disabled in nixos's kernel config?

Technical details

  • System: NixOS: 17.09.1535.1fdca25ee8 (Hummingbird)
  • Nix version: 1.11.15
  • Nixpkgs version: 17.09.1535.1fdca25ee8
  • Sandboxing enabled: false
@emmanuelrosa
Copy link
Contributor

emmanuelrosa commented Oct 15, 2017

I don't think you've got the required firmware installed. Take a look here to see which firmware packages NixOS has (make sure to change the branch to your release branch). Also check here for general info on using the driver.

@bmabsout
Copy link
Author

it's part of firmware-linux-nonfree on debian, which is enabled in nixos when i do hardware.enableRedistributableFirmware = true; but even though it is loaded. it doesn't detect my usb. But in arch linux the usb is detected fine. Also the debian page shows the output of modinfo rt2800usb | grep 5370 as not being empty. Sorry if im missing something I am new to this.

@emmanuelrosa
Copy link
Contributor

No, problem. Have you checked dmesg for errors regarding the device? If the firmware is being loaded you should see a log entry which looks like: rt280: Loading firmware version ... It may not say rt2800 exactly. You can check your Arch Linux system for the exact log entry.

@bmabsout
Copy link
Author

both of them show : usbcore: registered new interface driver rt2800usb
and after that arch says it renamed the interface to something like wlp1n0
but nixos does nothing.

@emmanuelrosa
Copy link
Contributor

OK, the problem is the RT800USB driver does not include support for the RT5370 by default; It has to be enabled explicitly (since only the RT2800USB_RT55XX option is enabled by default). Along with boot.kernelModules = [ "rt2800usb" ]; you'll need something like this:

nixpkgs.config.packageOverrides = pkgs:
  { linux_4_9 = pkgs.linux_4_9.override {
      extraConfig =
        ''
          RT2800USB_RT53XX y
        '';
    };
  };

What that does is override the NixOS kernel package so that you can set custom kernel configuration options, this this case adding support for the RT5370 to the RT800USB driver. Just make sure you check your kernel version with uname -a; it could be 4.9 or 4.13.

You can see all the driver's configuration options here: https://github.com/torvalds/linux/blob/master/drivers/net/wireless/ralink/rt2x00/Kconfig#L175 and how to enable kernel options as shown above here: https://nixos.org/nixos/manual/index.html#sec-kernel-config

@bmabsout
Copy link
Author

This worked thank you! But shouldn't this be on by default? also I tried this hoping it works but it didn't

system.requiredKernelConfig = with config.lib.kernelConfig; [
    (isYes "RT2800USB_RT53XX")
];

@emmanuelrosa
Copy link
Contributor

No, it shouldn't be on by default because that option requires the module to be enabled first, which in turn would require the module to be enabled always; a strategy that would need to a bloated kernel when applied consistently.

A better alternative would be for a way to turn options on only when their respective modules are enabled. in pseudo-code: if module x is enabled then enable options X, Y, and Z

@dezgeg
Copy link
Contributor

dezgeg commented Oct 17, 2017

No, it doesn't bloat the kernel image itself, it only affects rt2x00lib.ko. It would be just fine to enable all of these that are currently missing:

# CONFIG_RT2800USB_RT3573 is not set
# CONFIG_RT2800USB_RT53XX is not set
# CONFIG_RT2800USB_UNKNOWN is not set

@puffnfresh
Copy link
Contributor

Looks like this was fixed. Is that right @bmabsout ?

@bmabsout
Copy link
Author

yes

@dezgeg dezgeg closed this as completed Sep 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants