Bug 219394

Summary: [BISECTED][REGRESSION] WIFI Hotspot broken by commit 5c38bedac16
Product: Drivers Reporter: Jingyuan Deng (1700011628)
Component: network-wireless-intelAssignee: Default virtual assignee for network-wireless-intel (drivers_network-wireless-intel)
Status: CLOSED WILL_NOT_FIX    
Severity: normal CC: 1700011628, emmanuel.grumbach, gabriel.mantei, kingwingshit
Priority: P3    
Hardware: All   
OS: Linux   
URL: https://github.com/lakinduakash/linux-wifi-hotspot/issues/435
Kernel Version: 6.11 Subsystem:
Regression: Yes Bisected commit-id: 5c38bedac16a946402b627621b3d4bfcc9952479

Description Jingyuan Deng 2024-10-17 12:14:41 UTC
Although full support of multi-channel may not be available for `iwlwifi` , multi-channel operation is helpful for some special services like hotspot. For example, it is possible to use multi-channel operation to create Hotspot at the same time connected to a WIFI AP. See https://github.com/lakinduakash/linux-wifi-hotspot for details.  

Commit 5c38bedac16a946402b627621b3d4bfcc9952479 bans multi-channel operation for `iwlwifi`. So that such Hotspot is not available anymore. See https://github.com/lakinduakash/linux-wifi-hotspot/issues/435 for details.   

I suggest thinking about some revision not to ban multi-channel operation totally.
Comment 1 Emmanuel Grumbach 2024-10-22 06:18:27 UTC
You should be using p2p_group_add instead of adding a hotspot.
You'll get the same feature set, but then, you'll be able to add the GO because we'll be allowed to use the Notice Of Absence.
Comment 2 Emmanuel Grumbach 2024-10-22 06:21:00 UTC
I am closing this since it is not a bug on the wifi side and there is a solution to keep your use case working: not using hostapd, but rather using p2p_group_add command in wpa_supplicant.
Comment 3 Gabriel Mantei 2025-01-18 22:35:36 UTC
I'm sorry to come in late, but by now I use a kernel on my distribution (manjaro) that is affected by this change. I want to argue, that wifi-p2p doesn't give the same features as a hotspot and isn't even supported for dumb linux users like me. When looking at android and windows (and I would guess apple too), they have a prominent feature to open a hotspot even if the single wifi-adapter is already connected to a network. The option for wifi-p2p / Wifi Direct is well hidden. On linux there are no guis for p2p available. As recommended I tried to get wifi-p2p working and jumped through a lot of hoops. But I couldn't get my linux pc connect to an android phone and am even further away from a wifi bridge. Please see some of the steps I tried. This is not a call for support, rather an example that wifi-p2p isn't supported (yet?) on linux desktops. But if someone wants to get me going again in my course to setup a wireless bridge with wifi-p2p, I'm happy to hear.
> 
> 
>* wifi bridge works on this machine with linux-wifi-hotspot and kernel 6.6
>* I was loosely following this 9 year old post [1]
>* I was trying to understand [2] but didn't
>* I can connect my android to another android via Wifi Direct
>* firewall, dnsmasq.conf, interface capabilities should all check out
>* I can see the connection attempts on the phone, but none go through to a
>working connection
> 
>```
>uname -r             # returns 6.12.4-1-MANJARO
>sudo dnsmasq
> 
>nmcli con add type wifi-p2p peer mac:aa:of:phone autoconnect no ipv4.addresses
>>192.168.12.1/24 ipv4.method manual
>nmcli con up wifi-p2p
># not working
> 
>### new attempt
>echo 'ctrl_interface=/var/run/wpa_supplicant
>ap_scan=1
>device_name=My-pc
>device_type=1-0050F204-1
>driver_param=use_p2p_group_interface=1' > /home/user/wpa_supplicant.conf
>nmcli radio wifi off
>rfkill unblock wlan
>sudo wpa_supplicant -Dnl80211 -iwlp3s0 -c/home/user/wpa_supplicant.conf
>sudo wpa_cli
> > p2p_find
> > p2p_peers             # returns mac:aa:of:phone
> > p2p_connect mac:aa:of:phone 45629034 display persistent
>sudo ip addr add 192.168.12.1/24 dev p2p-wlp3s0-0
># connected but disconnected after several seconds
> 
>### another attempt 
>sudo wpa_supplicant -Dnl80211 -iwlp3s0 -c/home/user/wpa_supplicant.conf
>sudo wpa_cli
> > p2p_find
> > p2p_peers             # returns mac:aa:of:phone
> > p2p_connect mac:aa:of:phone 45629034 wps_pbc
>sudo ip addr add 192.168.12.1/24 dev p2p-wlp3s0-0
># android responds, but can't get over 'CTRL-EVENT-EAP-FAILURE'
> 
>### again
>sudo wpa_supplicant -Dnl80211 -iwlp3s0 -c/home/user/wpa_supplicant.conf
>sudo wpa_cli -i wlp3s0 p2p_group_add
>sudo ip addr a 192.168.12.1/24 dev p2p-wlp3s0-0
>sudo wpa_cli
> > p2p_find
> > p2p_peers             # returns mac:aa:of:phone
> > p2p_connect mac:aa:of:phone 45629034 display persistent
># fails with error 'Failed to create interface p2p-wlp3s0-0: -23 (Too many
>open files in system)'
>```
> 
I'm not sure whether all of this is valid from a kernel point of view, but I still hope that the repeater/hotspot usecase can get enabled again either in kernel or as a user application for wifi-p2p.
> 
>[1](https://stackoverflow.com/questions/31877144/how-to-set-up-a-wifi-direct-connection-between-android-and-linux)
>[2](https://w1.fi/cgit/hostap/tree/wpa_supplicant/README-P2P)
Comment 4 kingwingshit 2025-02-04 19:44:47 UTC
I just registered to comment on this problem. 

Arch Linux's pacman just updated to linux-6.12.12-1, and my create_ap does not work while connecting to a WiFi. 

In my case, I run samba(smb) to share files on 192.168.12.0/24 only as well as port 22 for speed and security.