Skip to content

Commit c7cdba3

Browse files
Databeanjmberg-intel
authored andcommitted
mac80211-next: rtnetlink wifi simulation device
This device takes over an existing network device and produces a new one that appears like a wireless connection, returning enough canned responses to nl80211 to satisfy a standard connection manager. If necessary, it can also be set up one step removed from an existing network device, such as through a vlan/80211Q or macvlan connection to not disrupt the existing network interface. To use it to wrap a bare ethernet connection: ip link add link eth0 name wlan0 type virt_wifi You may have to rename or otherwise hide the eth0 from your connection manager, as the original network link will become unusuable and only the wireless wrapper will be functional. This can also be combined with vlan or macvlan links on top of eth0 to share the network between distinct links, but that requires support outside the machine for accepting vlan-tagged packets or packets from multiple MAC addresses. This is being used for Google's Remote Android Virtual Device project, which runs Android devices in virtual machines. The standard network interfaces provided inside the virtual machines are all ethernet. However, Android is not interested in ethernet devices and would rather connect to a wireless interface. This patch allows the virtual machine guest to treat one of its network connections as wireless rather than ethernet, satisfying Android's network connection requirements. We believe this is a generally useful driver for simulating wireless network connections in other environments where a wireless connection is desired by some userspace process but is not available. This is distinct from other testing efforts such as mac80211_hwsim by being a cfg80211 device instead of mac80211 device, allowing straight pass-through on the data plane instead of forcing packaging of ethernet data into mac80211 frames. Signed-off-by: A. Cody Schuffelen <[email protected]> Acked-by: Alistair Strachan <[email protected]> Acked-by: Greg Hartman <[email protected]> Acked-by: Tristan Muntsinger <[email protected]> [make it a tristate] Signed-off-by: Johannes Berg <[email protected]>
1 parent cc1068e commit c7cdba3

File tree

3 files changed

+641
-0
lines changed

3 files changed

+641
-0
lines changed

drivers/net/wireless/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,11 @@ config USB_NET_RNDIS_WLAN
114114

115115
If you choose to build a module, it'll be called rndis_wlan.
116116

117+
config VIRT_WIFI
118+
tristate "Wifi wrapper for ethernet drivers"
119+
depends on CFG80211
120+
---help---
121+
This option adds support for ethernet connections to appear as if they
122+
are wifi connections through a special rtnetlink device.
123+
117124
endif # WLAN

drivers/net/wireless/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o
2727
obj-$(CONFIG_USB_NET_RNDIS_WLAN) += rndis_wlan.o
2828

2929
obj-$(CONFIG_MAC80211_HWSIM) += mac80211_hwsim.o
30+
31+
obj-$(CONFIG_VIRT_WIFI) += virt_wifi.o

0 commit comments

Comments
 (0)