Skip to content

Instantly share code, notes, and snippets.

@HeySora
Last active May 17, 2024 11:04
Show Gist options
  • Save HeySora/d720554aa5564a7800de8eca45403ef7 to your computer and use it in GitHub Desktop.
Save HeySora/d720554aa5564a7800de8eca45403ef7 to your computer and use it in GitHub Desktop.
WWAN SSDT for ThinkPad T490s (Fibocom L850-GL)
// This SSDT is essentially sending "CAP_EXP+10.w=0052" as well as a RST() call
// in order to switch the Fibocom WWAN card to USB mode.
// This is fully working on my ThinkPad T490s (20NX*), but I cannot guarantee
// that this code will work for you as well. Read below for instructions for other brands.
// There might be issues when going out of sleep mode? I vaguely recall
// having rare issues in these cases. Going in sleep mode and going out fixed it.
// There are probably better ways to do something like this...
// Please note that you need to remove the FCC Lock of your card!
// -HeySora <@HeeySora / heysora.net>
// FOR OTHER BRANDS / OTHER MODELS
// "CAP_EXP+10", on my system, is located at the PCI address "@80", which is 0x50 in hex.
// This is the 0x50 you see in the OperationRegion declaration below.
// In order to find your actual PCI address (which should NOT be different, but just in case...),
// you first need to use Linux, and find your PCI address (e.g.: 0000:3b:00.0) via `lspci`, and
// then execute this command (replacing "0000:3b:00.0" with your own PCI address!)
// setpci -v -s 0000:3b:00.0 "CAP_EXP+10.w"
// On my end, the result is "0000:3b:00.0 (cap 10 @70) @80 = 0142"
// The interesting info, here, is that "@80", being the address of "CAP_EXP+10".
// Convert that value to hexadecimal (80 => 0x50), then put it in the OperationRegion.
DefinitionBlock("", "SSDT", 2, "HeySora", "WWAN", 0)
{
// WWAN card, at least in my own DSDT. Your mileage may vary.
// If yours is different, simply replace all occurences of "RP07"!
External (_SB.PCI0.RP07, DeviceObj)
External (_SB.PCI0.RP07.PXSX._RST, MethodObj)
// OS Is Darwin?
External (OSDW, MethodObj) // 0 Arguments
Scope(_SB.PCI0.RP07)
{
// Dummy OperationRegion + Field, in order to be able to write to the proper byte.
OperationRegion (AAAA, PCI_Config, 0x50, 0x02)
Field (AAAA, AnyAcc, NoLock, Preserve)
{
BBBB, 16,
}
Method (PINI, 0, NotSerialized)
{
// Only act if it is running on macOS.
If (OSDW ())
{
// Set the actual byte
BBBB = 0x52
// Reset the WWAN card, effectively restarting it into USB mode.
\_SB.PCI0.RP07.PXSX._RST ()
}
}
}
}
@HeySora
Copy link
Author

HeySora commented Aug 9, 2023

If what you're getting out of lspci is "0000:03:00.0", then you need to do setpci -v -s 0000:03:00.0 "CAP_EXP+10.w".
The 0000:3b:00.0 part is what needs to be replaced with whatever address lspci gives you.

@BloodLancet
Copy link

I got setpci: 0000:03:00.0: Instance #0 of Capabilty 0010 not found - there are no capabilities with that id

@HeySora
Copy link
Author

HeySora commented Aug 9, 2023

Please make sure you are typing the command correctly and not adding spaces where there shouldn't be. The syntax has to strictly match.
I unfortunately cannot assist you further, as I do not own your model of laptop.

@Einstonoy
Copy link

Einstonoy commented Aug 12, 2023

Hey man, I got the same response like 'BloodLancet':Instance #0 of Capabilty 0010 not found - there are no capabilities with that id.
I try a lot but it remains same, could you explain the meaning of "CAP_EXP+10.w" and what exact the effect mean, is there another way to get this offset by command like "CAP_PM" or "CAP_MSI", it is really frustrated that I have been stuck in things like this for days, hope you could help me.
Anyway, thinks a lot for your good work.

@Einstonoy
Copy link

I doubt the @80 you mentioned in the dsl file means the decimal No. shows in Ubuntu, the first No. I got by lspci and setpci is 40, however hexadecimal 0x28 then was used, but it ends bad, remains no work

@HeySora
Copy link
Author

HeySora commented Aug 13, 2023

If you cannot find any capability called CAP_EXP, that means you have a variant of L850-GL that is not compatible with USB-MBIM; which unfortunately makes your hardware not compatible with this SSDT. There is nothing that can be do neto assist, as this SSDT focuses on the (vast) majority of L850-GL/XMM7360 modems that are able to switch into USB-MBIM.

Without that capability, your card cannot be used on macOS, period.

@Einstonoy
Copy link

Alright then, I would purchase a usb model like em7430 to realize the wwan function, but now I should mod the bios and release the white list first. It seems the only way to get wwan function in my laptop in different OS (MacOS, Ubuntu and Win).

@dolame
Copy link

dolame commented Mar 27, 2024

how can I find my device's value is "RP07" or other

@limin9988
Copy link

limin9988 commented Mar 29, 2024

awesome work , mind share how to remove the fcc lock?thanx in advance

@karnadii
Copy link

karnadii commented May 17, 2024

I am using T440p and my modem is L860 GL

I initially want to use this DSDT for my L860 GL modem, but unfortunately when I try to search for my modem PCI, I couldn't find it because linux already has a driver for it and my modem automatically assigned as USB cdc_acm/cdc_ncm.

But I tried it without this DSDT, Since the USB interface already mapped in my USB kext, and yeah without any kext and ssdt the fibocom l860 gl recognized by the native cdc_acm driver.

In Ventura and Sonoma it will still be recognized, you will not be able to configure the connection, since apple as decided to ditchsupport for dial up modem. Apple won’t help you set up your dial-up modem anymore.

I don't know about monterey, I tried this one with big sur. and I am writing and editing this comment using the dial up connection from my l860 modem. it is hard to see the signal strength, maybe I will write a shell script to show the signal strength and other misc info.

If anyone having a failure setting l850, maybe you can bought new modem and replace your L850 with L860 since it pretty much work Out of the box.

@karnadii
Copy link

Screen Shot 2024-05-17 at 03 36 44
Screen Shot 2024-05-17 at 03 37 48
Screen Shot 2024-05-17 at 03 51 41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment