brcmfmac: add support to move wiphy instance into network namespace
authorArend Van Spriel <arend.vanspriel@broadcom.com>
Tue, 28 Mar 2017 10:43:26 +0000 (11:43 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 5 Apr 2017 12:42:19 +0000 (15:42 +0300)
commit0cc0236cf713a9ecfcf902e35bd098bc179265a8
treee8ca072994e8861add78ec2dd5a17f2355253ad9
parent8f9dd1a974380ebe2d7bf82df4e6ba6bfb89c575
brcmfmac: add support to move wiphy instance into network namespace

To support network namespace the driver must assure all created
network interfaces are in the same namespace as the wiphy instance
and flag the support using WIPHY_FLAG_NETNS_OK.

Verified using two terminals:

 Terminal 1 Terminal 2
 -------------------------- ---------------------------------
 # ip netns add brcm-wifi # iw dev
phy#0
Interface wlan3
ifindex 11
wdev 0x1
 # ip netns exec brcm-wifi bash
 # iw dev
 # echo $$
 20337 # iw phy0 set netns 20337
 # iw dev
 phy#0
Interface wlan3
ifindex 11
wdev 0x2
 # iw phy0 interface add wl3.ap type __ap
 # iw dev
 phy#0
Interface wl3.ap
ifindex 2
wdev 0x3
Interface wlan3
ifindex 11
wdev 0x2
# iw dev
 # iw phy0 set netns 1
 # iw dev
# iw dev
phy#0
Interface wl3.ap
ifindex 2
wdev 0x5
Interface wlan3
ifindex 11
wdev 0x4

Note:
increasing wdev identifier above indicates issue in
cfg80211 which is addressed separately.

Tested-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c