Remove legacy wifi driver

The driver is superseded by the new driver located in the 'pc'
repository.

Fixes #4508.
This commit is contained in:
Josef Söntgen 2022-05-17 17:20:00 +02:00 committed by Christian Helmuth
parent 14bc7b9c6a
commit 573cabaf24
53 changed files with 3 additions and 16096 deletions

View File

@ -33,118 +33,6 @@ library named 'lxip.lib.so'. The IP stack can be interfaced using Genode's
version of 'libc' by linking your application to 'lxip_libc' plugin in your
'target.mk' file.
WiFi
####
The wifi_drv component is a port of the Linux mac802.11 stack, including the
iwlwifi driver as well as libnl and wpa_supplicant, to Genode.
To start the component the following configuration snippet can be used:
!<start name="wifi_drv" caps="200">
! <resource name="RAM" quantum="24M"/>
! <provides><service name="Nic"/></provides>
! <config>
! <libc stdout="/dev/null" stderr="/dev/null" rtc="/dev/rtc"/>
! <vfs>
! <dir name="dev"> <log/> <null/> <rtc/>
! <jitterentropy name="random"/>
! <jitterentropy name="urandom"/>
! </dir>
! </vfs>
! </config>
! <route>
! <service name="Rtc"> <any-child /> </service>
! <any-service> <parent/> <any-child /> </any-service>
! </route>
!</start
The driver will request access to the ROM module 'wifi_config' to
connect to a network:
!<wifi_config connected_scan_interval="30" scan_interval="10" rfkill="no">
! <network ssid="Foobar" protection="WPA2" passphrase="allyourbase"/>
!</wifi_config>
To temporarily prevent any radio activity, the 'rfkill' attribute
can be set to 'true'.
If the network is protected by, e.g., WPA/WPA2, the protection type, either
'WPA' or 'WPA2' as well as the the passphrase have to be specified.
The 'bssid' attribute can be used to select a specifc accesspoint within a
network. Of all attributes only the 'ssid' attribute is mandatory, all others
are optional and should only be used when needed.
The configuration may contain more than one network. In This case the driver
will try to select the best one it gets a response from. To prevent it
from automatically joining the network the 'auto_connect' attribute must be
set to 'false'; the default value is 'true'. If the 'explicit_scan' attribute
is set, the driver will pro-actively scan for a hidden network with the given
SSID:
!<wifi_config connected_scan_interval="30" scan_interval="10">
! <network ssid="Zero" protection="WPA2" passphrase="allyourbase"/>
! <network ssid="Skynet" protection="WPA" passphrase="12345678"
! explicit_scan="true" auto_connect="false"/>
!</wifi_config>
By default, the driver scans for available networks only when not
connected. This can be changed with the 'connected_scan_interval'
attribute, which specifies the interval for connected scans in
seconds and directly influences any roaming decision, i.e., select
a better fit accesspoint for the configured network.
Also, the driver can be switched to verbose logging during runtime
by setting the 'verbose' or 'verbose_state' attribute to 'true'.
The wifi_drv creates two distinct reports to communicate its state and
information about the wireless infrastructure to other components. The
first one is a list of all available accesspoints. The following examplary
report shows its general structure:
!<accesspoints>
! <accesspoint ssid="skynet" bssid="00:01:02:03:04:05" quality="40"/>
! <accesspoint ssid="foobar" bssid="01:02:03:04:05:06" quality="70" protection="WPA2"/>
! <accesspoint ssid="foobar" bssid="01:02:03:04:05:07" quality="10" protection="WPA2"/>
!</accesspoints>
Each accesspoint node has attributes that contain the SSID and the BSSID
of the accesspoint as well as the link quality (signal strength). These
attributes are mandatory. If the network is protected, the node will also
have an attribute describing the type of protection in addition.
The second report provides information about the state of the connection
to the currently connected accesspoint:
!<state>
! <accesspoint ssid="foobar" bssid="01:02:03:04:05:06" quality="70" freq="2418" state="connected"/>
!</state>
Valid state values are 'connected', 'disconnected', 'connecting'. Depending
on the state, there are additional attributes that can be checked. In case
of an authentication error, e.g. the passphrase is wrong, the 'auth_failure'
attribute will be set to 'true'. The 'rfkilled' attribute is set to 'true'
if a disconnect was triggered by disabling the radio activity via setting
the 'rfkill' attribute.
By subscribing to both reports and providing the required 'wifi_config' ROM
module, a component is able control the wireless driver.
Currently only WPA/WPA2 protection using a passphrase is supported and the the
SSID is copied verbatim. At the moment, there is no way to express or escape
non alphanumeric characters.
On certain cards, e.g. Intel Wireless 6200 ABG, it may be necessary to disable
the 11n mode. This can be achieved by setting the 'use_11n' attribute in
the 'wifi_config' node to 'no'.
The driver optionally reports the following information under the
label "devices" if requested in the config as depicted.
! <config> <report mac_address="true"/> </config>
! <devices> <nic mac_address="02:00:00:00:00:01"/> </devices>
lx_kit
######

View File

@ -1,27 +0,0 @@
WIFI_CONTRIB_DIR := $(call select_from_ports,dde_linux)/src/lib/wifi
SRC_DIR := $(REP_DIR)/src/lib/legacy/wifi
# architecture-dependent includes
ifeq ($(filter-out $(SPECS),x86),)
ARCH_SRC_INC_DIR += $(REP_DIR)/src/include/spec/x86
ifeq ($(filter-out $(SPECS),32bit),)
ARCH_SRC_INC_DIR += $(REP_DIR)/src/include/spec/x86_32
endif # 32bit
ifeq ($(filter-out $(SPECS),64bit),)
ARCH_SRC_INC_DIR += $(REP_DIR)/src/include/spec/x86_64
endif # 64bit
endif # x86
#
# The order of include-search directories is important, we need to look into
# 'contrib' before falling back to our custom 'lx_emul.h' header.
#
INC_DIR += $(SRC_DIR) \
$(SRC_DIR)/include
INC_DIR += $(REP_DIR)/src/include
INC_DIR += $(ARCH_SRC_INC_DIR)
INC_DIR += $(WIFI_CONTRIB_DIR)/include \
$(WIFI_CONTRIB_DIR)/include/uapi \
$(WIFI_CONTRIB_DIR)/drivers/net/wireless/iwlwifi
INC_DIR += $(LIB_CACHE_DIR)/legacy_wifi_include/include/include/include

View File

@ -1,21 +0,0 @@
#
# Pseudo library to copy Intel Wireless firmware to build directory
#
WIFI_CONTRIB_DIR := $(call select_from_ports,dde_linux)
IMAGES := $(notdir $(wildcard $(WIFI_CONTRIB_DIR)/firmware/*.ucode))
IMAGES += $(notdir $(wildcard $(WIFI_CONTRIB_DIR)/firmware/*.db))
BIN_DIR := $(BUILD_BASE_DIR)/bin
FW_DIR := $(WIFI_CONTRIB_DIR)/firmware
CUSTOM_TARGET_DEPS += $(addprefix $(BIN_DIR)/,$(IMAGES))
$(BIN_DIR)/%.ucode: $(FW_DIR)/%.ucode
$(VERBOSE)cp $^ $@
$(BIN_DIR)/%.db: $(FW_DIR)/%.db
$(VERBOSE)cp $^ $@
CC_CXX_WARN_STRICT =

View File

@ -1,134 +0,0 @@
LIB_DIR := $(REP_DIR)/src/lib/legacy/wifi
LIB_INC_DIR := $(LIB_DIR)/include
WIFI_CONTRIB_DIR := $(call select_from_ports,dde_linux)/src/lib/wifi
DRIVERS_DIR := $(WIFI_CONTRIB_DIR)/drivers
WIFI_DIR := $(WIFI_CONTRIB_DIR)/net
SHARED_LIB = yes
#
# legacy_wifi_include *must* be the first library, otherwise the include
# order is wrong
#
LIBS += legacy_wifi_include lx_kit_setjmp nic_driver
LD_OPT += --version-script=$(LIB_DIR)/symbol.map
SRC_CC += dummies.cc init.cc lxcc_emul.cc nic.cc socket_call.cc random.cc \
firmware.cc
# lx_kit
SRC_CC += mapped_io_mem_range.cc irq.cc pci.cc malloc.cc scheduler.cc \
work.cc timer.cc printf.cc bug.cc env.cc
SRC_C += lxc_emul.c dummies_new.c
CC_WARN =
CC_OPT += -fno-builtin-toupper
CC_C_OPT += -std=gnu89
CC_C_OPT += -include $(LIB_INC_DIR)/lx_emul.h
CC_C_OPT += -Wall -Wno-unused-variable -Wno-unused-function -Wno-uninitialized
CC_C_OPT += -Wno-unused-but-set-variable -Wno-pointer-sign -Wno-cast-qual
CC_C_OPT += -Wno-stringop-truncation
CC_CXX_OPT += -Wall -fpermissive
CC_OPT += -U__linux__ -D __KERNEL__ -DCONFIG_PCI
#CC_OPT += -DCONFIG_INET
CC_OPT += -DCONFIG_NET -DCONFIG_NET_NS -DCONFIG_WLAN #-D__MAC80211_DRIVER_TRACE
# CONFIG options
CC_OPT += -DCONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=1
# needed for firmware loading
CC_OPT += -DCONFIG_FW_LOADER
# bling bling
CC_OPT += -DCONFIG_LEDS_TRIGGERS -DCONFIG_MAC80211_LEDS
# mesh
CC_OPT += -DCONFIG_MAC80211_MESH
# power management
CC_OPT += -DCONFIG_PM -DCONFIG_PM_SLEEP
# rfkill
CC_OPT += -DCONFIG_RFKILL -DCONFIG_RFKILL_INPUT
# choose default pid algorithm
CC_OPT += -DCONFIG_MAC80211_RC_PID -DCONFIG_MAC80211_RC_DEFAULT=\"pid\"
CC_OPT += -DCONFIG_CFG80211
#
# Suffix of global 'module_init' function
#
MOD_SUFFIX =
CC_OPT += -DMOD_SUFFIX=$(MOD_SUFFIX)
SRC_C += lib/bsearch.c
SRC_C += lib/bucket_locks.c
SRC_C += lib/crc32.c
SRC_C += lib/ctype.c
SRC_C += lib/gcd.c
# crypto
SRC_C += $(addprefix crypto/, $(notdir $(wildcard $(WIFI_CONTRIB_DIR)/crypto/*.c)))
# net
SRC_C += net/core/datagram.c
SRC_C += net/core/rtnetlink.c
SRC_C += net/core/skbuff.c
SRC_C += net/core/sock.c
SRC_C += net/ethernet/eth.c
SRC_C += net/netlink/af_netlink.c
SRC_C += net/netlink/genetlink.c
SRC_C += net/packet/af_packet.c
# netlink
SRC_C += lib/nlattr.c
SRC_C += lib/rbtree.c
SRC_C += lib/rhashtable.c
# wifi mac80211
SRC_C += $(addprefix net/mac80211/, $(notdir $(wildcard $(WIFI_DIR)/mac80211/*.c)))
CC_OPT += -DCONFIG_MAC80211_RC_MINSTREL -DCONFIG_MAC80211_RC_MINSTREL_HT
CC_OPT += -DCONFIG_MAC80211_STA_HASH_MAX_SIZE=0
# wifi rfkill
SRC_C += $(addprefix net/rfkill/, $(notdir $(wildcard $(WIFI_DIR)/rfkill/*.c)))
INC_DIR += $(WIFI_DIR)/rfkill
# wifi cfg80211
SRC_C += $(addprefix net/wireless/, $(notdir $(wildcard $(WIFI_DIR)/wireless/*.c)))
INC_DIR += $(WIFI_DIR)/wireless
CC_OPT += -DCONFIG_CFG80211_REG_RELAX_NO_IR=0
# led driver
SRC_C += $(addprefix drivers/leds/, $(notdir $(wildcard $(DRIVERS_DIR)/leds/*.c)))
CC_OPT += -DCONFIG_LEDS_TRIGGERS
CC_OPT += -D__CHECK_ENDIAN__
# iwlwifi driver
DRV_DIR_IWLWIFI := drivers/net/wireless/intel/iwlwifi
SRC_C += $(addprefix $(DRV_DIR_IWLWIFI)/, $(notdir $(wildcard $(WIFI_CONTRIB_DIR)/$(DRV_DIR_IWLWIFI)/*.c)))
SRC_C += $(addprefix $(DRV_DIR_IWLWIFI)/cfg/, $(notdir $(wildcard $(WIFI_CONTRIB_DIR)/$(DRV_DIR_IWLWIFI)/cfg/*.c)))
SRC_C += $(addprefix $(DRV_DIR_IWLWIFI)/dvm/, $(notdir $(wildcard $(WIFI_CONTRIB_DIR)/$(DRV_DIR_IWLWIFI)/dvm/*.c)))
SRC_C += $(addprefix $(DRV_DIR_IWLWIFI)/fw/, $(notdir $(wildcard $(WIFI_CONTRIB_DIR)/$(DRV_DIR_IWLWIFI)/fw/*.c)))
SRC_C += $(addprefix $(DRV_DIR_IWLWIFI)/mvm/, $(notdir $(wildcard $(WIFI_CONTRIB_DIR)/$(DRV_DIR_IWLWIFI)/mvm/*.c)))
SRC_C += $(addprefix $(DRV_DIR_IWLWIFI)/pcie/, $(notdir $(wildcard $(WIFI_CONTRIB_DIR)/$(DRV_DIR_IWLWIFI)/pcie/*.c)))
INC_DIR += $(WIFI_CONTRIB_DIR)/$(DRV_DIR_IWLWIFI)
INC_DIR += $(WIFI_CONTRIB_DIR)/$(DRV_DIR_IWLWIFI)/fw
CC_OPT += -DCONFIG_IWLMVM -DCONFIG_IWLDVM -DCONFIG_IWLWIFI_LEDS
CC_OPT += -DCONFIG_IWLWIFI_DEBUG
vpath %.c $(DRIVERS_DIR)
vpath %.c $(WIFI_CONTRIB_DIR)/drivers/net/wireless/
vpath %.c $(WIFI_DIR)
vpath %.c $(WIFI_CONTRIB_DIR)
vpath %.c $(LIB_DIR)
vpath %.cc $(LIB_DIR)
vpath %.cc $(REP_DIR)/src/lib/legacy/lx_kit
# vi: set ft=make :

View File

@ -1,39 +0,0 @@
ifeq ($(called_from_lib_mk),yes)
WIFI_CONTRIB_DIR := $(call select_from_ports,dde_linux)/src/lib/wifi
LX_EMUL_H := $(REP_DIR)/src/lib/legacy/wifi/include/lx_emul.h
#
# Determine the header files included by the contrib code. For each
# of these header files we create a symlink to 'lx_emul.h'.
#
SCAN_DIRS := $(addprefix $(WIFI_CONTRIB_DIR)/include/, asm-generic crypto linux net trace uapi) \
$(addprefix $(WIFI_CONTRIB_DIR)/, crypto drivers lib net)
GEN_INCLUDES := $(shell grep -rIh "^\#include .*\/" $(SCAN_DIRS) |\
sed "s/^\#include [^<\"]*[<\"]\([^>\"]*\)[>\"].*/\1/" |\
sort | uniq)
#
# Filter out original Linux headers that exist in the contrib directory
#
NO_GEN_INCLUDES := $(shell cd $(WIFI_CONTRIB_DIR)/; find include -name "*.h" |\
sed "s/.\///" | sed "s/.*include\///")
GEN_INCLUDES := $(filter-out $(NO_GEN_INCLUDES),$(GEN_INCLUDES))
#
# Put Linux headers in 'GEN_INC' dir, since some include use "../../" paths use
# three level include hierarchy
#
GEN_INC := $(shell pwd)/include/include/include
GEN_INCLUDES := $(addprefix $(GEN_INC)/,$(GEN_INCLUDES))
all: $(GEN_INCLUDES)
$(GEN_INCLUDES):
$(VERBOSE)mkdir -p $(dir $@)
$(VERBOSE)ln -s $(LX_EMUL_H) $@
endif
# vi: set ft=make :
CC_CXX_WARN_STRICT =

View File

@ -1,9 +0,0 @@
include $(REP_DIR)/lib/mk/legacy_wifi.inc
INC_DIR += $(LIB_INC_DIR)/spec/32bit $(LIB_INC_DIR)/spec/x86_32 $(LIB_INC_DIR)/spec/x86
CC_OPT += -DCONFIG_64BIT=0
vpath %.S $(REP_DIR)/src/lib/legacy/lx_kit/spec/x86_32
CC_CXX_WARN_STRICT =

View File

@ -1,9 +0,0 @@
include $(REP_DIR)/lib/mk/legacy_wifi.inc
INC_DIR += $(LIB_INC_DIR)/spec/64bit $(LIB_INC_DIR)/spec/x86_64 $(LIB_INC_DIR)/spec/x86
CC_OPT += -DCONFIG_64BIT=1
vpath %.S $(REP_DIR)/src/lib/legacy/lx_kit/spec/x86_64
CC_CXX_WARN_STRICT =

View File

@ -1,154 +0,0 @@
diff --git a/crypto/algboss.c b/crypto/algboss.c
index 5e6df2a..6ec2ce3 100644
--- a/crypto/algboss.c
+++ b/crypto/algboss.c
@@ -90,6 +90,8 @@ out:
crypto_alg_put(&param->larval->alg);
kfree(param);
module_put_and_exit(0);
+
+ return 0;
}
static int cryptomgr_schedule_probe(struct crypto_larval *larval)
@@ -227,6 +229,8 @@ skiptest:
kfree(param);
module_put_and_exit(0);
+
+ return 0;
}
static int cryptomgr_schedule_test(struct crypto_alg *alg)
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
index 7bd704a..d329673 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -549,6 +549,8 @@ static struct scatterlist *alloc_sgtable(int size)
void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt)
{
+ return;
+
struct iwl_fw_error_dump_file *dump_file;
struct iwl_fw_error_dump_data *dump_data;
struct iwl_fw_error_dump_info *dump_info;
@@ -1106,6 +1108,8 @@ IWL_EXPORT_SYMBOL(iwl_fw_start_dbg_conf);
void iwl_fw_error_dump_wk(struct work_struct *work)
{
+ return;
+
struct iwl_fw_runtime *fwrt =
container_of(work, struct iwl_fw_runtime, dump.wk.work);
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index 9c4a7f6..3bf610f 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -1776,6 +1776,7 @@ MODULE_PARM_DESC(debug, "debug output mask");
module_param_named(swcrypto, iwlwifi_mod_params.swcrypto, int, S_IRUGO);
MODULE_PARM_DESC(swcrypto, "using crypto in software (default 0 [hardware])");
module_param_named(11n_disable, iwlwifi_mod_params.disable_11n, uint, S_IRUGO);
+unsigned int *module_param_11n_disable = &iwlwifi_mod_params.disable_11n;
MODULE_PARM_DESC(11n_disable,
"disable 11n functionality, bitmap: 1: full, 2: disable agg TX, 4: disable agg RX, 8 enable agg TX");
module_param_named(amsdu_size, iwlwifi_mod_params.amsdu_size,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/led.c b/drivers/net/wireless/intel/iwlwifi/mvm/led.c
index b272695..143130d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/led.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/led.c
@@ -142,7 +142,7 @@ int iwl_mvm_leds_init(struct iwl_mvm *mvm)
if (ret) {
kfree(mvm->led.name);
IWL_INFO(mvm, "Failed to enable led\n");
- return ret;
+ return 0;
}
mvm->init_status |= IWL_MVM_INIT_STATUS_LEDS_INIT_COMPLETE;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 7152fdc..5d133e5 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -4368,7 +4368,7 @@ const struct ieee80211_ops iwl_mvm_hw_ops = {
.add_interface = iwl_mvm_mac_add_interface,
.remove_interface = iwl_mvm_mac_remove_interface,
.config = iwl_mvm_mac_config,
- .prepare_multicast = iwl_mvm_prepare_multicast,
+ .prepare_multicast = 0,
.configure_filter = iwl_mvm_configure_filter,
.config_iface_filter = iwl_mvm_config_iface_filter,
.bss_info_changed = iwl_mvm_bss_info_changed,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 5d133e5..ec770d4 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -1573,7 +1573,7 @@ static void iwl_mvm_recalc_multicast(struct iwl_mvm *mvm)
lockdep_assert_held(&mvm->mutex);
- if (WARN_ON_ONCE(!mvm->mcast_filter_cmd))
+ if (!mvm->mcast_filter_cmd)
return;
ieee80211_iterate_active_interfaces_atomic(
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
index f25ce3a..85007fc 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
@@ -1601,7 +1601,7 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
* Re-enable interrupts here since we don't
* have anything to service
*/
- if (test_bit(STATUS_INT_ENABLED, &trans->status))
+ // if (test_bit(STATUS_INT_ENABLED, &trans->status))
_iwl_enable_interrupts(trans);
spin_unlock(&trans_pcie->irq_lock);
lock_map_release(&trans->sync_cmd_lockdep_map);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 99df171..4632cdf 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -3781,7 +3781,7 @@ static inline void skb_remcsum_process(struct sk_buff *skb, void *ptr,
if (unlikely(skb->ip_summed != CHECKSUM_COMPLETE)) {
__skb_checksum_complete(skb);
- skb_postpull_rcsum(skb, skb->data, ptr - (void *)skb->data);
+ skb_postpull_rcsum(skb, skb->data, (unsigned char*)ptr - skb->data);
}
delta = remcsum_adjust(ptr, skb->csum, start, offset);
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 1fdcde9..5f221bd 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -97,9 +97,13 @@ void rtnetlink_init(void);
void __rtnl_unlock(void);
void rtnl_kfree_skbs(struct sk_buff *head, struct sk_buff *tail);
+#if 1
+#define ASSERT_RTNL()
+# else
#define ASSERT_RTNL() \
WARN_ONCE(!rtnl_is_locked(), \
"RTNL: assertion failed at %s (%d)\n", __FILE__, __LINE__)
+#endif
extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
struct netlink_callback *cb,
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index e0f3f4a..a309257 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -4544,8 +4547,10 @@ static int __net_init packet_net_init(struct net *net)
mutex_init(&net->packet.sklist_lock);
INIT_HLIST_HEAD(&net->packet.sklist);
+#ifdef CONFIG_PROC_FS
if (!proc_create("packet", 0, net->proc_net, &packet_seq_fops))
return -ENOMEM;
+#endif
return 0;
}

View File

@ -1,138 +0,0 @@
--- a/drivers/net/wireless/intel/iwlwifi/dvm/calib.c
+++ b/drivers/net/wireless/intel/iwlwifi/dvm/calib.c
@@ -120,7 +120,7 @@ int iwl_calib_set(struct iwl_priv *priv,
struct iwl_calib_result *res, *tmp;
res = kmalloc(sizeof(*res) + len - sizeof(struct iwl_calib_hdr),
- GFP_ATOMIC);
+ GFP_ATOMIC | GFP_LX_DMA);
if (!res)
return -ENOMEM;
memcpy(&res->hdr, cmd, len);
--- a/drivers/net/wireless/intel/iwlwifi/dvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/dvm/scan.c
@@ -666,7 +666,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
ctx = iwl_rxon_ctx_from_vif(vif);
if (!priv->scan_cmd) {
- priv->scan_cmd = kmalloc(scan_cmd_size, GFP_KERNEL);
+ priv->scan_cmd = kmalloc(scan_cmd_size, GFP_KERNEL | GFP_LX_DMA);
if (!priv->scan_cmd) {
IWL_DEBUG_SCAN(priv,
"fail to allocate memory for scan\n");
--- a/drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c
@@ -251,7 +251,7 @@ int iwl_phy_db_set_section(struct iwl_phy_db *phy_db,
return -EINVAL;
kfree(entry->data);
- entry->data = kmemdup(phy_db_notif->data, size, GFP_ATOMIC);
+ entry->data = kmemdup(phy_db_notif->data, size, GFP_ATOMIC | GFP_LX_DMA);
if (!entry->data) {
entry->size = 0;
return -ENOMEM;
--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
@@ -99,7 +99,7 @@ struct iwl_trans *iwl_trans_alloc(unsigned int priv_size,
kmem_cache_create(trans->dev_cmd_pool_name,
sizeof(struct iwl_device_cmd),
sizeof(void *),
- SLAB_HWCACHE_ALIGN,
+ SLAB_HWCACHE_ALIGN|SLAB_LX_DMA,
NULL);
if (!trans->dev_cmd_pool)
return NULL;
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -767,7 +767,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
scan_size = iwl_mvm_scan_size(mvm);
- mvm->scan_cmd = kmalloc(scan_size, GFP_KERNEL);
+ mvm->scan_cmd = kmalloc(scan_size, GFP_KERNEL | GFP_LX_DMA);
if (!mvm->scan_cmd)
goto out_free;
--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
@@ -501,11 +501,11 @@ iwl_mvm_config_sched_scan_profiles(struct iwl_mvm *mvm,
else
blacklist_len = IWL_SCAN_MAX_BLACKLIST_LEN;
- blacklist = kzalloc(sizeof(*blacklist) * blacklist_len, GFP_KERNEL);
+ blacklist = kzalloc(sizeof(*blacklist) * blacklist_len, GFP_KERNEL | GFP_LX_DMA);
if (!blacklist)
return -ENOMEM;
- profile_cfg = kzalloc(sizeof(*profile_cfg), GFP_KERNEL);
+ profile_cfg = kzalloc(sizeof(*profile_cfg), GFP_KERNEL | GFP_LX_DMA);
if (!profile_cfg) {
ret = -ENOMEM;
goto free_blacklist;
@@ -1052,7 +1052,7 @@ int iwl_mvm_config_scan(struct iwl_mvm *mvm)
cmd_size = sizeof(struct iwl_scan_config_v1);
cmd_size += mvm->fw->ucode_capa.n_scan_channels;
- cfg = kzalloc(cmd_size, GFP_KERNEL);
+ cfg = kzalloc(cmd_size, GFP_KERNEL | GFP_LX_DMA);
if (!cfg)
return -ENOMEM;
--- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
@@ -502,7 +502,7 @@ int iwl_pcie_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq,
txq->entries = kcalloc(slots_num,
sizeof(struct iwl_pcie_txq_entry),
- GFP_KERNEL);
+ GFP_KERNEL | GFP_LX_DMA);
if (!txq->entries)
goto error;
@@ -511,7 +511,7 @@ int iwl_pcie_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq,
for (i = 0; i < slots_num; i++) {
txq->entries[i].cmd =
kmalloc(sizeof(struct iwl_device_cmd),
- GFP_KERNEL);
+ GFP_KERNEL | GFP_LX_DMA);
if (!txq->entries[i].cmd)
goto error;
}
@@ -938,7 +938,7 @@ static int iwl_pcie_tx_alloc(struct iwl_trans *trans)
}
trans_pcie->txq_memory = kcalloc(trans->cfg->base_params->num_of_queues,
- sizeof(struct iwl_txq), GFP_KERNEL);
+ sizeof(struct iwl_txq), GFP_KERNEL | GFP_LX_DMA);
if (!trans_pcie->txq_memory) {
IWL_ERR(trans, "Not enough memory for txq\n");
ret = -ENOMEM;
@@ -1539,7 +1539,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
}
dup_buf = kmemdup(cmddata[i], cmdlen[i],
- GFP_ATOMIC);
+ GFP_ATOMIC | GFP_LX_DMA);
if (!dup_buf)
return -ENOMEM;
} else {
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -130,6 +130,8 @@ static void *__kmalloc_reserve(size_t size, gfp_t flags, int node,
void *obj;
bool ret_pfmemalloc = false;
+ flags |= GFP_LX_DMA;
+
/*
* Try a regular allocation, when that fails and we're not entitled
* to the reserves, fail.
@@ -278,7 +280,7 @@ struct sk_buff *__build_skb(void *data, unsigned int frag_size)
struct sk_buff *skb;
unsigned int size = frag_size ? : ksize(data);
- skb = kmem_cache_alloc(skbuff_head_cache, GFP_ATOMIC);
+ skb = kmem_cache_alloc(skbuff_head_cache, GFP_ATOMIC|GFP_LX_DMA);
if (!skb)
return NULL;

View File

@ -1,22 +0,0 @@
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -911,6 +911,19 @@ bool rfkill_blocked(struct rfkill *rfkill)
}
EXPORT_SYMBOL(rfkill_blocked);
+bool rfkill_get_any(enum rfkill_type type)
+{
+ bool blocked = false;
+
+ struct rfkill *rfkill;
+ list_for_each_entry(rfkill, &rfkill_list, node) {
+ if (rfkill->type != type && type != RFKILL_TYPE_ALL)
+ continue;
+
+ blocked |= rfkill_blocked(rfkill);
+ }
+ return blocked;
+}
struct rfkill * __must_check rfkill_alloc(const char *name,
struct device *parent,

View File

@ -1 +1 @@
72684892e704a964b714d37fbecad427d03f4f8f
428ae50e4ae60462249210de908f941666d7d85f

View File

@ -1,8 +1,8 @@
LICENSE := GPLv2
VERSION := 2
DOWNLOADS := intel_fb.archive lxip.archive \
wifi.archive fec.archive libnl.archive wpa_supplicant.git \
fw.archive usb_host.archive dwc_otg_host.git usb_hid.archive \
fec.archive libnl.archive wpa_supplicant.git \
usb_host.archive dwc_otg_host.git usb_hid.archive \
usb_modem.archive usb_net.archive
#
@ -75,17 +75,6 @@ DIR(intel_fb) := $(SRC_DIR_INTEL_FB)
TAR_OPT(intel_fb) := --strip-components=1 --files-from - < <(sed 's/-x.x.x/-$(VERSION_INTEL_FB)/g' $(REP_DIR)/intel_fb.list)
HASH_INPUT += $(REP_DIR)/intel_fb.list
#
# mac80211 stack, iwlwifi sources
#
SRC_DIR_WIFI := src/lib/wifi
VERSION_WIFI := 4.16.3
URL(wifi) := https://www.kernel.org/pub/linux/kernel/v4.x/linux-$(VERSION_WIFI).tar.xz
SHA(wifi) := 0d6971a81da97e38b974c5eba31a74803bfe41aabc46d406c3acda56306c81a3
DIR(wifi) := $(SRC_DIR_WIFI)
TAR_OPT(wifi) := --strip-components=1 --files-from - < <(sed 's/-x.x.x/-$(VERSION_WIFI)/g' $(REP_DIR)/wifi.list)
HASH_INPUT += $(REP_DIR)/wifi.list
#
# IP stack sources
#
@ -122,20 +111,11 @@ URL(wpa_supplicant) := git://w1.fi/srv/git/hostap.git
REV(wpa_supplicant) := 25bd4e7beb582509596fe60cb3591e1299f3121b
DIR(wpa_supplicant) := src/app/wpa_supplicant
#
# Firmware images
#
FW_REV := 73f503c65139f368e6155eed8c74d006a2f0219d
URL(fw) := https://github.com/cnuke/dde_linux_firmware/archive/$(FW_REV).tar.gz
SHA(fw) := d5a61cb07384a828560b8f869e4e899cb723d462646a48b45c398514bb246925
DIR(fw) := firmware
#
# Patches
#
PATCHES := $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/wpa*.patch)))
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/libnl*.patch)))
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/wifi*.patch)))
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/lxip*.patch)))
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/intel*.patch)))
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/usb_host*.patch)))
@ -155,12 +135,6 @@ PATCH_OPT(patches/lxip_request_sock.patch) := $(LXIP_OPT)
PATCH_OPT(patches/lxip_sk_wq.patch) := $(LXIP_OPT)
PATCH_OPT(patches/lxip_skbuff_cast.patch) := $(LXIP_OPT)
# WIFI
WIFI_OPT = -p1 -d$(SRC_DIR_WIFI)
PATCH_OPT(patches/wifi.patch) := $(WIFI_OPT)
PATCH_OPT(patches/wifi_mem.patch) := $(WIFI_OPT)
PATCH_OPT(patches/wifi_rfkill.patch) := $(WIFI_OPT)
# libnl
PATCH_OPT(patches/libnl.patch) := -p1 -d ${DIR(libnl)}

View File

@ -1,2 +0,0 @@
Package for bundling wifi_drv and wifi_firmware

View File

@ -1,6 +0,0 @@
_/src/legacy_wifi_drv
_/src/openssl
_/src/vfs
_/src/vfs_jitterentropy
_/src/libc
_/raw/legacy_wifi_firmware

View File

@ -1 +0,0 @@
2022-04-27 1f23370e7434b6b34f323734fa58e84dd04b1eb8

View File

@ -1,16 +0,0 @@
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/dde_linux)
content: ucode_files LICENSE.wifi_drv
.PHONY: ucode_files
ucode_files:
cp $(PORT_DIR)/firmware/*.ucode .
cp $(PORT_DIR)/firmware/regulatory.db .
LICENSE.wifi_drv:
for i in $(PORT_DIR)/firmware/LICEN*E.*; do \
echo "$${i##*/}:" >> $@; \
cat $$i >> $@; \
echo >> $@; \
done

View File

@ -1 +0,0 @@
2019-11-25 ff24f3bafaeeb47c053670264b5096dbc4b9a36d

View File

@ -1,52 +0,0 @@
LIB_MK := $(addprefix lib/mk/,libnl.inc libnl_include.mk iwl_firmware.mk legacy_wifi.inc \
legacy_wifi_include.mk) \
$(foreach SPEC,x86_32 x86_64,lib/mk/spec/$(SPEC)/libnl.mk) \
$(foreach SPEC,x86_32 x86_64,lib/mk/spec/$(SPEC)/lx_kit_setjmp.mk) \
$(foreach SPEC,x86_32 x86_64,lib/mk/spec/$(SPEC)/legacy_wifi.mk) \
$(addprefix lib/mk/spec/x86/,wpa_driver_nl80211.mk wpa_supplicant.mk)
PORT_DIR := $(call port_dir,$(REP_DIR)/ports/dde_linux)
MIRROR_FROM_REP_DIR := $(LIB_MK) \
lib/import/import-legacy_wifi_include.mk \
lib/import/import-libnl_include.mk \
lib/import/import-libnl.mk \
include/wifi src/include/legacy src/lib/legacy/lx_kit \
src/lib/lx_kit/spec \
$(foreach SPEC, x86 x86_32 x86_64, \
src/include/spec/$(SPEC)) \
$(shell cd $(REP_DIR); find src/drivers/wifi -type f) \
$(shell cd $(REP_DIR); find src/lib/libnl -type f) \
$(shell cd $(REP_DIR); find src/lib/legacy/wifi -type f) \
$(shell cd $(REP_DIR); find src/lib/wpa_driver_nl80211 -type f) \
$(shell cd $(REP_DIR); find src/lib/wpa_supplicant -type f)
MIRROR_FROM_PORT_DIR := $(shell cd $(PORT_DIR); find src/lib/libnl -type f) \
$(shell cd $(PORT_DIR); find src/lib/wifi -type f) \
$(shell cd $(PORT_DIR); find src/app/wpa_supplicant -type f)
MIRROR_FROM_PORT_DIR := $(filter-out $(MIRROR_FROM_REP_DIR),$(MIRROR_FROM_PORT_DIR))
content: $(MIRROR_FROM_REP_DIR) $(MIRROR_FROM_PORT_DIR) cleanup-wpa
$(MIRROR_FROM_REP_DIR):
$(mirror_from_rep_dir)
$(MIRROR_FROM_PORT_DIR):
mkdir -p $(dir $@)
cp -r $(PORT_DIR)/$@ $@
cleanup-wpa: $(MIRROR_FROM_PORT_DIR)
@for dir in .git doc eap_example hs20 mac80211_hwsim radius_example \
hostapd tests wlantest wpadebug wpaspy; do \
rm -rf src/app/wpa_supplicant/$$dir; done
content: LICENSE
LICENSE:
( echo "Linux is subject to GNU General Public License version 2, see:"; \
echo "https://www.kernel.org/pub/linux/kernel/COPYING"; \
echo; \
echo "Libnl is subject to GNU LESSER GENERAL PUBLIC LICENSE Verson 2.1, see:"; \
echo " src/lib/libnl/COPYING"; \
echo; \
echo "Wpa_supplicant is subject to 3-clause BSD license, see:"; \
echo " src/app/wpa_supplicant/COPYING"; ) > $@

View File

@ -1 +0,0 @@
2022-04-27 7b52c2ae3613ade65895e2a4d0737a3a1461c74c

View File

@ -1,11 +0,0 @@
base
os
libc
openssl
nic_session
uplink_session
nic_driver
platform_session
report_session
timer_session
vfs

View File

@ -1,275 +0,0 @@
#
# Configure wireless lan
#
proc wifi_ssid { } {
return $::env(GENODE_WIFI_SSID)
}
proc wifi_psk { } {
return $::env(GENODE_WIFI_PSK)
}
#
# widi_drv config generator (supporting a network list)
#
# You may script your tests with this function in the dynamic_rom config below.
# The syntax for the networks parameter is
#
# { ssid protection passphrase explicit_scan }
#
# Example dynamic_rom config:
#
# {<inline description="auto-connect both networks">
# } [wifi_config 30 5 no [list "net1 WPA2 net1_psk no" "net2 WPA2 net2_psk no"]] {
# </inline>
# <inline description="aquto-connect both, but net2 explicitly">
# } [wifi_config 30 5 no [list "net1 WPA2 net1_psk no" "net2 WPA2 net2_psk yes"]] {
# </inline>}
set wifi_verbose false
set wifi_verbose_state false
proc wifi_config { connected_scan_interval scan_interval rfkill networks } {
global wifi_verbose
global wifi_verbose_state
set config "<wifi_config"
append config " verbose=\"$wifi_verbose\""
append config " verbose_state=\"$wifi_verbose_state\""
append config " connected_scan_interval=\"$connected_scan_interval\""
append config " scan_interval=\"$scan_interval\""
append config " rfkill=\"$rfkill\""
append config ">\n"
foreach n $networks {
append config " <network"
append config " ssid=\"[lindex $n 0]\""
append config " protection=\"[lindex $n 1]\""
append config " passphrase=\"[lindex $n 2]\""
append config " explicit_scan=\"[lindex $n 3]\""
append config "/>\n"
}
append config "</wifi_config>\n"
return $config
}
#
# Restrict platforms
#
assert_spec x86
#
# Build
#
set build_components {
core init timer
drivers/rtc
drivers/wifi
server/report_rom
server/dynamic_rom
server/nic_router
test/lwip/http_srv
lib/vfs/jitterentropy
lib/vfs/lwip
}
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
#
# Generate config
#
append config {
<config verbose="yes">
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="rtc_drv">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Rtc"/> </provides>
</start>
<start name="test-lwip_httpsrv">
<resource name="RAM" quantum="16M"/>
<config>
<libc stdout="/dev/null" stderr="/dev/log" socket="/socket"/>
<vfs>
<dir name="dev"> <log/> <null/> </dir>
<dir name="socket"> <lwip dhcp="yes"/> </dir>
</vfs>
</config>
<route>
<service name="Nic"> <child name="nic_router"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="state_report_rom">
<binary name="report_rom"/>
<resource name="RAM" quantum="2M"/>
<provides> <service name="Report"/> <service name="ROM"/> </provides>
<config verbose="no"/>
</start>
<start name="accesspoints_report_rom">
<binary name="report_rom"/>
<resource name="RAM" quantum="2M"/>
<provides> <service name="Report"/> <service name="ROM"/> </provides>
<config verbose="no"/>
</start>
<start name="config_rom">
<binary name="dynamic_rom"/>
<resource name="RAM" quantum="4M"/>
<provides><service name="ROM"/></provides>
<config verbose="yes">
<rom name="wifi_config">
<inline description="disconnect">
} [wifi_config 30 5 no {}] {
</inline>
<sleep milliseconds="15000"/>
<inline description="connect">
} [wifi_config 30 5 no [list "[wifi_ssid] WPA2 [wifi_psk] yes"]] {
</inline>
<sleep milliseconds="60000"/>
<inline description="rfkill block">
} [wifi_config 30 5 yes [list "[wifi_ssid] WPA2 [wifi_psk] yes"]] {
</inline>
<sleep milliseconds="30000"/>
<inline description="rfkill unblock">
} [wifi_config 30 5 no [list "[wifi_ssid] WPA2 [wifi_psk] yes"]] {
</inline>
<sleep milliseconds="30000"/>
</rom>
</config>
</start>
<start name="nic_router" caps="200">
<resource name="RAM" quantum="10M"/>
<provides>
<service name="Nic"/>
<service name="Uplink"/>
</provides>
<config verbose_domain_state="yes">
<policy label_prefix="test-lwip_httpsrv" domain="downlink"/>
<policy label_prefix="wifi_drv" domain="uplink"/>
<domain name="uplink">
<nat domain="downlink" tcp-ports="16384"/>
<tcp-forward port="443" domain="downlink" to="10.0.3.2"/>
<tcp-forward port="80" domain="downlink" to="10.0.3.2"/>
</domain>
<domain name="downlink" interface="10.0.3.1/24">
<dhcp-server ip_first="10.0.3.2" ip_last="10.0.3.2"/>
</domain>
</config>
</start>
<start name="devices_report_rom">
<binary name="report_rom"/>
<resource name="RAM" quantum="1200K"/>
<provides> <service name="Report"/> <service name="ROM"/> </provides>
<config verbose="yes"/>
</start>
<start name="wifi_drv" caps="220">
<binary name="legacy_pc_wifi_drv"/>
<resource name="RAM" quantum="28M"/>
<config ld_verbose="yes">
<report mac_address="true"/>
<libc stdout="/dev/null" stderr="/dev/null" rtc="/dev/rtc"/>
<vfs>
<dir name="dev"> <log/> <null/> <rtc/>
<jitterentropy name="random"/>
<jitterentropy name="urandom"/>
</dir>
</vfs>
</config>
<route>
<service name="Uplink"> <child name="nic_router"/> </service>
<service name="Rtc"> <any-child/> </service>
<service name="Report" label="accesspoints"> <child name="accesspoints_report_rom"/> </service>
<service name="Report" label="state"> <child name="state_report_rom"/> </service>
<service name="Report" label="devices"> <child name="devices_report_rom"/> </service>
<service name="ROM" label="wifi_config"> <child name="config_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>}
append_platform_drv_config
append config {
</config>
}
install_config $config
set firmware_modules {
iwlwifi-6000-4.ucode
iwlwifi-6000g2a-6.ucode
iwlwifi-6000g2b-6.ucode
iwlwifi-7260-17.ucode
iwlwifi-7265-17.ucode
iwlwifi-7265D-29.ucode
iwlwifi-8000C-36.ucode
iwlwifi-8265-36.ucode
regulatory.db
}
#
# Boot modules
#
# generic modules
set boot_modules {
core ld.lib.so init timer rtc_drv report_rom dynamic_rom
vfs_jitterentropy.lib.so
libc.lib.so vfs.lib.so libcrypto.lib.so libssl.lib.so
wpa_driver_nl80211.lib.so wpa_supplicant.lib.so
legacy_wifi.lib.so
legacy_pc_wifi_drv
nic_router
test-lwip_httpsrv
vfs_lwip.lib.so
}
append boot_modules $firmware_modules
append_platform_drv_boot_modules
build_boot_image $boot_modules
run_genode_until forever
# vi: set ft=tcl :

File diff suppressed because it is too large Load Diff

View File

@ -1,132 +0,0 @@
/*
* \brief Startup Wifi driver
* \author Josef Soentgen
* \date 2014-03-03
*/
/*
* Copyright (C) 2014-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <libc/component.h>
#include <base/attached_rom_dataspace.h>
#include <base/log.h>
#include <base/sleep.h>
#include <os/reporter.h>
#include <timer_session/connection.h>
#include <util/xml_node.h>
/* local includes */
#include <util.h>
#include <wpa.h>
#include <frontend.h>
static Wifi::Frontend *_wifi_frontend = nullptr;
/**
* Notify front end about command processing
*
* Called by the CTRL interface after wpa_supplicant has processed
* the command.
*/
void wifi_block_for_processing(void)
{
if (!_wifi_frontend) {
Genode::warning("frontend not available, dropping notification");
return;
}
/*
* Next time we block as long as the front end has not finished
* handling our previous request
*/
_wifi_frontend->block_for_processing();
/* XXX hack to trick poll() into returning faster */
wpa_ctrl_set_fd();
}
void wifi_notify_cmd_result(void)
{
if (!_wifi_frontend) {
Genode::warning("frontend not available, dropping notification");
return;
}
Genode::Signal_transmitter(_wifi_frontend->result_sigh()).submit();
}
/**
* Notify front end about triggered event
*
* Called by the CTRL interface whenever wpa_supplicant has triggered
* a event.
*/
void wifi_notify_event(void)
{
if (!_wifi_frontend) {
Genode::warning("frontend not available, dropping notification");
return;
}
Genode::Signal_transmitter(_wifi_frontend->event_sigh()).submit();
}
/**
* Return shared-memory message buffer
*
* It is used by the wpa_supplicant CTRL interface.
*/
void *wifi_get_buffer(void)
{
return _wifi_frontend ? &_wifi_frontend->msg_buffer() : nullptr;
}
/* exported by wifi.lib.so */
extern void wifi_init(Genode::Env&,
Genode::Blockade&,
bool,
Genode::Signal_context_capability);
struct Main
{
Genode::Env &env;
Genode::Constructible<Wpa_thread> _wpa;
Genode::Constructible<Wifi::Frontend> _frontend;
Genode::Blockade _wpa_startup_blockade { };
Main(Genode::Env &env) : env(env)
{
_frontend.construct(env);
_wifi_frontend = &*_frontend;
_wpa.construct(env, _wpa_startup_blockade);
/*
* Forcefully disable 11n but for convenience the attribute is used the
* other way araound.
*/
bool const disable_11n = !_frontend->use_11n();
wifi_init(env, _wpa_startup_blockade, disable_11n,
_frontend->rfkill_sigh());
}
};
void Libc::Component::construct(Libc::Env &env)
{
Libc::with_libc([&] () { static Main server(env); });
}

View File

@ -1,13 +0,0 @@
REQUIRES = x86
TARGET := legacy_pc_wifi_drv
SRC_CC = main.cc wpa.cc
LIBS = base legacy_wifi iwl_firmware
LIBS += wpa_supplicant libc nic_driver
LIBS += libcrypto libssl wpa_driver_nl80211
# needed for firmware.h
INC_DIR += $(REP_DIR)/src/lib/legacy/wifi/include
INC_DIR += $(PRG_DIR)
CC_CXX_WARN_STRICT :=

View File

@ -1,90 +0,0 @@
/*
* \brief Wifi front end utilities
* \author Josef Soentgen
* \date 2018-07-23
*/
/*
* Copyright (C) 2018 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#ifndef _WIFI__UTIL_H_
#define _WIFI__UTIL_H_
/* Genode includes */
#include <util/string.h>
typedef unsigned long size_t;
typedef long long ssize_t;
typedef unsigned char uint8_t;
namespace Util {
using size_t = Genode::size_t;
using uint8_t = Genode::uint8_t;
size_t next_char(char const *s, size_t start, char const c)
{
size_t v = start;
while (s[v]) {
if (s[v] == c) { break; }
v++;
}
return v - start;
}
bool string_contains(char const *str, char const *pattern)
{
char const *p = pattern;
while (*str && *p) {
p = *str == *p ? p + 1 : pattern;
str++;
}
return !*p;
}
void byte2hex(char *dest, uint8_t b)
{
int i = 1;
if (b < 16) { dest[i--] = '0'; }
for (; b > 0; b /= 16) {
uint8_t const v = b % 16;
uint8_t const c = (v > 9) ? v + 'a' - 10 : v + '0';
dest[i--] = (char)c;
}
}
/**********************************
** Front end specific utilities **
**********************************/
inline unsigned approximate_quality(char const *str)
{
long level = 0;
Genode::ascii_to(str, level);
/*
* We provide an quality value by transforming the actual
* signal level [-50,-100] (dBm) to [100,0] (%).
*/
if (level <= -100) { return 0; }
else if (level >= -50) { return 100; }
return 2 * (level + 100);
}
inline Genode::uint64_t check_time(Genode::uint64_t value, Genode::uint64_t min, Genode::uint64_t max)
{
if (value < min) { return min; }
else if (value > max) { return max; }
return value;
}
} /* namespace Util */
#endif /* _WIFI__UTIL_H_ */

View File

@ -1,57 +0,0 @@
/*
* \brief Wpa_supplicant thread of the wifi driver
* \author Josef Soentgen
* \author Christian Helmuth
* \date 2019-12-18
*/
/*
* Copyright (C) 2019 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/blockade.h>
#include <base/env.h>
#include <base/sleep.h>
/* libc includes */
#include <stdio.h>
#include <pthread.h>
#include <stdlib.h>
#include "wpa.h"
/* entry function */
extern "C" int wpa_main(void);
void * Wpa_thread::_entry_trampoline(void *arg)
{
Wpa_thread *t = (Wpa_thread *)arg;
t->_entry();
return nullptr;
}
void Wpa_thread::_entry()
{
/* wait until the wifi driver is up and running */
_blockade.block();
_exit = wpa_main();
Genode::sleep_forever();
}
Wpa_thread::Wpa_thread(Genode::Env &env, Genode::Blockade &blockade)
: _blockade(blockade), _exit(-1)
{
pthread_t tid = 0;
if (pthread_create(&tid, 0, _entry_trampoline, this) != 0) {
printf("Error: pthread_create() failed\n");
exit(-1);
}
}

View File

@ -1,39 +0,0 @@
/*
* \brief Wpa_supplicant thread of the wifi driver
* \author Josef Soentgen
* \date 2014-03-03
*/
/*
* Copyright (C) 2014-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#ifndef _WIFI__WPA_H_
#define _WIFI__WPA_H_
namespace Genode {
struct Env;
struct Blockade;
}
class Wpa_thread
{
private:
Genode::Blockade &_blockade;
int _exit;
static void * _entry_trampoline(void *arg);
void _entry();
public:
Wpa_thread(Genode::Env &, Genode::Blockade &);
};
#endif /* _WIFI__WPA_H_ */

View File

@ -1,578 +0,0 @@
/*
* \brief Dummy functions
* \author Josef Soentgen
* \date 2014-03-03
*/
/*
* Copyright (C) 2014-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/log.h>
#include <base/sleep.h>
extern "C" {
typedef long DUMMY;
enum {
SHOW_DUMMY = 0,
SHOW_SKIP = 0,
SHOW_RET = 0,
};
#define DUMMY(retval, name) \
DUMMY name(void) { \
if (SHOW_DUMMY) \
Genode::log(__func__, ": " #name " called " \
"(from ", __builtin_return_address(0), ") " \
"not implemented"); \
return retval; \
}
#define DUMMY_SKIP(retval, name) \
DUMMY name(void) { \
if (SHOW_SKIP) \
Genode::log(__func__, ": " #name " called " \
"(from ", __builtin_return_address(0), ") " \
"skipped"); \
return retval; \
}
#define DUMMY_RET(retval, name) \
DUMMY name(void) { \
if (SHOW_RET) \
Genode::log(__func__, ": " #name " called " \
"(from ", __builtin_return_address(0), ") " \
"return ", retval); \
return retval; \
}
#define DUMMY_STOP(retval, name) \
DUMMY name(void) { \
do { \
Genode::warning(__func__, ": " #name " called " \
"(from ", __builtin_return_address(0), ") " \
"stopped"); \
Genode::sleep_forever(); \
} while (0); \
return retval; \
}
/* return sucessful */
DUMMY_RET(0, netdev_kobject_init)
DUMMY_RET(0, vlan_tx_nonzero_tag_present)
DUMMY_RET(0, vlan_tx_tag_present)
DUMMY_RET(1, capable)
DUMMY_RET(1, rcu_read_lock_bh_held)
DUMMY_RET(1, softirq_count);
DUMMY_RET(1, try_module_get)
DUMMY_RET(0, security_sk_alloc)
DUMMY_RET(0, net_ratelimit)
DUMMY_RET(0, static_key_false)
DUMMY_RET(1, dma_supported)
DUMMY_RET(1, ns_capable)
DUMMY_RET(0, sock_tx_timestamp)
/* not needed */
DUMMY_SKIP(0, module_put_and_exit)
DUMMY_SKIP(-1, might_sleep)
DUMMY_SKIP(-1, read_lock_bh)
DUMMY_SKIP(-1, read_unlock_bh)
DUMMY_SKIP(-1, rwlock_init)
DUMMY_SKIP(-1, spin_lock_irqsave)
DUMMY_SKIP(-1, spin_unlock_irqrestore)
DUMMY_SKIP(-1, write_lock_bh)
DUMMY_SKIP(-1, write_unlock_bh)
DUMMY_SKIP(0, debugfs_create_dir)
DUMMY_SKIP(0, debugfs_remove_recursive)
DUMMY_SKIP(0, debugfs_rename)
DUMMY_SKIP(0, destroy_workqueue)
DUMMY_SKIP(0, device_create)
DUMMY_SKIP(0, device_initialize)
DUMMY_SKIP(0, down_read)
DUMMY_SKIP(0, down_write)
DUMMY_SKIP(0, free_irq)
DUMMY_SKIP(0, init_rwsem)
DUMMY_SKIP(0, iounmap)
DUMMY_SKIP(0, kparam_block_sysfs_write)
DUMMY_SKIP(0, kparam_unblock_sysfs_write)
DUMMY_SKIP(0, pci_disable_device)
DUMMY_SKIP(0, pci_disable_link_state)
DUMMY_SKIP(0, pci_disable_msi)
DUMMY_SKIP(0, pci_enable_device)
DUMMY_SKIP(0, pci_enable_msi)
DUMMY_SKIP(0, pci_release_regions)
DUMMY_SKIP(0, pci_request_regions)
DUMMY_SKIP(0, pci_set_master)
DUMMY_SKIP(0, put_device)
DUMMY_SKIP(0, scm_destroy)
DUMMY_SKIP(0, scm_recv)
DUMMY_SKIP(0, scm_send)
DUMMY_SKIP(0, security_netlink_send)
DUMMY_SKIP(0, sk_filter)
DUMMY_SKIP(0, sk_filter_release_rcu)
DUMMY_SKIP(-1, sk_filter_size)
DUMMY_SKIP(0, spin_lock)
DUMMY_SKIP(0, spin_lock_bh)
DUMMY_SKIP(0, spin_lock_init)
DUMMY_SKIP(0, spin_lock_irq)
DUMMY_SKIP(0, spin_unlock)
DUMMY_SKIP(0, spin_unlock_bh)
DUMMY_SKIP(0, spin_unlock_irq)
DUMMY_SKIP(0, up_read)
DUMMY_SKIP(0, up_write)
DUMMY_SKIP(1, in_interrupt) /* XXX * */
DUMMY_SKIP(0, in_softirq) /* XXX */
DUMMY_SKIP(0, is_vmalloc_addr) /* XXX */
DUMMY_SKIP(0, in_irq) /* XXX */
DUMMY_SKIP(0, local_bh_disable)
DUMMY_SKIP(0, local_bh_enable)
DUMMY_SKIP(0, dma_set_coherent_mask) /* we set the mask always to ~0UL */
DUMMY_SKIP(0, dma_set_mask) /* in the PCI driver */
DUMMY_SKIP(0, dma_sync_single_for_cpu)
DUMMY_SKIP(0, dma_sync_single_for_device)
/*
* There is no actual mapping going on as the memory is always
* allocated from the DMA backend. It is safe to _not_ implement
* the unmap functions.
*/
DUMMY_SKIP(0, dma_unmap_page)
DUMMY_SKIP(0, dma_unmap_single)
DUMMY_SKIP(-1, dump_stack)
DUMMY_SKIP(-1, gfp_pfmemalloc_allowed)
DUMMY_SKIP(-1, prefetchw)
DUMMY_SKIP(-1, write_lock_irq)
DUMMY_SKIP(-1, write_lock_irqsave)
DUMMY_SKIP(-1, write_unlock_irq)
DUMMY_SKIP(-1, write_unlock_irqrestore)
DUMMY_SKIP(0, read_lock)
DUMMY_SKIP(0, read_unlock)
DUMMY_SKIP(0, sysfs_create_group)
DUMMY_SKIP(0, sysfs_remove_group)
DUMMY_SKIP(0, sysfs_create_link)
DUMMY_SKIP(0, sysfs_remove_link)
DUMMY_SKIP(0, module_put)
DUMMY(0, device_release_driver)
DUMMY(-1, __vlan_put_tag)
DUMMY(-1, dev_printk_emit)
DUMMY(-1, gen_kill_estimator)
DUMMY(-1, generic_pipe_buf_confirm)
DUMMY(-1, generic_pipe_buf_map)
DUMMY(-1, generic_pipe_buf_unmap)
DUMMY(-1, linkwatch_fire_event)
DUMMY(-1, need_resched)
DUMMY(-1, open_softirq)
DUMMY(-1, raw_notifier_chain_unregister)
DUMMY(-1, vlan_do_receive)
DUMMY(-1, vlan_untag)
DUMMY(-1, yield)
DUMMY(0, __raise_softirq_irqoff)
DUMMY(0, __this_cpu_read)
DUMMY(-1, add_device_randomness)
DUMMY(0, add_uevent_var)
DUMMY(0, atomic64_read)
DUMMY(0, bitmap_empty)
DUMMY_SKIP(0, call_rcu)
DUMMY(0, csum_block_add)
DUMMY(0, csum_fold)
DUMMY(0, csum_partial)
DUMMY(0, device_del)
DUMMY(0, device_rename)
DUMMY(0, device_unregister)
DUMMY(0, do_posix_clock_monotonic_gettime)
DUMMY(0, do_softirq)
DUMMY(0, genl_dump_check_consistent)
DUMMY(0, genl_info_net)
DUMMY(0, genlmsg_cancel)
DUMMY(0, genlmsg_end)
DUMMY(0, genlmsg_multicast)
DUMMY(0, genlmsg_multicast_netns)
DUMMY(0, genlmsg_reply)
DUMMY(0, genlmsg_unicast)
DUMMY(0, get_cpu)
DUMMY(0, get_seconds)
DUMMY(0, hweight16)
DUMMY(0, hweight64)
DUMMY(0, idr_destroy)
DUMMY(0, idr_for_each)
DUMMY(0, idr_init)
DUMMY(0, idr_remove)
DUMMY(0, ip_hdr)
DUMMY(0, ipv4_get_dsfield)
DUMMY(0, ipv6_get_dsfield)
DUMMY(0, ipv6_hdr)
DUMMY(0, irqs_disabled)
DUMMY(0, jhash_2words)
DUMMY(0, kobject_uevent)
DUMMY(0, kobject_uevent_env)
DUMMY(0, kstrtoul)
DUMMY(0, linkwatch_init_dev)
DUMMY(0, local_softirq_pending)
DUMMY(0, mb)
DUMMY_SKIP(0, misc_register)
DUMMY(0, mmiowb)
DUMMY(0, net_dmaengine_put)
DUMMY(0, net_info_ratelimited)
DUMMY(0, net_ns_type_operations)
DUMMY(0, netdev_pick_tx)
DUMMY(0, netdev_register_kobject)
DUMMY(0, netdev_unregister_kobject)
DUMMY(0, netpoll_poll_lock)
DUMMY(0, netpoll_poll_unlock)
DUMMY(0, netpoll_receive_skb)
DUMMY(0, netpoll_rx)
DUMMY(0, netpoll_rx_disable)
DUMMY(0, netpoll_rx_enable)
DUMMY(0, nla_data)
DUMMY(0, nla_get_be32)
DUMMY(0, nla_get_flag)
DUMMY(0, nla_get_s8)
DUMMY(0, nla_get_u16)
DUMMY(0, nla_get_u32)
DUMMY(0, nla_get_u64)
DUMMY(0, nla_get_u8)
DUMMY(0, nla_len)
DUMMY(0, nla_nest_end)
DUMMY(0, nla_nest_start)
DUMMY(0, nla_parse_nested)
DUMMY(0, nla_put_be32)
DUMMY(0, nla_put_flag)
DUMMY(0, nla_put_string)
DUMMY(0, nla_put_u16)
DUMMY(0, nla_put_u32)
DUMMY(0, nla_put_u64)
DUMMY(0, nla_put_u8)
DUMMY(0, nla_type)
DUMMY(0, nlmsg_free)
DUMMY(0, nlmsg_new)
DUMMY(0, nlmsg_parse)
DUMMY(0, nonseekable_open)
DUMMY(0, ntohs)
DUMMY(0, pci_pme_capable)
DUMMY(0, pm_qos_add_notifier)
DUMMY(0, pm_qos_remove_notifier)
DUMMY(0, pm_qos_request)
DUMMY(0, poll_wait)
DUMMY(0, preempt_disable)
DUMMY(0, preempt_enable)
DUMMY(0, put_cpu)
DUMMY(0, put_unaligned_le64)
DUMMY(0, qdisc_all_tx_empty)
DUMMY(0, raise_softirq_irqoff)
DUMMY(0, rcu_barrier)
DUMMY(0, rcu_read_lock_bh)
DUMMY(0, rcu_read_lock_held)
DUMMY(0, rcu_read_unlock_bh)
DUMMY(-1, release_net)
DUMMY(0, rtnl_dereference)
DUMMY(-1, seq_printf)
DUMMY(0, smp_mb)
DUMMY(0, smp_mb__before_clear_bit)
DUMMY(0, smp_processor_id)
DUMMY(0, smp_rmb)
DUMMY(0, sock_net)
DUMMY(0, sock_release)
DUMMY(0, spin_trylock)
DUMMY(0, synchronize_irq)
DUMMY(0, synchronize_rcu_expedited)
DUMMY(0, tasklet_disable)
DUMMY(0, tasklet_enable)
DUMMY(0, tasklet_kill)
DUMMY(0, tcp_hdrlen)
DUMMY(0, this_cpu_dec)
DUMMY(0, this_cpu_inc)
DUMMY(0, toupper)
DUMMY(0, wait_event_interruptible)
DUMMY(0, work_busy)
DUMMY_SKIP(0, class_register)
DUMMY(0, class_unregister)
DUMMY(0, debugfs_remove)
DUMMY(0, dev_set_uevent_suppress)
DUMMY(0, ethtool_op_get_link)
DUMMY(0, genl_register_family_with_ops)
DUMMY(0, genl_register_mc_group)
DUMMY(0, init_utsname)
DUMMY(0, platform_device_unregister)
DUMMY(0, atomic_notifier_chain_register)
DUMMY(0, __get_free_pages)
DUMMY(0, __get_free_page)
DUMMY(0, __set_current_state)
// DUMMY(0, add_wait_queue)
DUMMY(0, add_wait_queue_exclusive)
DUMMY(0, atomic_notifier_call_chain)
DUMMY(0, cond_resched)
DUMMY(0, current)
DUMMY(0, debug_check_no_locks_freed)
DUMMY(0, get_user)
DUMMY(0, jhash_1word)
DUMMY(0, kernel_sendmsg)
DUMMY(0, put_cmsg)
DUMMY(0, put_cred)
DUMMY(0, put_pid)
DUMMY(0, schedule)
DUMMY(-1, security_sk_free)
DUMMY(0, set_current_state)
DUMMY(0, signal_pending)
DUMMY(0, smp_wmb)
DUMMY_SKIP(0, sock_update_classid)
DUMMY_SKIP(0, sock_update_netprioidx)
DUMMY(0, sock_wake_async)
DUMMY(0, static_key_slow_dec)
DUMMY(0, task_tgid_vnr)
DUMMY(0, totalram_pages)
DUMMY(0, wake_up_interruptible_poll)
DUMMY(-1, __this_cpu_write)
DUMMY(-1, csum_block_add_ext)
DUMMY(-1, csum_partial_ext)
DUMMY(-1, genl_register_family_with_ops_groups)
DUMMY(-1, sg_init_one)
DUMMY(-1, vlan_hw_offload_capable)
DUMMY(-1, vlan_tx_tag_get_id)
DUMMY(-1, tsk_restore_flags)
DUMMY(-1, put_user)
DUMMY(-1, write_seqcount_begin)
DUMMY(-1, write_seqcount_end)
DUMMY(-1, net_dmaengine_get)
DUMMY(-1, audit_enabled)
DUMMY(-1, audit_get_sessionid)
DUMMY(-1, audit_get_loginuid)
DUMMY(-1, init_user_ns)
DUMMY(-1, from_kgid)
DUMMY(-1, from_kuid)
DUMMY(-1, pci_num_vf)
DUMMY(-1, audit_log)
DUMMY(-1, linkwatch_forget_dev)
DUMMY(-1, linkwatch_run_queue)
DUMMY(-1, on_each_cpu)
DUMMY(-1, kobject_put)
DUMMY(-1, mq_qdisc_ops)
DUMMY(-1, get_net_ns_by_pid)
DUMMY(-1, get_net_ns_by_fd)
DUMMY(-1, unregister_pernet_device)
DUMMY(0, __hw_addr_init)
DUMMY(0, __hw_addr_sync)
DUMMY(0, __hw_addr_unsync)
DUMMY_SKIP(0, dev_alloc_name)
DUMMY(0, dev_change_net_namespace)
DUMMY(0, dev_kfree_skb_any)
DUMMY(0, dev_net_set)
DUMMY(0, dev_open)
DUMMY_SKIP(0, dev_hold)
DUMMY_SKIP(0, dev_put)
DUMMY(0, dst_release)
DUMMY(0, free_netdev)
DUMMY(0, net_disable_timestamp)
DUMMY(0, next_net_device)
DUMMY_SKIP(0, synchronize_net)
DUMMY(0, unregister_netdevice_many)
DUMMY(0, unregister_netdevice_notifier)
DUMMY(0, unregister_netdevice_queue)
DUMMY(-1, task_pid_nr)
DUMMY(-1, pid_vnr)
DUMMY(-1, from_kuid_munged)
DUMMY(-1, from_kgid_munged)
DUMMY(-1, sk_get_filter)
DUMMY(-1, sk_detach_filter)
DUMMY(-1, cond_resched_softirq)
DUMMY(-1, prefetch)
DUMMY(-1, security_socket_getpeersec_stream)
DUMMY(-1, net_enable_timestamp)
DUMMY(-1, __lock_sock)
DUMMY(-1, bpf_tell_extensions)
DUMMY(0, atomic64_set)
DUMMY(0, device_can_wakeup)
DUMMY(0, device_reprobe)
DUMMY(0, device_set_wakeup_enable)
DUMMY(0, ip_fast_csum)
DUMMY(0, request_firmware)
DUMMY(0, tcp_v4_check)
DUMMY(0, sk_attach_filter)
DUMMY(0, __module_get)
DUMMY(0, __sock_recv_timestamp)
DUMMY(0, __sock_recv_wifi_status)
DUMMY(0, _sigprocmask)
DUMMY(0, acpi_match_device)
DUMMY(0, atomic_notifier_chain_unregister)
DUMMY(0, can_checksum_protocol)
DUMMY(0, class_destroy)
DUMMY(0, clk_disable)
DUMMY(0, clk_enable)
DUMMY(0, csum_ipv6_magic)
DUMMY(0, csum_partial_copy)
DUMMY(0, csum_sub)
DUMMY(0, csum_tcpudp_nofold)
DUMMY(0, devm_clk_get)
DUMMY(0, devm_gpiod_get_index)
DUMMY(0, file_inode)
DUMMY(0, gpiod_direction_output)
DUMMY(0, gpiod_set_value)
DUMMY(0, hex_dump_to_buffer)
DUMMY(0, __ilog2_u32)
DUMMY(0, __ilog2_u64)
DUMMY(0, input_close_device)
DUMMY(0, input_open_device)
DUMMY(0, input_register_handle)
DUMMY(0, input_register_handler)
DUMMY(0, input_unregister_handle)
DUMMY(0, input_unregister_handler)
DUMMY(0, ip_hdrlen)
DUMMY(0, ipv6_authlen)
DUMMY(0, ipv6_optlen)
DUMMY(0, misc_deregister)
DUMMY(0, net_gso_ok)
DUMMY(0, nosteal_pipe_buf_ops)
DUMMY(0, pci_unregister_driver)
DUMMY(0, platform_get_drvdata)
DUMMY(0, platform_set_drvdata)
DUMMY(0, regulator_disable)
DUMMY(0, regulator_enable)
DUMMY(0, regulator_get_exclusive)
DUMMY(0, regulator_is_enabled)
DUMMY(0, regulator_put)
DUMMY(0, send_sigurg)
DUMMY(0, simple_strtoul)
DUMMY(0, skb_gro_len)
DUMMY(0, skb_gro_offset)
DUMMY(0, skb_network_protocol)
DUMMY(0, spin_lock_nested)
DUMMY(0, splice_to_pipe)
DUMMY(0, static_key_slow_inc)
DUMMY(0, tcp_hdr)
DUMMY(0, textsearch_find)
DUMMY(0, udp_hdr)
DUMMY(0, virt_to_page)
DUMMY(0, xfrm_sk_clone_policy)
DUMMY(0, xfrm_sk_free_policy)
DUMMY(0, __ethtool_get_settings)
DUMMY(0, __skb_get_hash)
DUMMY(0, __sock_recv_ts_and_drops)
DUMMY(0, cpu_relax)
DUMMY(0, dev_get_by_name)
DUMMY(0, dev_get_by_name_rcu)
DUMMY(0, dev_mc_add)
DUMMY(0, dev_mc_del)
DUMMY(0, dev_remove_pack)
DUMMY(0, dev_set_allmulti)
DUMMY(0, dev_set_promiscuity)
DUMMY(0, dev_uc_add)
DUMMY(0, dev_uc_del)
DUMMY(0, dev_xmit_complete)
DUMMY(0, ethtool_cmd_speed)
DUMMY(0, flush_dcache_page)
DUMMY(0, getnstimeofday)
DUMMY(0, ip_check_defrag)
DUMMY(0, netdev_get_tx_queue)
DUMMY(0, offset_in_page)
DUMMY(0, prandom_u32_max)
DUMMY(0, raw_smp_processor_id)
DUMMY(0, sk_run_filter)
DUMMY(0, skb_flow_dissect)
DUMMY(0, sock_unregister)
DUMMY(0, txq_trans_update)
DUMMY(0, unregister_pernet_subsys)
DUMMY(0, vm_insert_page)
DUMMY(0, vmalloc_to_page)
DUMMY(0, __dev_change_flags)
DUMMY(0, __dev_get_by_name)
DUMMY(0, __dev_notify_flags)
DUMMY(0, call_netdevice_notifiers)
DUMMY(0, dev_base_lock)
DUMMY(0, dev_change_carrier)
DUMMY(0, dev_change_flags)
DUMMY(0, dev_change_name)
DUMMY(0, dev_get_flags)
DUMMY(0, dev_get_phys_port_id)
DUMMY(0, dev_get_stats)
DUMMY(0, dev_mc_add_excl)
DUMMY(0, dev_set_alias)
DUMMY(0, dev_set_group)
DUMMY(0, dev_set_mac_address)
DUMMY(0, dev_set_mtu)
DUMMY(0, dev_uc_add_excl)
DUMMY(0, is_link_local_ether_addr)
DUMMY(0, jiffies_to_clock_t)
DUMMY(0, netdev_boot_setup)
DUMMY(0, netdev_master_upper_dev_get)
DUMMY(0, netdev_state_change)
DUMMY(0, netdev_unregistering_wq)
DUMMY(0, autoremove_wake_function)
DUMMY(0, get_user_pages_fast)
DUMMY(0, memcpy_toiovecend)
DUMMY(0, netdev_rx_csum_fault)
DUMMY(0, release_pages)
DUMMY(0, sk_busy_loop)
DUMMY(0, sk_can_busy_loop)
DUMMY_SKIP(0, simple_strtol)
DUMMY_SKIP(0, alg_test)
DUMMY(0, __cfg80211_leave_ocb)
DUMMY(0, __skb_flow_dissect)
DUMMY(0, __sock_tx_timestamp)
DUMMY(0, bpf_prog_create_from_user)
DUMMY(0, bpf_prog_destroy)
DUMMY(0, bpf_prog_run_clear_cb)
DUMMY(0, cfg80211_join_ocb)
DUMMY(0, cfg80211_leave_ocb)
DUMMY(0, class_find_device)
DUMMY(0, config_enabled)
DUMMY(0, dev_change_proto_down)
DUMMY(0, dev_get_iflink)
DUMMY(0, dev_get_phys_port_name)
DUMMY(0, device_enable_async_suspend)
DUMMY(0, fatal_signal_pending)
DUMMY_RET(1, file_ns_capable)
DUMMY(0, flow_keys_dissector)
DUMMY(0, get_net_ns_by_id)
DUMMY_SKIP(0, gfpflags_allow_blocking)
DUMMY(0, init_dummy_netdev)
DUMMY(0, napi_gro_flush)
DUMMY(0, netdev_start_xmit)
DUMMY_RET(0, netdev_uses_dsa)
DUMMY_RET(0, page_is_pfmemalloc)
DUMMY_RET(0, peernet2id)
DUMMY(0, pr_err_once)
DUMMY(0, sk_attach_bpf)
DUMMY(0, sk_filter_uncharge)
DUMMY(0, skb_checksum_help)
DUMMY(0, skb_get_tx_queue)
DUMMY(0, skb_gso_segment)
DUMMY(0, skb_vlan_tag_get)
DUMMY(0, skb_vlan_tag_present)
DUMMY(0, smp_mb__before_atomic)
DUMMY(0, sock_diag_broadcast_destroy)
DUMMY(0, sock_diag_has_destroy_listeners)
DUMMY(0, switchdev_port_attr_get)
DUMMY_RET(0, netif_dormant)
DUMMY(0, netif_napi_add)
DUMMY(0, netif_napi_del)
DUMMY_STOP(0, netif_rx)
DUMMY(0, netif_skb_features)
DUMMY(0, netif_supports_nofcs)
DUMMY(0, netif_xmit_frozen_or_drv_stopped)
DUMMY(0, netif_xmit_frozen_or_stopped)
DUMMY_STOP(0, netif_rx_ni)
DUMMY_STOP(0, netif_tx_start_all_queues)
DUMMY(0, netif_tx_stop_all_queues)
DUMMY(0, peernet_has_id)
DUMMY(0, peernet2id_alloc)
} /* extern "C" */

View File

@ -1,516 +0,0 @@
/*
* \brief Dummy functions
* \author Josef Soentgen
* \date 2018-04-26
*/
/*
* Copyright (C) 2018 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* local includes */
#include <lx_emul.h>
#if 0
#define TRACE \
do { \
lx_printf("%s not implemented from: %p\n", __func__, \
__builtin_return_address(0)); \
} while (0)
#define TRACE_OK \
do { \
lx_printf("%s not implemented but OK\n", __func__); \
} while (0)
#else
#define TRACE do { ; } while (0)
#define TRACE_OK do { ; } while (0)
#endif
void __dev_xdp_query(struct net_device *dev, bpf_op_t xdp_op, struct netdev_bpf *xdp)
{
TRACE;
}
int __ethtool_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *link_ksettings)
{
TRACE;
return -1;
}
u32 __skb_get_hash_symmetric(const struct sk_buff *skb)
{
TRACE;
return 0;
}
// typedef int (*bpf_op_t)(struct net_device *dev, struct netdev_bpf *bpf);
// struct bpf_prog *bpf_prog_get_type(u32 ufd, enum bpf_prog_type type)
// {
// TRACE;
// return NULL;
// }
struct sk_buff **call_gro_receive(gro_receive_t cb, struct sk_buff **head, struct sk_buff *skb)
{
TRACE;
return NULL;
}
struct user_struct *current_user()
{
TRACE;
return NULL;
}
int dev_change_tx_queue_len(struct net_device *dev, unsigned long d)
{
TRACE;
return -1;
}
int dev_change_xdp_fd(struct net_device *dev, struct netlink_ext_ack *extack,
int fd, u32 flags)
{
TRACE;
return -1;
}
int dev_get_alias(const struct net_device *dev, char *p, size_t n)
{
TRACE;
return -1;
}
int dev_recursion_level(void)
{
TRACE;
return 0;
}
bool dev_validate_header(const struct net_device *dev, char *ll_header, int len)
{
TRACE;
return false;
}
void free_uid(struct user_struct *user)
{
TRACE;
}
void iov_iter_revert(struct iov_iter *i, size_t bytes)
{
TRACE;
}
kuid_t make_kuid(struct user_namespace *from, uid_t uid)
{
TRACE;
return 0;
}
void memalloc_noreclaim_restore(unsigned int flags)
{
TRACE;
}
unsigned int memalloc_noreclaim_save(void)
{
TRACE;
return 0;
}
struct fq_flow *fq_flow_classify(struct fq *fq, struct fq_tin *tin,
struct sk_buff *skb,
fq_flow_get_default_t get_default_func)
{
TRACE;
return 0;
}
void fq_flow_init(struct fq_flow *flow)
{
TRACE;
}
int fq_init(struct fq *fq, int flows_cnt)
{
TRACE;
return -1;
}
void fq_recalc_backlog(struct fq *fq, struct fq_tin *tin, struct fq_flow *flow)
{
TRACE;
}
void fq_reset(struct fq *fq, fq_skb_free_t free_func)
{
TRACE;
}
void fq_tin_enqueue(struct fq *fq, struct fq_tin *tin, struct sk_buff *skb,
fq_skb_free_t free_func, fq_flow_get_default_t get_default_func)
{
TRACE;
}
void fq_tin_filter(struct fq *fq, struct fq_tin *tin, fq_skb_filter_t filter_func,
void *filter_data, fq_skb_free_t free_func)
{
TRACE;
}
void fq_tin_init(struct fq_tin *tin)
{
TRACE;
}
void fq_tin_reset(struct fq *fq, struct fq_tin *tin, fq_skb_free_t free_func)
{
TRACE;
}
int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m)
{
TRACE;
return 0;
}
struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev)
{
TRACE;
return NULL;
}
void netdev_rss_key_fill(void *buffer, size_t len)
{
TRACE;
/* XXX get_random_once() to fill cmd.secret_key */
}
const void *of_get_mac_address(struct device_node *np)
{
TRACE;
return NULL;
}
struct device_node * pci_device_to_OF_node(const struct pci_dev *pdev)
{
TRACE;
return NULL;
}
int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
int minvec, int maxvec)
{
TRACE;
return -1;
}
int pci_find_ext_capability(struct pci_dev *dev, int cap)
{
TRACE;
return -1;
}
int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
{
// TRACE_OK;
return 0;
}
int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
{
// TRACE_OK;
return 0;
}
struct pci_dev *pcie_find_root_port(struct pci_dev *dev)
{
TRACE;
return NULL;
}
int pcim_enable_device(struct pci_dev *pdev)
{
TRACE;
return 0;
}
bool pm_runtime_active(struct device *dev)
{
TRACE;
return true;
}
void pm_runtime_allow(struct device *dev)
{
TRACE;
}
void pm_runtime_forbid(struct device *dev)
{
TRACE;
}
int pm_runtime_get(struct device *dev)
{
TRACE;
return 1;
}
void pm_runtime_mark_last_busy(struct device *dev)
{
TRACE;
}
int pm_runtime_put_autosuspend(struct device *dev)
{
TRACE;
return -1;
}
int pm_runtime_resume(struct device *dev)
{
TRACE;
return 1;
}
int pm_runtime_set_active(struct device *dev)
{
TRACE;
return 0;
}
void pm_runtime_set_autosuspend_delay(struct device *dev, int delay)
{
TRACE;
}
bool pm_runtime_suspended(struct device *dev)
{
// TRACE_OK;
return false;
}
void pm_runtime_use_autosuspend(struct device *dev)
{
TRACE;
}
void pm_wakeup_event(struct device *dev, unsigned int msec)
{
TRACE;
}
void reuseport_detach_sock(struct sock *sk)
{
TRACE;
}
int sg_nents(struct scatterlist *sg)
{
TRACE;
return -1;
}
size_t sg_pcopy_from_buffer(struct scatterlist *sgl, unsigned int nents,
const void *buf, size_t buflen, off_t skip)
{
TRACE;
return 0;
}
int sk_reuseport_attach_bpf(u32 ufd, struct sock *sk)
{
TRACE;
return -1;
}
int sk_reuseport_attach_filter(struct sock_fprog *fprog, struct sock *sk)
{
TRACE;
return -1;
}
void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff **pp, int flush)
{
TRACE;
}
void *skb_gro_header_fast(struct sk_buff *skb, unsigned int offset)
{
TRACE;
return NULL;
}
int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen)
{
TRACE;
return 0; // XXX
}
void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen, unsigned int offset)
{
TRACE;
return NULL;
}
void skb_gro_postpull_rcsum(struct sk_buff *skb, const void *start, unsigned int len)
{
TRACE;
}
void skb_gro_pull(struct sk_buff *skb, unsigned int len)
{
TRACE;
}
u64 sock_gen_cookie(struct sock *sk)
{
TRACE;
return 0;
}
unsigned int u64_stats_fetch_begin(const struct u64_stats_sync *syncp)
{
// TRACE;
return 0;
}
unsigned int u64_stats_fetch_begin_irq(const struct u64_stats_sync *syncp)
{
// TRACE;
return 0;
}
bool u64_stats_fetch_retry(const struct u64_stats_sync *syncp, unsigned int start)
{
// TRACE;
return false;
}
bool u64_stats_fetch_retry_irq(const struct u64_stats_sync *syncp, unsigned int start)
{
// TRACE;
return false;
}
void u64_stats_init(struct u64_stats_sync *syncp)
{
// TRACE;
}
struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *dev,
bool *again)
{
TRACE;
return NULL;
}
int virtio_net_hdr_from_skb(const struct sk_buff *skb, struct virtio_net_hdr *hdr,
bool little_endian, bool has_data_valid)
{
TRACE;
return -1;
}
int virtio_net_hdr_to_skb(struct sk_buff *skb, const struct virtio_net_hdr *hdr,
bool little_endian)
{
TRACE;
return -1;
}
void wireless_nlevent_flush(void)
{
TRACE;
}
bool wq_has_sleeper(struct wait_queue_head *wq_head)
{
TRACE_OK;
return true;
}
bool sysfs_streq(const char *s1, const char *s2)
{
TRACE;
return false;
}

View File

@ -1,115 +0,0 @@
/*
* \brief Linux wireless stack
* \author Josef Soentgen
* \date 2018-06-29
*/
/*
* Copyright (C) 2018 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/log.h>
/* local includes */
#include <legacy/lx_kit/env.h>
#include <firmware_list.h>
#include <lx_emul.h>
Firmware_list fw_list[] = {
{ "regulatory.db", 4144, nullptr },
{ "iwlwifi-1000-5.ucode", 337520, nullptr },
{ "iwlwifi-3160-17.ucode", 918268, nullptr },
{ "iwlwifi-5000-5.ucode", 340696, nullptr },
{ "iwlwifi-6000-4.ucode", 454608, nullptr },
{ "iwlwifi-6000-6.ucode", 454608, "iwlwifi-6000-4.ucode" },
{ "iwlwifi-6000g2a-6.ucode", 677296, nullptr },
{ "iwlwifi-6000g2b-6.ucode", 679436, nullptr },
{ "iwlwifi-7260-17.ucode", 1049340, nullptr },
{ "iwlwifi-7265-16.ucode", 1180412, nullptr },
{ "iwlwifi-7265D-22.ucode", 1028376, nullptr },
{ "iwlwifi-7265D-29.ucode", 1036432, nullptr },
{ "iwlwifi-8000C-22.ucode", 2120860, nullptr },
{ "iwlwifi-8000C-36.ucode", 2486572, nullptr },
{ "iwlwifi-8265-22.ucode", 1811984, nullptr },
{ "iwlwifi-8265-36.ucode", 2498044, nullptr },
{ "iwlwifi-9000-pu-b0-jf-b0-34.ucode", 2678284, nullptr },
{ "iwlwifi-9000-pu-b0-jf-b0-36.ucode", 2678284, "iwlwifi-9000-pu-b0-jf-b0-34.ucode" }
};
size_t fw_list_len = sizeof(fw_list) / sizeof(fw_list[0]);
/**********************
** linux/firmware.h **
**********************/
int request_firmware_nowait(struct module *module, bool uevent,
const char *name, struct device *device,
gfp_t gfp, void *context,
void (*cont)(const struct firmware *, void *))
{
/* only try to load known firmware images */
Firmware_list *fwl = 0;
for (size_t i = 0; i < fw_list_len; i++) {
if (Genode::strcmp(name, fw_list[i].requested_name) == 0) {
fwl = &fw_list[i];
break;
}
}
if (!fwl) {
Genode::error("firmware '", name, "' is not in the firmware white list");
return -1;
}
char const *fw_name = fwl->available_name
? fwl->available_name : fwl->requested_name;
Genode::Rom_connection rom(Lx_kit::env().env(), fw_name);
Genode::Dataspace_capability ds_cap = rom.dataspace();
if (!ds_cap.valid()) {
Genode::error("could not get firmware ROM dataspace");
return -1;
}
struct firmware *fw = (struct firmware *)kzalloc(sizeof(struct firmware), 0);
if (!fw) {
Genode::error("could not allocate memory for firmware metadata");
return -1;
}
/* use allocator because fw is too big for slab */
Lx_kit::env().heap().try_alloc(fwl->size).with_result(
[&] (void *ptr) { fw->data = (u8 *)ptr; },
[&] (Genode::Allocator::Alloc_error) {
Genode::error("Could not allocate memory for firmware image"); });
if (!fw->data) {
kfree(fw);
return -1;
}
void const *image = Lx_kit::env().env().rm().attach(ds_cap);
Genode::memcpy((void*)fw->data, image, fwl->size);
Lx_kit::env().env().rm().detach(image);
fw->size = fwl->size;
cont(fw, context);
return 0;
}
void release_firmware(const struct firmware *fw)
{
Lx_kit::env().heap().free(const_cast<u8 *>(fw->data), fw->size);
kfree(fw);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +0,0 @@
/*
* \brief List for firmware images and their sizes
* \author Josef Soentgen
* \date 2014-03-26
*/
/*
* Copyright (C) 2014-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#ifndef _FIRMWARE_LIST_H_
#define _FIRMWARE_LIST_H_
typedef __SIZE_TYPE__ size_t;
struct Firmware_list
{
char const *requested_name;
size_t size;
char const *available_name;
};
#endif /* _FIRMWARE_LIST_H_ */

View File

@ -1 +0,0 @@
#include <uapi/linux/gen_stats.h>

View File

@ -1 +0,0 @@
#include <uapi/linux/hdlc/ioctl.h>

View File

@ -1 +0,0 @@
#include <uapi/linux/if_bridge.h>

View File

@ -1 +0,0 @@
#include <uapi/linux/if_packet.h>

View File

@ -1 +0,0 @@
#include <uapi/linux/neighbour.h>

View File

@ -1 +0,0 @@
#include <uapi/linux/nl80211.h>

View File

@ -1,2 +0,0 @@
#include <uapi/asm-generic/socket.h>
#include <uapi/linux/sockios.h>

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
/*
* net/core/sock.c needs <net/inet_sock.h> but it does not
* include this header directly. <net/protocol.h> is normally
* provided by lx_emul.h and is included by sock.c.
*/
#include <net/inet_sock.h>

View File

@ -1,27 +0,0 @@
/*
* \brief Platform specific code
* \author Sebastian Sumpf
* \date 2012-06-10
*/
/*
* Copyright (C) 2012-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#ifndef _X86_32__PLATFORM_H_
#define _X86_32__PLATFORM_H_
static inline
void platform_execute(void *sp, void *func, void *arg)
{
asm volatile ("movl %2, 0(%0);"
"movl %1, -0x4(%0);"
"movl %0, %%esp;"
"call *-4(%%esp);"
: : "r" (sp), "r" (func), "r" (arg));
}
#endif /* _X86_32__PLATFORM_H_ */

View File

@ -1,33 +0,0 @@
/*
* \brief Platform specific code
* \author Sebastian Sumpf
* \author Alexander Boettcher
* \date 2012-06-10
*/
/*
* Copyright (C) 2012-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#ifndef _X86_64__PLATFORM_H_
#define _X86_64__PLATFORM_H_
static inline
void platform_execute(void *sp, void *func, void *arg)
{
asm volatile ("movq %0, %%rsp;" /* load stack pointer */
"movq %%rsp, %%rbp;" /* caller stack frame (for GDB debugging) */
"movq %0, -8(%%rbp);"
"movq %1, -16(%%rbp);"
"movq %2, -24(%%rbp);"
"sub $24, %%rsp;" /* adjust to next stack frame */
"movq %2, %%rdi;" /* 1st argument */
"call *-16(%%rbp);" /* call func */
: : "r" (sp), "r" (func), "r" (arg));
}
#endif /* _X86_64__PLATFORM_H_ */

View File

@ -1,246 +0,0 @@
/*
* \brief Linux wireless stack
* \author Josef Soentgen
* \date 2014-03-03
*/
/*
* Copyright (C) 2014-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/env.h>
#include <base/blockade.h>
/* local includes */
#include <firmware_list.h>
#include <lx.h>
#include <lx_emul.h>
#include <legacy/lx_kit/malloc.h>
#include <legacy/lx_kit/env.h>
#include <legacy/lx_kit/irq.h>
#include <legacy/lx_kit/work.h>
#include <legacy/lx_kit/timer.h>
#include <legacy/lx_kit/pci.h>
/*********************
** RFKILL handling **
*********************/
#include <linux/rfkill.h>
extern "C" void rfkill_switch_all(enum rfkill_type type, bool blocked);
extern "C" bool rfkill_get_any(enum rfkill_type type);
#include <wifi/rfkill.h>
bool wifi_get_rfkill(void)
{
return rfkill_get_any(RFKILL_TYPE_WLAN);
}
static Lx::Task *_lx_task = nullptr;
static bool _lx_init_done = false;
static bool _switch_rfkill = false;
static bool _new_blocked = false;
static Genode::Signal_context_capability _rfkill_sig_ctx;
void wifi_set_rfkill(bool blocked)
{
bool const cur = wifi_get_rfkill();
_switch_rfkill = blocked != cur;
if (_lx_init_done && _switch_rfkill) {
_new_blocked = blocked;
_lx_task->unblock();
Lx::scheduler().schedule();
}
}
extern "C" unsigned int wifi_ifindex(void)
{
return 1;
}
extern "C" char const wifi_ifname(void)
{
return "wlan0";
}
/**************************
** socketcall poll hack **
**************************/
void wifi_kick_socketcall()
{
/*
* Kicking is going to unblock the socketcall task that
* probably is waiting in poll_all().
*/
Lx::socket_kick();
}
/*****************************
** Initialization handling **
*****************************/
extern "C" void core_netlink_proto_init(void);
extern "C" void core_sock_init(void);
extern "C" void module_packet_init(void);
extern "C" void subsys_genl_init(void);
extern "C" void subsys_rfkill_init(void);
extern "C" void fs_cfg80211_init(void);
extern "C" void subsys_ieee80211_init(void);
extern "C" int module_iwl_drv_init(void);
extern "C" void subsys_cryptomgr_init(void);
extern "C" void module_crypto_ccm_module_init(void);
extern "C" void module_crypto_ctr_module_init(void);
extern "C" void module_aes_init(void);
extern "C" void module_arc4_init(void);
// extern "C" void module_chainiv_module_init(void);
extern "C" void module_krng_mod_init(void);
extern "C" void subsys_leds_init(void);
extern "C" unsigned int *module_param_11n_disable;
struct workqueue_struct *system_power_efficient_wq;
struct workqueue_struct *system_wq;
struct pernet_operations loopback_net_ops;
struct net init_net;
LIST_HEAD(net_namespace_list);
static Genode::Blockade *_wpa_blockade;
static void run_linux(void *args)
{
system_power_efficient_wq = alloc_workqueue("system_power_efficient_wq", 0, 0);
system_wq = alloc_workqueue("system_wq", 0, 0);
core_sock_init();
core_netlink_proto_init();
module_packet_init();
subsys_genl_init();
subsys_rfkill_init();
subsys_leds_init();
fs_cfg80211_init();
subsys_ieee80211_init();
subsys_cryptomgr_init();
module_crypto_ccm_module_init();
module_crypto_ctr_module_init();
module_aes_init();
module_arc4_init();
try {
int const err = module_iwl_drv_init();
if (err) { throw -1; }
} catch (...) {
Genode::Env &env = *(Genode::Env*)args;
env.parent().exit(1);
Genode::sleep_forever();
}
_wpa_blockade->wakeup();
_lx_init_done = true;
while (1) {
Lx::scheduler().current()->block_and_schedule();
if (!_switch_rfkill) { continue; }
Genode::log("RFKILL: ", _new_blocked ? "BLOCKED" : "UNBLOCKED");
rfkill_switch_all(RFKILL_TYPE_WLAN, _new_blocked);
if (!_new_blocked) {
try {
bool const ok = Lx::open_device();
if (!ok) { throw -1; }
} catch (...) {
Genode::Env &env = *(Genode::Env*)args;
env.parent().exit(1);
Genode::sleep_forever();
}
}
/* notify front end */
Genode::Signal_transmitter(_rfkill_sig_ctx).submit();
}
}
unsigned long jiffies;
void wifi_init(Genode::Env &env,
Genode::Blockade &blockade,
bool disable_11n,
Genode::Signal_context_capability rfkill)
{
Lx_kit::construct_env(env);
LX_MUTEX_INIT(crypto_default_rng_lock);
LX_MUTEX_INIT(fanout_mutex);
LX_MUTEX_INIT(genl_mutex);
LX_MUTEX_INIT(proto_list_mutex);
LX_MUTEX_INIT(rate_ctrl_mutex);
LX_MUTEX_INIT(reg_regdb_apply_mutex);
LX_MUTEX_INIT(rfkill_global_mutex);
LX_MUTEX_INIT(rtnl_mutex);
_wpa_blockade = &blockade;
INIT_LIST_HEAD(&init_net.dev_base_head);
/* add init_net namespace to namespace list */
list_add_tail_rcu(&init_net.list, &net_namespace_list);
Lx::scheduler(&env);
Lx::timer(&env, &env.ep(), &Lx_kit::env().heap(), &jiffies);
Lx::Irq::irq(&env.ep(), &Lx_kit::env().heap());
Lx::Work::work_queue(&Lx_kit::env().heap());
Lx::socket_init(env.ep(), Lx_kit::env().heap());
Lx::nic_init(env, Lx_kit::env().heap());
Lx::pci_init(env, env.ram(), Lx_kit::env().heap());
Lx::malloc_init(env, Lx_kit::env().heap());
/* set IWL_DISABLE_HT_ALL if disable 11n is requested */
if (disable_11n) {
Genode::log("Disable 11n mode");
*module_param_11n_disable = 1;
}
_rfkill_sig_ctx = rfkill;
/* Linux task (handles the initialization only currently) */
static Lx::Task linux(run_linux, &env, "linux",
Lx::Task::PRIORITY_0, Lx::scheduler());
_lx_task = &linux;
/* give all task a first kick before returning */
Lx::scheduler().schedule();
}

View File

@ -1,46 +0,0 @@
/*
* \brief Lx env
* \author Josef Soentgen
* \date 2014-10-17
*/
/*
* Copyright (C) 2014-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#ifndef _LX_H_
#define _LX_H_
/* Genode includes */
#include <base/allocator.h>
/* local includes */
#include <legacy/lx_kit/scheduler.h>
#define DEBUG_PRINTK 1
#define DEBUG_DEV_DBG 1
#define DEBUG_SCHEDULING 0
namespace Lx
{
void emul_init(Genode::Env&, Genode::Allocator&);
void socket_init(Genode::Entrypoint&, Genode::Allocator&);
void socket_kick();
void nic_init(Genode::Env&, Genode::Allocator&);
Genode::Ram_dataspace_capability backend_alloc(Genode::addr_t, Genode::Cache);
void backend_free(Genode::Ram_dataspace_capability);
void get_mac_address(unsigned char *);
bool open_device();
}
#endif /* _LX_H_ */

View File

@ -1,40 +0,0 @@
/*
* \brief Lx C env
* \author Josef Soentgen
* \date 2016-03-04
*/
/*
* Copyright (C) 2016-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#ifndef _LXC_H_
#define _LXC_H_
/*
* The sk_buff struct contains empty array members whose
* size differs between C and C++. Since we want to access
* certain members of the sk_buff from C++ we have to use
* a uniform format useable from both languages.W
*
* Note: we pull struct skb_buff as well as size_t from
* headers included before this one.
*/
struct Skb
{
void *packet;
size_t packet_size;
void *frag;
size_t frag_size;
};
struct Skb skb_helper(struct sk_buff *skb);
bool is_eapol(struct sk_buff *skb);
struct sk_buff *lxc_alloc_skb(size_t len, size_t headroom);
unsigned char *lxc_skb_put(struct sk_buff *skb, size_t len);
#endif /* _LXC_H_ */

View File

@ -1,519 +0,0 @@
/*
* \brief Linux emulation code
* \author Josef Soentgen
* \date 2014-03-07
*/
/*
* Copyright (C) 2014-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* linux includes */
#include <asm-generic/atomic64.h>
#include <linux/netdevice.h>
#include <net/sock.h>
#include <linux/skbuff.h>
/* local includes */
#include <lxc.h>
/*************************************
** private Lx C env implementation **
*************************************/
bool is_eapol(struct sk_buff *skb)
{
return ntohs(skb->protocol) == ETH_P_PAE;
}
struct Skb skb_helper(struct sk_buff *skb)
{
struct Skb helper;
skb_push(skb, ETH_HLEN);
helper.packet = skb->data;
helper.packet_size = skb->len;
helper.frag = 0;
helper.frag_size = 0;
/**
* If received packets are too large (as of now 128 bytes) the actually
* payload is put into a fragment. Otherwise the payload is stored directly
* in the sk_buff.
*/
if (skb_shinfo(skb)->nr_frags) {
if (skb_shinfo(skb)->nr_frags > 1)
printk("more than 1 fragment in skb: %p nr_frags: %d", skb,
skb_shinfo(skb)->nr_frags);
skb_frag_t *f = &skb_shinfo(skb)->frags[0];
helper.frag = skb_frag_address(f);
helper.frag_size = skb_frag_size(f);
/* fragment contains payload but header is still found in packet */
helper.packet_size = ETH_HLEN;
}
return helper;
}
extern int verbose_alloc;
struct sk_buff *lxc_alloc_skb(size_t len, size_t headroom)
{
struct sk_buff *skb = alloc_skb(len + headroom, GFP_KERNEL);
skb_reserve(skb, headroom);
return skb;
}
unsigned char *lxc_skb_put(struct sk_buff *skb, size_t len)
{
return skb_put(skb, len);
}
/****************************
** asm-generic/atomic64.h **
****************************/
/**
* This is not atomic on 32bit systems but this is not a problem
* because we will not be preempted.
*/
long long atomic64_add_return(long long i, atomic64_t *p)
{
p->counter += i;
return p->counter;
}
/**********************
** linux/refcount.h **
**********************/
void refcount_add(unsigned int i, refcount_t *r)
{
atomic_add(i, &r->refs);
}
void refcount_dec(refcount_t *r)
{
atomic_dec(&r->refs);
}
bool refcount_dec_and_test(refcount_t *r)
{
return atomic_dec_and_test(&r->refs);
}
void refcount_inc(refcount_t *r)
{
atomic_inc(&r->refs);
}
bool refcount_inc_not_zero(refcount_t *r)
{
return atomic_add_unless(&r->refs, 1, 0);
}
unsigned int refcount_read(const refcount_t *r)
{
return atomic_read(&r->refs);
}
void refcount_set(refcount_t *r, unsigned int n)
{
atomic_set(&r->refs, n);
}
bool refcount_sub_and_test(unsigned int i, refcount_t *r)
{
return atomic_sub_and_test(i, &r->refs);
}
/**********************************
** linux/bitops.h, asm/bitops.h **
**********************************/
unsigned int hweight32(unsigned int w)
{
w -= (w >> 1) & 0x55555555;
w = (w & 0x33333333) + ((w >> 2) & 0x33333333);
w = (w + (w >> 4)) & 0x0f0f0f0f;
return (w * 0x01010101) >> 24;
}
unsigned long find_last_bit(const unsigned long *addr, unsigned long size)
{
if (size) {
unsigned long val = BITMAP_LAST_WORD_MASK(size);
unsigned long idx = (size-1) / BITS_PER_LONG;
do {
val &= addr[idx];
if (val)
return idx * BITS_PER_LONG + __fls(val);
val = ~0ul;
} while (idx--);
}
return size;
}
/*****************************
** linux/platform_device.h **
*****************************/
int platform_device_add_resources(struct platform_device *pdev,
const struct resource *res, unsigned int num)
{
if (!res || !num) {
pdev->resource = NULL;
pdev->num_resources = 0;
}
struct resource *r = NULL;
if (res) {
r = kmemdup(res, sizeof(struct resource) * num, GFP_KERNEL);
if (!r)
return -ENOMEM;
}
kfree(pdev->resource);
pdev->resource = r;
pdev->num_resources = num;
return 0;
}
struct bus_type platform_bus_type = {
.name = "platform"
};
struct platform_device *platform_device_register_simple(const char *name, int id,
const struct resource *res,
unsigned int num)
{
struct platform_device *pdev = kzalloc(sizeof (struct platform_device), GFP_KERNEL);
if (!pdev)
return 0;
pdev->dev.bus = &platform_bus_type;
size_t len = strlen(name);
pdev->name = kzalloc(len + 1, GFP_KERNEL);
if (!pdev->name)
goto pdev_out;
memcpy(pdev->name, name, len);
pdev->name[len] = 0;
pdev->id = id;
int err = platform_device_add_resources(pdev, res, num);
if (err)
goto pdev_name_out;
return pdev;
pdev_name_out:
kfree(pdev->name);
pdev_out:
kfree(pdev);
return 0;
}
/***********************
** linux/netdevice.h **
***********************/
void netdev_run_todo() {
__rtnl_unlock();
}
void netif_set_gso_max_size(struct net_device *dev, unsigned int size)
{
dev->gso_max_size = size;
}
/********************
** linux/kernel.h **
********************/
unsigned long int_sqrt(unsigned long x)
{
unsigned long b, m, y = 0;
if (x <= 1) return x;
m = 1UL << (BITS_PER_LONG - 2);
while (m != 0) {
b = y + m;
y >>= 1;
if (x >= b) {
x -= b;
y += m;
}
m >>= 2;
}
return y;
}
/*************************
** linux/scatterlist.h **
*************************/
void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
struct scatterlist *sgl)
{
prv[prv_nents - 1].offset = 0;
prv[prv_nents - 1].length = 0;
prv[prv_nents - 1].page_link = (unsigned long)sgl;
prv[prv_nents - 1].page_flags |= 0x01;
prv[prv_nents - 1].page_flags &= ~0x02;
}
void sg_init_table(struct scatterlist *sgl, unsigned int nents)
{
memset(sgl, 0, sizeof(*sgl) * nents);
sg_mark_end(&sgl[nents -1]);
}
void sg_mark_end(struct scatterlist *sg)
{
sg->page_flags |= 0x02;
sg->page_flags &= ~0x01;
}
struct scatterlist *sg_next(struct scatterlist *sg)
{
if (sg_is_last(sg))
return NULL;
sg++;
if (sg_is_chain(sg))
sg = sg_chain_ptr(sg);
return sg;
}
void sg_set_buf(struct scatterlist *sg, const void *buf, unsigned int buflen)
{
struct page *page = &sg->page_dummy;
sg->page_dummy.addr = (void*)buf;
sg_set_page(sg, page, buflen, 0);
}
void sg_set_page(struct scatterlist *sg, struct page *page, unsigned int len, unsigned int offset)
{
sg->page_link = (unsigned long) page;
sg->offset = offset;
sg->length = len;
}
/****************
** net/sock.h **
****************/
static const struct net_proto_family *net_families[NPROTO];
int sock_register(const struct net_proto_family *ops)
{
if (ops->family >= NPROTO) {
printk("protocol %d >= NPROTO (%d)\n", ops->family, NPROTO);
return -ENOBUFS;
}
net_families[ops->family] = ops;
pr_info("NET: Registered protocol family %d\n", ops->family);
return 0;
}
struct socket *sock_alloc(void)
{
return (struct socket *)kmalloc(sizeof(struct socket), 0);
}
int sock_create_lite(int family, int type, int protocol, struct socket **res)
{
struct socket *sock = sock_alloc();
if (!sock) return -ENOMEM;
sock->type = type;
*res = sock;
return 0;
}
int sock_create_kern(struct net *net, int family, int type, int proto,
struct socket **res)
{
struct socket *sock;
const struct net_proto_family *pf;
int err;
if (family < 0 || family > NPROTO)
return -EAFNOSUPPORT;
if (type < 0 || type > SOCK_MAX)
return -EINVAL;
pf = net_families[family];
if (!pf) {
printk("No protocol found for family %d\n", family);
return -ENOPROTOOPT;
}
if (!(sock = (struct socket *)kzalloc(sizeof(struct socket), 0))) {
printk("Could not allocate socket\n");
return -ENFILE;
}
sock->type = type;
err = pf->create(&init_net, sock, proto, 1);
if (err) {
kfree(sock);
return err;
}
*res = sock;
return 0;
}
void log_sock(struct socket *socket)
{
printk("\nNEW socket %p sk %p fsk %lx &sk %p &fsk %p\n\n",
socket, socket->sk, socket->flags, &socket->sk, &socket->flags);
}
static void sock_init(void)
{
skb_init();
}
core_initcall(sock_init);
/*****************
** net/codel.h **
*****************/
codel_time_t codel_get_time(void)
{
u64 ns = ktime_get();
return ns >> CODEL_SHIFT;
}
/**********************
** net/codel_impl.h **
**********************/
void codel_params_init(struct codel_params *params)
{
params->interval = MS2TIME(100);
params->target = MS2TIME(5);
params->ce_threshold = CODEL_DISABLED_THRESHOLD;
params->ecn = false;
}
void codel_vars_init(struct codel_vars *vars)
{
memset(vars, 0, sizeof(*vars));
}
void codel_stats_init(struct codel_stats *stats)
{
// stats->maxpacket = 0;
}
/*************************
** linux/timekeeping.h **
*************************/
u64 ktime_get_boot_ns(void)
{
return (u64)ktime_get();
}
/********************
** linux/device.h **
********************/
struct device *device_create_with_groups(struct class *class,
struct device *parent, dev_t devt,
void *drvdata,
const struct attribute_group **groups,
const char *fmt, ...)
{
long ret = -ENODEV;
if (class == NULL || IS_ERR(class)) { goto err; }
struct device *dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) {
ret = -ENOMEM;
goto err;
}
return dev;
err:
return (void*)ret;
}
struct class *__class_create(struct module *owner,
const char *name,
struct lock_class_key *key)
{
struct class *cls = kzalloc(sizeof(*cls), GFP_KERNEL);
if (!cls) { return (void*)-ENOMEM; }
cls->name = name;
return cls;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,849 +0,0 @@
/*
* \brief Glue code for Linux network drivers
* \author Sebastian Sumpf
* \author Josef Soentgen
* \date 2012-07-05
*/
/*
* Copyright (C) 2012-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/log.h>
#include <base/rpc_server.h>
#include <base/snprintf.h>
#include <base/tslab.h>
#include <base/registry.h>
#include <os/reporter.h>
#include <util/xml_node.h>
#include <uplink_session/connection.h>
/* NIC driver includes */
#include <drivers/nic/uplink_client_base.h>
/* local includes */
#include <lx.h>
#include <lx_emul.h>
#include <legacy/lx_kit/env.h>
#include <legacy/lx_emul/extern_c_begin.h>
# include <linux/skbuff.h>
# include <net/cfg80211.h>
# include <lxc.h>
#include <legacy/lx_emul/extern_c_end.h>
enum {
HEAD_ROOM = 128, /* XXX guessed value but works */
};
struct Tx_data
{
net_device *ndev;
struct sk_buff *skb;
Lx::Task *task;
int err;
};
static Lx::Task *_tx_task;
static Tx_data _tx_data;
static void _run_tx_task(void *args)
{
Tx_data *data = static_cast<Tx_data*>(args);
while (1) {
Lx::scheduler().current()->block_and_schedule();
net_device *ndev = data->ndev;
struct sk_buff *skb = data->skb;
data->err = ndev->netdev_ops->ndo_start_xmit(skb, ndev);
if (data->err) {
Genode::warning("xmit failed: ", data->err, " skb: ", skb);
}
data->skb = nullptr;
if (data->task) {
data->task->unblock();
data->task = nullptr;
}
}
}
bool tx_task_send(struct sk_buff *skb)
{
if (_tx_data.skb) {
Genode::error("skb: ", skb, " already queued");
return false;
}
if (!_tx_task) {
Genode::error("no TX task available");
return false;
}
_tx_data.ndev = skb->dev;
_tx_data.skb = skb;
_tx_data.task = Lx::scheduler().current();
_tx_task->unblock();
Lx::scheduler().current()->block_and_schedule();
return true;
}
namespace Genode { class Wifi_uplink; }
class Genode::Wifi_uplink
{
private:
net_device *_device { nullptr };
Constructible<Reporter> _reporter { };
static Wifi_uplink *_instance;
class Uplink_client : public Uplink_client_base
{
private:
net_device &_ndev;
Net::Mac_address _init_drv_mac_addr(net_device &ndev)
{
Net::Mac_address mac_addr { };
memcpy(&mac_addr, ndev.perm_addr, ETH_ALEN);
return mac_addr;
}
/************************
** Uplink_client_base **
************************/
Transmit_result
_drv_transmit_pkt(const char *conn_rx_pkt_base,
size_t conn_rx_pkt_size) override
{
/*
* We must not be called from another task, just from the
* packet stream dispatcher.
*/
if (Lx::scheduler().active()) {
warning("scheduler active");
return Transmit_result::RETRY;
}
struct sk_buff *skb {
lxc_alloc_skb(conn_rx_pkt_size +
HEAD_ROOM, HEAD_ROOM) };
skb->dev = &_ndev;
unsigned char *data = lxc_skb_put(skb, conn_rx_pkt_size);
memcpy(data, conn_rx_pkt_base, conn_rx_pkt_size);
_tx_data.ndev = &_ndev;
_tx_data.skb = skb;
_tx_task->unblock();
Lx::scheduler().schedule();
return Transmit_result::ACCEPTED;
}
public:
Uplink_client(Env &env,
Allocator &alloc,
net_device &ndev)
:
Uplink_client_base { env, alloc,
_init_drv_mac_addr(ndev) },
_ndev { ndev }
{
_drv_handle_link_state(
!(_ndev.state & 1UL << __LINK_STATE_NOCARRIER));
}
Net::Mac_address mac_address() const { return _drv_mac_addr; }
void handle_driver_link_state(bool state)
{
_drv_handle_link_state(state);
}
void handle_driver_rx_packet(struct sk_buff *skb)
{
Skb skbh { skb_helper(skb) };
_drv_rx_handle_pkt(
skbh.packet_size + skbh.frag_size,
[&] (void *conn_tx_pkt_base,
size_t &)
{
memcpy(
conn_tx_pkt_base,
skbh.packet,
skbh.packet_size);
if (skbh.frag_size) {
memcpy(
(char *)conn_tx_pkt_base + skbh.packet_size,
skbh.frag,
skbh.frag_size);
}
return Write_result::WRITE_SUCCEEDED;
});
}
};
Env &_env;
Allocator &_alloc;
Constructible<Uplink_client> _client { };
public:
Wifi_uplink(Env &env,
Allocator &alloc)
:
_env { env },
_alloc { alloc }
{ }
void device(net_device &device)
{
_device = &device;
}
bool device_set() const
{
return _device != nullptr;
}
net_device &device()
{
if (_device == nullptr) {
class Invalid { };
throw Invalid { };
}
return *_device;
}
void activate()
{
_client.construct(_env, _alloc, device());
Lx_kit::env().config_rom().xml().with_sub_node("report", [&] (Xml_node const &xml) {
bool const report_mac_address =
xml.attribute_value("mac_address", false);
if (!report_mac_address)
return;
_reporter.construct(_env, "devices");
_reporter->enabled(true);
Reporter::Xml_generator report(*_reporter, [&] () {
report.node("nic", [&] () {
report.attribute("mac_address", String<32>(_client->mac_address()));
});
});
});
}
void handle_driver_rx_packet(struct sk_buff *skb)
{
if (_client.constructed()) {
_client->handle_driver_rx_packet(skb);
}
}
void handle_driver_link_state(bool state)
{
if (_client.constructed()) {
_client->handle_driver_link_state(state);
}
}
static void instance(Wifi_uplink &instance)
{
_instance = &instance;
}
static Wifi_uplink &instance()
{
if (!_instance) {
class Invalid { };
throw Invalid { };
}
return *_instance;
}
};
using Genode::Wifi_uplink;
Wifi_uplink *Wifi_uplink::_instance;
void Lx::nic_init(Genode::Env &env, Genode::Allocator &alloc)
{
Wifi_uplink::instance(*new (alloc) Genode::Wifi_uplink(env, alloc));
}
void Lx::get_mac_address(unsigned char *addr)
{
memcpy(addr, Wifi_uplink::instance().device().perm_addr, ETH_ALEN);
}
namespace Lx {
class Notifier;
}
class Lx::Notifier
{
private:
struct Block : public Genode::List<Block>::Element
{
struct notifier_block *nb;
Block(struct notifier_block *nb) : nb(nb) { }
};
Lx_kit::List<Block> _list;
Genode::Tslab<Block, 32 * sizeof(Block)> _block_alloc;
void *_ptr;
public:
Notifier(Genode::Allocator &alloc, void *ptr)
: _block_alloc(&alloc), _ptr(ptr) { }
virtual ~Notifier() { };
bool handles(void *ptr)
{
return _ptr == ptr;
}
void register_block(struct notifier_block *nb)
{
Block *b = new (&_block_alloc) Block(nb);
_list.insert(b);
}
void unregister_block(struct notifier_block *nb)
{
for (Block *b = _list.first(); b; b = b->next())
if (b->nb == nb) {
_list.remove(b);
destroy(&_block_alloc, b);
break;
}
}
int call_all_blocks(unsigned long val, void *v)
{
int rv = NOTIFY_DONE;
for (Block *b = _list.first(); b; b = b->next()) {
rv = b->nb->notifier_call(b->nb, val, v);
if (rv & NOTIFY_STOP_MASK)
break;
}
return rv;
}
};
static Genode::Registry<Genode::Registered<Lx::Notifier>> _blocking_notifier_registry;
/* XXX move blocking_notifier_call to proper location */
/**********************
** linux/notifier.h **
**********************/
static Lx::Notifier &blocking_notifier(struct blocking_notifier_head *nh)
{
Lx::Notifier *notifier = nullptr;
auto lookup = [&](Lx::Notifier &n) {
if (!n.handles(nh)) { return; }
notifier = &n;
};
_blocking_notifier_registry.for_each(lookup);
if (!notifier) {
Genode::Registered<Lx::Notifier> *n = new (&Lx_kit::env().heap())
Genode::Registered<Lx::Notifier>(_blocking_notifier_registry,
Lx_kit::env().heap(), nh);
notifier = &*n;
}
return *notifier;
}
int blocking_notifier_chain_register(struct blocking_notifier_head *nh,
struct notifier_block *nb)
{
blocking_notifier(nh).register_block(nb);
return 0;
}
int blocking_notifier_chain_unregister(struct blocking_notifier_head *nh,
struct notifier_block *nb)
{
blocking_notifier(nh).unregister_block(nb);
return 0;
}
int blocking_notifier_call_chain(struct blocking_notifier_head *nh,
unsigned long val, void *v)
{
return blocking_notifier(nh).call_all_blocks(val, v);
}
/***********************
** linux/netdevice.h **
***********************/
static Lx::Notifier &net_notifier()
{
static Lx::Notifier inst(Lx_kit::env().heap(), NULL);
return inst;
}
extern "C" int register_netdevice_notifier(struct notifier_block *nb)
{
/**
* In Linux the nb is actually called upon on registration. We do not
* that semantic because we add a net_device only after all notifiers
* were registered.
*/
net_notifier().register_block(nb);
return 0;
}
extern "C" int unregster_netdevice_notifier(struct notifier_block *nb)
{
net_notifier().unregister_block(nb);
return 0;
}
extern "C" struct net_device * netdev_notifier_info_to_dev(struct netdev_notifier_info *info)
{
/* we always pass a net_device pointer to this function */
return reinterpret_cast<net_device *>(info);
}
struct Proto_hook : public Lx_kit::List<Proto_hook>::Element
{
struct packet_type &pt;
Proto_hook(struct packet_type *pt) : pt(*pt) { }
};
class Proto_hook_list
{
private:
Lx_kit::List<Proto_hook> _list;
Genode::Allocator &_alloc;
public:
Proto_hook_list(Genode::Allocator &alloc) : _alloc(alloc) { }
void insert(struct packet_type *pt) {
_list.insert(new (&_alloc) Proto_hook(pt)); }
void remove(struct packet_type *pt)
{
for (Proto_hook *ph = _list.first(); ph; ph = ph->next())
if (&ph->pt == pt) {
_list.remove(ph);
destroy(&_alloc, ph);
break;
}
}
Proto_hook* first() { return _list.first(); }
};
static Proto_hook_list& proto_hook_list()
{
static Proto_hook_list inst(Lx_kit::env().heap());
return inst;
}
extern "C" void dev_add_pack(struct packet_type *pt)
{
proto_hook_list().insert(pt);
}
extern "C" void __dev_remove_pack(struct packet_type *pt)
{
proto_hook_list().remove(pt);
}
extern "C" struct net_device *__dev_get_by_index(struct net *net, int ifindex)
{
if (!Wifi_uplink::instance().device_set()) {
Genode::error("no net device registered!");
return 0;
}
return &Wifi_uplink::instance().device();
}
extern "C" struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex)
{
return __dev_get_by_index(net, ifindex);
}
extern "C" struct net_device *dev_get_by_index(struct net *net, int ifindex)
{
return __dev_get_by_index(net, ifindex);
}
extern "C" int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *daddr,
const void *saddr, unsigned int len)
{
if (!dev->header_ops || !dev->header_ops->create)
return 0;
return dev->header_ops->create(skb, dev, type, daddr, saddr, len);
}
extern "C" int dev_parse_header(const struct sk_buff *skb, unsigned char *haddr)
{
struct net_device const *dev = skb->dev;
if (!dev->header_ops || dev->header_ops->parse)
return 0;
return dev->header_ops->parse(skb, haddr);
}
extern "C" int dev_queue_xmit(struct sk_buff *skb)
{
if (skb->next) {
Genode::warning("more skb's queued");
}
return tx_task_send(skb) ? NETDEV_TX_OK : -1;
}
extern "C" size_t LL_RESERVED_SPACE(struct net_device *dev)
{
return dev->hard_header_len ?
(dev->hard_header_len + (HH_DATA_MOD - 1)) & ~(HH_DATA_MOD - 1) : 0;
}
extern "C" void dev_close(struct net_device *ndev)
{
/*
* First instruct cfg80211 to leave the associated network
* and then shutdown the interface.
*/
net_notifier().call_all_blocks(NETDEV_GOING_DOWN, ndev);
net_notifier().call_all_blocks(NETDEV_DOWN, ndev);
ndev->state &= ~(1UL << __LINK_STATE_START);
netif_carrier_off(ndev);
const struct net_device_ops *ops = ndev->netdev_ops;
if (ops->ndo_stop) { ops->ndo_stop(ndev); }
ndev->flags &= ~IFF_UP;
}
bool Lx::open_device()
{
if (!Wifi_uplink::instance().device_set()) {
Genode::error("no net_device available");
return false;
}
struct net_device * const ndev = &Wifi_uplink::instance().device();
int err = ndev->netdev_ops->ndo_open(ndev);
if (err) {
Genode::error("Open device failed");
throw -1;
return err;
}
/*
* Important, otherwise netif_running checks fail and AF_PACKET
* will not bind and EAPOL will cease to work.
*/
ndev->flags |= IFF_UP;
ndev->state |= (1UL << __LINK_STATE_START);
if (ndev->netdev_ops->ndo_set_rx_mode)
ndev->netdev_ops->ndo_set_rx_mode(ndev);
net_notifier().call_all_blocks(NETDEV_UP, ndev);
return true;
}
extern "C" int register_netdevice(struct net_device *ndev)
{
static bool already_registered = false;
if (already_registered) {
Genode::error("We don't support multiple network devices in one driver instance");
return -ENODEV;
}
already_registered = true;
if (ndev == nullptr) {
class Invalid_net_device { };
throw Invalid_net_device { };
}
Wifi_uplink::instance().device(*ndev);
ndev->state |= 1UL << __LINK_STATE_START;
netif_carrier_off(ndev);
/* execute all notifier blocks */
net_notifier().call_all_blocks(NETDEV_REGISTER, ndev);
net_notifier().call_all_blocks(NETDEV_UP, ndev);
ndev->ifindex = 1;
/* set mac adress */
Genode::memcpy(ndev->perm_addr, ndev->ieee80211_ptr->wiphy->perm_addr, ETH_ALEN);
int err = ndev->netdev_ops->ndo_open(ndev);
if (err) {
Genode::error("Initializing device failed");
throw -1;
return err;
}
static Lx::Task tx_task { _run_tx_task, &_tx_data, "tx_task",
Lx::Task::PRIORITY_1, Lx::scheduler() };
_tx_task = &tx_task;
if (ndev->netdev_ops->ndo_set_rx_mode)
ndev->netdev_ops->ndo_set_rx_mode(ndev);
Wifi_uplink::instance().activate();
list_add_tail_rcu(&ndev->dev_list, &init_net.dev_base_head);
return 0;
}
extern "C" int netif_running(const struct net_device *dev)
{
return dev->state & (1UL << __LINK_STATE_START);
}
extern "C" int netif_device_present(struct net_device *dev) { return 1; }
extern "C" int netif_carrier_ok(const struct net_device *dev)
{
return !(dev->state & (1UL << __LINK_STATE_NOCARRIER));
}
extern "C" void netif_carrier_on(struct net_device *dev)
{
dev->state &= ~(1UL << __LINK_STATE_NOCARRIER);
Wifi_uplink::instance().handle_driver_link_state(true);
}
extern "C" void netif_carrier_off(struct net_device *dev)
{
dev->state |= 1UL << __LINK_STATE_NOCARRIER;
Wifi_uplink::instance().handle_driver_link_state(false);
}
extern "C" int netif_receive_skb(struct sk_buff *skb)
{
/**
* XXX check original linux implementation if it is really
* necessary to free the skb if it was not handled.
*/
/* send EAPOL related frames only to the wpa_supplicant */
if (is_eapol(skb)) {
/* XXX call only AF_PACKET hook */
for (Proto_hook* ph = proto_hook_list().first(); ph; ph = ph->next()) {
ph->pt.func(skb, &Wifi_uplink::instance().device(), &ph->pt, &Wifi_uplink::instance().device());
}
return NET_RX_SUCCESS;
}
Wifi_uplink::instance().handle_driver_rx_packet(skb);
dev_kfree_skb(skb);
return NET_RX_SUCCESS;
}
gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
{
return netif_receive_skb(skb);
}
extern "C" void netif_start_subqueue(struct net_device *dev, u16 queue_index)
{
dev->_tx[queue_index].state = NETDEV_QUEUE_START;
}
extern "C" void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
{
dev->_tx[queue_index].state = 0;
}
extern "C" void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
{
dev->_tx[queue_index].state = NETDEV_QUEUE_START;
}
extern "C" u16 netdev_cap_txqueue(struct net_device *dev, u16 queue_index)
{
if (queue_index > dev-> real_num_tx_queues) {
Genode::error("queue_index ", queue_index, " out of range (",
dev->real_num_tx_queues, " max)");
return 0;
}
return queue_index;
}
extern "C" struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name,
unsigned char name_assign_type,
void (*setup)(struct net_device *),
unsigned int txqs, unsigned int rxqs)
{
struct net_device *dev;
size_t alloc_size;
struct net_device *p;
alloc_size = ALIGN(sizeof(struct net_device), NETDEV_ALIGN);
/* ensure 32-byte alignment of whole construct */
alloc_size += NETDEV_ALIGN - 1;
p = (net_device *)kzalloc(alloc_size, GFP_KERNEL);
if (!p)
return NULL;
dev = PTR_ALIGN(p, NETDEV_ALIGN);
dev->gso_max_size = GSO_MAX_SIZE;
dev->gso_max_segs = GSO_MAX_SEGS;
setup(dev);
/* actually set by dev_open() */
dev->flags |= IFF_UP;
/* XXX our dev is always called wlan0 */
strcpy(dev->name, "wlan0");
dev->dev_addr = (unsigned char *)kzalloc(ETH_ALEN, GFP_KERNEL);
if (!dev->dev_addr)
return 0;
if (sizeof_priv) {
/* ensure 32-byte alignment of private area */
dev->priv = kzalloc(sizeof_priv, GFP_KERNEL);
if (!dev->priv)
return 0;
}
dev->num_tx_queues = txqs;
dev->real_num_tx_queues = txqs;
struct netdev_queue *tx = (struct netdev_queue*)
kcalloc(txqs, sizeof(struct netdev_queue),
GFP_KERNEL | GFP_LX_DMA);
if (!tx) {
Genode::error("could not allocate ndev_queues");
}
dev->_tx = tx;
for (unsigned i = 0; i < txqs; i++) {
tx[i].dev = dev;
tx[i].numa_node = NUMA_NO_NODE;
}
return dev;
}
/*************************
** linux/etherdevice.h **
*************************/
int is_valid_ether_addr(const u8 *addr)
{
/* is multicast */
if ((addr[0] & 0x1))
return 0;
/* zero */
if (!(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]))
return 0;
return 1;
}

View File

@ -1,104 +0,0 @@
/*
* \brief Linux random emulation code
* \author Josef Soentgen
* \date 2016-10-19
*/
/*
* Copyright (C) 2016-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/fixed_stdint.h>
#include <util/string.h>
using Genode::uint64_t;
/*
* Xoroshiro128+ written in 2014-2016 by Sebastiano Vigna (vigna@acm.org)
*
* (see http://xoroshiro.di.unimi.it/xorshift128plus.c and
* http://xoroshiro.di.unimi.it/splitmix64.c)
*/
struct Xoroshiro
{
uint64_t seed;
uint64_t splitmix64()
{
uint64_t z = (seed += __UINT64_C(0x9E3779B97F4A7C15));
z = (z ^ (z >> 30)) * __UINT64_C(0xBF58476D1CE4E5B9);
z = (z ^ (z >> 27)) * __UINT64_C(0x94D049BB133111EB);
return z ^ (z >> 31);
}
Xoroshiro(uint64_t seed) : seed(seed)
{
s[0] = splitmix64();
s[1] = splitmix64();
}
uint64_t s[2];
static uint64_t rotl(uint64_t const x, int k) {
return (x << k) | (x >> (64 - k));
}
uint64_t get()
{
uint64_t const s0 = s[0];
uint64_t s1 = s[1];
uint64_t const result = s0 + s1;
s1 ^= s0;
s[0] = rotl(s0, 55) ^ s1 ^ (s1 << 14);
s[1] = rotl(s1, 36);
return result;
}
};
static Xoroshiro xoroshiro(0x636864324d766931);
/********************
** linux/random.h **
********************/
extern "C" void get_random_bytes(void *buf, int nbytes)
{
if (nbytes <= 0) {
return;
}
char *p = reinterpret_cast<char*>(buf);
int const rounds = nbytes / 8;
for (int i = 0; i < rounds; i++) {
uint64_t const v = xoroshiro.get();
Genode::memcpy(p, &v, 8);
p += 8;
}
int const remain = nbytes - rounds * 8;
if (!remain) {
return;
}
uint64_t const v = xoroshiro.get();
Genode::memcpy(p, &v, remain);
}
extern "C" unsigned int prandom_u32(void)
{
return xoroshiro.get();
}

View File

@ -1,648 +0,0 @@
/*
* \brief Linux emulation code
* \author Josef Soentgen
* \date 2014-08-04
*/
/*
* Copyright (C) 2014-2017 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/env.h>
#include <base/log.h>
/* local includes */
#include <lx.h>
#include <lx_emul.h>
#include <legacy/lx_emul/extern_c_begin.h>
# include <linux/socket.h>
# include <linux/net.h>
# include <net/sock.h>
#include <legacy/lx_emul/extern_c_end.h>
#include <wifi/socket_call.h>
static void run_socketcall(void *);
/* XXX move Wifi::Socket definition to better location */
struct Wifi::Socket
{
void *socket = nullptr;
bool non_block = false;
Socket() { }
explicit Socket(void *s) : socket(s) { }
};
struct Call
{
enum Opcode {
NONE, SOCKET, CLOSE,
BIND, GETSOCKNAME, RECVMSG, SENDMSG, SENDTO, SETSOCKOPT,
GET_MAC_ADDRESS, POLL_ALL, NON_BLOCK,
};
Opcode opcode = NONE;
Wifi::Socket *handle = nullptr;
union {
struct
{
int domain;
int type;
int protocol;
void *result;
} socket;
struct { /* no args */ } close;
struct
{
sockaddr const *addr;
int addrlen;
} bind;
struct
{
sockaddr *addr;
int *addrlen;
} getsockname;
struct
{
msghdr msg;
int flags;
iovec iov[Wifi::Msghdr::MAX_IOV_LEN];
} recvmsg;
struct
{
msghdr msg;
int flags;
iovec iov[Wifi::Msghdr::MAX_IOV_LEN];
} sendmsg;
struct {
int level;
int optname;
void const *optval;
uint32_t optlen;
} setsockopt;
struct
{
unsigned char *addr;
} get_mac_address;
struct
{
Wifi::Poll_socket_fd *sockets;
unsigned num;
int timeout;
} poll_all;
struct
{
bool value;
} non_block;
};
int err = 0;
};
static Call _call;
static Genode::Semaphore _block;
namespace Lx {
class Socket;
}
/**
* Context for socket calls
*/
class Lx::Socket
{
private:
Genode::Signal_transmitter _sender;
Genode::Signal_handler<Lx::Socket> _dispatcher;
Lx::Task _task;
struct socket *_call_socket()
{
struct socket *sock = static_cast<struct socket*>(_call.handle->socket);
if (!sock)
Genode::error("BUG: sock is zero");
return sock;
}
void _do_socket()
{
struct socket *s;
int res = sock_create_kern(nullptr, _call.socket.domain, _call.socket.type,
_call.socket.protocol, &s);
if (!res) {
_call.socket.result = s;
_call.err = 0;
return;
}
Genode::error("sock_create_kern failed, res: ", res);
_call.socket.result = nullptr;
_call.err = res;
}
void _do_close()
{
struct socket *sock = _call_socket();
_call.err = sock->ops->release(sock);
}
void _do_bind()
{
struct socket *sock = _call_socket();
_call.err = sock->ops->bind(sock,
const_cast<struct sockaddr *>(_call.bind.addr),
_call.bind.addrlen);
}
void _do_getsockname()
{
struct socket *sock = _call_socket();
int addrlen = *_call.getsockname.addrlen;
_call.err = sock->ops->getname(sock, _call.getsockname.addr, &addrlen, 0);
*_call.getsockname.addrlen = addrlen;
}
void _do_recvmsg()
{
struct socket *sock = _call_socket();
struct msghdr *msg = &_call.recvmsg.msg;
if (_call.handle->non_block)
msg->msg_flags |= MSG_DONTWAIT;
size_t iovlen = 0;
for (size_t i = 0; i < msg->msg_iter.nr_segs; i++)
iovlen += msg->msg_iter.iov[i].iov_len;
_call.err = sock->ops->recvmsg(sock, msg, iovlen, _call.recvmsg.flags);
}
void _do_sendmsg()
{
struct socket *sock = _call_socket();
struct msghdr *msg = const_cast<msghdr *>(&_call.sendmsg.msg);
if (_call.handle->non_block)
msg->msg_flags |= MSG_DONTWAIT;
size_t iovlen = 0;
for (size_t i = 0; i < msg->msg_iter.nr_segs; i++)
iovlen += msg->msg_iter.iov[i].iov_len;
_call.err = sock->ops->sendmsg(sock, msg, iovlen);
}
void _do_setsockopt()
{
struct socket *sock = _call_socket();
/* taken from kernel_setsockopt() in net/socket.c */
if (_call.setsockopt.level == SOL_SOCKET)
_call.err = sock_setsockopt(sock,
_call.setsockopt.level,
_call.setsockopt.optname,
(char *)_call.setsockopt.optval,
_call.setsockopt.optlen);
else
_call.err = sock->ops->setsockopt(sock,
_call.setsockopt.level,
_call.setsockopt.optname,
(char *)_call.setsockopt.optval,
_call.setsockopt.optlen);
}
void _do_get_mac_address()
{
Lx::get_mac_address(_call.get_mac_address.addr);
}
void _do_poll_all()
{
Wifi::Poll_socket_fd *sockets = _call.poll_all.sockets;
unsigned num = _call.poll_all.num;
int timeout = _call.poll_all.timeout;
enum {
POLLIN_SET = (POLLRDNORM | POLLRDBAND | POLLIN | POLLHUP | POLLERR),
POLLOUT_SET = (POLLWRBAND | POLLWRNORM | POLLOUT | POLLERR),
POLLEX_SET = (POLLPRI)
};
int nready = 0;
bool timeout_triggered = false;
bool woken_up = false;
do {
/**
* Timeout was triggered, exit early.
*/
if (timeout_triggered)
break;
/**
* Poll each socket and check if there is something of interest.
*/
for (unsigned i = 0; i < num; i++) {
struct socket *sock = static_cast<struct socket*>(sockets[i].s->socket);
int mask = sock->ops->poll(0, sock, 0);
sockets[i].revents = 0;
if (mask & POLLIN_SET)
sockets[i].revents |= sockets[i].events & Wifi::WIFI_POLLIN ? Wifi::WIFI_POLLIN : 0;
if (mask & POLLOUT_SET)
sockets[i].revents |= sockets[i].events & Wifi::WIFI_POLLOUT ? Wifi::WIFI_POLLOUT : 0;
if (mask & POLLEX_SET)
sockets[i].revents |= sockets[i].events & Wifi::WIFI_POLLEX ? Wifi::WIFI_POLLEX : 0;
if (sockets[i].revents)
nready++;
}
/**
* We were woken up but there is still nothing of interest.
*/
if (woken_up)
break;
/**
* Exit the loop if either a socket is ready or there is
* no timeout given.
*/
if (nready || !timeout)
break;
/**
* In case of a timeout add all sockets to an artificial wait list
* so at least one is woken up an sk_data_ready() call.
*/
Lx::Task *task = Lx::scheduler().current();
struct socket_wq wq[num];
Lx::Task::List wait_list;
task->wait_enqueue(&wait_list);
for (unsigned i = 0; i < num; i++) {
struct socket *sock = static_cast<struct socket*>(sockets[i].s->socket);
wq[i].wait.list = &wait_list;
sock->sk->sk_wq = &wq[i];
}
long t = msecs_to_jiffies(timeout);
timeout_triggered = !schedule_timeout(t);
task->wait_dequeue(&wait_list);
for (unsigned i = 0; i < num; i++) {
struct socket *sock = static_cast<struct socket*>(sockets[i].s->socket);
sock->sk->sk_wq = 0;
}
woken_up = true;
} while (1);
_call.err = nready;
}
void _do_non_block()
{
_call.handle->non_block = _call.non_block.value;
}
void _handle()
{
_task.unblock();
Lx::scheduler().schedule();
}
public:
Socket(Genode::Entrypoint &ep)
:
_dispatcher(ep, *this, &Lx::Socket::_handle),
_task(run_socketcall, nullptr, "socketcall",
Lx::Task::PRIORITY_0, Lx::scheduler())
{
_sender.context(_dispatcher);
}
void exec_call()
{
switch (_call.opcode) {
case Call::BIND: _do_bind(); break;
case Call::CLOSE: _do_close(); break;
case Call::GETSOCKNAME: _do_getsockname(); break;
case Call::POLL_ALL: _do_poll_all(); break;
case Call::RECVMSG: _do_recvmsg(); break;
case Call::SENDMSG: _do_sendmsg(); break;
case Call::SETSOCKOPT: _do_setsockopt(); break;
case Call::SOCKET: _do_socket(); break;
case Call::GET_MAC_ADDRESS: _do_get_mac_address(); break;
case Call::NON_BLOCK: _do_non_block(); break;
default:
Genode::warning("unknown opcode: ", (int)_call.opcode);
case Call::NONE: /* ignore silently */
_call.err = -EINVAL;
break;
}
/*
* Save old call opcode as we may only release the blocker
* when actually did something useful, i.e., were called by
* some socket operation and not by kicking the socket.
*/
Call::Opcode old = _call.opcode;
_call.opcode = Call::NONE;
if (old != Call::NONE) { _block.up(); }
}
void submit_and_block()
{
_sender.submit();
_block.down();
}
void unblock_task()
{
_task.unblock();
}
};
static Lx::Socket *_socket;
static Genode::Allocator *_alloc;
void Lx::socket_init(Genode::Entrypoint &ep, Genode::Allocator &alloc)
{
static Lx::Socket socket_ctx(ep);
_socket = &socket_ctx;
_alloc = &alloc;
}
void Lx::socket_kick()
{
/* ignore silently, the function might be called to before init */
if (!_socket) { return; }
_socket->unblock_task();
Lx::scheduler().schedule();
}
static void run_socketcall(void *)
{
while (1) {
Lx::scheduler().current()->block_and_schedule();
_socket->exec_call();
}
}
/**************************
** Socket_call instance **
**************************/
Wifi::Socket_call socket_call;
/***************************
** Socket_call interface **
***************************/
using namespace Wifi;
Wifi::Socket *Socket_call::socket(int domain, int type, int protocol)
{
/* FIXME domain, type, protocol values */
_call.opcode = Call::SOCKET;
_call.socket.domain = domain;
_call.socket.type = type & 0xff;
_call.socket.protocol = protocol;
_socket->submit_and_block();
if (_call.socket.result == 0)
return 0;
Wifi::Socket *s = new (_alloc) Wifi::Socket(_call.socket.result);
return s;
}
int Socket_call::close(Socket *s)
{
_call.opcode = Call::CLOSE;
_call.handle = s;
_socket->submit_and_block();
if (_call.err) {
Genode::error("closing socket failed: ", _call.err);
}
destroy(_alloc, s);
return 0;
}
int Socket_call::bind(Socket *s, Wifi::Sockaddr const *addr, unsigned addrlen)
{
/* FIXME convert to/from Sockaddr */
_call.opcode = Call::BIND;
_call.handle = s;
_call.bind.addr = (sockaddr const *)addr;
_call.bind.addrlen = addrlen;
_socket->submit_and_block();
return _call.err;
}
int Socket_call::getsockname(Socket *s, Wifi::Sockaddr *addr, unsigned *addrlen)
{
/* FIXME convert to/from Sockaddr */
/* FIXME unsigned * -> int * */
_call.opcode = Call::GETSOCKNAME;
_call.handle = s;
_call.getsockname.addr = (sockaddr *)addr;
_call.getsockname.addrlen = (int *)addrlen;
_socket->submit_and_block();
return _call.err;
}
int Socket_call::poll_all(Poll_socket_fd *s, unsigned num, int timeout)
{
_call.opcode = Call::POLL_ALL;
_call.handle = 0;
_call.poll_all.sockets = s;
_call.poll_all.num = num;
_call.poll_all.timeout = timeout;
_socket->submit_and_block();
return _call.err;
}
static int msg_flags(Wifi::Flags in)
{
int out = Wifi::WIFI_F_NONE;
if (in & Wifi::WIFI_F_MSG_ERRQUEUE)
out |= MSG_ERRQUEUE;
return out;
};
Wifi::ssize_t Socket_call::recvmsg(Socket *s, Wifi::Msghdr *msg, Wifi::Flags flags)
{
_call.opcode = Call::RECVMSG;
_call.handle = s;
_call.recvmsg.msg.msg_name = msg->msg_name;
_call.recvmsg.msg.msg_namelen = msg->msg_namelen;
_call.recvmsg.msg.msg_iter.iov = _call.recvmsg.iov;
_call.recvmsg.msg.msg_iter.nr_segs = msg->msg_iovlen;
_call.recvmsg.msg.msg_iter.count = msg->msg_count;
_call.recvmsg.msg.msg_control = msg->msg_control;
_call.recvmsg.msg.msg_controllen = msg->msg_controllen;
_call.recvmsg.flags = msg_flags(flags);
for (unsigned i = 0; i < msg->msg_iovlen; ++i) {
_call.recvmsg.iov[i].iov_base = msg->msg_iov[i].iov_base;
_call.recvmsg.iov[i].iov_len = msg->msg_iov[i].iov_len;
}
_socket->submit_and_block();
msg->msg_namelen = _call.recvmsg.msg.msg_namelen;
return _call.err;
}
Wifi::ssize_t Socket_call::sendmsg(Socket *s, Wifi::Msghdr const *msg, Wifi::Flags flags)
{
_call.opcode = Call::SENDMSG;
_call.handle = s;
_call.sendmsg.msg.msg_name = msg->msg_name;
_call.sendmsg.msg.msg_namelen = msg->msg_namelen;
_call.sendmsg.msg.msg_iter.iov = _call.sendmsg.iov;
_call.sendmsg.msg.msg_iter.nr_segs = msg->msg_iovlen;
_call.sendmsg.msg.msg_iter.count = msg->msg_count;
_call.sendmsg.msg.msg_control = 0;
_call.sendmsg.msg.msg_controllen = 0;
_call.sendmsg.flags = msg_flags(flags);
for (unsigned i = 0; i < msg->msg_iovlen; ++i) {
_call.sendmsg.iov[i].iov_base = msg->msg_iov[i].iov_base;
_call.sendmsg.iov[i].iov_len = msg->msg_iov[i].iov_len;
}
_socket->submit_and_block();
return _call.err;
}
static int sockopt_level(Sockopt_level const in)
{
switch (in) {
case Wifi::WIFI_SOL_SOCKET: return SOL_SOCKET;
case Wifi::WIFI_SOL_NETLINK: return SOL_NETLINK;
}
return -1;
}
static int sockopt_name(Sockopt_level const level, Sockopt_name const in)
{
switch (level) {
case Wifi::WIFI_SOL_SOCKET:
switch (in) {
case Wifi::WIFI_SO_SNDBUF: return SO_SNDBUF;
case Wifi::WIFI_SO_RCVBUF: return SO_RCVBUF;
case Wifi::WIFI_SO_PASSCRED: return SO_PASSCRED;
case Wifi::WIFI_SO_WIFI_STATUS: return SO_WIFI_STATUS;
default: return -1;
}
case Wifi::WIFI_SOL_NETLINK:
switch (in) {
case Wifi::WIFI_NETLINK_ADD_MEMBERSHIP: return NETLINK_ADD_MEMBERSHIP;
case Wifi::WIFI_NETLINK_DROP_MEMBERSHIP: return NETLINK_DROP_MEMBERSHIP;
case Wifi::WIFI_NETLINK_PKTINFO: return NETLINK_PKTINFO;
default: return -1;
}
}
return -1;
}
int Socket_call::setsockopt(Socket *s,
Wifi::Sockopt_level level, Wifi::Sockopt_name optname,
const void *optval, uint32_t optlen)
{
/* FIXME optval values */
_call.opcode = Call::SETSOCKOPT;
_call.handle = s;
_call.setsockopt.level = sockopt_level(level);
_call.setsockopt.optname = sockopt_name(level, optname);
_call.setsockopt.optval = optval;
_call.setsockopt.optlen = optlen;
_socket->submit_and_block();
return _call.err;
}
void Socket_call::non_block(Socket *s, bool value)
{
_call.opcode = Call::NON_BLOCK;
_call.handle = s;
_call.non_block.value = value;
_socket->submit_and_block();
}
void Socket_call::get_mac_address(unsigned char *addr)
{
_call.opcode = Call::GET_MAC_ADDRESS;
_call.handle = 0;
_call.get_mac_address.addr = addr;
_socket->submit_and_block();
}

View File

@ -1,28 +0,0 @@
/*
*
*/
{
global:
/* initialize function */
_*wifi_init*;
/* Wifi::Socket_call interface */
*Socket_call*;
/* Wifi::Socket_call instance */
socket_call;
/* rfkill interface */
_*wifi_*_rfkill*;
_*wifi_kick_*;
/* interface libnl/wpa_driver_nl80211*/
wifi_if*;
/* used by libnl's time() */
jiffies;
lx_printf*;
local:
*;
};

View File

@ -1,385 +0,0 @@
linux-x.x.x/crypto/ablkcipher.c
linux-x.x.x/crypto/aead.c
linux-x.x.x/crypto/aes_generic.c
linux-x.x.x/crypto/ahash.c
linux-x.x.x/crypto/algapi.c
linux-x.x.x/crypto/algboss.c
linux-x.x.x/crypto/api.c
linux-x.x.x/crypto/arc4.c
linux-x.x.x/crypto/blkcipher.c
linux-x.x.x/crypto/ccm.c
linux-x.x.x/crypto/cipher.c
linux-x.x.x/crypto/compress.c
linux-x.x.x/crypto/crypto_wq.c
linux-x.x.x/crypto/ctr.c
linux-x.x.x/crypto/internal.h
linux-x.x.x/crypto/memneq.c
linux-x.x.x/crypto/rng.c
linux-x.x.x/crypto/scatterwalk.c
linux-x.x.x/crypto/shash.c
linux-x.x.x/crypto/skcipher.c
linux-x.x.x/drivers/leds/led-class.c
linux-x.x.x/drivers/leds/led-core.c
linux-x.x.x/drivers/leds/led-triggers.c
linux-x.x.x/drivers/leds/leds.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/cfg/1000.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/cfg/2000.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/cfg/22000.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/cfg/5000.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/cfg/6000.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/cfg/7000.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/cfg/8000.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/cfg/9000.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/agn.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/calib.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/calib.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/commands.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/dev.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/devices.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/led.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/led.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/lib.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/main.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/power.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/power.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/rs.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/rs.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/rx.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/rxon.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/scan.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/sta.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/tt.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/tt.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/tx.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/dvm/ucode.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/alive.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/binding.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/cmdhdr.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/coex.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/config.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/context.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/d3.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/filter.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/led.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/offload.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/paging.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/phy-ctxt.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/phy.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/power.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/scan.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/sf.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/stats.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/tdls.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/time-event.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/tof.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/api/txq.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/common_rx.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/dbg.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/debugfs.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/error-dump.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/file.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/img.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/init.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/notif-wait.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/notif-wait.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/nvm.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/paging.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/fw/smem.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-agn-hw.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-config.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-context-info.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-debug.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-debug.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-devtrace-data.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-devtrace-io.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-devtrace-iwlwifi.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-devtrace-msg.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-devtrace-ucode.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-drv.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-read.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-eeprom-read.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-fh.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-io.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-io.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-phy-db.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-phy-db.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-prph.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-scd.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/binding.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/coex.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/constants.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/led.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/offloading.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/power.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/quota.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/rs.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/rs.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/sf.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/sta.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/tdls.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/testmode.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/time-event.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/tof.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/tof.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/pcie/tx.c
linux-x.x.x/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
linux-x.x.x/include/asm-generic/atomic64.h
linux-x.x.x/include/asm-generic/bitops/__ffs.h
linux-x.x.x/include/asm-generic/bitops/__fls.h
linux-x.x.x/include/asm-generic/bitops/ffs.h
linux-x.x.x/include/asm-generic/bitops/fls.h
linux-x.x.x/include/asm-generic/bitops/fls64.h
linux-x.x.x/include/asm-generic/bitops/non-atomic.h
linux-x.x.x/include/crypto/aead.h
linux-x.x.x/include/crypto/aes.h
linux-x.x.x/include/crypto/algapi.h
linux-x.x.x/include/crypto/crypto_wq.h
linux-x.x.x/include/crypto/ctr.h
linux-x.x.x/include/crypto/hash.h
linux-x.x.x/include/crypto/internal/aead.h
linux-x.x.x/include/crypto/internal/geniv.h
linux-x.x.x/include/crypto/internal/hash.h
linux-x.x.x/include/crypto/internal/rng.h
linux-x.x.x/include/crypto/internal/skcipher.h
linux-x.x.x/include/crypto/null.h
linux-x.x.x/include/crypto/rng.h
linux-x.x.x/include/crypto/scatterwalk.h
linux-x.x.x/include/crypto/skcipher.h
linux-x.x.x/include/linux/average.h
linux-x.x.x/include/linux/bsearch.h
linux-x.x.x/include/linux/crypto.h
linux-x.x.x/include/linux/ctype.h
linux-x.x.x/include/linux/errqueue.h
linux-x.x.x/include/linux/ethtool.h
linux-x.x.x/include/linux/gcd.h
linux-x.x.x/include/linux/genetlink.h
linux-x.x.x/include/linux/hashtable.h
linux-x.x.x/include/linux/ieee80211.h
linux-x.x.x/include/linux/if_ether.h
linux-x.x.x/include/linux/if_link.h
linux-x.x.x/include/linux/jhash.h
linux-x.x.x/include/linux/leds.h
linux-x.x.x/include/linux/list.h
linux-x.x.x/include/linux/list_nulls.h
linux-x.x.x/include/linux/lockdep.h
linux-x.x.x/include/linux/log2.h
linux-x.x.x/include/linux/mod_devicetable.h
linux-x.x.x/include/linux/net.h
linux-x.x.x/include/linux/netdev_features.h
linux-x.x.x/include/linux/netlink.h
linux-x.x.x/include/linux/pci_ids.h
linux-x.x.x/include/linux/rbtree.h
linux-x.x.x/include/linux/rbtree_augmented.h
linux-x.x.x/include/linux/rfkill.h
linux-x.x.x/include/linux/rhashtable.h
linux-x.x.x/include/linux/rtnetlink.h
linux-x.x.x/include/linux/skbuff.h
linux-x.x.x/include/linux/socket.h
linux-x.x.x/include/linux/swab.h
linux-x.x.x/include/net/cfg80211.h
linux-x.x.x/include/net/dsfield.h
linux-x.x.x/include/net/dst.h
linux-x.x.x/include/net/dst_ops.h
linux-x.x.x/include/net/genetlink.h
linux-x.x.x/include/net/ieee80211_radiotap.h
linux-x.x.x/include/net/inet_frag.h
linux-x.x.x/include/net/inet_sock.h
linux-x.x.x/include/net/mac80211.h
linux-x.x.x/include/net/neighbour.h
linux-x.x.x/include/net/netlink.h
linux-x.x.x/include/net/netns/ipv4.h
linux-x.x.x/include/net/netns/mib.h
linux-x.x.x/include/net/regulatory.h
linux-x.x.x/include/net/request_sock.h
linux-x.x.x/include/net/rtnetlink.h
linux-x.x.x/include/net/snmp.h
linux-x.x.x/include/net/sock.h
linux-x.x.x/include/net/tcp_states.h
linux-x.x.x/include/net/timewait_sock.h
linux-x.x.x/include/trace/events/skb.h
linux-x.x.x/include/trace/events/sock.h
linux-x.x.x/include/uapi/asm-generic/socket.h
linux-x.x.x/include/uapi/linux/byteorder/little_endian.h
linux-x.x.x/include/uapi/linux/cryptouser.h
linux-x.x.x/include/uapi/linux/errqueue.h
linux-x.x.x/include/uapi/linux/genetlink.h
linux-x.x.x/include/uapi/linux/if_bridge.h
linux-x.x.x/include/uapi/linux/if_ether.h
linux-x.x.x/include/uapi/linux/if_link.h
linux-x.x.x/include/uapi/linux/if_packet.h
linux-x.x.x/include/uapi/linux/neighbour.h
linux-x.x.x/include/uapi/linux/net.h
linux-x.x.x/include/uapi/linux/netlink.h
linux-x.x.x/include/uapi/linux/nl80211.h
linux-x.x.x/include/uapi/linux/pci_regs.h
linux-x.x.x/include/uapi/linux/rfkill.h
linux-x.x.x/include/uapi/linux/rtnetlink.h
linux-x.x.x/include/uapi/linux/snmp.h
linux-x.x.x/include/uapi/linux/socket.h
linux-x.x.x/include/uapi/linux/sockios.h
linux-x.x.x/include/uapi/linux/swab.h
linux-x.x.x/lib/bsearch.c
linux-x.x.x/lib/bucket_locks.c
linux-x.x.x/lib/crc32.c
linux-x.x.x/lib/crc32defs.h
linux-x.x.x/lib/ctype.c
linux-x.x.x/lib/gcd.c
linux-x.x.x/lib/nlattr.c
linux-x.x.x/lib/rbtree.c
linux-x.x.x/lib/rhashtable.c
linux-x.x.x/net/core/datagram.c
linux-x.x.x/net/core/rtnetlink.c
linux-x.x.x/net/core/skbuff.c
linux-x.x.x/net/core/sock.c
linux-x.x.x/net/ethernet/eth.c
linux-x.x.x/net/mac80211/aead_api.c
linux-x.x.x/net/mac80211/aead_api.h
linux-x.x.x/net/mac80211/aes_ccm.h
linux-x.x.x/net/mac80211/aes_cmac.c
linux-x.x.x/net/mac80211/aes_cmac.h
linux-x.x.x/net/mac80211/aes_gcm.h
linux-x.x.x/net/mac80211/aes_gmac.c
linux-x.x.x/net/mac80211/aes_gmac.h
linux-x.x.x/net/mac80211/agg-rx.c
linux-x.x.x/net/mac80211/agg-tx.c
linux-x.x.x/net/mac80211/cfg.c
linux-x.x.x/net/mac80211/chan.c
linux-x.x.x/net/mac80211/debug.h
linux-x.x.x/net/mac80211/debugfs.h
linux-x.x.x/net/mac80211/debugfs_key.h
linux-x.x.x/net/mac80211/debugfs_netdev.h
linux-x.x.x/net/mac80211/debugfs_sta.h
linux-x.x.x/net/mac80211/driver-ops.c
linux-x.x.x/net/mac80211/driver-ops.h
linux-x.x.x/net/mac80211/ethtool.c
linux-x.x.x/net/mac80211/fils_aead.c
linux-x.x.x/net/mac80211/fils_aead.h
linux-x.x.x/net/mac80211/ht.c
linux-x.x.x/net/mac80211/ibss.c
linux-x.x.x/net/mac80211/ieee80211_i.h
linux-x.x.x/net/mac80211/iface.c
linux-x.x.x/net/mac80211/key.c
linux-x.x.x/net/mac80211/key.h
linux-x.x.x/net/mac80211/led.c
linux-x.x.x/net/mac80211/led.h
linux-x.x.x/net/mac80211/main.c
linux-x.x.x/net/mac80211/mesh.c
linux-x.x.x/net/mac80211/mesh.h
linux-x.x.x/net/mac80211/mesh_hwmp.c
linux-x.x.x/net/mac80211/mesh_pathtbl.c
linux-x.x.x/net/mac80211/mesh_plink.c
linux-x.x.x/net/mac80211/mesh_ps.c
linux-x.x.x/net/mac80211/mesh_sync.c
linux-x.x.x/net/mac80211/michael.c
linux-x.x.x/net/mac80211/michael.h
linux-x.x.x/net/mac80211/mlme.c
linux-x.x.x/net/mac80211/ocb.c
linux-x.x.x/net/mac80211/offchannel.c
linux-x.x.x/net/mac80211/pm.c
linux-x.x.x/net/mac80211/rate.c
linux-x.x.x/net/mac80211/rate.h
linux-x.x.x/net/mac80211/rc80211_minstrel.c
linux-x.x.x/net/mac80211/rc80211_minstrel.h
linux-x.x.x/net/mac80211/rc80211_minstrel_ht.c
linux-x.x.x/net/mac80211/rc80211_minstrel_ht.h
linux-x.x.x/net/mac80211/rx.c
linux-x.x.x/net/mac80211/scan.c
linux-x.x.x/net/mac80211/spectmgmt.c
linux-x.x.x/net/mac80211/sta_info.c
linux-x.x.x/net/mac80211/sta_info.h
linux-x.x.x/net/mac80211/status.c
linux-x.x.x/net/mac80211/tdls.c
linux-x.x.x/net/mac80211/tkip.c
linux-x.x.x/net/mac80211/tkip.h
linux-x.x.x/net/mac80211/trace.c
linux-x.x.x/net/mac80211/trace.h
linux-x.x.x/net/mac80211/trace_msg.h
linux-x.x.x/net/mac80211/tx.c
linux-x.x.x/net/mac80211/util.c
linux-x.x.x/net/mac80211/vht.c
linux-x.x.x/net/mac80211/wep.c
linux-x.x.x/net/mac80211/wep.h
linux-x.x.x/net/mac80211/wme.c
linux-x.x.x/net/mac80211/wme.h
linux-x.x.x/net/mac80211/wpa.c
linux-x.x.x/net/mac80211/wpa.h
linux-x.x.x/net/netlink/af_netlink.c
linux-x.x.x/net/netlink/af_netlink.h
linux-x.x.x/net/netlink/genetlink.c
linux-x.x.x/net/packet/af_packet.c
linux-x.x.x/net/packet/internal.h
linux-x.x.x/net/rfkill/core.c
linux-x.x.x/net/rfkill/input.c
linux-x.x.x/net/rfkill/rfkill.h
linux-x.x.x/net/wireless/ap.c
linux-x.x.x/net/wireless/chan.c
linux-x.x.x/net/wireless/core.c
linux-x.x.x/net/wireless/core.h
linux-x.x.x/net/wireless/debugfs.h
linux-x.x.x/net/wireless/ethtool.c
linux-x.x.x/net/wireless/ibss.c
linux-x.x.x/net/wireless/mesh.c
linux-x.x.x/net/wireless/mlme.c
linux-x.x.x/net/wireless/nl80211.c
linux-x.x.x/net/wireless/nl80211.h
linux-x.x.x/net/wireless/radiotap.c
linux-x.x.x/net/wireless/rdev-ops.h
linux-x.x.x/net/wireless/reg.c
linux-x.x.x/net/wireless/reg.h
linux-x.x.x/net/wireless/scan.c
linux-x.x.x/net/wireless/sme.c
linux-x.x.x/net/wireless/sysfs.c
linux-x.x.x/net/wireless/sysfs.h
linux-x.x.x/net/wireless/trace.c
linux-x.x.x/net/wireless/trace.h
linux-x.x.x/net/wireless/util.c
linux-x.x.x/net/wireless/wext-compat.h