Lenovo X1 Carbon Gen 9

OP
jbodenmann

jbodenmann

Well-Known Member

Reaction score: 238
Messages: 454

yjqg6666 as I understand it's somewhat necessary to run 13.0-STABLE instead of 13.0-RELEASE on this machine in order to use the new wireless driver. Is that correct?
 

yjqg6666

New Member

Reaction score: 15
Messages: 17

yjqg6666 as I understand it's somewhat necessary to run 13.0-STABLE instead of 13.0-RELEASE on this machine in order to use the new wireless driver. Is that correct?
You'd better to use stable/13 from snapshot or git. mkdir /usr/src; cd /usr/src && git clone -b stable/13 https://git.freebsd.org/src.git . . From the latest commit, i see the iwlwifi patch has been merged into the branch. You may only need to apply the LTE modem patch(if your model had Quectel EM05).
 
OP
jbodenmann

jbodenmann

Well-Known Member

Reaction score: 238
Messages: 454

Thank you for providing all this valuable information. I'm currently building stable/13.

Yep, I ordered the machine with the Quectel modem. That's a very low priority for me right now tho. I'll first try to get WiFi & Bluetooth working as per your helpful posts :)
 

diizzy

Aspiring Daemon

Reaction score: 193
Messages: 577

If you're going to build from source you probably want to at least set CPUTYPE.

Here's what I use for example however you might need LIB32 in some cases.

/etc/make.conf (CPUTYPE needs to be changed)
Code:
CPUTYPE?=cortex-a53
WITHOUT_DEBUG=YES
MK_PROFILE=no
# These only affects ports
OPTIONS_UNSET=DOCS EXAMPLES NLS MANPAGES TEST
OPTIONS_SET=LTO

/etc/src.conf
Code:
WITHOUT_DEBUG_FILES=1
WITHOUT_LIB32=1
WITHOUT_KERNEL_SYMBOLS=yes
WITHOUT_TESTS=yes
WITHOUT_PROFILE=yes
WITH_MALLOC_PRODUCTION=yes
WITHOUT_LLVM_ASSERTIONS=yes
WITH_EXTRA_TCP_STACKS=1
 
OP
jbodenmann

jbodenmann

Well-Known Member

Reaction score: 238
Messages: 454

yjqg6666 would you be able to share some information regarding the iwlwifi driver? From what I understand you have that working on 13.0-STABLE, right?

Today I compiled 13.0-STABLE which seems to be running fine. I then followed these instructions to get the iwlwifi driver: https://wiki.freebsd.org/WiFi/Iwlwifi#Getting_code

I downloaded & ran the script mentioned in the wiki under /usr/src and rebuilt the kernel. After rebooting, I tried to load the kernel module by running kldload if_iwlwifi but the module apparently doesn't exist.
My /usr/src is of course tracking stable/13 from https://github.com/freebsd/freebsd-src.

This is the first time I'm compiling my own kernel so I might be missing something obvious here.
 
OP
jbodenmann

jbodenmann

Well-Known Member

Reaction score: 238
Messages: 454

/usr/src/sys/modules/iwlwifi* doesn't exist (and therefore also not the corresponding kernel module.

When applying the patch, I get this:
Code:
root@x1g9:/usr/src # ./iwlwifi.sh
Script expects to run from src/
Fetching patches and tarballs ...
20210904-linuxkpi-latest.tar                           250 kB  603 kBps    00s
20210904-iwlwifi-latest.tar                             25 MB 5134 kBps    05s
20210904-rtw88-latest.tar                             3505 kB 2913 kBps    01s
20210904-net80211-latest.diff                           13 kB   13 MBps    00s
20210904-build-latest.diff                            2878  B   40 MBps    00s
Applying changes related to net80211  ...
Reversed (or previously applied) patch detected!  Assume -R? [y] y
Reversed (or previously applied) patch detected!  Assume -R? [y] y
1 out of 2 hunks failed while patching sys/net80211/ieee80211.c
Reversed (or previously applied) patch detected!  Assume -R? [y] y
Reversed (or previously applied) patch detected!  Assume -R? [y] y
Reversed (or previously applied) patch detected!  Assume -R? [y] y
Reversed (or previously applied) patch detected!  Assume -R? [y] y
Reversed (or previously applied) patch detected!  Assume -R? [y] y

Is this how it works for you guys too? Or am I missing something obvious here?
I am running v0.91 of that script from the website bakul linked.

Looking at the script it would seem like it fails half way through it (while applying the patches). It doesn't even get to extract the tarballs.
What am I doing wrong here? I am on stable/13 from yesterday (and so is /usr/src).
 

bakul

Active Member

Reaction score: 80
Messages: 150

The https://people.freebsd.org/~bz/wireless/apply-wireless-latest.sh script applied fine to a tree with commit ID f8b998c73058. But that was a month or so ago. Just now I asked Zeeb and he says most of the non-driver and non-LinuxKPI changes were comitted and merged and the driver is coming very soon. First in main, then in stable/13, and then he will have clean instructions for main & stable/13. In other words, hold your horses for now! You‘re doing nothing wrong.
 
OP
jbodenmann

jbodenmann

Well-Known Member

Reaction score: 238
Messages: 454

bakul Thank you for this valuable information. How exactly can I stay up-to-date on this matter so I know when I can get the new iwlwifi driver working on my stable/13 machine?
Was Zeeb able to provide any rough guesstimation on this? Is this a matter of days, weeks or months?
I'm familiar with the process of developing something like this so I don't mean to be pushy - just so I know whether I should start investigation some alternative solutions or whether I can just sit tight.
 

grahamperrin

Son of Beastie

Reaction score: 835
Messages: 2,687

… stay up-to-date on this matter …

FWIW, assuming timely updates to the wiki:

1638122705462.png
 

bakul

Active Member

Reaction score: 80
Messages: 150

Subscribe to the freebsd-wireless mailing list to stay up-to-date. And watch related commits! My guess is days but I don’t know how many projects Zeeb may be juggling at the same time or if there are further unforeseen problems. As I had suggested in an earlier message, if you need wifi connectivity now, buy a supported $20 intel wifi card. Running iwlwifi now is strictly for testing; you can’t make plans based on any estimates of when it will be ready.
 

yjqg6666

New Member

Reaction score: 15
Messages: 17

yjqg6666 would you be able to share some information regarding the iwlwifi driver? From what I understand you have that working on 13.0-STABLE, right?

Today I compiled 13.0-STABLE which seems to be running fine. I then followed these instructions to get the iwlwifi driver: https://wiki.freebsd.org/WiFi/Iwlwifi#Getting_code

I downloaded & ran the script mentioned in the wiki under /usr/src and rebuilt the kernel. After rebooting, I tried to load the kernel module by running kldload if_iwlwifi but the module apparently doesn't exist.
My /usr/src is of course tracking stable/13 from https://github.com/freebsd/freebsd-src.

This is the first time I'm compiling my own kernel so I might be missing something obvious here.
jbodenmann When you are building the kernel, any error occurred? When I built the kernel after the patch had applied, the introduced module rtw88 caused the build failed. So I added
Code:
WITHOUT_MODULES = rtw88 rtw88fw
to /etc/make.conf for exclusive build and rebuild the kernel. You need to make sure the buildkernel and installkernel steps have no failure. Before installkernel, you'd better backup your original kernel by cp -Rv /boot/kernel /boot/kernel.orig. After the installation, there should be a file if_iwlwifi.ko in /boot/kernel.
 
OP
jbodenmann

jbodenmann

Well-Known Member

Reaction score: 238
Messages: 454

yjqg6666 The problem I am facing is that the script patching the kernel source doesn't execute completely.

Looking at the wiki history, we have this now:
* 2021-11-28 The driver and firmware went into HEAD (detached from build)

I would assume that this means that now we don't need that patch anymore. I should be able to just `git pull` the latest `stable/13` branch and build regularly without applying any patches or executing any scripts. Is that correct?
I do assume that I'll need something like options iwlwifi or similar. Any ideas where to look that up?

Or am I misunderstanding this node and this is only relevant for -CURRENT (because HEAD)?
 

yjqg6666

New Member

Reaction score: 15
Messages: 17

yjqg6666 The problem I am facing is that the script patching the kernel source doesn't execute completely.

Looking at the wiki history, we have this now:


I would assume that this means that now we don't need that patch anymore. I should be able to just `git pull` the latest `stable/13` branch and build regularly without applying any patches or executing any scripts. Is that correct?
I do assume that I'll need something like options iwlwifi or similar. Any ideas where to look that up?

Or am I misunderstanding this node and this is only relevant for -CURRENT (because HEAD)?
I rebuilt my kernel from the latest commit, got the same result as yours. I will check later. If the tars were not extracted, how about trying to extract them manually?
 
OP
jbodenmann

jbodenmann

Well-Known Member

Reaction score: 238
Messages: 454

Zeeb answered an e-mail on the freebsd-wireless mailing list (extremely quickly btw). That the script doesn't work right now is known.
He's hoping to provide a workable solution within a few days - (quote) For appropriate values of "few". (unquote).
 

yjqg6666

New Member

Reaction score: 15
Messages: 17

yjqg6666 The problem I am facing is that the script patching the kernel source doesn't execute completely.

Looking at the wiki history, we have this now:


I would assume that this means that now we don't need that patch anymore. I should be able to just `git pull` the latest `stable/13` branch and build regularly without applying any patches or executing any scripts. Is that correct?
I do assume that I'll need something like options iwlwifi or similar. Any ideas where to look that up?

Or am I misunderstanding this node and this is only relevant for -CURRENT (because HEAD)?
You may also try to make LTE working to get connected.
 

yjqg6666

New Member

Reaction score: 15
Messages: 17

Zeeb answered an e-mail on the freebsd-wireless mailing list (extremely quickly btw). That the script doesn't work right now is known.
He's hoping to provide a workable solution within a few days - (quote) For appropriate values of "few". (unquote).
jbodenmann You could also checkout the code by commit hash(my initial tested one) and apply the iwlwifi patches.

cd /usr/src
git branch tpx1 b1cca74367374bbb9cdc881c671a9f9525dca313
git checkout tpx1
git cherry-pick 0229172a65765392f566ae1cdc730615ab504e15 #add Quectel EM05 support, merged to main.
bash -x ./apply-wireless-latest.sh
make -j9 buildworld && make -j9 kernel
shutdown -r now
cd /usr/src
make installworld
shutdown -r now
etcupdate # see handbook
 
OP
jbodenmann

jbodenmann

Well-Known Member

Reaction score: 238
Messages: 454

yjqg6666 while waiting for the latest iwlwifi patches/MFCs I wanted to get the Quectel LTE modem up and running.

I pulled the latest stable/13 branch and applied the patch from your PR. Then I built, installed & booted the kernel.
The u3g kernel module loaded successfully. However, I don't have a /dev/cua* or /dev/ttyU* device at all.

I checked my order and it would seem that the laptop I got has this modem: Quectel EM120R-GL 4G/LTE Cat. 12
That would be different from the EM05 that you have (and provided a patch for).

Any ideas how how easy it is to support this model?
Looking at the datasheet it would seem like this module communicates over PCIe rather than USB.
In any case I don't seem to be able to "locate the device" - neither with usbconfig nor pciconf.
I loaded up the BIOS/UEFI to check whether the device might be disabled but that doesn't seem to be the case.

Here's my probe: https://bsd-hardware.info/?probe=8f9e9ddde5
The Quectel doesn't show up there either o_O
 

yjqg6666

New Member

Reaction score: 15
Messages: 17

yjqg6666 while waiting for the latest iwlwifi patches/MFCs I wanted to get the Quectel LTE modem up and running.

I pulled the latest stable/13 branch and applied the patch from your PR. Then I built, installed & booted the kernel.
The u3g kernel module loaded successfully. However, I don't have a /dev/cua* or /dev/ttyU* device at all.

I checked my order and it would seem that the laptop I got has this modem: Quectel EM120R-GL 4G/LTE Cat. 12
That would be different from the EM05 that you have (and provided a patch for).

Any ideas how how easy it is to support this model?
Looking at the datasheet it would seem like this module communicates over PCIe rather than USB.
In any case I don't seem to be able to "locate the device" - neither with usbconfig nor pciconf.
I loaded up the BIOS/UEFI to check whether the device might be disabled but that doesn't seem to be the case.

Here's my probe: https://bsd-hardware.info/?probe=8f9e9ddde5
The Quectel doesn't show up there either o_O
The product: https://www.quectel.com/product/lte-a-em120r-gl
the spec: https://www.quectel.com/wp-content/uploads/2021/03/Quectel_EM120R-GL_LTE-A_Specification_V1.0.pdf

There are two modes, USB mode and pcie-only mode. There are ECM driver, Gobinet driver and QMI_WWAN driver for Linux. Try to search these driver name + freebsd to find out relative native driver.
 

grahamperrin

Son of Beastie

Reaction score: 835
Messages: 2,687

neel

Active Member
Developer

Reaction score: 59
Messages: 139

I don't think modern LTE modems work on FreeBSD, even as "consumer" PCs (not just "enterprise" ones) are getting LTE/5G support. The supported

Two solutions you have:

* If you have an Android phone, you may be able to repeat your Wi-Fi onto a USB tethering. This worked for me on both Pixel and OnePlus devices, with both stock and custom ROMs, but I don't know about other OEMs like Samsung, Huawei, or Xiaomi.

* Get a Ralink USB Wi-Fi dongle. Ralink dongles are the only ones I tested which work on Intel TigerLake and FreeBSD. This is what I do.
 
Top