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

Improve wired/wireless NICs support #2761

Closed
wants to merge 6 commits into from

Conversation

FlyGoat
Copy link

@FlyGoat FlyGoat commented Sep 21, 2023

Hi,

This PR enabled various USB/PCIe wired/wireless NICs in Kconifg and their firmware in buildroot config, so there will be no suprise on ethernet support for OS users.

All configs are derivived from debian's kernel config: https://salsa.debian.org/kernel-team/linux/-/blob/master/debian/config/config

Please review, thanks!

@home-assistant
Copy link

Hi @FlyGoat

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

Copy link
Member

@agners agners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, in Home Assistant OS we so far have been enabling drivers on a as-needed basis. I am not against bulk enabling drivers, where it make sense. But we should avoid unnecessary kernel bloat to keep things clean as much as possible.

CONFIG_IWLMVM=m

CONFIG_WLAN_VENDOR_REALTEK=y
CONFIG_RTL_CARDS=m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also required by some USB adapters, so I think this and the above should stay in here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agners I think OVA included device-support.config as well? Those are moved to device-support.config.

CONFIG_RTL_CARDS=m
CONFIG_RTL8723BE=y

CONFIG_BCMA=m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this driver can be used on non PCIe targets as well. Not sure if that is actually the case though.

CONFIG_BT_HCIBTUSB=m
CONFIG_BT_HCIBTUSB_AUTOSUSPEND=y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that this doesn't lead to problems?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debian is doing that for years, if it doesn't sound right I'll just remove this :-)

@FlyGoat
Copy link
Author

FlyGoat commented Sep 21, 2023

In general, in Home Assistant OS we so far have been enabling drivers on a as-needed basis. I am not against bulk enabling drivers, where it make sense. But we should avoid unnecessary kernel bloat to keep things clean as much as possible.

I was a little bit frustrated finding that either BCM4356 on my BarTrail mini-PC and a MediaTek USB wireless adaptar won't work with HAOS, so I spent my time on align HAOS NIC support with other Linux distros.

I think NIC, as are essential device for HAOS to work, shouldn't give user any suprise on driver issues. After bulk enabling NIC drivers HAOS can reassure users like "if your ethernet card works on other distros, it will work for us as well".

@FlyGoat
Copy link
Author

FlyGoat commented Sep 21, 2023

Hmm, ouch I just notified that I'm enabling some extra drivers that is not in kernel 6.1 yet.
What do you perfer me to do with those configs? Leave them there for easier kernel upgrade in future or document them else where?

@agners
Copy link
Member

agners commented Sep 21, 2023

Leave them there for easier kernel upgrade in future or document them else where?

I'd prefer if you could list those elsewhere, so we can add them on next kernel update.

@patryk4815
Copy link

patryk4815 commented Sep 28, 2023

related: #2776

Please, copy all firmware files for mediatek.

@agners
Copy link
Member

agners commented Oct 3, 2023

I've created two builds to check the impact of this change:

The kernel image size got about 500KiB smaller (from 14803808 bytes to 14803808 bytes, presumably because some drivers changed from built-in to modules).

The compressed size of the rootfs squashfs changed from 228MB to 246MB, so a growth of 18MB. The rootfs partition where the rootfs squashfs is stored is 256MB (for A slot as well as B slot). Without re-partitioning we cannot grow beyond that.

That means we have less than 10MB spare after this change, which is really making me a bit uncomfortable. 😰

@patryk4815
Copy link

@agners You can enable CONFIG_MODULE_COMPRESS and it will compress modules ;)

Right now it is disabled in HAOS:

# zcat /proc/config.gz | grep 'CONFIG_MODULE_COMPRESS'
CONFIG_MODULE_COMPRESS_NONE=y
# CONFIG_MODULE_COMPRESS_GZIP is not set
# CONFIG_MODULE_COMPRESS_XZ is not set
# CONFIG_MODULE_COMPRESS_ZSTD is not set

@agners
Copy link
Member

agners commented Oct 3, 2023

@agners You can enable CONFIG_MODULE_COMPRESS and it will compress modules ;)

That doesn't help much as the whole squashfs based rootfs is compressed already.

CONFIG_DUMMY=m
CONFIG_NET_FC=y
CONFIG_NET_SB1000=m
CONFIG_VMXNET3=m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This driver is used on VMs only and already enabled in the ova kernel config.

Suggested change
CONFIG_VMXNET3=m

Comment on lines +106 to +107
CONFIG_PCI_HYPERV=y

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Suggested change
CONFIG_PCI_HYPERV=y

BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_22000=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_22260=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_3160=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_3168=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_3945=y
BR2_PACKAGE_LINUX_FIRMWARE_IWLWIFI_4965=y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for removing those?

@agners
Copy link
Member

agners commented Oct 4, 2023

We should split up this PR a bit. The wired NIC support probably doesn't add as much as there is no additional firmware required typically. I am inclined to merge such a change, even when it enables things in bulk.

However, on the wireless end we might need to filter out a bit more what is actively used.

@FlyGoat
Copy link
Author

FlyGoat commented Oct 4, 2023

We should split up this PR a bit. The wired NIC support probably doesn't add as much as there is no additional firmware required typically. I am inclined to merge such a change, even when it enables things in bulk.

However, on the wireless end we might need to filter out a bit more what is actively used.

Yes that was something I'm trying to investigate in past weeks. The problem is, 6.1 LTS doesn't support some of very popular wireless NICs especially 11ax one. I was messing around linux-backport with buildroot bit that's probably too much hassle.

@agners
Copy link
Member

agners commented Oct 4, 2023

Yes that was something I'm trying to investigate in past weeks. The problem is, 6.1 LTS doesn't support some of very popular wireless NICs especially 11ax one. I was messing around linux-backport with buildroot bit that's probably too much hassle.

While I prefer to use the LTS versions of the kernel, we did use non-LTS in the past for particular boards to get the latest versions of certain drivers. So before doing to much work on backports etc, probably moving to a regular stable kernel is the better approach.

That said, this should be the third step 😄 Enabling what is available on 6.1 should be first.

FYI, we intend to release a first 11.0.rc1 probably tomorrow.

@agners agners mentioned this pull request Oct 9, 2023
sairon added a commit that referenced this pull request Nov 30, 2023
Preemptively enable larger set of WiFi drivers for all platforms and add more firmwares for them with the aim to harmonize WiFi device support among all boards and to have implicit support of devices that users might want to use.  Targets `generic_aarch64`, `generic_x86_64` and `ova` also include options and firmwares for cards that are using PCI/PCIe bus - support for these is in a separate config fragment.

Especially the `generic_x86_64` is currently very tight with the rootfs space, so I had to do some triaging and select only sensible drivers and firmwares - especially archaic PCMCIA devices or devices not supporting only 802.11g or lower standards were among the first that I removed during the triaging - we can consider enabling those but this time on an someone's explicit need to have them enabled.

This closes #2815 and replaces large part of #2761, also potentially addresses (at least) these: #2806, #2783, #2841, #2776, #2725, #2600

-------------

* Remove WiFi options from generic and board kernel config fragments
* Enable MMC in OVA kernel
   This is needed for SDIO drivers to work. Use the same options as we
   currently use for generic_x86_64.
* Add CRYPTO_MICHAEL_MIC to the common kernel config
   This is requirement for TKIP and is a dependency of ATH11K driver.
* Add kernel config fragments with wireless cards support
* Add firmwares for WiFi cards
* Enable more Bluetooth device drivers
@agners
Copy link
Member

agners commented Dec 21, 2023

Most of the aim of this PR has been addressed by the PR's linked. HAOS 11.3 will support many more WiFi devices as well as a couple more USB/PCIe network devices. If anything is still missing, please feel free to send a PR and enable the driver as required.

@agners agners closed this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants