I recently upgraded from my old Macbook to a Lenovo T450s - which is a great machine, only it has one little flaw: The wifi connection is unstable when you run Linux without an AC connected. On battery power, I experience a packet loss of somewhere between 30% and 75% with frequent disconnects.
This blogpost suggests, that it may be a faulty implementation of the 802.11n protocol in the iwlwifi driver.
So, to remedy the situation first check that the solution applies to you:
$> lspci | grep Network 03:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)
lspci should yield something like the above, a Network controller of the 726x family. The problem with these controllers seems to be a negative interference of the 802.11n protocol and bluetooth in the iwlwifi-driver, which leaves you with two options: You can either disable 802.11n, which slows down wifi connections, that use this standard, or you can disable bluetooth coexistence.
For the former, you can disable 11n functionality by passing the corresponding kernel module parameter. For that, make a config file iwlwifi.conf in /etc/modprobe.d/ and enter
options iwlwifi 11n_disable=1
If you would rather disable bluetooth coexistence (my prefered choice), make the same file but enter
options iwlwifi bt_coex_active=N
You can also use modprobe to make that change apply temporarily and immediately - or you can do the permanent solutions above and reboot.
Update: I have also of course disabled the power saving capabilites of the wifi card. I haven’t verified if this is important or not for the wifi stability to improve, but just in case… I did this in the config options of TLP
Update: Tried Thisco’s comment about the interference of 802.11n and bt coexistence and changed the entry accordingly.