1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-24 03:01:55 +02:00

Merge branch 'master' of projects.qi-hardware.com:openwrt-xburst

This commit is contained in:
kyak 2010-11-12 11:04:21 +03:00
commit 099ec978ba
254 changed files with 4999 additions and 3465 deletions

View File

@ -126,6 +126,10 @@ menu "Global build settings"
comment "General build options"
config DISPLAY_SUPPORT
bool "Show packages that require graphics support (local or remote)"
default n
config BUILD_PATENTED
default y
bool "Compile with support for patented functionality"

View File

@ -23,6 +23,11 @@ define Package/Default
else
VERSION:=$(PKG_RELEASE)
endif
ifneq ($(PKG_FLAGS),)
PKGFLAGS:=$(PKG_FLAGS)
else
PKGFLAGS:=
endif
ifneq ($(ARCH_PACKAGES),)
PKGARCH:=$(ARCH_PACKAGES)
else

View File

@ -49,6 +49,7 @@ ifeq ($(DUMP),)
IPKG_$(1):=$(PACKAGE_DIR)/$(1)_$(VERSION)_$(PKGARCH).ipk
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
INFO_$(1):=$(IPKG_STATE_DIR)/info/$(1).list
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT))
ifdef Package/$(1)/install
@ -98,6 +99,8 @@ ifeq ($(DUMP),)
echo "Provides: $(PROVIDES)"; \
echo "Source: $(SOURCE)"; \
echo "Section: $(SECTION)"; \
echo "Status: unknown $(if $(filter hold,$(PKG_FLAGS)),hold,ok) not-installed"; \
echo "Essential: $(if $(filter essential,$(PKG_FLAGS)),yes,no)"; \
echo "Priority: $(PRIORITY)"; \
echo "Maintainer: $(MAINTAINER)"; \
echo "Architecture: $(PKGARCH)"; \
@ -114,12 +117,27 @@ ifeq ($(DUMP),)
$(RSTRIP) $$(IDIR_$(1))
SIZE=`cd $$(IDIR_$(1)); du -bs --exclude=./CONTROL . 2>/dev/null | cut -f1`; \
$(SED) "s|^\(Installed-Size:\).*|\1 $$$$SIZE|g" $$(IDIR_$(1))/CONTROL/control
ifneq ($$(KEEP_$(1)),)
@( \
keepfiles=""; \
for x in $$(KEEP_$(1)); do \
[ -f "$$(IDIR_$(1))/$$$$x" ] || keepfiles="$$$${keepfiles:+$$$$keepfiles }$$$$x"; \
done; \
[ -z "$keepfiles" ] || { \
mkdir -p $$(IDIR_$(1))/lib/upgrade/keep.d; \
for x in $$$$keepfiles; do echo $$$$x >> $$(IDIR_$(1))/lib/upgrade/keep.d/$(1); done; \
}; \
)
endif
$(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR)
@[ -f $$(IPKG_$(1)) ] || false
$$(INFO_$(1)): $$(IPKG_$(1))
@[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
$(OPKG) install $$(IPKG_$(1))
$(if $(filter-out essential,$(PKG_FLAGS)),for flag in $(filter-out essential,$(PKG_FLAGS)); do $(OPKG) flag $$$$flag $(1); done)
$(1)-clean:
rm -f $(PACKAGE_DIR)/$(1)_*

View File

@ -21,6 +21,8 @@ STAMP_CONFIGURED:=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PK
STAMP_BUILT:=$(PKG_BUILD_DIR)/.built
STAMP_INSTALLED:=$(STAGING_DIR)/stamp/.$(PKG_NAME)_installed
STAGING_FILES_LIST:=$(PKG_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),).list
include $(INCLUDE_DIR)/download.mk
include $(INCLUDE_DIR)/quilt.mk
include $(INCLUDE_DIR)/package-defaults.mk
@ -125,7 +127,7 @@ define Build/DefaultTargets
$(call $(hook),$(TMP_DIR)/stage-$(PKG_NAME),$(TMP_DIR)/stage-$(PKG_NAME)/host)$(sep)\
)
if [ -d $(TMP_DIR)/stage-$(PKG_NAME) ]; then \
(cd $(TMP_DIR)/stage-$(PKG_NAME); find ./ > $(STAGING_DIR)/packages/$(PKG_NAME).list); \
(cd $(TMP_DIR)/stage-$(PKG_NAME); find ./ > $(STAGING_DIR)/packages/$(STAGING_FILES_LIST)); \
$(CP) $(TMP_DIR)/stage-$(PKG_NAME)/* $(STAGING_DIR)/; \
fi
rm -rf $(TMP_DIR)/stage-$(PKG_NAME)
@ -213,15 +215,15 @@ clean-staging: FORCE
rm -f $(STAMP_INSTALLED)
@-(\
cd "$(STAGING_DIR)"; \
if [ -f packages/$(PKG_NAME).list ]; then \
cat packages/$(PKG_NAME).list | xargs -r rm -f 2>/dev/null; \
if [ -f packages/$(STAGING_FILES_LIST) ]; then \
cat packages/$(STAGING_FILES_LIST) | xargs -r rm -f 2>/dev/null; \
fi; \
)
clean: clean-staging FORCE
$(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST))
$(Build/Clean)
rm -f $(STAGING_DIR)/packages/$(PKG_NAME).list $(STAGING_DIR_HOST)/packages/$(PKG_NAME).list
rm -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) $(STAGING_DIR_HOST)/packages/$(STAGING_FILES_LIST)
rm -rf $(PKG_BUILD_DIR)
dist:

View File

@ -42,6 +42,8 @@ endif
SCAN_COOKIE?=$(shell echo $$$$)
export SCAN_COOKIE
SUBMAKE:=umask 022; $(SUBMAKE)
prepare-mk: FORCE ;
prepare-tmpinfo: FORCE

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=6in4
PKG_VERSION:=6
PKG_VERSION:=7
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk

View File

@ -17,11 +17,9 @@ if [ "$ACTION" = ifup ]; then
config_get wandev "$cfg" wan_device "$(find_6in4_wanif)"
[ "$wandev" = "$DEVICE" ] || return 0
local oldip
local wanip=$(find_6in4_wanip "$wandev")
config_get oldip "$cfg" ipaddr
[ -n "$wanip" ] && [ "$oldip" != "$wanip" ] && {
[ -n "$wanip" ] && {
local tunnelid
config_get tunnelid "$cfg" tunnelid
@ -37,7 +35,22 @@ if [ "$ACTION" = ifup ]; then
}
uci_set_state network "$cfg" ipaddr "$wanip"
( wget -qO/dev/null "http://ipv4.tunnelbroker.net/ipv4_end.php?ipv4b=AUTO&user_id=$username&pass=$password&tunnel_id=$tunnelid" && ifup "$cfg" )&
(
local url="http://ipv4.tunnelbroker.net/ipv4_end.php?ipv4b=AUTO&user_id=$username&pass=$password&tunnel_id=$tunnelid"
local try=0
local max=3
while [ $((++try)) -le $max ]; do
wget -qO/dev/null "$url" 2>/dev/null && {
logger -t 6in4-update "Updated tunnel #$tunnelid endpoint to $wanip"
ifup "$cfg"
break
} || {
logger -t 6in4-update "Try $try/$max failed, retrying"
sleep 1
}
done
)&
}
}
}

View File

@ -17,7 +17,7 @@ else
$(curdir)/builddirs-install:=. $(sort $(package-y))
endif
ifneq ($(IGNORE_ERRORS),)
$(curdir)/builddirs-ignore-compile:= $(if $(filter m y, $(IGNORE_ERRORS)),$(foreach m,$(IGNORE_ERRORS),$(package-$(m))),$(package-m))
$(curdir)/builddirs-ignore-compile:= $(if $(filter n m y, $(IGNORE_ERRORS)),$(foreach m,$(IGNORE_ERRORS),$(package-$(subst n,,$(m)))),$(package-m) $(package-))
endif
$(curdir)/install:=$(curdir)/install-cleanup

View File

@ -185,7 +185,7 @@ detect_acx() {
cat <<EOF
config wifi-device $dev
option type acx
option channel 5
option channel 11
# REMOVE THIS LINE TO ENABLE WIFI:
option disabled 1

View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=base-files
PKG_RELEASE:=43.3
PKG_RELEASE:=43.8
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
PKG_BUILD_DEPENDS:=opkg/host
@ -50,9 +50,14 @@ define Package/base-files/conffiles
/etc/inittab
/etc/group
/etc/passwd
/etc/shadow
/etc/profile
/etc/shells
/etc/sysctl.conf
/etc/rc.local
/etc/sysupgrade.conf
/etc/config/
/etc/dropbear/
$(call $(TARGET)/conffiles)
endef
@ -159,6 +164,7 @@ ifneq ($(TARGET_avr32)$(TARGET_coldfire),)
DEPENDS:=+libgcc
endif
URL:=$(LIBC_URL)
PKG_FLAGS:=hold essential
endef

View File

@ -1,18 +1,16 @@
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006-2010 OpenWrt.org
grep '^root:[^!]' /etc/passwd >&- 2>&-
[ "$?" = "0" -a -z "$FAILSAFE" ] &&
{
if grep -qs '^root:[^!]' /etc/passwd /etc/shadow && [ -z "$FAILSAFE" ]; then
echo "Login failed."
exit 0
} || {
else
cat << EOF
=== IMPORTANT ============================
Use 'passwd' to set your login password
this will disable telnet and enable SSH
------------------------------------------
EOF
}
fi
exec /bin/ash --login

View File

@ -274,4 +274,42 @@ uci_apply_defaults() {
uci commit
}
service_kill() {
local name="${1}"
local pid="${2:-$(pidof "$name")}"
local grace="${3:-5}"
[ -f "$pid" ] && pid="$(head -n1 "$pid" 2>/dev/null)"
for pid in $pid; do
[ -d "/proc/$pid" ] || continue
local try=0
kill -TERM $pid 2>/dev/null && \
while grep -qs "$name" "/proc/$pid/cmdline" && [ $((try++)) -lt $grace ]; do sleep 1; done
kill -KILL $pid 2>/dev/null && \
while grep -qs "$name" "/proc/$pid/cmdline"; do sleep 1; done
done
}
pi_include() {
if [ -f "/tmp/overlay/$1" ]; then
. "/tmp/overlay/$1"
elif [ -f "$1" ]; then
. "$1"
elif [ -d "/tmp/overlay/$1" ]; then
for src_script in /tmp/overlay/$1/*.sh; do
. "$src_script"
done
elif [ -d "$1" ]; then
for src_script in $1/*.sh; do
. "$src_script"
done
else
echo "WARNING: $1 not found"
return 1
fi
return 0
}
[ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh

View File

@ -5,12 +5,6 @@
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
. /etc/diag.sh
preinit_essential_hook=
preinit_main_hook=
failsafe_hook=
initramfs_hook=
preinit_mount_root_hook=
pi_ifname=
pi_ip=192.168.1.1
pi_broadcast=192.168.1.255
@ -28,8 +22,14 @@ pi_init_suppress_stderr="y"
pi_init_path="/bin:/sbin:/usr/bin:/usr/sbin"
pi_init_cmd="/sbin/init"
. /etc/functions.sh
. /lib/functions/boot.sh
boot_hook_init preinit_essential
boot_hook_init preinit_main
boot_hook_init failsafe
boot_hook_init initramfs
boot_hook_init preinit_mount_root
for pi_source_file in /lib/preinit/*; do
. $pi_source_file

View File

@ -0,0 +1,5 @@
## This file contains files and directories that should
## be preserved during an upgrade.
# /etc/example.conf
# /etc/openvpn/

View File

@ -6,18 +6,65 @@ mount() {
/bin/busybox mount "$@"
}
boot_hook_add() {
local hook="${1}_hook"
local value="$2"
local sep=" "
boot_hook_splice_start() {
export -n PI_HOOK_SPLICE=1
}
eval "$hook=\"\${$hook:+\${$hook}\${value:+\$sep}}\$value\""
boot_hook_splice_finish() {
local hook
for hook in $PI_STACK_LIST; do
local v; eval "v=\${${hook}_splice:+\$${hook}_splice }$hook"
export -n "${hook}=${v% }"
export -n "${hook}_splice="
done
export -n PI_HOOK_SPLICE=
}
boot_hook_init() {
local hook="${1}_hook"
export -n "PI_STACK_LIST=${PI_STACK_LIST:+$PI_STACK_LIST }$hook"
export -n "$hook="
}
boot_hook_add() {
local hook="${1}_hook${PI_HOOK_SPLICE:+_splice}"
local func="${2}"
[ -n "$func" ] && {
local v; eval "v=\$$hook"
export -n "$hook=${v:+$v }$func"
}
}
boot_hook_shift() {
local hook="${1}_hook"
local rvar="${2}"
local v; eval "v=\$$hook"
[ -n "$v" ] && {
local first="${v%% *}"
[ "$v" != "${v#* }" ] && \
export -n "$hook=${v#* }" || \
export -n "$hook="
export -n "$rvar=$first"
return 0
}
return 1
}
boot_run_hook() {
local boot_func
for boot_func in $(eval "echo \"\$${1}_hook\""); do
$boot_func "$1" "$2"
local hook="$1"
local func
while boot_hook_shift "$hook" func; do
local ran; eval "ran=\$PI_RAN_$func"
[ -n "$ran" ] || {
export -n "PI_RAN_$func=1"
$func "$1" "$2"
}
done
}
@ -95,6 +142,7 @@ fopivot() { # <rw_root> <ro_root> <dupe?>
ramoverlay() {
mkdir -p /tmp/root
mount -t tmpfs root /tmp/root
mount -t tmpfs -o mode=0755 root /tmp/root
fopivot /tmp/root /rom 1
}

View File

@ -339,21 +339,17 @@ setup_interface() {
setup_interface_static "$iface" "$config"
;;
dhcp)
local lockfile="/var/lock/dhcp-$iface"
lock "$lockfile"
# prevent udhcpc from starting more than once
# kill running udhcpc instance
local pidfile="/var/run/dhcp-${iface}.pid"
local pid="$(cat "$pidfile" 2>/dev/null)"
if [ -d "/proc/$pid" ] && grep -qs udhcpc "/proc/${pid}/cmdline"; then
lock -u "$lockfile"
else
local ipaddr netmask hostname proto1 clientid broadcast
service_kill udhcpc "$pidfile"
local ipaddr netmask hostname proto1 clientid vendorid broadcast
config_get ipaddr "$config" ipaddr
config_get netmask "$config" netmask
config_get hostname "$config" hostname
config_get proto1 "$config" proto
config_get clientid "$config" clientid
config_get vendorid "$config" vendorid
config_get_bool broadcast "$config" broadcast 0
[ -z "$ipaddr" ] || \
@ -368,11 +364,9 @@ setup_interface() {
${ipaddr:+-r $ipaddr} \
${hostname:+-H $hostname} \
${clientid:+-c $clientid} \
${vendorid:+-V $vendorid} \
-b -p "$pidfile" $broadcast \
${dhcpopts:- -O rootpath -R &}
lock -u "$lockfile"
fi
;;
none)
setup_interface_none "$iface" "$config"
@ -400,12 +394,7 @@ stop_interface_dhcp() {
remove_dns "$config"
local pidfile="/var/run/dhcp-${ifname}.pid"
local pid="$(cat "$pidfile" 2>/dev/null)"
[ -d "/proc/$pid" ] && {
grep -qs udhcpc "/proc/$pid/cmdline" && kill -TERM $pid && \
while grep -qs udhcpc "/proc/$pid/cmdline"; do sleep 1; done
rm -f "$pidfile"
}
service_kill udhcpc "$pidfile"
uci -P /var/state revert "network.$config"
}

View File

@ -7,7 +7,7 @@ do_mount_devfs() {
}
do_mount_hotplug() {
mount -t tmpfs tmpfs /dev -o size=512K
mount -t tmpfs tmpfs /dev -o mode=0755,size=512K
}
do_mount_udev() {

View File

@ -0,0 +1,24 @@
#!/bin/sh
# Copyright (C) 2010 OpenWrt.org
merge_overlay_hooks() {
jffs2_not_mounted || [ ! -d /tmp/overlay/lib/preinit ] || {
echo "- merge overlay components -"
mkdir -p /tmp/preinit-hook-merge
ln -sf /lib/preinit/* /tmp/overlay/lib/preinit/[0-9][0-9]_* /tmp/preinit-hook-merge/
boot_hook_splice_start
local pipart
for pipart in /tmp/preinit-hook-merge/*; do
. $pipart
done
boot_hook_splice_finish
rm -rf /tmp/preinit-hook-merge
}
}
boot_hook_add preinit_mount_root merge_overlay_hooks

View File

@ -0,0 +1,10 @@
# Essential files that will be always kept
/etc/banner
/etc/hosts
/etc/inittab
/etc/group
/etc/passwd
/etc/profile
/etc/shells
/etc/sysctl.conf
/etc/rc.local

View File

@ -51,8 +51,10 @@ EOF
add_uci_conffiles() {
local file="$1"
find /etc/config /etc/passwd /etc/group /etc/dropbear \
/etc/firewall.user /etc/rc.local -type f > "$file"
( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
/etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
-type f 2>/dev/null;
opkg list-changed-conffiles ) | sort -u > "$file"
return 0
}

View File

@ -21,9 +21,9 @@ setup_interface () {
local user_router
[ -n "$ifc" ] && {
config_get old_ip "$ifc" ipaddr
config_get old_broadcast "$ifc" broadcast
config_get old_subnet "$ifc" netmask
old_ip="$(uci_get_state network "$ifc" ipaddr)"
old_broadcast="$(uci_get_state network "$ifc" broadcast)"
old_subnet="$(uci_get_state network "$ifc" netmask)"
}
[ "$ip" != "$old_ip" ] \
@ -41,8 +41,8 @@ setup_interface () {
# Default Route
[ -n "$ifc" ] && {
change_state network "$ifc" lease_gateway "$router"
config_get old_router "$ifc" gateway
user_router=$(uci_get "network.$ifc.gateway")
old_router="$(uci_get_state network "$ifc" gateway)"
user_router="$(uci_get network "$ifc" gateway)"
[ -n "$user_router" ] && router="$user_router"
}

View File

@ -17,10 +17,9 @@ PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/block-extroot/Default
SECTION:=utils
CATEGORY:=Utilities
SECTION:=base
CATEGORY:=Base system
TITLE:=root filesystem on secondary storage
SUBMENU:=disc
endef
define Package/block-extroot

View File

@ -4,11 +4,10 @@
# See /LICENSE for more information.
. /etc/functions.sh
. /lib/functions/extmount.sh
. /lib/functions/mount.sh
determine_external_root() {
pi_include /lib/functions/extmount.sh
pi_include /lib/functions/mount.sh
local OLD_UCI_CONFIG_DIR="$UCI_CONFIG_DIR"
set_jffs_mp
determine_root_device

View File

@ -13,12 +13,14 @@ set_jffs_mp() {
}
er_load_modules() {
[ -d $ER_ROOT/etc/modules.d ] && {
cd $ER_ROOT/etc/modules.d && {
local modules="$(grep -l '# May be required for rootfs' *)"
cat $modules | sed 's/^\([^#]\)/insmod \1/' | sh 2>&- || :
}
mkdir -p /tmp/extroot_modules/modules.d
mkdir -p /tmp/extroot_modules/modules
ln -sf /etc/modules.d/* /tmp/overlay/etc/modules.d/* /tmp/extroot_modules/modules.d
ln -sf /lib/modules/*/* /tmp/overlay/lib/modules/*/* /tmp/extroot_modules/modules
local modules="$(grep -l '# May be required for rootfs' /tmp/extroot_modules/modules.d/*)"
cd /tmp/extroot_modules/modules && {
cat $modules | sed -e 's/^\([^#].*\)/insmod \.\/\1.ko/'| sh 2>&- || :
}
rm -rf /tmp/extroot_modules
}

View File

@ -118,15 +118,18 @@ config_create_swap_fstab_entry() {
[ -n "$device" ] || return 0
local fstabnew="$(mktemp -t '.fstab.XXXXXXXX')"
local fstabnew
mkdir -p /var/lock
lock -w /var/lock/fstab.lck && {
lock /var/lock/fstab.lck
fstabnew="$(mktemp -t '.fstab.XXXXXXXX')"
cat /tmp/fstab | grep -E -v "^$device[[:blank:]]" >>"$fstabnew"
[ "$enabled" -eq 1 ] && echo "$device none swap sw 0 0" >> "$fstabnew"
cat "$fstabnew" >/tmp/fstab
lock -u /var/lock/fstab.lck
rm -f $fstabnew
lock -u /var/lock/fstab.lck
}
}
config_create_mount_fstab_entry() {
@ -140,15 +143,18 @@ config_create_mount_fstab_entry() {
[ -n "$target" ] || return 0
[ -n "$device" ] || return 0
local fstabnew="$(mktemp -t '.fstab.XXXXXXXX')"
local fstabnew
mkdir -p /var/lock
lock -w /var/lock/fstab.lck && {
lock /var/lock/fstab.lck
fstabnew="$(mktemp -t '.fstab.XXXXXXXX')"
cat /tmp/fstab | grep -E -v "^$device[[:blank:]]" | grep -v "$target" >>"$fstabnew"
echo "$device $target $fstype $options 0 0" >>"$fstabnew"
cat "$fstabnew" >/tmp/fstab
lock -u /var/lock/fstab.lck
rm -f $fstabnew
lock -u /var/lock/fstab.lck
}
}
libmount_find_token() {

View File

@ -12,7 +12,6 @@ libmount_fsck() {
local found_fsck=0
[ -n "$fsck_type" ] && [ "$fsck_type" != "swap" ] && {
grep -q "$device" /proc/swaps || grep -q "$device" /proc/mounts || {
[ -e "$device" ] && [ "$fsck_enabled" -eq 1 ] && {
for known_type in $libmount_known_fsck; do
@ -28,9 +27,8 @@ libmount_fsck() {
}
}
}
}
libmount_known_fsck=""
include /lib/functions/fsck
pi_include /lib/functions/fsck

View File

@ -8,8 +8,6 @@
START=20
. /lib/functions/mount.sh
do_mount() {
local cfg="$1"
config_mount_by_section "$cfg"
@ -39,19 +37,29 @@ do_swapoff() {
}
start() {
. /lib/functions/mount.sh
config_load fstab
mkdir -p /var/lock
lock -w /var/lock/fstab.lck && {
lock /var/lock/fstab.lck
echo '# WARNING: this is an auto generated file, please use uci to set defined filesystems' > /etc/fstab
[ -e /tmp/fstab ] || {
echo '# WARNING: this is an auto generated file, please use uci to set defined filesystems' > /tmp/fstab
}
lock -u /var/lock/fstab.lck
config_foreach do_mount mount
}
config_foreach do_swapon swap
config_foreach do_mount mount
config_foreach do_swapon swap # do swap a second time so that swap on filesystems is enabled
}
stop() {
. /lib/functions/mount.sh
config_load fstab
config_foreach do_unmount mount
config_foreach do_swapoff swap
swapoff -a
}

View File

@ -5,8 +5,8 @@
#
. /lib/functions/block.sh
. /lib/functions/fsck.sh
pi_include /lib/functions/block.sh
pi_include /lib/functions/fsck.sh
config_mount_by_section() {
local cfg="$1"
@ -28,14 +28,13 @@ config_mount_by_section() {
local is_rootfs="$9"
shift
local found_device=""
local fsck_type=""
found_device="$(libmount_find_device_by_id "$uuid" "$label" "$device" "$cfgdevice")"
if [ -n "$found_device" ]; then
if [ -z "$find_rootfs" ] || [ "$find_rootfs" -eq 0 ] || [ "$is_rootfs" -eq 1 ]; then
[ "$enabled_fsck" -eq 1 ] && {
grep -q "$found_device" /proc/swaps || grep -q "$found_device" /proc/mounts || {
libmount_fsck "$found_device" "$fsck_type" "$enabled_fsck"
libmount_fsck "$found_device" "$fstype" "$enabled_fsck"
}
}
@ -72,7 +71,6 @@ config_swapon_by_section() {
local label
local found_device=""
local fsck_type=""
found_device="$(libmount_find_device_by_id "$uuid" "$label" "$device" "$cfgdevice")"

View File

@ -354,7 +354,7 @@ detect_broadcom() {
cat <<EOF
config wifi-device wl${i}
option type broadcom
option channel 5
option channel 11
# REMOVE THIS LINE TO ENABLE WIFI:
option disabled 1

View File

@ -10,6 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=busybox
PKG_VERSION:=1.15.3
PKG_RELEASE:=2
PKG_FLAGS:=essential
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.busybox.net/downloads \

View File

@ -1,16 +1,24 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006-2010 OpenWrt.org
START=50
has_root_pwd() {
local pwd=$([ -f "$1" ] && cat "$1")
pwd="${pwd#*root:}"
pwd="${pwd%%:*}"
test -n "${pwd#!}"
}
start() {
if [ \! -f /etc/passwd ] || \
awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/passwd 2>/dev/null || \
( [ \! -x /usr/sbin/dropbear ] && [ \! -x /usr/sbin/sshd ] )
then \
if ( ! has_root_pwd /etc/passwd && ! has_root_pwd /etc/shadow ) || \
( [ ! -x /usr/sbin/dropbear ] && [ ! -x /usr/sbin/sshd ] );
then
telnetd -l /bin/login.sh
fi
}
stop() {
killall telnetd
killall telnetd 2>/dev/null
}

View File

@ -1,90 +0,0 @@
#
# Copyright (C) 2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=carl9170
PKG_VERSION:=1.0.5.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/chr/carl9170/$(PKG_VERSION) \
@KERNEL/linux/kernel/people/chr/carl9170/old/$(PKG_VERSION)
PKG_MD5SUM:=91d714d1e5c5c62da1191ac5afd8bcb0
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_CARL9170_DEBUGFS \
include $(INCLUDE_DIR)/package.mk
DRV_PATH:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170
define KernelPackage/carl9170
SUBMENU:=Wireless Drivers
TITLE:=Driver for Atheros AR9170 USB sticks
DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core
URL:=http://www.kernel.org/pub/linux/kernel/people/chr/carl9170
FILES:=$(DRV_PATH)/carl9170usb.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,60,carl9170usb)
MENU:=1
endef
define KernelPackage/carl9170/config
menu "Configuration"
depends PACKAGE_kmod-carl9170
config PACKAGE_CARL9170_DEBUGFS
bool "Enable Debugging (DebugFS) Support"
depends PACKAGE_MAC80211_DEBUGFS
help
Say Y if you need access to carl9170usb's statistics for QoS queue
status, rate control, etc...
endmenu
endef
define KernelPackage/carl9170/description
This package contains a driver for Atheros AR9170 USB sticks using the free firmware
endef
define Build/Prepare
rm -rf $(PKG_BUILD_DIR)
mkdir -p $(PKG_BUILD_DIR)
$(HOST_TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_SOURCE)
$(HOST_TAR) -C $(PKG_BUILD_DIR) -xf $(PKG_BUILD_DIR)/$(PKG_VERSION)/driver/carl9170-driver-$(PKG_VERSION).tar
ln -s $(STAGING_DIR)/usr/include/mac80211/ath/*.h $(PKG_BUILD_DIR)/drivers/net/wireless/ath/
$(Build/Patch)
endef
BUILDFLAGS = \
CONFIG_CARL9170_USB=m \
CONFIG_CARL9170_LEDS=$(if $(CONFIG_LEDS_TRIGGERS),y) \
CONFIG_CARL9170_DEBUGFS=$(if $(CONFIG_PACKAGE_CARL9170_DEBUGFS),y) \
CONFIG_MAC80211_DEBUGFS=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \
EXTRA_CFLAGS = \
$(if $(CONFIG_ATH_USER_REGD),-DATH_USER_REGD) \
$(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS -DCONFIG_CARL9170_LEDS) \
$(if $(CONFIG_PACKAGE_CARL9170_DEBUGFS),-DCONFIG_CARL9170_DEBUGFS) \
$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),-DCONFIG_MAC80211_DEBUGFS) \
define Build/Compile
$(MAKE) -C $(LINUX_DIR) \
SUBDIRS="$(DRV_PATH)" \
ARCH="$(LINUX_KARCH)" \
CROSS_COMPILE="$(KERNEL_CROSS)" \
CC="$(TARGET_CC) -I$(STAGING_DIR)/usr/include/mac80211 $(EXTRA_CFLAGS)" \
$(BUILDFLAGS)
endef
define KernelPackage/carl9170/install
$(INSTALL_DIR) $(1)/lib/firmware
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_VERSION)/firmware_build/carl9170-1.fw $(1)/lib/firmware/
endef
$(eval $(call KernelPackage,carl9170))

View File

@ -1,31 +0,0 @@
--- a/drivers/net/wireless/ath/carl9170/usb.c
+++ b/drivers/net/wireless/ath/carl9170/usb.c
@@ -1000,11 +1000,28 @@ err_failed:
ar9170_usb_firmware_failed(aru);
}
+
+
static int ar9170_usb_request_firmware(struct ar9170_usb *aru)
{
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
+ const struct firmware *fw;
+ int ret;
+
+ ret = request_firmware(&fw,
+ ar9170_fws[aru->fw_load].files[aru->fw_files].name,
+ &aru->udev->dev);
+
+ if (ret < 0)
+ return ret;
+
+ ar9170_usb_firmware_step2(fw, aru);
+ return 0;
+#else
return request_firmware_nowait(THIS_MODULE, 1,
ar9170_fws[aru->fw_load].files[aru->fw_files].name,
&aru->udev->dev, GFP_KERNEL, aru, ar9170_usb_firmware_step2);
+#endif
}
static void ar9170_usb_disconnect(struct usb_interface *intf)

View File

@ -1,11 +0,0 @@
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -51,7 +51,7 @@ static int modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
-int modparam_ht;
+int modparam_ht = 1;
module_param_named(ht, modparam_ht, bool, S_IRUGO);
MODULE_PARM_DESC(ht, "enable MPDU aggregation.");

View File

@ -28,7 +28,7 @@ define Package/crda
SECTION:=net
CATEGORY:=Network
TITLE:=Central Regulatory Domain Agent (CRDA)
DEPENDS:=@LINUX_2_6 +hotplug2 +kmod-mac80211 +libnl-tiny
DEPENDS:=@LINUX_2_6 +hotplug2 +libnl-tiny
URL:=http://wireless.kernel.org/en/developers/Regulatory/CRDA
endef

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmasq
PKG_VERSION:=2.55
PKG_RELEASE:=3
PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq

View File

@ -4,7 +4,7 @@ config dnsmasq
option filterwin2k 0 # enable for dial on demand
option localise_queries 1
option rebind_protection 1 # disable if upstream must serve RFC1918 addresses
option rebind_localhost 0 # enable for RBL checking and similar services
option rebind_localhost 1 # enable for RBL checking and similar services
#list rebind_domain example.lan # whitelist RFC1918 responses for domains
option local '/lan/'
option domain 'lan'
@ -18,6 +18,7 @@ config dnsmasq
#option nonwildcard 1
#list interface br-lan
#list notinterface lo
#list bogusnxdomain '64.94.110.11'
config dhcp lan
option interface lan

View File

@ -42,17 +42,23 @@ append_server() {
}
append_interface() {
append args "-i $1"
local ifname=$(uci_get_state network "$1" ifname "$1")
append args "-i $ifname"
}
append_notinterface() {
append args "-I $1"
local ifname=$(uci_get_state network "$1" ifname "$1")
append args "-I $ifname"
}
append_addnhosts() {
append args "-H $1"
}
append_bogusnxdomain() {
append args "-B $1"
}
dnsmasq() {
local cfg="$1"
append_bool "$cfg" authoritative "-K"
@ -72,6 +78,7 @@ dnsmasq() {
append_bool "$cfg" enable_tftp "--enable-tftp"
append_bool "$cfg" nonwildcard "-z"
append_parm "$cfg" cachesize "-c"
append_parm "$cfg" dnsforwardmax "-0"
append_parm "$cfg" port "-p"
append_parm "$cfg" ednspacket_max "-P"
@ -83,6 +90,7 @@ dnsmasq() {
config_list_foreach "$cfg" "interface" append_interface
config_list_foreach "$cfg" "notinterface" append_notinterface
config_list_foreach "$cfg" "addnhosts" append_addnhosts
config_list_foreach "$cfg" "bogusnxdomain" append_bogusnxdomain
append_parm "$cfg" "leasefile" "-l"
append_parm "$cfg" "resolvfile" "-r"
append_parm "$cfg" "tftp_root" "--tftp-root"
@ -94,7 +102,7 @@ dnsmasq() {
[ "$readethers" = "1" ] && [ -e "/etc/ethers" ] || touch /etc/ethers
config_get leasefile $cfg leasefile
[ -e "$leasefile" ] || touch "$leasefile"
[ -n "$leasefile" ] && [ -e "$leasefile" ] || touch "$leasefile"
config_get_bool cachelocal "$cfg" cachelocal 1
config_get hostsfile "$cfg" dhcphostsfile

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=firewall
PKG_VERSION:=1
PKG_RELEASE:=16
PKG_RELEASE:=20
include $(INCLUDE_DIR)/package.mk
@ -32,6 +32,7 @@ endef
define Package/firewall/conffiles
/etc/config/firewall
/etc/firewall.user
endef
define Package/firewall/install

View File

@ -15,6 +15,11 @@ if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "wan" ]; then
iptables -t nat -A postrouting_rule -j nat_reflection_out
}
iptables -t filter -F nat_reflection_fwd 2>/dev/null || {
iptables -t filter -N nat_reflection_fwd
iptables -t filter -A forwarding_rule -j nat_reflection_fwd
}
find_networks() {
find_networks_cb() {
local cfg="$1"
@ -38,6 +43,10 @@ if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "wan" ]; then
setup_fwd() {
local cfg="$1"
local reflection
config_get_bool reflection "$cfg" reflection 1
[ "$reflection" == 1 ] || return
local src
config_get src "$cfg" src
@ -56,10 +65,6 @@ if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "wan" ]; then
local proto
config_get proto "$cfg" proto
local reflection
config_get_bool reflection "$cfg" reflection 1
[ "$reflection" == 1 ] || return
local epmin epmax extport
config_get extport "$cfg" src_dport
[ -n "$extport" ] || return
@ -82,6 +87,9 @@ if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "wan" ]; then
[ "$proto" = tcpudp ] && proto="tcp udp"
[ "${inthost#!}" = "$inthost" ] || return 0
[ "${exthost#!}" = "$exthost" ] || return 0
local p
for p in ${proto:-tcp udp}; do
case "$p" in
@ -95,6 +103,11 @@ if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "wan" ]; then
-s $lanip/$lanmk -d $inthost \
-p $p --dport $ipmin${ipmax:+:$ipmax} \
-j SNAT --to-source $lanip
iptables -t filter -A nat_reflection_fwd \
-s $lanip/$lanmk -d $inthost \
-p $p --dport $ipmin${ipmax:+:$ipmax} \
-j ACCEPT
;;
esac
done
@ -105,4 +118,3 @@ if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "wan" ]; then
config_load firewall
config_foreach setup_fwd redirect
fi

View File

@ -15,6 +15,7 @@ config_load firewall
config fw_zones
ZONE_LIST=$CONFIG_SECTION
ZONE_NAMES=
CUSTOM_CHAINS=1
DEF_INPUT=DROP
@ -23,6 +24,25 @@ DEF_FORWARD=DROP
CONNTRACK_ZONES=
NOTRACK_DISABLED=
add_state() {
local var="$1"
local item="$2"
local val="$(uci_get_state firewall core $var)"
uci_set_state firewall core $var "${val:+$val }$item"
}
del_state() {
local var="$1"
local item="$2"
local val=" $(uci_get_state firewall core $var) "
val="${val// $item / }"
val="${val# }"
val="${val% }"
uci_set_state firewall core $var "$val"
}
find_item() {
local item="$1"; shift
for i in "$@"; do
@ -44,6 +64,16 @@ get_portrange() {
export -n -- "$_var=${_min:-$_max}"
}
get_negation() {
local _var="$1"
local _flag="$2"
local _ipaddr="$3"
[ "${_ipaddr#!}" != "$_ipaddr" ] && \
export -n -- "$_var=! $_flag ${_ipaddr#!}" || \
export -n -- "$_var=${_ipaddr:+$_flag $_ipaddr}"
}
load_policy() {
config_get input $1 input
config_get output $1 output
@ -88,13 +118,15 @@ create_zone() {
if [ "$masq" == "1" ]; then
local msrc mdst
for msrc in ${masq_src:-0.0.0.0/0}; do
[ "${msrc#!}" != "$msrc" ] && msrc="! -s ${msrc#!}" || msrc="-s $msrc"
get_negation msrc '-s' "$msrc"
for mdst in ${masq_dest:-0.0.0.0/0}; do
[ "${mdst#!}" != "$mdst" ] && mdst="! -d ${mdst#!}" || mdst="-d $mdst"
get_negation mdst '-d' "$mdst"
$IPTABLES -A zone_${name}_nat -t nat $msrc $mdst -j MASQUERADE
done
done
fi
append ZONE_NAMES "$name"
}
@ -132,6 +164,8 @@ addif() {
uci_set_state firewall core "${network}_ifname" "$ifname"
uci_set_state firewall core "${network}_zone" "$zone"
add_state "${zone}_networks" "$network"
ACTION=add ZONE="$zone" INTERFACE="$network" DEVICE="$ifname" /sbin/hotplug-call firewall
}
@ -158,6 +192,8 @@ delif() {
uci_revert_state firewall core "${network}_ifname"
uci_revert_state firewall core "${network}_zone"
del_state "${zone}_networks" "$network"
ACTION=remove ZONE="$zone" INTERFACE="$network" DEVICE="$ifname" /sbin/hotplug-call firewall
}
@ -327,27 +363,41 @@ fw_rule() {
config_get target $1 target
config_get ruleset $1 ruleset
[ "$target" != "NOTRACK" ] || [ -n "$src" ] || {
echo "NOTRACK rule needs src"
return
}
local srcaddr destaddr
get_negation srcaddr '-s' "$src_ip"
get_negation destaddr '-d' "$dest_ip"
local srcports destports
get_portrange srcports "$src_port" ":"
get_portrange destports "$dest_port" ":"
ZONE=input
TARGET=$target
[ -z "$target" ] && target=DROP
[ -n "$src" -a -z "$dest" ] && ZONE=zone_$src
[ -n "$src" -a -n "$dest" ] && ZONE=zone_${src}_forward
[ -n "$dest" ] && TARGET=zone_${dest}_$target
TABLE=filter
TARGET="${target:-DROP}"
eval 'RULE_COUNT=$((++RULE_COUNT_'$ZONE'))'
if [ "$TARGET" = "NOTRACK" ]; then
TABLE=raw
ZONE="zone_${src}_notrack"
else
[ -n "$src" ] && ZONE="zone_${src}${dest:+_forward}"
[ -n "$dest" ] && TARGET="zone_${dest}_${TARGET}"
fi
local pos
eval 'pos=$((++FW__RULE_COUNT_'$ZONE'))'
add_rule() {
$IPTABLES -I $ZONE $RULE_COUNT \
$IPTABLES -t $TABLE -I $ZONE $pos \
$srcaddr $destaddr \
${proto:+-p $proto} \
${icmp_type:+--icmp-type $icmp_type} \
${src_ip:+-s $src_ip} \
${srcports:+--sport $srcports} \
${src_mac:+-m mac --mac-source $src_mac} \
${dest_ip:+-d $dest_ip} \
${destports:+--dport $destports} \
-j $TARGET
}
@ -413,7 +463,7 @@ fw_redirect() {
nataddr="$dest_ip"
get_portrange natports "$dest_port" "-"
srcdaddr="$src_dip"
get_negation srcdaddr '-d' "$src_dip"
get_portrange srcdports "$src_dport" ":"
find_item "$src" $CONNTRACK_ZONES || \
@ -432,7 +482,7 @@ fw_redirect() {
nataddr="$src_dip"
get_portrange natports "$src_dport" "-"
srcdaddr="$dest_ip"
get_negation srcdaddr '-d' "$dest_ip"
get_portrange srcdports "$dest_port" ":"
find_item "$dest" $CONNTRACK_ZONES || \
@ -443,26 +493,31 @@ fw_redirect() {
return
fi
local srcaddr destaddr
get_negation srcaddr '-s' "$src_ip"
get_negation destaddr '-d' "$dest_ip"
local srcports destports
get_portrange srcports "$src_port" ":"
get_portrange destports "${dest_port-$src_dport}" ":"
add_rule() {
$IPTABLES -I $natchain 1 -t nat \
local pos
eval 'pos=$((++FW__REDIR_COUNT_'$natchain'))'
$IPTABLES -I $natchain $pos -t nat \
$srcaddr $srcdaddr \
${proto:+-p $proto} \
${src_ip:+-s $src_ip} \
${srcports:+--sport $srcports} \
${srcdaddr:+-d $srcdaddr} \
${srcdports:+--dport $srcdports} \
${src_mac:+-m mac --mac-source $src_mac} \
-j ${target:-DNAT} $natopt $nataddr${natports:+:$natports}
[ -n "$dest_ip" ] && \
$IPTABLES -I ${fwdchain:-forward} 1 \
$srcaddr $destaddr \
${proto:+-p $proto} \
${src_ip:+-s $src_ip} \
${srcports:+--sport $srcports} \
${dest_ip:+-d $dest_ip} \
${destports:+--dport $destports} \
${src_mac:+-m mac --mac-source $src_mac} \
-j ACCEPT
@ -605,9 +660,22 @@ fw_init() {
for interface in $INTERFACES; do
fw_event ifup "$interface"
done
uci_set_state firewall core zones "$ZONE_NAMES"
}
fw_stop() {
local z n i
config_get z core zones
for z in $z; do
config_get n core "${z}_networks"
for n in $n; do
config_get i core "${n}_ifname"
[ -n "$i" ] && env -i ACTION=remove ZONE="$z" INTERFACE="$n" DEVICE="$i" \
/sbin/hotplug-call firewall
done
done
fw_clear
$IPTABLES -P INPUT ACCEPT
$IPTABLES -P OUTPUT ACCEPT

View File

@ -20,3 +20,8 @@ config WPA_SUPPLICANT_OPENSSL
select PACKAGE_libopenssl
endchoice
config WPA_RFKILL_SUPPORT
bool "Add rfkill support"
depends PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini
default n

View File

@ -8,9 +8,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hostapd
PKG_VERSION:=20100418
PKG_RELEASE:=2
PKG_REV:=0b86f67a2970403d1b1b6d34ce49f5485ef5dbb3
PKG_VERSION:=20100705
PKG_RELEASE:=1
PKG_REV:=2f1ce78bf78cecd7021385b04a4f55f22e76ab97
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
@ -30,7 +30,8 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_kmod-madwifi \
CONFIG_PACKAGE_hostapd \
CONFIG_PACKAGE_hostapd-mini \
CONFIG_PACKAGE_kmod-hostap
CONFIG_PACKAGE_kmod-hostap \
CONFIG_WPA_RFKILL_SUPPORT
LOCAL_TYPE=$(strip \
$(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \
@ -64,7 +65,8 @@ DRIVER_MAKEOPTS= \
CONFIG_DRIVER_MADWIFI=$(CONFIG_PACKAGE_kmod-madwifi) \
CONFIG_DRIVER_HOSTAP=$(CONFIG_PACKAGE_kmod-hostap) \
CONFIG_IEEE80211N=$(HOSTAPD_IEEE80211N) \
CONFIG_IEEE80211W=$(CONFIG_PACKAGE_kmod-ath9k)
CONFIG_IEEE80211W=$(CONFIG_PACKAGE_kmod-ath9k) \
$(if $(CONFIG_WPA_RFKILL_SUPPORT),NEED_RFKILL=y)
ifneq ($(LOCAL_TYPE),hostapd)
ifdef CONFIG_WPA_SUPPLICANT_OPENSSL
@ -80,7 +82,7 @@ ifneq ($(LOCAL_TYPE),hostapd)
CONFIG_DRIVER_ROBOSWITCH=$(CONFIG_PACKAGE_kmod-switch)
endif
DRV_DEPENDS:=+PACKAGE_kmod-mac80211:libnl-tiny +PACKAGE_kmod-mac80211:crda @(!(TARGET_avr32||TARGET_etrax)||BROKEN)
DRV_DEPENDS:=+PACKAGE_kmod-mac80211:libnl-tiny @(!(TARGET_avr32||TARGET_etrax)||BROKEN)
define Package/hostapd/Default
SECTION:=net
@ -115,7 +117,7 @@ endef
define Package/hostapd-utils
$(call Package/hostapd/Default)
TITLE+= (utils)
DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini
DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini||PACKAGE_wpad||PACKAGE_wpad-mini
endef
define Package/hostapd-utils/description
@ -186,7 +188,7 @@ endef
define Package/wpa-cli
SECTION:=net
CATEGORY:=Network
DEPENDS:=wpa-supplicant
DEPENDS:=@PACKAGE_wpa-supplicant||PACKAGE_wpad-mini||PACKAGE_wpad
TITLE:=WPA Supplicant command line interface
MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
endef
@ -237,7 +239,7 @@ endef
define Build/Compile/wpad
echo ` \
$(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
$(call Build/RunMake,wpa_supplicant,-s dump_cflags) | \
$(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \
sed -e 's,-n ,,g' -e 's,$(TARGET_CFLAGS),,' \
` > $(PKG_BUILD_DIR)/.cflags
$(call Build/RunMake,hostapd, \
@ -294,8 +296,9 @@ Package/hostapd-mini/install = $(Package/hostapd/install)
ifneq ($(LOCAL_TYPE),supplicant)
define Package/hostapd-utils/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/hotplug.d/button
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/
$(INSTALL_DATA) ./files/wps-hotplug.sh $(1)/etc/hotplug.d/button/50-wps
endef
endif

View File

@ -156,3 +156,5 @@ CONFIG_TLS=internal
CONFIG_INTERNAL_LIBTOMMATH=y
CONFIG_INTERNAL_AES=y
NEED_AES_DEC=y
CONFIG_WPS=y

View File

@ -1,7 +1,7 @@
hostapd_set_bss_options() {
local var="$1"
local vif="$2"
local enc wpa_group_rekey
local enc wpa_group_rekey wps_possible
config_get enc "$vif" encryption
config_get wpa_group_rekey "$vif" wpa_group_rekey
@ -60,6 +60,7 @@ hostapd_set_bss_options() {
else
append "$var" "wpa_passphrase=$psk" "$N"
fi
wps_possible=1
;;
*wpa*)
# required fields? formats?
@ -76,7 +77,6 @@ hostapd_set_bss_options() {
append "$var" "eapol_key_index_workaround=1" "$N"
append "$var" "radius_acct_interim_interval=300" "$N"
append "$var" "ieee8021x=1" "$N"
append "$var" "auth_algs=1" "$N"
append "$var" "wpa_key_mgmt=WPA-EAP" "$N"
append "$var" "wpa_group_rekey=300" "$N"
append "$var" "wpa_gmk_rekey=640" "$N"
@ -100,6 +100,14 @@ hostapd_set_bss_options() {
append "$var" "wep_default_key=0" "$N"
;;
esac
case "$enc" in
*shared*)
auth_algs=2
;;
*mixed*)
auth_algs=3
;;
esac
wpa=0
crypto=
;;
@ -108,6 +116,7 @@ hostapd_set_bss_options() {
crypto=
;;
esac
append "$var" "auth_algs=${auth_algs:-1}" "$N"
append "$var" "wpa=$wpa" "$N"
[ -n "$crypto" ] && append "$var" "wpa_pairwise=$crypto" "$N"
[ -n "$wpa_group_rekey" ] && append "$var" "wpa_group_rekey=$wpa_group_rekey" "$N"
@ -115,10 +124,20 @@ hostapd_set_bss_options() {
config_get ssid "$vif" ssid
config_get bridge "$vif" bridge
config_get ieee80211d "$vif" ieee80211d
config_get iapp_interface "$vif" iapp_interface
config_get_bool wps_pbc "$vif" wps_pushbutton 0
[ -n "$wps_possible" -a "$wps_pbc" -gt 0 ] && {
append "$var" "eap_server=1" "$N"
append "$var" "wps_state=2" "$N"
append "$var" "ap_setup_locked=1" "$N"
append "$var" "config_methods=push_button" "$N"
}
append "$var" "ssid=$ssid" "$N"
[ -n "$bridge" ] && append "$var" "bridge=$bridge" "$N"
[ -n "$ieee80211d" ] && append "$var" "ieee80211d=$ieee80211d" "$N"
[ -n "$iapp_interface" ] && append "$var" $(uci_get_state network "$iapp_interface" ifname "$iapp_interface") "$N"
[ "$wpa" -ge "2" ] && config_get ieee80211w "$vif" ieee80211w
case "$ieee80211w" in

View File

@ -189,7 +189,7 @@ CONFIG_EAP_LEAP=y
#CONFIG_EAP_TNC=y
# Wi-Fi Protected Setup (WPS)
#CONFIG_WPS=y
CONFIG_WPS=y
# EAP-IKEv2
#CONFIG_EAP_IKEV2=y

View File

@ -2,6 +2,7 @@ wpa_supplicant_setup_vif() {
local vif="$1"
local driver="$2"
local key="$key"
local options="$3"
# wpa_supplicant should use wext for mac80211 cards
[ "$driver" = "mac80211" ] && driver='wext'
@ -133,5 +134,5 @@ network={
}
EOF
[ -z "$proto" -a "$key_mgmt" != "NONE" ] || \
wpa_supplicant ${bridge:+ -b $bridge} -B -P "/var/run/wifi-${ifname}.pid" -D ${driver:-wext} -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf
wpa_supplicant ${bridge:+ -b $bridge} -B -P "/var/run/wifi-${ifname}.pid" -D ${driver:-wext} -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf $options
}

View File

@ -0,0 +1,6 @@
if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then
for dir in /var/run/hostapd-*; do
[ -d "$dir" ] || continue
hostapd_cli -p "$dir" wps_pbc
done
fi

View File

@ -1,6 +1,6 @@
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -659,7 +659,6 @@ static int setup_interface(struct hostap
@@ -660,7 +660,6 @@ static int setup_interface(struct hostap
country[3] = '\0';
if (hostapd_set_country(hapd, country) < 0) {
wpa_printf(MSG_ERROR, "Failed to set country code");

View File

@ -10,7 +10,7 @@
/* hostapd.c */
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -754,6 +754,9 @@ int hostapd_setup_interface_complete(str
@@ -755,6 +755,9 @@ int hostapd_setup_interface_complete(str
wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
iface->bss[0]->conf->iface);

View File

@ -62,7 +62,7 @@
ifndef CONFIG_OS
ifdef CONFIG_NATIVE_WINDOWS
@@ -579,6 +580,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
@@ -581,6 +582,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS
CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
LIBS += -ldl -rdynamic
endif
@ -73,7 +73,7 @@
endif
ifdef CONFIG_AP
@@ -631,6 +636,12 @@ CFLAGS += -DEAP_SERVER_WSC
@@ -635,6 +640,12 @@ CFLAGS += -DEAP_SERVER_WSC
OBJS += ../src/ap/wps_hostapd.o
OBJS += ../src/eap_server/eap_server_wsc.o
endif
@ -86,7 +86,7 @@
endif
ifdef NEED_RSN_AUTHENTICATOR
@@ -1262,6 +1273,12 @@ BCHECK=../src/drivers/build.wpa_supplica
@@ -1270,6 +1281,12 @@ BCHECK=../src/drivers/build.wpa_supplica
wpa_priv: $(BCHECK) $(OBJS_priv)
$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
@ -99,7 +99,7 @@
wpa_supplicant: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
@@ -1321,6 +1338,12 @@ endif
@@ -1329,6 +1346,12 @@ endif
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
@$(E) " CC " $<
@ -114,7 +114,7 @@
wpa_cli.exe: wpa_cli
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -2449,8 +2449,8 @@ union wpa_event_data {
@@ -2465,8 +2465,8 @@ union wpa_event_data {
* Driver wrapper code should call this function whenever an event is received
* from the driver.
*/
@ -169,7 +169,7 @@
for (;;) {
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1577,8 +1577,8 @@ static void ft_rx_action(struct wpa_supp
@@ -1582,8 +1582,8 @@ static void ft_rx_action(struct wpa_supp
#endif /* CONFIG_IEEE80211R */
@ -182,7 +182,7 @@
u16 reason_code = 0;
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2223,6 +2223,9 @@ struct wpa_supplicant * wpa_supplicant_g
@@ -2228,6 +2228,9 @@ struct wpa_supplicant * wpa_supplicant_g
return NULL;
}
@ -192,7 +192,7 @@
/**
* wpa_supplicant_init - Initialize %wpa_supplicant
@@ -2241,6 +2244,7 @@ struct wpa_global * wpa_supplicant_init(
@@ -2246,6 +2249,7 @@ struct wpa_global * wpa_supplicant_init(
if (params == NULL)
return NULL;

View File

@ -1,6 +1,6 @@
--- a/src/tls/x509v3.c
+++ b/src/tls/x509v3.c
@@ -1832,8 +1832,11 @@ int x509_certificate_chain_validate(stru
@@ -1854,8 +1854,11 @@ int x509_certificate_chain_validate(stru
if (chain_trusted)
continue;

View File

@ -8,7 +8,7 @@
size_t max_ssids;
enum wpa_states prev_state;
@@ -311,6 +312,16 @@ static void wpa_supplicant_scan(void *el
@@ -316,6 +317,16 @@ static void wpa_supplicant_scan(void *el
wpa_s->wpa_state == WPA_INACTIVE)
wpa_supplicant_set_state(wpa_s, WPA_SCANNING);
@ -25,7 +25,7 @@
/* Find the starting point from which to continue scanning */
ssid = wpa_s->conf->ssid;
if (wpa_s->prev_scan_ssid != WILDCARD_SSID_SCAN) {
@@ -374,6 +385,9 @@ static void wpa_supplicant_scan(void *el
@@ -379,6 +390,9 @@ static void wpa_supplicant_scan(void *el
int_array_sort_unique(params.freqs);
}

View File

@ -1,6 +1,6 @@
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -958,7 +958,7 @@ static void wpa_supplicant_event_scan_re
@@ -963,7 +963,7 @@ static void wpa_supplicant_event_scan_re
wpa_printf(MSG_DEBUG, "Setup a new network");
wpa_supplicant_associate(wpa_s, NULL, ssid);
} else {

View File

@ -336,7 +336,7 @@
- return 0;
-}
-
static int
-static int
-set80211param(struct wpa_driver_madwifi_data *drv, int op, int arg,
- int show_err)
-{
@ -355,7 +355,7 @@
- return 0;
-}
-
-static int
static int
-wpa_driver_madwifi_set_wpa_ie(struct wpa_driver_madwifi_data *drv,
+wpa_driver_madwifi_set_wpa_ie(struct madwifi_driver_data *drv,
const u8 *wpa_ie, size_t wpa_ie_len)
@ -627,7 +627,7 @@
return wpa_driver_wext_get_ssid(drv->wext, ssid);
}
@@ -1705,14 +1481,14 @@ static int wpa_driver_madwifi_get_ssid(v
@@ -1705,14 +1481,16 @@ static int wpa_driver_madwifi_get_ssid(v
static struct wpa_scan_results *
wpa_driver_madwifi_get_scan_results(void *priv)
{
@ -641,10 +641,12 @@
{
- struct wpa_driver_madwifi_data *drv = priv;
+ struct madwifi_driver_data *drv = priv;
+ if (!drv->wext)
+ return 0;
return wpa_driver_wext_set_operstate(drv->wext, state);
}
@@ -1733,7 +1509,7 @@ static int wpa_driver_madwifi_set_probe_
@@ -1733,7 +1511,7 @@ static int wpa_driver_madwifi_set_probe_
ret = set80211priv(priv, IEEE80211_IOCTL_SET_APPIEBUF, probe_req_ie,
sizeof(struct ieee80211req_getset_appiebuf) +
@ -653,7 +655,7 @@
os_free(probe_req_ie);
@@ -1743,7 +1519,7 @@ static int wpa_driver_madwifi_set_probe_
@@ -1743,7 +1521,7 @@ static int wpa_driver_madwifi_set_probe_
static void * wpa_driver_madwifi_init(void *ctx, const char *ifname)
{
@ -662,7 +664,7 @@
drv = os_zalloc(sizeof(*drv));
if (drv == NULL)
@@ -1754,17 +1530,17 @@ static void * wpa_driver_madwifi_init(vo
@@ -1754,17 +1532,17 @@ static void * wpa_driver_madwifi_init(vo
drv->ctx = ctx;
os_strlcpy(drv->ifname, ifname, sizeof(drv->ifname));
@ -684,7 +686,7 @@
wpa_printf(MSG_DEBUG, "%s: failed to enable WPA support",
__FUNCTION__);
goto fail3;
@@ -1773,7 +1549,7 @@ static void * wpa_driver_madwifi_init(vo
@@ -1773,7 +1551,7 @@ static void * wpa_driver_madwifi_init(vo
return drv;
fail3:
@ -693,7 +695,7 @@
fail2:
wpa_driver_wext_deinit(drv->wext);
fail:
@@ -1784,38 +1560,37 @@ fail:
@@ -1784,38 +1562,37 @@ fail:
static void wpa_driver_madwifi_deinit(void *priv)
{
@ -739,7 +741,7 @@
#ifdef HOSTAPD
.hapd_init = madwifi_init,
.hapd_deinit = madwifi_deinit,
@@ -1835,7 +1610,8 @@ const struct wpa_driver_ops wpa_driver_m
@@ -1835,7 +1612,8 @@ const struct wpa_driver_ops wpa_driver_m
.sta_clear_stats = madwifi_sta_clear_stats,
.commit = madwifi_commit,
.set_ap_wps_ie = madwifi_set_ap_wps_ie,
@ -749,7 +751,7 @@
.get_bssid = wpa_driver_madwifi_get_bssid,
.get_ssid = wpa_driver_madwifi_get_ssid,
.init = wpa_driver_madwifi_init,
@@ -1847,5 +1623,5 @@ const struct wpa_driver_ops wpa_driver_m
@@ -1847,5 +1625,5 @@ const struct wpa_driver_ops wpa_driver_m
.disassociate = wpa_driver_madwifi_disassociate,
.associate = wpa_driver_madwifi_associate,
.set_operstate = wpa_driver_madwifi_set_operstate,

View File

@ -1,6 +1,6 @@
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4576,9 +4576,11 @@ static int i802_set_wds_sta(void *priv,
@@ -4652,9 +4652,11 @@ static int i802_set_wds_sta(void *priv,
wpa_printf(MSG_DEBUG, "nl80211: Set WDS STA addr=" MACSTR
" aid=%d val=%d name=%s", MAC2STR(addr), aid, val, name);
if (val) {
@ -16,7 +16,7 @@
} else {
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -1614,6 +1614,9 @@ static void handle_assoc_cb(struct hosta
@@ -1627,6 +1627,9 @@ static void handle_assoc_cb(struct hosta
"Could not add STA to kernel driver");
}

View File

@ -21,7 +21,7 @@
/* clear to get error below if setting is invalid */
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4566,7 +4566,8 @@ static int i802_set_sta_vlan(void *priv,
@@ -4642,7 +4642,8 @@ static int i802_set_sta_vlan(void *priv,
}
@ -31,7 +31,7 @@
{
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
@@ -4580,6 +4581,10 @@ static int i802_set_wds_sta(void *priv,
@@ -4656,6 +4657,10 @@ static int i802_set_wds_sta(void *priv,
if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN,
NULL, 1) < 0)
return -1;

View File

@ -1,6 +1,6 @@
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -715,6 +715,16 @@ int hostapd_setup_interface_complete(str
@@ -716,6 +716,16 @@ int hostapd_setup_interface_complete(str
}
}

View File

@ -38,7 +38,7 @@
* @freq: Frequency (in MHz) of the channel
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4263,6 +4263,29 @@ static int i802_set_rate_sets(void *priv
@@ -4339,6 +4339,29 @@ static int i802_set_rate_sets(void *priv
return -ENOBUFS;
}
@ -68,7 +68,7 @@
#endif /* HOSTAPD */
@@ -5372,6 +5395,7 @@ const struct wpa_driver_ops wpa_driver_n
@@ -5448,6 +5471,7 @@ const struct wpa_driver_ops wpa_driver_n
.set_tx_queue_params = i802_set_tx_queue_params,
.set_sta_vlan = i802_set_sta_vlan,
.set_wds_sta = i802_set_wds_sta,

View File

@ -1,6 +1,6 @@
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1119,7 +1119,6 @@ nla_put_failure:
@@ -1135,7 +1135,6 @@ nla_put_failure:
}
@ -8,7 +8,7 @@
struct wiphy_info_data {
int max_scan_ssids;
int ap_supported;
@@ -1231,7 +1230,6 @@ static int wpa_driver_nl80211_capa(struc
@@ -1247,7 +1246,6 @@ static int wpa_driver_nl80211_capa(struc
return 0;
}
@ -16,7 +16,7 @@
static int wpa_driver_nl80211_init_nl(struct wpa_driver_nl80211_data *drv,
@@ -1371,6 +1369,7 @@ static void * wpa_driver_nl80211_init(vo
@@ -1411,6 +1409,7 @@ static void * wpa_driver_nl80211_init(vo
drv->monitor_ifidx = -1;
drv->monitor_sock = -1;
drv->ioctl_sock = -1;
@ -24,7 +24,7 @@
if (wpa_driver_nl80211_init_nl(drv, ctx)) {
os_free(drv);
@@ -1468,24 +1467,23 @@ wpa_driver_nl80211_finish_drv_init(struc
@@ -1530,32 +1529,32 @@ wpa_driver_nl80211_finish_drv_init(struc
drv->ifindex = if_nametoindex(bss->ifname);
drv->first_bss.ifindex = drv->ifindex;
@ -33,22 +33,37 @@
- wpa_printf(MSG_DEBUG, "nl80211: Could not configure driver to "
- "use managed mode");
- }
-
- if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) {
- wpa_printf(MSG_ERROR, "Could not set interface '%s' UP",
- bss->ifname);
- return -1;
- }
+ if (drv->nlmode == NL80211_IFTYPE_STATION) {
+ if (wpa_driver_nl80211_set_mode(bss, IEEE80211_MODE_INFRA) < 0)
+ wpa_printf(MSG_DEBUG, "nl80211: Could not configure "
+ "driver to use managed mode");
+
+ if (wpa_driver_nl80211_set_mode(bss, IEEE80211_MODE_INFRA) < 0) {
+ wpa_printf(MSG_DEBUG, "nl80211: Could not configure driver to "
+ "use managed mode");
+ }
- if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) {
- if (rfkill_is_blocked(drv->rfkill)) {
- wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
- "interface '%s' due to rfkill",
- bss->ifname);
- drv->if_disabled = 1;
- send_rfkill_event = 1;
- } else {
- wpa_printf(MSG_ERROR, "nl80211: Could not set "
- "interface '%s' UP", bss->ifname);
- return -1;
+ if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) {
+ wpa_printf(MSG_ERROR, "Could not set interface '%s' UP",
+ if (rfkill_is_blocked(drv->rfkill)) {
+ wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
+ "interface '%s' due to rfkill",
+ bss->ifname);
+ drv->if_disabled = 1;
+ send_rfkill_event = 1;
+ } else {
+ wpa_printf(MSG_ERROR, "nl80211: Could not set "
+ "interface '%s' UP", bss->ifname);
+ return -1;
+ }
}
- }
- if (wpa_driver_nl80211_capa(drv))
- return -1;
@ -64,7 +79,7 @@
if (nl80211_register_action_frames(drv) < 0) {
wpa_printf(MSG_DEBUG, "nl80211: Failed to register Action "
@@ -2143,13 +2141,9 @@ static int wpa_driver_nl80211_set_key(co
@@ -2219,13 +2218,9 @@ static int wpa_driver_nl80211_set_key(co
*/
if (ret || !set_tx || alg == WPA_ALG_NONE)
return ret;
@ -79,7 +94,7 @@
msg = nlmsg_alloc();
if (!msg)
@@ -2990,7 +2984,8 @@ static void nl80211_remove_iface(struct
@@ -3066,7 +3061,8 @@ static void nl80211_remove_iface(struct
#ifdef HOSTAPD
/* stop listening for EAPOL on this interface */
@ -89,7 +104,7 @@
#endif /* HOSTAPD */
msg = nlmsg_alloc();
@@ -3063,7 +3058,8 @@ static int nl80211_create_iface_once(str
@@ -3139,7 +3135,8 @@ static int nl80211_create_iface_once(str
#ifdef HOSTAPD
/* start listening for EAPOL on this interface */
@ -99,7 +114,7 @@
#endif /* HOSTAPD */
if (addr && iftype != NL80211_IFTYPE_MONITOR &&
@@ -4766,6 +4762,7 @@ static void *i802_init(struct hostapd_da
@@ -4842,6 +4839,7 @@ static void *i802_init(struct hostapd_da
return NULL;
drv = bss->drv;

View File

@ -1,6 +1,6 @@
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -543,10 +543,16 @@ void wpa_supplicant_set_state(struct wpa
@@ -545,10 +545,16 @@ void wpa_supplicant_set_state(struct wpa
wpa_s->reassociated_connection = 1;
wpa_drv_set_operstate(wpa_s, 1);
wpa_s->after_wps = 0;

View File

@ -0,0 +1,263 @@
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -75,7 +75,9 @@ struct wpa_driver_nl80211_data {
int ifindex;
int if_removed;
int if_disabled;
+#ifdef CONFIG_RFKILL
struct rfkill_data *rfkill;
+#endif
struct wpa_driver_capa capa;
int has_capability;
@@ -1361,7 +1363,7 @@ err1:
return -1;
}
-
+#ifdef CONFIG_RFKILL
static void wpa_driver_nl80211_rfkill_blocked(void *ctx)
{
wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked");
@@ -1383,6 +1385,7 @@ static void wpa_driver_nl80211_rfkill_un
}
/* rtnetlink ifup handler will report interface as enabled */
}
+#endif /* CONFIG_RFKILL */
/**
@@ -1396,7 +1399,9 @@ static void * wpa_driver_nl80211_init(vo
{
struct wpa_driver_nl80211_data *drv;
struct netlink_config *cfg;
+#ifdef CONFIG_RFKILL
struct rfkill_config *rcfg;
+#endif
struct i802_bss *bss;
drv = os_zalloc(sizeof(*drv));
@@ -1434,6 +1439,7 @@ static void * wpa_driver_nl80211_init(vo
goto failed;
}
+#ifdef CONFIG_RFKILL
rcfg = os_zalloc(sizeof(*rcfg));
if (rcfg == NULL)
goto failed;
@@ -1446,6 +1452,7 @@ static void * wpa_driver_nl80211_init(vo
wpa_printf(MSG_DEBUG, "nl80211: RFKILL status not available");
os_free(rcfg);
}
+#endif /* CONFIG_RFKILL */
if (wpa_driver_nl80211_finish_drv_init(drv))
goto failed;
@@ -1453,7 +1460,9 @@ static void * wpa_driver_nl80211_init(vo
return bss;
failed:
+#ifdef CONFIG_RFKILL
rfkill_deinit(drv->rfkill);
+#endif
netlink_deinit(drv->netlink);
if (drv->ioctl_sock >= 0)
close(drv->ioctl_sock);
@@ -1514,10 +1523,12 @@ static int nl80211_register_action_frame
}
+#ifdef CONFIG_RFKILL
static void wpa_driver_nl80211_send_rfkill(void *eloop_ctx, void *timeout_ctx)
{
wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
}
+#endif /* CONFIG_RFKILL */
static int
@@ -1536,13 +1547,16 @@ wpa_driver_nl80211_finish_drv_init(struc
}
if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) {
+#ifdef CONFIG_RFKILL
if (rfkill_is_blocked(drv->rfkill)) {
wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
"interface '%s' due to rfkill",
bss->ifname);
drv->if_disabled = 1;
send_rfkill_event = 1;
- } else {
+ } else
+#endif
+ {
wpa_printf(MSG_ERROR, "nl80211: Could not set "
"interface '%s' UP", bss->ifname);
return -1;
@@ -1567,8 +1581,10 @@ wpa_driver_nl80211_finish_drv_init(struc
}
if (send_rfkill_event) {
+#ifdef CONFIG_RFKILL
eloop_register_timeout(0, 0, wpa_driver_nl80211_send_rfkill,
drv, drv->ctx);
+#endif
}
return 0;
@@ -1647,7 +1663,9 @@ static void wpa_driver_nl80211_deinit(vo
netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP);
netlink_deinit(drv->netlink);
+#ifdef CONFIG_RFKILL
rfkill_deinit(drv->rfkill);
+#endif
eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx);
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -700,7 +700,7 @@ static void wpa_driver_wext_event_rtm_de
}
}
-
+#ifdef CONFIG_RFKILL
static void wpa_driver_wext_rfkill_blocked(void *ctx)
{
wpa_printf(MSG_DEBUG, "WEXT: RFKILL blocked");
@@ -722,7 +722,7 @@ static void wpa_driver_wext_rfkill_unblo
}
/* rtnetlink ifup handler will report interface as enabled */
}
-
+#endif /* CONFIG_RFKILL */
/**
* wpa_driver_wext_init - Initialize WE driver interface
@@ -735,7 +735,9 @@ void * wpa_driver_wext_init(void *ctx, c
{
struct wpa_driver_wext_data *drv;
struct netlink_config *cfg;
+#ifdef CONFIG_RFKILL
struct rfkill_config *rcfg;
+#endif
char path[128];
struct stat buf;
@@ -769,6 +771,7 @@ void * wpa_driver_wext_init(void *ctx, c
goto err2;
}
+#ifdef CONFIG_RFKILL
rcfg = os_zalloc(sizeof(*rcfg));
if (rcfg == NULL)
goto err3;
@@ -781,6 +784,7 @@ void * wpa_driver_wext_init(void *ctx, c
wpa_printf(MSG_DEBUG, "WEXT: RFKILL status not available");
os_free(rcfg);
}
+#endif /* CONFIG_RFKILL */
drv->mlme_sock = -1;
@@ -792,7 +796,9 @@ void * wpa_driver_wext_init(void *ctx, c
return drv;
err3:
+#ifdef CONFIG_RFKILL
rfkill_deinit(drv->rfkill);
+#endif
netlink_deinit(drv->netlink);
err2:
close(drv->ioctl_sock);
@@ -802,10 +808,12 @@ err1:
}
+#ifdef CONFIG_RFKILL
static void wpa_driver_wext_send_rfkill(void *eloop_ctx, void *timeout_ctx)
{
wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
}
+#endif /* CONFIG_RFKILL */
static int wpa_driver_wext_finish_drv_init(struct wpa_driver_wext_data *drv)
@@ -813,13 +821,16 @@ static int wpa_driver_wext_finish_drv_in
int send_rfkill_event = 0;
if (linux_set_iface_flags(drv->ioctl_sock, drv->ifname, 1) < 0) {
+#ifdef CONFIG_RFKILL
if (rfkill_is_blocked(drv->rfkill)) {
wpa_printf(MSG_DEBUG, "WEXT: Could not yet enable "
"interface '%s' due to rfkill",
drv->ifname);
drv->if_disabled = 1;
send_rfkill_event = 1;
- } else {
+ } else
+#endif
+ {
wpa_printf(MSG_ERROR, "WEXT: Could not set "
"interface '%s' UP", drv->ifname);
return -1;
@@ -867,8 +878,10 @@ static int wpa_driver_wext_finish_drv_in
1, IF_OPER_DORMANT);
if (send_rfkill_event) {
+#ifdef CONFIG_RFKILL
eloop_register_timeout(0, 0, wpa_driver_wext_send_rfkill,
drv, drv->ctx);
+#endif
}
return 0;
@@ -898,7 +911,9 @@ void wpa_driver_wext_deinit(void *priv)
netlink_send_oper_ifla(drv->netlink, drv->ifindex, 0, IF_OPER_UP);
netlink_deinit(drv->netlink);
+#ifdef CONFIG_RFKILL
rfkill_deinit(drv->rfkill);
+#endif
if (drv->mlme_sock >= 0)
eloop_unregister_read_sock(drv->mlme_sock);
--- a/src/drivers/drivers.mak
+++ b/src/drivers/drivers.mak
@@ -31,7 +31,6 @@ NEED_SME=y
NEED_AP_MLME=y
NEED_NETLINK=y
NEED_LINUX_IOCTL=y
-NEED_RFKILL=y
DRV_LIBS += -lnl
ifdef CONFIG_LIBNL20
@@ -78,7 +77,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
CONFIG_WIRELESS_EXTENSION=y
NEED_NETLINK=y
NEED_LINUX_IOCTL=y
-NEED_RFKILL=y
endif
ifdef CONFIG_DRIVER_HERMES
@@ -166,6 +164,7 @@ endif
ifdef NEED_RFKILL
DRV_OBJS += ../src/drivers/rfkill.o
+DRV_WPA_CFLAGS += -DCONFIG_RFKILL
endif
--- a/src/drivers/driver_wext.h
+++ b/src/drivers/driver_wext.h
@@ -27,7 +27,9 @@ struct wpa_driver_wext_data {
int ifindex2;
int if_removed;
int if_disabled;
+#ifdef CONFIG_RFKILL
struct rfkill_data *rfkill;
+#endif
u8 *assoc_req_ies;
size_t assoc_req_ies_len;
u8 *assoc_resp_ies;

View File

@ -0,0 +1,45 @@
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -410,6 +410,10 @@ static void wpa_driver_nl80211_event_rtm
return;
}
+ if (ifi->ifi_family == AF_BRIDGE &&
+ drv->nlmode != NL80211_IFTYPE_AP)
+ return;
+
wpa_printf(MSG_DEBUG, "RTM_NEWLINK: operstate=%d ifi_flags=0x%x "
"(%s%s%s%s)",
drv->operstate, ifi->ifi_flags,
@@ -481,6 +485,10 @@ static void wpa_driver_nl80211_event_rtm
attrlen = len;
attr = (struct rtattr *) buf;
+ if (ifi->ifi_family == AF_BRIDGE &&
+ drv->nlmode != NL80211_IFTYPE_AP)
+ return;
+
rta_len = RTA_ALIGN(sizeof(struct rtattr));
while (RTA_OK(attr, attrlen)) {
if (attr->rta_type == IFLA_IFNAME) {
@@ -1347,6 +1355,11 @@ static int wpa_driver_nl80211_init_nl(st
eloop_register_read_sock(nl_socket_get_fd(drv->nl_handle_event),
wpa_driver_nl80211_event_receive, drv, ctx);
+#ifdef HOSTAPD
+ drv->num_if_indices = sizeof(drv->default_if_indices) / sizeof(int);
+ drv->if_indices = drv->default_if_indices;
+#endif
+
return 0;
err4:
@@ -4867,8 +4880,6 @@ static void *i802_init(struct hostapd_da
br_ifindex = 0;
}
- drv->num_if_indices = sizeof(drv->default_if_indices) / sizeof(int);
- drv->if_indices = drv->default_if_indices;
for (i = 0; i < params->num_bridge; i++) {
if (params->bridge[i]) {
ifindex = if_nametoindex(params->bridge[i]);

View File

@ -0,0 +1,89 @@
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -42,37 +42,8 @@ static int hostapd_setup_encryption(char
extern int wpa_debug_level;
-
-int hostapd_reload_config(struct hostapd_iface *iface)
+static int hostapd_reload_bss(struct hostapd_data *hapd)
{
- struct hostapd_data *hapd = iface->bss[0];
- struct hostapd_config *newconf, *oldconf;
- size_t j;
-
- if (iface->config_read_cb == NULL)
- return -1;
- newconf = iface->config_read_cb(iface->config_fname);
- if (newconf == NULL)
- return -1;
-
- /*
- * Deauthenticate all stations since the new configuration may not
- * allow them to use the BSS anymore.
- */
- for (j = 0; j < iface->num_bss; j++)
- hostapd_flush_old_stations(iface->bss[j]);
-
-#ifndef CONFIG_NO_RADIUS
- /* TODO: update dynamic data based on changed configuration
- * items (e.g., open/close sockets, etc.) */
- radius_client_flush(hapd->radius, 0);
-#endif /* CONFIG_NO_RADIUS */
-
- oldconf = hapd->iconf;
- hapd->iconf = newconf;
- hapd->conf = &newconf->bss[0];
- iface->conf = newconf;
-
if (hostapd_setup_wpa_psk(hapd->conf)) {
wpa_printf(MSG_ERROR, "Failed to re-configure WPA PSK "
"after reloading configuration");
@@ -110,10 +81,46 @@ int hostapd_reload_config(struct hostapd
wpa_printf(MSG_ERROR, "Could not set SSID for kernel driver");
/* try to continue */
}
+ wpa_printf(MSG_DEBUG, "Reconfigured interface %s", hapd->conf->iface);
+}
+
+int hostapd_reload_config(struct hostapd_iface *iface)
+{
+ struct hostapd_data *hapd = iface->bss[0];
+ struct hostapd_config *newconf, *oldconf;
+ size_t j;
+
+ if (iface->config_read_cb == NULL)
+ return -1;
+ newconf = iface->config_read_cb(iface->config_fname);
+ if (newconf == NULL)
+ return -1;
+
+ /*
+ * Deauthenticate all stations since the new configuration may not
+ * allow them to use the BSS anymore.
+ */
+ for (j = 0; j < iface->num_bss; j++)
+ hostapd_flush_old_stations(iface->bss[j]);
+
+#ifndef CONFIG_NO_RADIUS
+ /* TODO: update dynamic data based on changed configuration
+ * items (e.g., open/close sockets, etc.) */
+ radius_client_flush(hapd->radius, 0);
+#endif /* CONFIG_NO_RADIUS */
+
+ oldconf = hapd->iconf;
+ iface->conf = newconf;
+
+ for (j = 0; j < iface->num_bss; j++) {
+ hapd = iface->bss[j];
+ hapd->iconf = newconf;
+ hapd->conf = &newconf->bss[j];
+ hostapd_reload_bss(hapd);
+ }
hostapd_config_free(oldconf);
- wpa_printf(MSG_DEBUG, "Reconfigured interface %s", hapd->conf->iface);
return 0;
}

View File

@ -0,0 +1,13 @@
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -112,6 +112,10 @@ int hostapd_reload_config(struct hostapd
oldconf = hapd->iconf;
iface->conf = newconf;
+ iface->freq = hostapd_hw_get_freq(hapd, hapd->iconf->channel);
+ if (iface->current_mode)
+ hostapd_prepare_rates(hapd, iface->current_mode);
+
for (j = 0; j < iface->num_bss; j++) {
hapd = iface->bss[j];
hapd->iconf = newconf;

View File

@ -0,0 +1,63 @@
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1604,23 +1604,41 @@ wpa_driver_nl80211_finish_drv_init(struc
}
-static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv)
+static int wpa_driver_nl80211_del_bss_beacon(struct i802_bss *bss)
{
+ struct wpa_driver_nl80211_data *drv = bss->drv;
struct nl_msg *msg;
+ bss->beacon_set = 0;
+
msg = nlmsg_alloc();
if (!msg)
return -ENOMEM;
genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0,
0, NL80211_CMD_DEL_BEACON, 0);
- NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
+ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, bss->ifindex);
return send_and_recv_msgs(drv, msg, NULL, NULL);
nla_put_failure:
+ nlmsg_free(msg);
return -ENOBUFS;
}
+static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv)
+{
+ struct i802_bss *bss;
+
+ for (bss = &drv->first_bss; bss; bss = bss->next)
+ wpa_driver_nl80211_del_bss_beacon(bss);
+}
+
+static int wpa_driver_nl80211_stop_ap(void *priv)
+{
+ struct i802_bss *bss = priv;
+
+ wpa_driver_nl80211_del_beacon(bss->drv);
+}
/**
* wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface
@@ -5512,4 +5530,5 @@ const struct wpa_driver_ops wpa_driver_n
.send_ft_action = nl80211_send_ft_action,
.signal_monitor = nl80211_signal_monitor,
.send_frame = nl80211_send_frame,
+ .stop_ap = wpa_driver_nl80211_stop_ap,
};
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1774,6 +1774,8 @@ struct wpa_driver_ops {
*/
int (*send_frame)(void *priv, const u8 *data, size_t data_len,
int encrypt);
+
+ int (*stop_ap)(void *priv);
};

View File

@ -0,0 +1,96 @@
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -35,6 +35,7 @@
#include "ap/wps_hostapd.h"
#include "ap/ctrl_iface_ap.h"
#include "ctrl_iface.h"
+#include "config_file.h"
struct wpa_ctrl_dst {
@@ -45,6 +46,7 @@ struct wpa_ctrl_dst {
int errors;
};
+static char *reload_opts = NULL;
static void hostapd_ctrl_iface_send(struct hostapd_data *hapd, int level,
const char *buf, size_t len);
@@ -315,6 +317,66 @@ static int hostapd_ctrl_iface_wps_oob(st
#endif /* CONFIG_WPS_OOB */
#endif /* CONFIG_WPS */
+static int hostapd_ctrl_iface_set_down(struct hostapd_data *hapd)
+{
+ if (hapd->driver->stop_ap)
+ hapd->driver->stop_ap(hapd->drv_priv);
+ return 0;
+}
+
+static char *get_option(char *opt, char *str)
+{
+ int len = strlen(str);
+
+ if (!strncmp(opt, str, len))
+ return opt + len;
+ else
+ return NULL;
+}
+
+static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname)
+{
+ struct hostapd_config *conf;
+ char *opt, *val;
+
+ conf = hostapd_config_read(fname);
+ if (!conf)
+ return NULL;
+
+ for (opt = strtok(reload_opts, " ");
+ opt;
+ opt = strtok(NULL, " ")) {
+
+ if ((val = get_option(opt, "channel=")))
+ conf->channel = atoi(val);
+ else if ((val = get_option(opt, "ht_capab=")))
+ conf->ht_capab = atoi(val);
+ else if ((val = get_option(opt, "ht_capab_mask=")))
+ conf->ht_capab &= atoi(val);
+ else if ((val = get_option(opt, "sec_chan=")))
+ conf->secondary_channel = atoi(val);
+ else if ((val = get_option(opt, "hwmode=")))
+ conf->hw_mode = atoi(val);
+ else if ((val = get_option(opt, "ieee80211n=")))
+ conf->ieee80211n = atoi(val);
+ else
+ break;
+ }
+
+ return conf;
+}
+
+static int hostapd_ctrl_iface_reload(struct hostapd_data *hapd, char *txt)
+{
+ struct hostapd_iface *iface = hapd->iface;
+
+ iface->config_read_cb = hostapd_ctrl_iface_config_read;
+ reload_opts = txt;
+
+ hostapd_reload_config(iface);
+
+ iface->config_read_cb = hostapd_config_read;
+}
static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx,
void *sock_ctx)
@@ -379,6 +441,10 @@ static void hostapd_ctrl_iface_receive(i
reply_len += res;
}
#endif /* CONFIG_NO_RADIUS */
+ } else if (os_strcmp(buf, "DOWN") == 0) {
+ hostapd_ctrl_iface_set_down(hapd);
+ } else if (os_strncmp(buf, "RELOAD ", 7) == 0) {
+ hostapd_ctrl_iface_reload(hapd, buf + 7);
} else if (os_strcmp(buf, "STA-FIRST") == 0) {
reply_len = hostapd_ctrl_iface_sta_first(hapd, reply,
reply_size);

View File

@ -0,0 +1,211 @@
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -98,6 +98,8 @@ struct wpa_interface {
* receiving of EAPOL frames from an additional interface.
*/
const char *bridge_ifname;
+
+ const char *hostapd_ctrl;
};
/**
@@ -316,6 +318,8 @@ struct wpa_supplicant {
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
char bridge_ifname[16];
+ struct wpa_ctrl *hostapd;
+
char *confname;
struct wpa_config *conf;
int countermeasures;
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -51,6 +51,11 @@ OBJS_p += ../src/utils/wpa_debug.o
OBJS_p += ../src/utils/wpabuf.o
OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
+ifdef MULTICALL
+OBJS += ../src/common/wpa_ctrl.o
+CFLAGS += -DMULTICALL
+endif
+
-include .config
-include $(if $(MULTICALL),../hostapd/.config)
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -120,6 +120,55 @@ extern int wpa_debug_show_keys;
extern int wpa_debug_timestamp;
extern struct wpa_driver_ops *wpa_drivers[];
+#ifdef MULTICALL
+static int hostapd_stop(struct wpa_supplicant *wpa_s)
+{
+ const char *cmd = "DOWN";
+ char buf[256];
+ int len = sizeof(buf);
+
+ if (wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL) < 0) {
+ wpa_printf(MSG_ERROR, "\nFailed to stop hostapd AP interfaces\n");
+ return -1;
+ }
+ return 0;
+}
+
+static int hostapd_reload(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
+{
+ char *cmd = NULL;
+ char buf[256];
+ int len = sizeof(buf);
+ int channel, hw_mode;
+ int ret;
+
+ if (!bss)
+ return;
+
+ if (bss->freq < 4000) {
+ hw_mode = HOSTAPD_MODE_IEEE80211G;
+ channel = (bss->freq - 2407) / 5;
+ } else {
+ hw_mode = HOSTAPD_MODE_IEEE80211A;
+ channel = (bss->freq - 5000) / 5;
+ }
+
+ if (asprintf(&cmd, "RELOAD channel=%d sec_chan=0 hw_mode=%d ieee80211n=%d",
+ channel, hw_mode, !!bss->ht_capab) < 0) {
+ return -1;
+ }
+
+ ret = wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL);
+ free(cmd);
+
+ if (ret < 0) {
+ wpa_printf(MSG_ERROR, "\nFailed to reload hostapd AP interfaces\n");
+ return -1;
+ }
+ return 0;
+}
+#endif
+
/* Configure default/group WEP keys for static WEP */
int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
{
@@ -548,8 +597,16 @@ void wpa_supplicant_set_state(struct wpa
#ifndef IEEE8021X_EAPOL
wpa_drv_set_supp_port(wpa_s, 1);
#endif
+#ifdef MULTICALL
+ if (wpa_s->hostapd)
+ hostapd_reload(wpa_s, wpa_s->current_bss);
+#endif
} else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING ||
state == WPA_ASSOCIATED) {
+#ifdef MULTICALL
+ if (wpa_s->hostapd)
+ hostapd_stop(wpa_s);
+#endif
wpa_s->new_connection = 1;
wpa_drv_set_operstate(wpa_s, 0);
#ifndef IEEE8021X_EAPOL
@@ -1957,6 +2014,21 @@ static int wpa_supplicant_init_iface(str
os_strlcpy(wpa_s->bridge_ifname, iface->bridge_ifname,
sizeof(wpa_s->bridge_ifname));
}
+#ifdef MULTICALL
+ if (iface->hostapd_ctrl) {
+ char *cmd = "DOWN";
+ char buf[256];
+ int len = sizeof(buf);
+
+ wpa_s->hostapd = wpa_ctrl_open(iface->hostapd_ctrl);
+ if (!wpa_s->hostapd) {
+ wpa_printf(MSG_ERROR, "\nFailed to connect to hostapd\n");
+ return -1;
+ }
+ if (hostapd_stop(wpa_s) < 0)
+ return -1;
+ }
+#endif
/* RSNA Supplicant Key Management - INITIALIZE */
eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE);
--- a/wpa_supplicant/bss.c
+++ b/wpa_supplicant/bss.c
@@ -17,6 +17,7 @@
#include "utils/common.h"
#include "utils/eloop.h"
#include "common/ieee802_11_defs.h"
+#include "common/ieee802_11_common.h"
#include "drivers/driver.h"
#include "wpa_supplicant_i.h"
#include "config.h"
@@ -89,6 +90,8 @@ struct wpa_bss * wpa_bss_get(struct wpa_
static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src)
{
+ struct ieee80211_ht_capabilities *capab;
+ struct ieee802_11_elems elems;
os_time_t usec;
dst->flags = src->flags;
@@ -101,6 +104,12 @@ static void wpa_bss_copy_res(struct wpa_
dst->level = src->level;
dst->tsf = src->tsf;
+ memset(&elems, 0, sizeof(elems));
+ ieee802_11_parse_elems((u8 *) (src + 1), src->ie_len, &elems, 0);
+ capab = (struct ieee80211_ht_capabilities *) elems.ht_capabilities;
+ if (capab)
+ dst->ht_capab = le_to_host16(capab->ht_capabilities_info);
+
os_get_time(&dst->last_update);
dst->last_update.sec -= src->age / 1000;
usec = (src->age % 1000) * 1000;
--- a/wpa_supplicant/bss.h
+++ b/wpa_supplicant/bss.h
@@ -56,6 +56,7 @@ struct wpa_bss {
unsigned int flags;
u8 bssid[ETH_ALEN];
u8 ssid[32];
+ u16 ht_capab;
size_t ssid_len;
int freq;
u16 beacon_int;
--- a/wpa_supplicant/main.c
+++ b/wpa_supplicant/main.c
@@ -31,7 +31,7 @@ static void usage(void)
"usage:\n"
" wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] "
"[-g<global ctrl>] \\\n"
- " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] "
+ " -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-H<hostapd path>]"
"[-p<driver_param>] \\\n"
" [-b<br_ifname>] [-f<debug file>] \\\n"
" [-o<override driver>] [-O<override ctrl>] \\\n"
@@ -67,6 +67,7 @@ static void usage(void)
#endif /* CONFIG_DEBUG_SYSLOG */
printf(" -t = include timestamp in debug messages\n"
" -h = show this help text\n"
+ " -H = connect to a hostapd instance to manage state changes\n"
" -L = show license (GPL and BSD)\n"
" -o = override driver parameter for new interfaces\n"
" -O = override ctrl_interface parameter for new interfaces\n"
@@ -143,7 +144,7 @@ int main(int argc, char *argv[])
wpa_supplicant_fd_workaround();
for (;;) {
- c = getopt(argc, argv, "b:Bc:C:D:df:g:hi:KLNo:O:p:P:qstuvW");
+ c = getopt(argc, argv, "b:Bc:C:D:df:g:hH:i:KLNo:O:p:P:qstuvW");
if (c < 0)
break;
switch (c) {
@@ -184,6 +185,9 @@ int main(int argc, char *argv[])
usage();
exitcode = 0;
goto out;
+ case 'H':
+ iface->hostapd_ctrl = optarg;
+ break;
case 'i':
iface->ifname = optarg;
break;

View File

@ -0,0 +1,25 @@
From: Jouni Malinen <jouni.malinen@atheros.com>
Date: Tue, 26 Oct 2010 13:30:28 +0000 (+0300)
Subject: hostapd: Set operstate UP when initializing AP mode
X-Git-Url: http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=commitdiff_plain;h=e11f5a2cbc333113a3a1cc1aeea7f698c3936ca3
hostapd: Set operstate UP when initializing AP mode
This is needed to avoid problems with other applications setting and
leaving the interface to IF_OPER_DORMANT state. In AP mode, the interface
is ready immediately after the keys are set, so we better make sure the
DORMANT state does not prevent normal operations after that.
---
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -622,6 +622,9 @@ static int hostapd_setup_bss(struct host
ieee802_11_set_beacon(hapd);
+ if (hapd->driver && hapd->driver->set_operstate)
+ hapd->driver->set_operstate(hapd->drv_priv, 1);
+
return 0;
}

View File

@ -36,6 +36,10 @@ define Package/hotplug2/description
This is an implementation of Hotplug2-1.0-beta
endef
define Package/hotplug2/conffiles
/etc/hotplug2.rules
endef
MAKE_FLAGS += \
COPTS="$(TARGET_CFLAGS)" \
STATIC_WORKER="fork"

View File

@ -30,6 +30,10 @@ $(call Package/iproute2/Default)
TITLE:=Routing control utility
endef
define Package/ip/conffiles
/etc/iproute2/rt_tables
endef
define Package/tc
$(call Package/iproute2/Default)
TITLE:=Traffic control utility

View File

@ -0,0 +1,24 @@
--- a/extensions/libxt_iprange.c
+++ b/extensions/libxt_iprange.c
@@ -96,7 +96,8 @@ static int iprange_parse(int c, char **a
if (invert)
info->flags |= IPRANGE_SRC_INV;
iprange_parse_range(optarg, range, NFPROTO_IPV4, "--src-range");
-
+ info->src.min_ip = range[0].in.s_addr;
+ info->src.max_ip = range[1].in.s_addr;
break;
case '2':
@@ -110,8 +111,9 @@ static int iprange_parse(int c, char **a
if (invert)
info->flags |= IPRANGE_DST_INV;
- iprange_parse_range(optarg, range, NFPROTO_IPV4, "--src-range");
-
+ iprange_parse_range(optarg, range, NFPROTO_IPV4, "--dst-range");
+ info->dst.min_ip = range[0].in.s_addr;
+ info->dst.max_ip = range[1].in.s_addr;
break;
default:

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=iw
PKG_VERSION:=0.9.19
PKG_VERSION:=0.9.21
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://wireless.kernel.org/download/iw/
PKG_MD5SUM:=3b88743f9c6ce8a7e2f5fd7d18fdea42
PKG_MD5SUM:=726db5f1fd6bc316434414770513ef81
PKG_BUILD_DEPENDS:=mac80211
include $(INCLUDE_DIR)/package.mk
@ -48,11 +48,9 @@ MAKE_FLAGS += \
LIBS="-lm -lnl-tiny" \
V=1
ifneq ($(CONFIG_LINUX_2_6),)
define Package/iw/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/iw $(1)/usr/sbin/
endef
endif
$(eval $(call BuildPackage,iw))

View File

@ -0,0 +1,183 @@
--- a/nl80211.h
+++ b/nl80211.h
@@ -295,7 +295,9 @@
* auth and assoc steps. For this, you need to specify the SSID in a
* %NL80211_ATTR_SSID attribute, and can optionally specify the association
* IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC,
- * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_CONTROL_PORT.
+ * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
+ * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
+ * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
* It is also sent as an event, with the BSSID and response IEs when the
* connection is established or failed to be established. This can be
* determined by the STATUS_CODE attribute.
@@ -313,8 +315,8 @@
* channel for the specified amount of time. This can be used to do
* off-channel operations like transmit a Public Action frame and wait for
* a response while being associated to an AP on another channel.
- * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify which
- * radio is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
+ * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus
+ * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
* frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be
* optionally used to specify additional channel parameters.
* %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
@@ -385,6 +387,8 @@
* of any other interfaces, and other interfaces will again take
* precedence when they are used.
*
+ * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface.
+ *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -487,6 +491,7 @@ enum nl80211_commands {
NL80211_CMD_NOTIFY_CQM,
NL80211_CMD_SET_CHANNEL,
+ NL80211_CMD_SET_WDS_PEER,
/* add new commands above here */
@@ -686,6 +691,15 @@ enum nl80211_commands {
* request, the driver will assume that the port is unauthorized until
* authorized by user space. Otherwise, port is marked authorized by
* default in station mode.
+ * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the
+ * ethertype that will be used for key negotiation. It can be
+ * specified with the associate and connect commands. If it is not
+ * specified, the value defaults to 0x888E (PAE, 802.1X). This
+ * attribute is also used as a flag in the wiphy information to
+ * indicate that protocols other than PAE are supported.
+ * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with
+ * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom
+ * ethertype frames used for key negotiation must not be encrypted.
*
* @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
* We recommend using nested, driver-specific attributes within this.
@@ -787,6 +801,11 @@ enum nl80211_commands {
* This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING
* for non-automatic settings.
*
+ * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly
+ * means support for per-station GTKs.
+ *
+ * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS
+ *
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -951,6 +970,13 @@ enum nl80211_attrs {
NL80211_ATTR_RX_FRAME_TYPES,
NL80211_ATTR_FRAME_TYPE,
+ NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
+ NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
+
+ NL80211_ATTR_SUPPORT_IBSS_RSN,
+
+ NL80211_ATTR_MCAST_RATE,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -1006,6 +1032,8 @@ enum nl80211_attrs {
* @NL80211_IFTYPE_WDS: wireless distribution interface
* @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
* @NL80211_IFTYPE_MESH_POINT: mesh point
+ * @NL80211_IFTYPE_P2P_CLIENT: P2P client
+ * @NL80211_IFTYPE_P2P_GO: P2P group owner
* @NL80211_IFTYPE_MAX: highest interface type number currently defined
* @NUM_NL80211_IFTYPES: number of defined interface types
*
@@ -1022,6 +1050,8 @@ enum nl80211_iftype {
NL80211_IFTYPE_WDS,
NL80211_IFTYPE_MONITOR,
NL80211_IFTYPE_MESH_POINT,
+ NL80211_IFTYPE_P2P_CLIENT,
+ NL80211_IFTYPE_P2P_GO,
/* keep last */
NUM_NL80211_IFTYPES,
@@ -1111,6 +1141,8 @@ enum nl80211_rate_info {
* @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station)
* @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this
* station)
+ * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station)
+ * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station)
*/
enum nl80211_sta_info {
__NL80211_STA_INFO_INVALID,
@@ -1124,6 +1156,8 @@ enum nl80211_sta_info {
NL80211_STA_INFO_TX_BITRATE,
NL80211_STA_INFO_RX_PACKETS,
NL80211_STA_INFO_TX_PACKETS,
+ NL80211_STA_INFO_TX_RETRIES,
+ NL80211_STA_INFO_TX_FAILED,
/* keep last */
__NL80211_STA_INFO_AFTER_LAST,
@@ -1382,6 +1416,17 @@ enum nl80211_reg_rule_flags {
* @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved
* @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
* @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
+ * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used
+ * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio
+ * spent on this channel
+ * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary
+ * channel was sensed busy (either due to activity or energy detect)
+ * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension
+ * channel was sensed busy
+ * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent
+ * receiving data
+ * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent
+ * transmitting data
* @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
* currently defined
* @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
@@ -1390,6 +1435,12 @@ enum nl80211_survey_info {
__NL80211_SURVEY_INFO_INVALID,
NL80211_SURVEY_INFO_FREQUENCY,
NL80211_SURVEY_INFO_NOISE,
+ NL80211_SURVEY_INFO_IN_USE,
+ NL80211_SURVEY_INFO_CHANNEL_TIME,
+ NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY,
+ NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY,
+ NL80211_SURVEY_INFO_CHANNEL_TIME_RX,
+ NL80211_SURVEY_INFO_CHANNEL_TIME_TX,
/* keep last */
__NL80211_SURVEY_INFO_AFTER_LAST,
@@ -1636,11 +1687,14 @@ enum nl80211_auth_type {
* @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key
* @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key
* @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS)
+ * @NUM_NL80211_KEYTYPES: number of defined key types
*/
enum nl80211_key_type {
NL80211_KEYTYPE_GROUP,
NL80211_KEYTYPE_PAIRWISE,
NL80211_KEYTYPE_PEERKEY,
+
+ NUM_NL80211_KEYTYPES
};
/**
@@ -1671,6 +1725,9 @@ enum nl80211_wpa_versions {
* CCMP keys, each six bytes in little endian
* @NL80211_KEY_DEFAULT: flag indicating default key
* @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key
+ * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not
+ * specified the default depends on whether a MAC address was
+ * given with the command using the key or not (u32)
* @__NL80211_KEY_AFTER_LAST: internal
* @NL80211_KEY_MAX: highest key attribute
*/
@@ -1682,6 +1739,7 @@ enum nl80211_key_attributes {
NL80211_KEY_SEQ,
NL80211_KEY_DEFAULT,
NL80211_KEY_DEFAULT_MGMT,
+ NL80211_KEY_TYPE,
/* keep last */
__NL80211_KEY_AFTER_LAST,

View File

@ -1,167 +0,0 @@
--- a/nl80211.h
+++ b/nl80211.h
@@ -270,6 +270,35 @@
* @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices
* associated with this wiphy must be down and will follow.
*
+ * @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified
+ * channel for the specified amount of time. This can be used to do
+ * off-channel operations like transmit a Public Action frame and wait for
+ * a response while being associated to an AP on another channel.
+ * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify which
+ * radio is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
+ * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be
+ * optionally used to specify additional channel parameters.
+ * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
+ * to remain on the channel. This command is also used as an event to
+ * notify when the requested duration starts (it may take a while for the
+ * driver to schedule this time due to other concurrent needs for the
+ * radio).
+ * When called, this operation returns a cookie (%NL80211_ATTR_COOKIE)
+ * that will be included with any events pertaining to this request;
+ * the cookie is also used to cancel the request.
+ * @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a
+ * pending remain-on-channel duration if the desired operation has been
+ * completed prior to expiration of the originally requested duration.
+ * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the
+ * radio. The %NL80211_ATTR_COOKIE attribute must be given as well to
+ * uniquely identify the request.
+ * This command is also used as an event to notify when a requested
+ * remain-on-channel duration has expired.
+ *
+ * @NL80211_CMD_SET_TX_BITRATE_MASK: Set the mask of rates to be used in TX
+ * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
+ * and @NL80211_ATTR_TX_RATES the set of allowed rates.
+ *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -349,6 +378,15 @@ enum nl80211_commands {
NL80211_CMD_GET_SURVEY,
NL80211_CMD_NEW_SURVEY_RESULTS,
+ NL80211_CMD_SET_PMKSA,
+ NL80211_CMD_DEL_PMKSA,
+ NL80211_CMD_FLUSH_PMKSA,
+
+ NL80211_CMD_REMAIN_ON_CHANNEL,
+ NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
+
+ NL80211_CMD_SET_TX_BITRATE_MASK,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
@@ -398,6 +436,8 @@ enum nl80211_commands {
* @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length
* larger than or equal to this use RTS/CTS handshake); allowed range:
* 0..65536, disable with (u32)-1; dot11RTSThreshold; u32
+ * @NL80211_ATTR_WIPHY_COVERAGE_CLASS: Coverage Class as defined by IEEE 802.11
+ * section 7.3.2.9; dot11CoverageClass; u8
*
* @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
* @NL80211_ATTR_IFNAME: network interface name
@@ -598,6 +638,21 @@ enum nl80211_commands {
* the survey response for %NL80211_CMD_GET_SURVEY, nested attribute
* containing info as possible, see &enum survey_info.
*
+ * @NL80211_ATTR_PMKID: PMK material for PMKSA caching.
+ * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can
+ * cache, a wiphy attribute.
+ *
+ * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32.
+ *
+ * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects.
+ *
+ * @NL80211_ATTR_TX_RATES: Nested set of attributes
+ * (enum nl80211_tx_rate_attributes) describing TX rates per band. The
+ * enum nl80211_band value is used as the index (nla_type() of the nested
+ * data. If a band is not included, it will be configured to allow all
+ * rates based on negotiated supported rates information. This attribute
+ * is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
+ *
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -732,6 +787,17 @@ enum nl80211_attrs {
NL80211_ATTR_SURVEY_INFO,
+ NL80211_ATTR_PMKID,
+ NL80211_ATTR_MAX_NUM_PMKIDS,
+
+ NL80211_ATTR_DURATION,
+
+ NL80211_ATTR_COOKIE,
+
+ NL80211_ATTR_WIPHY_COVERAGE_CLASS,
+
+ NL80211_ATTR_TX_RATES,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -1312,13 +1378,20 @@ enum nl80211_channel_type {
* @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
* @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
* @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
- * raw information elements from the probe response/beacon (bin)
+ * raw information elements from the probe response/beacon (bin);
+ * if the %NL80211_BSS_BEACON_IES attribute is present, the IEs here are
+ * from a Probe Response frame; otherwise they are from a Beacon frame.
+ * However, if the driver does not indicate the source of the IEs, these
+ * IEs may be from either frame subtype.
* @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
* in mBm (100 * dBm) (s32)
* @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
* in unspecified units, scaled to 0..100 (u8)
* @NL80211_BSS_STATUS: status, if this BSS is "used"
* @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms
+ * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information
+ * elements from a Beacon frame (bin); not present if no Beacon frame has
+ * yet been received
* @__NL80211_BSS_AFTER_LAST: internal
* @NL80211_BSS_MAX: highest BSS attribute
*/
@@ -1334,6 +1407,7 @@ enum nl80211_bss {
NL80211_BSS_SIGNAL_UNSPEC,
NL80211_BSS_STATUS,
NL80211_BSS_SEEN_MS_AGO,
+ NL80211_BSS_BEACON_IES,
/* keep last */
__NL80211_BSS_AFTER_LAST,
@@ -1431,4 +1505,33 @@ enum nl80211_key_attributes {
NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1
};
+/**
+ * enum nl80211_tx_rate_attributes - TX rate set attributes
+ * @__NL80211_TXRATE_INVALID: invalid
+ * @NL80211_TXRATE_LEGACY: Legacy (non-MCS) rates allowed for TX rate selection
+ * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
+ * 1 = 500 kbps) but without the IE length restriction (at most
+ * %NL80211_MAX_SUPP_RATES in a single array).
+ * @__NL80211_TXRATE_AFTER_LAST: internal
+ * @NL80211_TXRATE_MAX: highest TX rate attribute
+ */
+enum nl80211_tx_rate_attributes {
+ __NL80211_TXRATE_INVALID,
+ NL80211_TXRATE_LEGACY,
+
+ /* keep last */
+ __NL80211_TXRATE_AFTER_LAST,
+ NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_band - Frequency band
+ * @NL80211_BAND_2GHZ - 2.4 GHz ISM band
+ * @NL80211_BAND_5GHZ - around 5 GHz band (4.9 - 5.7 GHz)
+ */
+enum nl80211_band {
+ NL80211_BAND_2GHZ,
+ NL80211_BAND_5GHZ,
+};
+
#endif /* __LINUX_NL80211_H */

View File

@ -1,81 +0,0 @@
--- a/info.c
+++ b/info.c
@@ -156,6 +156,14 @@ static int print_phy_handler(struct nl_m
printf("\tRTS threshold: %d\n", rts);
}
+ if (tb_msg[NL80211_ATTR_WIPHY_COVERAGE_CLASS]) {
+ unsigned char coverage;
+
+ coverage = nla_get_u8(tb_msg[NL80211_ATTR_WIPHY_COVERAGE_CLASS]);
+ /* See handle_distance() for an explanation where the '450' comes from */
+ printf("\tCoverage class: %d (up to %dm)\n", coverage, 450 * coverage);
+ }
+
if (!tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES])
goto commands;
--- a/phy.c
+++ b/phy.c
@@ -164,3 +164,61 @@ static int handle_netns(struct nl80211_s
COMMAND(set, netns, "<pid>",
NL80211_CMD_SET_WIPHY_NETNS, 0, CIB_PHY, handle_netns,
"Put this wireless device into a different network namespace");
+
+static int handle_coverage(struct nl80211_state *state,
+ struct nl_cb *cb,
+ struct nl_msg *msg,
+ int argc, char **argv)
+{
+ unsigned int coverage;
+
+ if (argc != 1)
+ return 1;
+
+ coverage = strtoul(argv[0], NULL, 10);
+ if (coverage > 255)
+ return 1;
+
+ NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS, coverage);
+
+ return 0;
+ nla_put_failure:
+ return -ENOBUFS;
+}
+COMMAND(set, coverage, "<coverage class>",
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_coverage,
+ "Set coverage class (1 for every 3 usec of air propagation time).\n"
+ "Valid values: 0 - 255.");
+
+static int handle_distance(struct nl80211_state *state,
+ struct nl_cb *cb,
+ struct nl_msg *msg,
+ int argc, char **argv)
+{
+ unsigned int distance, coverage;
+
+ if (argc != 1)
+ return 1;
+
+ distance = strtoul(argv[0], NULL, 10);
+
+ /*
+ * Divide double the distance by the speed of light in m/usec (300) to
+ * get round-trip time in microseconds and then divide the result by
+ * three to get coverage class as specified in IEEE 802.11-2007 table
+ * 7-27. Values are rounded upwards.
+ */
+ coverage = (distance + 449) / 450;
+ if (coverage > 255)
+ return 1;
+
+ NLA_PUT_U8(msg, NL80211_ATTR_WIPHY_COVERAGE_CLASS, coverage);
+
+ return 0;
+ nla_put_failure:
+ return -ENOBUFS;
+}
+COMMAND(set, distance, "<distance>",
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_distance,
+ "Set appropriate coverage class for given link distance in meters.\n"
+ "Valid values: 0 - 114750");

View File

@ -0,0 +1,14 @@
--- a/survey.c
+++ b/survey.c
@@ -44,8 +44,9 @@ static int print_survey_handler(struct n
}
if (sinfo[NL80211_SURVEY_INFO_FREQUENCY])
- printf("\tfrequency:\t%u MHz\n",
- nla_get_u32(sinfo[NL80211_SURVEY_INFO_FREQUENCY]));
+ printf("\tfrequency:\t%u MHz%s\n",
+ nla_get_u32(sinfo[NL80211_SURVEY_INFO_FREQUENCY]),
+ sinfo[NL80211_SURVEY_INFO_IN_USE] ? " [in use]" : "");
if (sinfo[NL80211_SURVEY_INFO_NOISE])
printf("\tnoise:\t\t%d dBm\n",
(int8_t)nla_get_u8(sinfo[NL80211_SURVEY_INFO_NOISE]));

View File

@ -1,30 +0,0 @@
--- a/interface.c
+++ b/interface.c
@@ -260,6 +260,27 @@ static int print_iface_handler(struct nl
printf("%s\tifindex %d\n", indent, nla_get_u32(tb_msg[NL80211_ATTR_IFINDEX]));
if (tb_msg[NL80211_ATTR_IFTYPE])
printf("%s\ttype %s\n", indent, iftype_name(nla_get_u32(tb_msg[NL80211_ATTR_IFTYPE])));
+ if (tb_msg[NL80211_ATTR_WIPHY_FREQ]) {
+ const char *mode;
+
+ if (tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE])
+ switch(nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE])) {
+ case NL80211_CHAN_HT20:
+ mode = "HT20";
+ break;
+ case NL80211_CHAN_HT40PLUS:
+ mode = "HT40+";
+ break;
+ case NL80211_CHAN_HT40MINUS:
+ mode = "HT40-";
+ break;
+ default:
+ mode = "";
+ }
+
+ printf("%s\tfrequency %d MHz %s\n", indent, nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_FREQ]), mode);
+ }
+
return NL_SKIP;
}

View File

@ -0,0 +1,32 @@
--- a/survey.c
+++ b/survey.c
@@ -44,12 +44,27 @@ static int print_survey_handler(struct n
}
if (sinfo[NL80211_SURVEY_INFO_FREQUENCY])
- printf("\tfrequency:\t%u MHz%s\n",
+ printf("\tfrequency:\t\t\t%u MHz%s\n",
nla_get_u32(sinfo[NL80211_SURVEY_INFO_FREQUENCY]),
sinfo[NL80211_SURVEY_INFO_IN_USE] ? " [in use]" : "");
if (sinfo[NL80211_SURVEY_INFO_NOISE])
- printf("\tnoise:\t\t%d dBm\n",
+ printf("\tnoise:\t\t\t\t%d dBm\n",
(int8_t)nla_get_u8(sinfo[NL80211_SURVEY_INFO_NOISE]));
+ if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME])
+ printf("\tchannel active time:\t\t%lld ms\n",
+ (int64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME]));
+ if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY])
+ printf("\tchannel busy time:\t\t%lld ms\n",
+ (int64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY]));
+ if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY])
+ printf("\textension channel busy time:\t%lld ms\n",
+ (int64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY]));
+ if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX])
+ printf("\tchannel receive time:\t\t%lld ms\n",
+ (int64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_RX]));
+ if (sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX])
+ printf("\tchannel transmit time:\t\t%lld ms\n",
+ (int64_t)nla_get_u64(sinfo[NL80211_SURVEY_INFO_CHANNEL_TIME_TX]));
return NL_SKIP;
}

View File

@ -0,0 +1,32 @@
--- a/ibss.c
+++ b/ibss.c
@@ -83,6 +83,20 @@ static int join_ibss(struct nl80211_stat
argc--;
}
+ /* multicast rate */
+ if (argc > 1 && strcmp(argv[0], "mcast-rate") == 0) {
+ argv++;
+ argc--;
+
+ rate = strtod(argv[0], &end);
+ if (*end != '\0')
+ return 1;
+
+ NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, (int) rate * 10);
+ argv++;
+ argc--;
+ }
+
if (!argc)
return 0;
@@ -109,7 +123,7 @@ COMMAND(ibss, leave, NULL,
"Leave the current IBSS cell.");
COMMAND(ibss, join,
"<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] "
- "[basic-rates <rate in Mbps,rate2,...>] [key d:0:abcde]",
+ "[basic-rates <rate in Mbps,rate2,...>] [mcast-rate <rate in Mbps>] [key d:0:abcde]",
NL80211_CMD_JOIN_IBSS, 0, CIB_NETDEV, join_ibss,
"Join the IBSS cell with the given SSID, if it doesn't exist create\n"
"it on the given frequency. When fixed frequency is requested, don't\n"

View File

@ -9,6 +9,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=kernel
PKG_FLAGS:=hold
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/packages
SCAN_DEPS=modules/*.mk

View File

@ -146,6 +146,22 @@ endef
$(eval $(call KernelPackage,8139too))
define KernelPackage/8139cp
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=RealTek RTL-8139C+ PCI Fast Ethernet Adapter kernel support
DEPENDS:=@TARGET_x86
KCONFIG:=CONFIG_8139CP
FILES:=$(LINUX_DIR)/drivers/net/8139cp.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,50,8139cp)
endef
define KernelPackage/8139cp/description
Kernel module for RealTek RTL-8139C+ PCI Fast Ethernet adapters.
endef
$(eval $(call KernelPackage,8139cp))
define KernelPackage/r8169
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=RealTek RTL-8169 PCI Gigabit Ethernet Adapter kernel support

View File

@ -85,7 +85,7 @@ $(eval $(call KernelPackage,video-konica))
define KernelPackage/video-ov511
$(call KernelPackage/video/Depends,@LINUX_2_6 @USB_SUPPORT +kmod-usb-core)
TITLE:=OV511 USB webcam support
KCONFIG:=CONFIG_VIDEO_OV511
KCONFIG:=CONFIG_USB_OV511
FILES:=$(LINUX_DIR)/drivers/media/video/ov511.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,70,ov511)
endef

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=lua
PKG_VERSION:=5.1.4
PKG_RELEASE:=6
PKG_RELEASE:=7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.lua.org/ftp/ \

View File

@ -0,0 +1,11 @@
--- a/src/lnum_config.h
+++ b/src/lnum_config.h
@@ -11,7 +11,7 @@
** Default number modes
*/
#if (!defined LNUM_DOUBLE) && (!defined LNUM_FLOAT) && (!defined LNUM_LDOUBLE)
-# define LNUM_FLOAT
+# define LNUM_DOUBLE
#endif
#if (!defined LNUM_INT16) && (!defined LNUM_INT32) && (!defined LNUM_INT64)
# define LNUM_INT32

View File

@ -0,0 +1,11 @@
--- a/src/lnum_config.h
+++ b/src/lnum_config.h
@@ -11,7 +11,7 @@
** Default number modes
*/
#if (!defined LNUM_DOUBLE) && (!defined LNUM_FLOAT) && (!defined LNUM_LDOUBLE)
-# define LNUM_FLOAT
+# define LNUM_DOUBLE
#endif
#if (!defined LNUM_INT16) && (!defined LNUM_INT32) && (!defined LNUM_INT64)
# define LNUM_INT32

View File

@ -10,23 +10,25 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mac80211
PKG_VERSION:=2010-07-29
PKG_VERSION:=2010-10-19
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
# http://www.orbit-lab.org/kernel/compat-wireless-2.6/2010/11 \
# http://wireless.kernel.org/download/compat-wireless-2.6
PKG_MD5SUM:=fcfb757939c4718efbf9c87ca59c6932
PKG_MD5SUM:=3bad1752f0154baa57a4d94774bd2ccf
PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_kmod-mac80211 \
CONFIG_PACKAGE_MAC80211_DEBUGFS \
CONFIG_PACKAGE_ATH9K_USE_MINSTREL \
CONFIG_PACKAGE_ATH_DEBUG \
CONFIG_ATH_USER_REGD \
CARL9170_FW_VERSION:=1.8.8.2
include $(INCLUDE_DIR)/package.mk
WMENU:=Wireless Drivers
@ -35,23 +37,23 @@ define KernelPackage/mac80211/Default
SUBMENU:=$(WMENU)
URL:=http://linuxwireless.org/
MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
DEPENDS:=@!LINUX_2_4 @(!(TARGET_avr32||TARGET_ep93xx||TARGET_ps3||TARGET_pxcab)||BROKEN)
DEPENDS:=@(!(TARGET_avr32||TARGET_ep93xx||TARGET_ps3||TARGET_pxcab)||BROKEN)
endef
define KernelPackage/cfg80211
$(call KernelPackage/mac80211/Default)
TITLE:=cfg80211 - wireless configuration API
DEPENDS+= +wireless-tools +iw @!LINUX_2_6_25
DEPENDS+= +wireless-tools +iw @!LINUX_2_6_25 @!LINUX_2_4 +crda
ifeq ($(strip $(call CompareKernelPatchVer,$(KERNEL_PATCHVER),ge,2.6.33)),1)
FILES:= \
$(PKG_BUILD_DIR)/compat/compat.$(LINUX_KMOD_SUFFIX) \
$(PKG_BUILD_DIR)/net/wireless/cfg80211.$(LINUX_KMOD_SUFFIX)
$(PKG_BUILD_DIR)/compat/compat.ko \
$(PKG_BUILD_DIR)/net/wireless/cfg80211.ko
AUTOLOAD:=$(call AutoLoad,20,compat cfg80211)
else
FILES:= \
$(PKG_BUILD_DIR)/compat/compat.$(LINUX_KMOD_SUFFIX) \
$(PKG_BUILD_DIR)/compat/compat_firmware_class.$(LINUX_KMOD_SUFFIX) \
$(PKG_BUILD_DIR)/net/wireless/cfg80211.$(LINUX_KMOD_SUFFIX)
$(PKG_BUILD_DIR)/compat/compat.ko \
$(PKG_BUILD_DIR)/compat/compat_firmware_class.ko \
$(PKG_BUILD_DIR)/net/wireless/cfg80211.ko
AUTOLOAD:=$(call AutoLoad,20,compat compat_firmware_class cfg80211)
endif
endef
@ -64,7 +66,7 @@ define KernelPackage/mac80211
$(call KernelPackage/mac80211/Default)
TITLE:=Linux 802.11 Wireless Networking Stack
DEPENDS+= +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +kmod-cfg80211
FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.$(LINUX_KMOD_SUFFIX)
FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko
AUTOLOAD:=$(call AutoLoad,21,mac80211)
MENU:=1
endef
@ -92,6 +94,8 @@ endef
# Prism54 drivers
P54PCIFW:=2.13.12.0.arm
P54USBFW:=2.13.24.0.lm87.arm
P54SPIFW:=2.13.0.0.a.13.14.arm
CARL9170_FW:=carl9170-1.fw
define Download/p54usb
FILE:=$(P54USBFW)
@ -107,6 +111,20 @@ define Download/p54pci
endef
$(eval $(call Download,p54pci))
define Download/p54spi
FILE:=$(P54SPIFW)
URL:=http://daemonizer.de/prism54/prism54-fw/stlc4560
MD5SUM:=42661f8ecbadd88012807493f596081d
endef
$(eval $(call Download,p54spi))
define Download/carl9170
FILE:=$(CARL9170_FW)
URL:=http://www.kernel.org/pub/linux/kernel/people/chr/carl9170/fw/$(CARL9170_FW_VERSION)
MD5SUM:=114c43846ed1d2f89cc92bd0e2ec0589
endef
$(eval $(call Download,carl9170))
define KernelPackage/p54/Default
$(call KernelPackage/mac80211/Default)
TITLE:=Prism54 Drivers
@ -118,9 +136,9 @@ endef
define KernelPackage/p54-common
$(call KernelPackage/p54/Default)
DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT +kmod-mac80211
DEPENDS+= @PCI_SUPPORT||@USB_SUPPORT||@TARGET_omap24xx +kmod-mac80211 +kmod-crc-ccitt
TITLE+= (COMMON)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54common.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54common.ko
AUTOLOAD:=$(call AutoLoad,30,p54common)
endef
@ -128,7 +146,7 @@ define KernelPackage/p54-pci
$(call KernelPackage/p54/Default)
TITLE+= (PCI)
DEPENDS+= @PCI_SUPPORT +kmod-p54-common
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54pci.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54pci.ko
AUTOLOAD:=$(call AutoLoad,31,p54pci)
endef
@ -136,10 +154,18 @@ define KernelPackage/p54-usb
$(call KernelPackage/p54/Default)
TITLE+= (USB)
DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54usb.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54usb.ko
AUTOLOAD:=$(call AutoLoad,31,p54usb)
endef
define KernelPackage/p54-spi
$(call KernelPackage/p54/Default)
TITLE+= (SPI)
DEPENDS+= @TARGET_omap24xx +kmod-p54-common
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/p54/p54spi.ko
AUTOLOAD:=$(call AutoLoad,31,p54spi)
endef
# Ralink rt2x00 drivers
RT61FW:=RT61_Firmware_V1.2.zip
RT71FW:=RT71W_Firmware_V1.8.zip
@ -197,7 +223,7 @@ define KernelPackage/rt2x00-lib
$(call KernelPackage/rt2x00/Default)
DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-mac80211 +kmod-crc-itu-t
TITLE+= (LIB)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00lib.ko
AUTOLOAD:=$(call AutoLoad,25,rt2x00lib)
MENU:=1
endef
@ -226,7 +252,7 @@ define KernelPackage/rt2x00-pci
$(call KernelPackage/rt2x00/Default)
DEPENDS+= @(PCI_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +kmod-eeprom-93cx6
TITLE+= (PCI)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00pci.ko
AUTOLOAD:=$(call AutoLoad,26,rt2x00pci)
endef
@ -234,7 +260,7 @@ define KernelPackage/rt2x00-usb
$(call KernelPackage/rt2x00/Default)
DEPENDS+= @USB_SUPPORT +kmod-rt2x00-lib +kmod-usb-core
TITLE+= (USB)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00usb.ko
AUTOLOAD:=$(call AutoLoad,26,rt2x00usb)
endef
@ -242,7 +268,7 @@ define KernelPackage/rt2x00-soc
$(call KernelPackage/rt2x00/Default)
DEPENDS+= @TARGET_ramips +kmod-rt2x00-lib
TITLE+= (SoC)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00soc.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2x00soc.ko
AUTOLOAD:=$(call AutoLoad,26,rt2x00soc)
endef
@ -250,7 +276,7 @@ define KernelPackage/rt2800-lib
$(call KernelPackage/rt2x00/Default)
DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT||TARGET_ramips) +kmod-rt2x00-lib +USB_SUPPORT:kmod-rt2x00-usb +TARGET_ramips:kmod-rt2x00-soc
TITLE+= (rt2800 LIB)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800lib.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800lib.ko
AUTOLOAD:=$(call AutoLoad,27,rt2800lib)
endef
@ -258,7 +284,7 @@ define KernelPackage/rt2400-pci
$(call KernelPackage/rt2x00/Default)
DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
TITLE+= (RT2400 PCI)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2400pci.ko
AUTOLOAD:=$(call AutoLoad,27,rt2400pci)
endef
@ -266,7 +292,7 @@ define KernelPackage/rt2500-pci
$(call KernelPackage/rt2x00/Default)
DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
TITLE+= (RT2500 PCI)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500pci.ko
AUTOLOAD:=$(call AutoLoad,27,rt2500pci)
endef
@ -274,7 +300,7 @@ define KernelPackage/rt2500-usb
$(call KernelPackage/rt2x00/Default)
DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
TITLE+= (RT2500 USB)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2500usb.ko
AUTOLOAD:=$(call AutoLoad,27,rt2500usb)
endef
@ -282,7 +308,7 @@ define KernelPackage/rt61-pci
$(call KernelPackage/rt2x00/Default)
DEPENDS+= @PCI_SUPPORT +kmod-rt2x00-pci
TITLE+= (RT2x61 PCI)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt61pci.ko
AUTOLOAD:=$(call AutoLoad,27,rt61pci)
endef
@ -290,7 +316,7 @@ define KernelPackage/rt73-usb
$(call KernelPackage/rt2x00/Default)
DEPENDS+= @USB_SUPPORT +kmod-rt2x00-usb
TITLE+= (RT73 USB)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt73usb.ko
AUTOLOAD:=$(call AutoLoad,27,rt73usb)
endef
@ -298,7 +324,7 @@ define KernelPackage/rt2800-pci
$(call KernelPackage/rt2x00/Default)
DEPENDS+= +kmod-rt2x00-pci +kmod-rt2800-lib +kmod-crc-ccitt +TARGET_ramips:kmod-rt2x00-soc
TITLE+= (RT2860 PCI)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800pci.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800pci.ko
AUTOLOAD:=$(call AutoLoad,28,rt2800pci)
endef
@ -306,7 +332,7 @@ define KernelPackage/rt2800-usb
$(call KernelPackage/rt2x00/Default)
DEPENDS+= +kmod-rt2x00-usb +kmod-rt2800-lib +kmod-crc-ccitt
TITLE+= (RT2870 USB)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800usb.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rt2x00/rt2800usb.ko
AUTOLOAD:=$(call AutoLoad,28,rt2800usb)
endef
@ -321,7 +347,7 @@ define KernelPackage/rtl8180
$(call KernelPackage/rtl818x/Default)
DEPENDS+= @PCI_SUPPORT
TITLE+= (RTL8180 PCI)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8180.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8180.ko
AUTOLOAD:=$(call AutoLoad,27,rtl8180)
endef
@ -329,7 +355,7 @@ define KernelPackage/rtl8187
$(call KernelPackage/rtl818x/Default)
DEPENDS+= @USB_SUPPORT
TITLE+= (RTL8187 USB)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8187.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rtl818x/rtl8187.ko
AUTOLOAD:=$(call AutoLoad,27,rtl8187)
endef
@ -346,7 +372,7 @@ define KernelPackage/zd1211rw
$(call KernelPackage/mac80211/Default)
TITLE:=Zydas ZD1211 support
DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zd1211rw/zd1211rw.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zd1211rw/zd1211rw.ko
AUTOLOAD:=$(call AutoLoad,60,zd1211rw)
endef
@ -378,7 +404,7 @@ define KernelPackage/ath
$(call KernelPackage/mac80211/Default)
TITLE:=Atheros common driver part
DEPENDS+= @PCI_SUPPORT +kmod-mac80211
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko
AUTOLOAD:=$(call AutoLoad,26,ath)
MENU:=1
endef
@ -392,7 +418,7 @@ define KernelPackage/ath5k
TITLE:=Atheros 5xxx wireless cards support
URL:=http://linuxwireless.org/en/users/Drivers/ath5k
DEPENDS+= +kmod-ath
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko
AUTOLOAD:=$(call AutoLoad,27,ath5k)
endef
@ -407,9 +433,9 @@ define KernelPackage/ath9k
URL:=http://linuxwireless.org/en/users/Drivers/ath9k
DEPENDS+= +kmod-ath
FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.$(LINUX_KMOD_SUFFIX) \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.$(LINUX_KMOD_SUFFIX) \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.$(LINUX_KMOD_SUFFIX)
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko
AUTOLOAD:=$(call AutoLoad,27,ath9k_hw ath9k_common ath9k)
MENU:=1
endef
@ -419,17 +445,20 @@ This module adds support for wireless adapters based on
Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets.
endef
define KernelPackage/ath9k/config
menu "Configuration"
depends PACKAGE_kmod-ath9k
config PACKAGE_ATH9K_USE_MINSTREL
bool "use the new minstrel_ht rate control for ath9k"
default y
endmenu
define KernelPackage/carl9170
$(call KernelPackage/mac80211/Default)
TITLE:=Driver for Atheros AR9170 USB sticks
DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko
AUTOLOAD:=$(call AutoLoad,60,carl9170)
endef
define KernelPackage/carl9170/install
$(INSTALL_DIR) $(1)/lib/firmware
$(INSTALL_DATA) $(DL_DIR)/$(CARL9170_FW) $(1)/lib/firmware/
endef
USB8388FW_NAME:=usb8388
USB8388FW_VERSION:=5.110.22.p23
@ -464,8 +493,8 @@ define KernelPackage/libertas-usb
DEPENDS+= @USB_SUPPORT +kmod-mac80211 +kmod-usb-core +kmod-lib80211
TITLE:=Marvell 88W8015 Wireless Driver
FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.$(LINUX_KMOD_SUFFIX) \
$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/usb8xxx.$(LINUX_KMOD_SUFFIX)
$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/usb8xxx.ko
AUTOLOAD:=$(call AutoLoad,27,libertas usb8xxx)
endef
@ -474,29 +503,16 @@ define KernelPackage/libertas-sd
DEPENDS+= +kmod-mac80211 +kmod-lib80211
TITLE:=Marvell 88W8686 Wireless Driver
FILES:= \
$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.$(LINUX_KMOD_SUFFIX) \
$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas_sdio.$(LINUX_KMOD_SUFFIX)
$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/libertas/libertas_sdio.ko
AUTOLOAD:=$(call AutoLoad,27,libertas libertas_sdio)
endef
define KernelPackage/ar9170
$(call KernelPackage/mac80211/Default)
TITLE:=Atheros AR9170 802.11n USB support
URL:=http://wireless.kernel.org/en/users/Drivers/ar9170
DEPENDS+= @USB_SUPPORT @!LINUX_2_6_25 +kmod-ath +kmod-usb-core
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ar9170/ar9170usb.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,27,ar9170usb)
endef
define KernelPackage/ar9170/description
This is a driver for the Atheros "otus" 802.11n USB devices.
endef
define KernelPackage/mac80211-hwsim
$(call KernelPackage/mac80211/Default)
TITLE:=mac80211 HW simulation device
DEPENDS+= +kmod-mac80211
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko
AUTOLOAD:=$(call AutoLoad,60,mac80211_hwsim)
endef
@ -504,7 +520,7 @@ define KernelPackage/net-libipw
$(call KernelPackage/mac80211/Default)
TITLE:=libipw for ipw2100 and ipw2200
DEPENDS:=@PCI_SUPPORT +kmod-crypto-core +kmod-crypto-arc4 +kmod-crypto-aes +kmod-crypto-michael-mic +kmod-lib80211 +kmod-cfg80211
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/libipw.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/libipw.ko
AUTOLOAD:=$(call AutoLoad,49,libipw)
endef
@ -526,7 +542,7 @@ define KernelPackage/net-ipw2100
$(call KernelPackage/mac80211/Default)
TITLE:=Intel IPW2100 driver
DEPENDS:=@PCI_SUPPORT +kmod-net-libipw
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2100.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2100.ko
AUTOLOAD:=$(call AutoLoad,50,ipw2100)
endef
@ -550,7 +566,7 @@ define KernelPackage/net-ipw2200
$(call KernelPackage/mac80211/Default)
TITLE:=Intel IPW2200 driver
DEPENDS:=@PCI_SUPPORT +kmod-net-libipw
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2200.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ipw2x00/ipw2200.ko
AUTOLOAD:=$(call AutoLoad,50,ipw2200)
endef
@ -566,7 +582,7 @@ define KernelPackage/mwl8k
TITLE:=Driver for Marvell TOPDOG 802.11 Wireless cards
URL:=http://wireless.kernel.org/en/users/Drivers/mwl8k
DEPENDS+= @PCI_SUPPORT +kmod-mac80211
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mwl8k.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mwl8k.ko
AUTOLOAD:=$(call AutoLoad,27,mwl8k)
endef
@ -661,7 +677,7 @@ endef
define KernelPackage/b43
$(call KernelPackage/b43-common)
TITLE:=Broadcom 43xx wireless support
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43/b43.ko
AUTOLOAD:=$(call AutoLoad,30,b43)
MENU:=1
endef
@ -759,7 +775,7 @@ endef
define KernelPackage/b43legacy
$(call KernelPackage/b43-common)
TITLE:=Broadcom 43xx-legacy wireless support
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43legacy/b43legacy.$(LINUX_KMOD_SUFFIX)
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/b43legacy/b43legacy.ko
AUTOLOAD:=$(call AutoLoad,30,b43legacy)
MENU:=1
endef
@ -804,12 +820,11 @@ BUILDFLAGS:= \
$(if $(CONFIG_PCI),-DCONFIG_B43_PCI_AUTOSELECT -DCONFIG_B43_PCICORE_AUTOSELECT) \
$(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS -DCONFIG_B43_LEDS -DCONFIG_B43LEGACY_LEDS -DCONFIG_AR9170_LEDS) \
-DCONFIG_B43_HWRNG -DCONFIG_B43LEGACY_HWRNG \
$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),-DCONFIG_MAC80211_DEBUGFS -DCONFIG_ATH9K_DEBUGFS) \
$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),-DCONFIG_MAC80211_DEBUGFS -DCONFIG_ATH9K_DEBUGFS -DCONFIG_CARL9170_DEBUGFS) \
$(if $(CONFIG_PACKAGE_ATH_DEBUG),-DCONFIG_ATH_DEBUG -DCONFIG_ATH9K_PKTLOG) \
-D__CONFIG_MAC80211_RC_DEFAULT=minstrel \
-DCONFIG_MAC80211_RC_MINSTREL_HT \
$(if $(CONFIG_ATH_USER_REGD),-DATH_USER_REGD=1) \
$(if $(CONFIG_PACKAGE_ATH9K_USE_MINSTREL),-DATH9K_USE_MINSTREL) \
$(if $(CONFIG_PACKAGE_RT2X00_LIB_DEBUGFS),-DCONFIG_RT2X00_LIB_DEBUGFS) \
$(if $(CONFIG_PACKAGE_RT2X00_DEBUG),-DCONFIG_RT2X00_DEBUG) \
$(if $(NEED_RT2X00_LIB_HT),-DCONFIG_RT2X00_LIB_HT) \
@ -821,6 +836,7 @@ BUILDFLAGS:= \
$(if $(CONFIG_PACKAGE_kmod-rt2x00-soc),-DCONFIG_RT2X00_LIB_SOC) \
$(if $(CONFIG_PCI_SUPPORT),-DCONFIG_RT2800PCI_PCI) \
$(if $(CONFIG_TARGET_ramips),-DCONFIG_RT2800PCI_SOC) \
-DCONFIG_P54_SPI_DEFAULT_EEPROM
MAKE_OPTS:= \
CROSS_COMPILE="$(KERNEL_CROSS)" \
@ -845,12 +861,17 @@ MAKE_OPTS:= \
CONFIG_ATH9K_PKTLOG=$(if $(CONFIG_PACKAGE_ATH_DEBUG),y) \
CONFIG_ATH5K=$(if $(CONFIG_PACKAGE_kmod-ath5k),m) \
CONFIG_ATH9K=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \
CONFIG_ATH9K_HW=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \
CONFIG_ATH9K_COMMON=$(if $(CONFIG_PACKAGE_kmod-ath9k),m) \
CONFIG_ATH9K_DEBUGFS=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \
CONFIG_CARL9170=$(if $(CONFIG_PACKAGE_kmod-carl9170),m) \
CONFIG_CARL9170_DEBUGFS=$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),y) \
CONFIG_ZD1211RW=$(if $(CONFIG_PACKAGE_kmod-zd1211rw),m) \
CONFIG_P54_COMMON=$(if $(CONFIG_PACKAGE_kmod-p54-common),m) \
CONFIG_P54_PCI=$(if $(CONFIG_PACKAGE_kmod-p54-pci),m) \
CONFIG_P54_USB=$(if $(CONFIG_PACKAGE_kmod-p54-usb),m) \
CONFIG_P54_SPI= \
CONFIG_P54_SPI=$(if $(CONFIG_PACKAGE_kmod-p54-spi),m) \
CONFIG_P54_SPI_DEFAULT_EEPROM=y \
CONFIG_RT2X00=$(if $(CONFIG_PACKAGE_kmod-rt2x00-lib),m) \
CONFIG_RT2X00_LIB=$(if $(CONFIG_PACKAGE_kmod-rt2x00-lib),m) \
CONFIG_RT2X00_LIB_PCI=$(if $(CONFIG_PACKAGE_kmod-rt2x00-pci),m) \
@ -890,6 +911,7 @@ MAKE_OPTS:= \
CONFIG_LIB80211_CRYPT_CCMP= \
CONFIG_LIB80211_CRYPT_TKIP= \
CONFIG_IWLWIFI= \
CONFIG_COMPAT_IWLWIFI= \
CONFIG_IWLAGN= \
CONFIG_MWL8K=$(if $(CONFIG_PACKAGE_kmod-mwl8k),m) \
CONFIG_ATMEL= \
@ -935,7 +957,7 @@ endef
ifneq ($(CONFIG_PACKAGE_kmod-cfg80211),)
define Build/Compile/kmod
rm -rf $(PKG_BUILD_DIR)/modules
$(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_OPTS) all
$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" $(MAKE_OPTS) all
endef
endif
@ -980,6 +1002,11 @@ define KernelPackage/p54-usb/install
$(INSTALL_DATA) $(DL_DIR)/$(P54USBFW) $(1)/lib/firmware/isl3887usb
endef
define KernelPackage/p54-spi/install
$(INSTALL_DIR) $(1)/lib/firmware
$(INSTALL_DATA) $(DL_DIR)/$(P54SPIFW) $(1)/lib/firmware/3826.arm
endef
define KernelPackage/rt61-pci/install
$(INSTALL_DIR) $(1)/lib/firmware
$(INSTALL_DATA) $(PKG_BUILD_DIR)/rt2?61*.bin $(1)/lib/firmware/
@ -1076,6 +1103,7 @@ $(eval $(call KernelPackage,mac80211))
$(eval $(call KernelPackage,p54-common))
$(eval $(call KernelPackage,p54-pci))
$(eval $(call KernelPackage,p54-usb))
$(eval $(call KernelPackage,p54-spi))
$(eval $(call KernelPackage,rt2x00-lib))
$(eval $(call KernelPackage,rt2x00-pci))
$(eval $(call KernelPackage,rt2x00-usb))
@ -1094,7 +1122,7 @@ $(eval $(call KernelPackage,zd1211rw))
$(eval $(call KernelPackage,mac80211-hwsim))
$(eval $(call KernelPackage,ath9k))
$(eval $(call KernelPackage,ath))
$(eval $(call KernelPackage,ar9170))
$(eval $(call KernelPackage,carl9170))
$(eval $(call KernelPackage,b43))
$(eval $(call KernelPackage,b43legacy))
$(eval $(call KernelPackage,net-libipw))

View File

@ -165,6 +165,14 @@ scan_mac80211() {
config_set "$device" vifs "${ap:+$ap }${adhoc:+$adhoc }${sta:+$sta }${monitor:+$monitor }${mesh:+$mesh}"
}
list_phy_interfaces() {
local phy="$1"
if [ -d "/sys/class/ieee80211/${phy}/device/net" ]; then
ls "/sys/class/ieee80211/${phy}/device/net" 2>/dev/null;
else
ls "/sys/class/ieee80211/${phy}/device" 2>/dev/null | grep net: | sed -e 's,net:,,g'
fi
}
disable_mac80211() (
local device="$1"
@ -181,7 +189,7 @@ disable_mac80211() (
done
include /lib/network
for wdev in $(ls /sys/class/ieee80211/${phy}/device/net 2>/dev/null); do
for wdev in $(list_phy_interfaces "$phy"); do
[ -f "/var/run/$wdev.pid" ] && kill $(cat /var/run/$wdev.pid) >&/dev/null 2>&1
for pid in `pidof wpa_supplicant`; do
grep "$wdev" /proc/$pid/cmdline >/dev/null && \
@ -214,6 +222,7 @@ enable_mac80211() {
local macidx=0
local apidx=0
fixed=""
local hostapd_ctrl=""
[ -n "$country" ] && iw reg set "$country"
[ "$channel" = "auto" -o "$channel" = "0" ] || {
@ -336,6 +345,7 @@ enable_mac80211() {
config_get mode "$vif" mode
config_get ifname "$vif" ifname
[ "$mode" = "ap" ] || continue
hostapd_ctrl="${hostapd_ctrl:-/var/run/hostapd-$phy/$ifname}"
mac80211_start_vif "$vif" "$ifname"
done
}
@ -352,11 +362,18 @@ enable_mac80211() {
adhoc)
config_get bssid "$vif" bssid
config_get ssid "$vif" ssid
iw dev "$ifname" ibss join "$ssid" $freq ${fixed:+fixed-freq} $bssid
config_get mcast_rate "$vif" mcast_rate
local mcval=""
[ -n "$mcast_rate" ] && {
mcval="$(($mcast_rate / 1000))"
mcsub="$(( ($mcast_rate / 100) % 10 ))"
[ "$mcsub" -gt 0 ] && mcval="$mcval.$mcsub"
}
iw dev "$ifname" ibss join "$ssid" $freq ${fixed:+fixed-freq} $bssid ${mcval:+mcast-rate $mcval}
;;
sta)
if eval "type wpa_supplicant_setup_vif" 2>/dev/null >/dev/null; then
wpa_supplicant_setup_vif "$vif" wext || {
wpa_supplicant_setup_vif "$vif" nl80211 "${hostapd_ctrl:+-H $hostapd_ctrl}" || {
echo "enable_mac80211($device): Failed to set up wpa_supplicant for interface $ifname" >&2
# make sure this wifi interface won't accidentally stay open without encryption
ifconfig "$ifname" down
@ -396,7 +413,7 @@ detect_mac80211() {
mode_11n=""
mode_band="g"
channel="5"
channel="11"
ht_cap=0
for cap in $(iw phy "$dev" info | grep 'Capabilities:' | cut -d: -f2); do
ht_cap="$(($ht_cap | $cap))"
@ -408,6 +425,7 @@ detect_mac80211() {
list=" list ht_capab"
[ "$(($ht_cap & 1))" -eq 1 ] && append ht_capab "$list LDPC" "$N"
[ "$(($ht_cap & 16))" -eq 16 ] && append ht_capab "$list GF" "$N"
[ "$(($ht_cap & 32))" -eq 32 ] && append ht_capab "$list SHORT-GI-20" "$N"
[ "$(($ht_cap & 64))" -eq 64 ] && append ht_capab "$list SHORT-GI-40" "$N"
[ "$(($ht_cap & 128))" -eq 128 ] && append ht_capab "$list TX-STBC" "$N"

View File

@ -1,6 +1,6 @@
--- a/config.mk
+++ b/config.mk
@@ -268,8 +268,8 @@ endif
@@ -300,8 +300,8 @@ endif #CONFIG_SSB
CONFIG_P54_PCI=m

View File

@ -1,6 +1,6 @@
--- a/config.mk
+++ b/config.mk
@@ -72,7 +72,7 @@ endif # build check
@@ -74,7 +74,7 @@ endif # build check
endif # kernel Makefile check
# These both are needed by compat-wireless || compat-bluetooth so enable them
@ -9,7 +9,7 @@
ifeq ($(CONFIG_MAC80211),y)
$(error "ERROR: you have MAC80211 compiled into the kernel, CONFIG_MAC80211=y, as such you cannot replace its mac80211 driver. You need this set to CONFIG_MAC80211=m. If you are using Fedora upgrade your kernel as later version should this set as modular. For further information on Fedora see https://bugzilla.redhat.com/show_bug.cgi?id=470143. If you are using your own kernel recompile it and make mac80211 modular")
@@ -495,8 +495,8 @@ endif
@@ -585,8 +585,8 @@ endif #CONFIG_COMPAT_KERNEL_27
# We need the backported rfkill module on kernel < 2.6.31.
# In more recent kernel versions use the in kernel rfkill module.
ifdef CONFIG_COMPAT_KERNEL_31
@ -19,5 +19,5 @@
+# CONFIG_RFKILL_BACKPORT=m
+# CONFIG_RFKILL_BACKPORT_LEDS=y
+# CONFIG_RFKILL_BACKPORT_INPUT=y
endif
endif #CONFIG_COMPAT_KERNEL_31

View File

@ -1,6 +1,6 @@
--- a/config.mk
+++ b/config.mk
@@ -94,8 +94,8 @@ ifndef CONFIG_COMPAT_KERNEL_27
@@ -96,8 +96,8 @@ ifndef CONFIG_COMPAT_KERNEL_27
ifeq ($(CONFIG_BT),y)
# we'll ignore compiling bluetooth
else
@ -9,5 +9,5 @@
+# CONFIG_COMPAT_BLUETOOTH=y
+# CONFIG_COMPAT_BLUETOOTH_MODULES=m
endif
endif # Kernel >= 2.6.26
endif #CONFIG_COMPAT_KERNEL_27

View File

@ -6,9 +6,9 @@
obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/
-obj-$(CONFIG_COMPAT_VAR_MODULES) += drivers/ssb/ drivers/misc/eeprom/
+obj-$(CONFIG_COMPAT_VAR_MODULES) += drivers/misc/eeprom/
endif
obj-$(CONFIG_COMPAT_BLUETOOTH) += net/bluetooth/
ifeq ($(CONFIG_STAGING_EXCLUDE_BUILD),)
obj-$(CONFIG_COMPAT_STAGING) += drivers/staging/ath6kl/
--- a/config.mk
+++ b/config.mk
@@ -9,7 +9,6 @@ ifeq ($(wildcard $(KLIB_BUILD)/.config),
@ -19,11 +19,11 @@
else
include $(KLIB_BUILD)/.config
endif
@@ -251,21 +250,6 @@ CONFIG_IPW2200_QOS=y
#
@@ -283,21 +282,6 @@ CONFIG_IPW2200_QOS=y
# % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface
endif #CONFIG_WIRELESS_EXT
-ifneq ($(CONFIG_SSB),)
-ifdef CONFIG_SSB
-# Sonics Silicon Backplane
-CONFIG_SSB_SPROM=y
-# CONFIG_SSB_DEBUG=y
@ -31,21 +31,21 @@
-CONFIG_SSB_BLOCKIO=y
-CONFIG_SSB_PCIHOST=y
-CONFIG_SSB_B43_PCI_BRIDGE=y
-ifneq ($(CONFIG_PCMCIA),)
-ifdef CONFIG_PCMCIA
-CONFIG_SSB_PCMCIAHOST=y
-endif
-endif #CONFIG_PCMCIA
-# CONFIG_SSB_DEBUG=y
-CONFIG_SSB_DRIVER_PCICORE=y
-endif
-endif #CONFIG_SSB
-
CONFIG_P54_PCI=m
# CONFIG_B44=m
@@ -429,7 +413,6 @@ endif # end of SPI driver list
@@ -485,7 +469,6 @@ endif #CONFIG_SPI_MASTER end of SPI driv
ifneq ($(CONFIG_MMC),)
ifdef CONFIG_MMC
-CONFIG_SSB_SDIOHOST=y
CONFIG_B43_SDIO=y
CONFIG_WL1251_SDIO=m
ifdef CONFIG_CRC7

View File

@ -1,6 +1,15 @@
--- a/config.mk
+++ b/config.mk
@@ -282,13 +282,13 @@ endif
@@ -196,7 +196,7 @@ $(warning "WARNING: CONFIG_CFG80211_WEXT
endif #CONFIG_WIRELESS_EXT
ifneq ($(CONFIG_STAGING),)
- CONFIG_COMPAT_STAGING=m
+# CONFIG_COMPAT_STAGING=m
endif
# mac80211 test driver
@@ -314,13 +314,13 @@ endif #CONFIG_CRC_ITU_T
CONFIG_MWL8K=m
# Ethernet drivers go here
@ -13,24 +22,35 @@
ifdef CONFIG_COMPAT_KERNEL_27
-CONFIG_ATL1C=n
+# CONFIG_ATL1C=n
else
else #CONFIG_COMPAT_KERNEL_27
-CONFIG_ATL1C=m
+# CONFIG_ATL1C=m
endif
endif #CONFIG_COMPAT_KERNEL_27
CONFIG_HERMES=m
@@ -342,10 +342,10 @@ CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
CONFIG_USB_NET_COMPAT_CDCETHER=n
else
ifdef CONFIG_WIRELESS_EXT
@@ -371,17 +371,17 @@ CONFIG_ZD1211RW=m
# Note: this depends on CONFIG_USB_NET_RNDIS_HOST and CONFIG_USB_NET_CDCETHER
# it also requires new RNDIS_HOST and CDC_ETHER modules which we add
ifdef CONFIG_COMPAT_KERNEL_29
-CONFIG_USB_COMPAT_USBNET=n
-CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
-CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
-CONFIG_USB_NET_COMPAT_CDCETHER=n
+# CONFIG_USB_COMPAT_USBNET=n
+# CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
+# CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
+# CONFIG_USB_NET_COMPAT_CDCETHER=n
else #CONFIG_COMPAT_KERNEL_29
-CONFIG_USB_COMPAT_USBNET=m
+# CONFIG_USB_COMPAT_USBNET=m
ifdef CONFIG_USB_NET_CDCETHER
-CONFIG_USB_NET_COMPAT_RNDIS_HOST=m
-CONFIG_USB_NET_COMPAT_RNDIS_WLAN=m
-CONFIG_USB_NET_COMPAT_CDCETHER=m
+# CONFIG_USB_COMPAT_USBNET=m
+# CONFIG_USB_NET_COMPAT_RNDIS_HOST=m
+# CONFIG_USB_NET_COMPAT_RNDIS_WLAN=m
endif #CONFIG_USB_NET_CDCETHER
-CONFIG_USB_NET_COMPAT_CDCETHER=m
+# CONFIG_USB_NET_COMPAT_CDCETHER=m
endif
endif #CONFIG_COMPAT_KERNEL_29

View File

@ -0,0 +1,127 @@
--- a/config.mk
+++ b/config.mk
@@ -132,7 +132,7 @@ CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstr
CONFIG_MAC80211_RC_PID=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_MINSTREL_HT=y
-CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_LEDS=y
# enable mesh networking too
CONFIG_MAC80211_MESH=y
@@ -240,7 +240,7 @@ CONFIG_B43_PCI_AUTOSELECT=y
ifdef CONFIG_PCMCIA
CONFIG_B43_PCMCIA=y
endif #CONFIG_PCMCIA
-CONFIG_B43_LEDS=y
+# CONFIG_B43_LEDS=y
CONFIG_B43_PHY_LP=y
CONFIG_B43_NPHY=y
# CONFIG_B43_FORCE_PIO=y
@@ -249,7 +249,7 @@ CONFIG_B43_NPHY=y
CONFIG_B43LEGACY=m
CONFIG_B43LEGACY_HWRNG=y
CONFIG_B43LEGACY_PCI_AUTOSELECT=y
-CONFIG_B43LEGACY_LEDS=y
+# CONFIG_B43LEGACY_LEDS=y
# CONFIG_B43LEGACY_DEBUG=y
CONFIG_B43LEGACY_DMA=y
CONFIG_B43LEGACY_PIO=y
@@ -542,7 +542,7 @@ endif
# p54
CONFIG_P54_COMMON=m
-CONFIG_P54_LEDS=y
+# CONFIG_P54_LEDS=y
# Atheros
CONFIG_ATH_COMMON=m
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -54,6 +54,7 @@ static void ath_led_blink_work(struct wo
sc->sc_flags |= SC_OP_LED_ON;
}
+#ifdef CONFIG_LEDS_CLASS
static void ath_led_brightness(struct led_classdev *led_cdev,
enum led_brightness brightness)
{
@@ -90,10 +91,12 @@ static void ath_led_brightness(struct le
break;
}
}
+#endif
static int ath_register_led(struct ath_softc *sc, struct ath_led *led,
char *trigger)
{
+#ifdef CONFIG_LEDS_CLASS
int ret;
led->sc = sc;
@@ -108,14 +111,19 @@ static int ath_register_led(struct ath_s
else
led->registered = 1;
return ret;
+#else
+ return 0;
+#endif
}
static void ath_unregister_led(struct ath_led *led)
{
+#ifdef CONFIG_LEDS_CLASS
if (led->registered) {
led_classdev_unregister(&led->led_cdev);
led->registered = 0;
}
+#endif
}
void ath_deinit_leds(struct ath_softc *sc)
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -860,6 +860,7 @@ static void ath9k_led_brightness_work(st
}
}
+#ifdef CONFIG_LEDS_CLASS
static void ath9k_led_brightness(struct led_classdev *led_cdev,
enum led_brightness brightness)
{
@@ -871,6 +872,7 @@ static void ath9k_led_brightness(struct
ieee80211_queue_delayed_work(priv->hw,
&led->brightness_work, 0);
}
+#endif
static void ath9k_led_stop_brightness(struct ath9k_htc_priv *priv)
{
@@ -883,6 +885,7 @@ static void ath9k_led_stop_brightness(st
static int ath9k_register_led(struct ath9k_htc_priv *priv, struct ath_led *led,
char *trigger)
{
+#ifdef CONFIG_LEDS_CLASS
int ret;
led->priv = priv;
@@ -900,14 +903,19 @@ static int ath9k_register_led(struct ath
INIT_DELAYED_WORK(&led->brightness_work, ath9k_led_brightness_work);
return ret;
+#else
+ return 0;
+#endif
}
static void ath9k_unregister_led(struct ath_led *led)
{
+#ifdef CONFIG_LEDS_CLASS
if (led->registered) {
led_classdev_unregister(&led->led_cdev);
led->registered = 0;
}
+#endif
}
void ath9k_deinit_leds(struct ath9k_htc_priv *priv)

View File

@ -1,6 +1,6 @@
--- a/config.mk
+++ b/config.mk
@@ -42,21 +42,6 @@ $(error "ERROR: Your 2.6.27 kernel has C
@@ -42,23 +42,6 @@ $(error "ERROR: Your 2.6.27 kernel has C
endif
endif
@ -13,9 +13,11 @@
-#
-# skb->requeue
-#
-ifeq ($(shell test $(KERNEL_SUBLEVEL) -ge 27 && echo yes),yes)
-# In kernel 2.6.32 both attributes were removed.
-#
-ifeq ($(shell test $(KERNEL_SUBLEVEL) -ge 27 -a $(KERNEL_SUBLEVEL) -le 31 && echo yes),yes)
-ifeq ($(CONFIG_MAC80211),)
-$(error "ERROR: Your >=2.6.27 kernel has CONFIG_MAC80211 disabled, you should have it CONFIG_MAC80211=m if you want to use this thing.")
-$(error "ERROR: Your >=2.6.27 and <= 2.6.31 kernel has CONFIG_MAC80211 disabled, you should have it CONFIG_MAC80211=m if you want to use this thing.")
-endif
-endif
-

View File

@ -9,12 +9,12 @@
else
include $(KLIB_BUILD)/.config
endif
@@ -192,7 +192,7 @@ CONFIG_B43=m
@@ -221,7 +221,7 @@ CONFIG_B43=m
CONFIG_B43_HWRNG=y
CONFIG_B43_PCI_AUTOSELECT=y
ifneq ($(CONFIG_PCMCIA),)
ifdef CONFIG_PCMCIA
-CONFIG_B43_PCMCIA=y
+# CONFIG_B43_PCMCIA=y
endif
CONFIG_B43_LEDS=y
endif #CONFIG_PCMCIA
# CONFIG_B43_LEDS=y
CONFIG_B43_PHY_LP=y

View File

@ -1,11 +1,11 @@
--- a/config.mk
+++ b/config.mk
@@ -398,7 +398,7 @@ endif # end of SPI driver list
@@ -452,7 +452,7 @@ endif #CONFIG_SPI_MASTER end of SPI driv
ifneq ($(CONFIG_MMC),)
ifdef CONFIG_MMC
-CONFIG_B43_SDIO=y
+# CONFIG_B43_SDIO=y
CONFIG_WL1251_SDIO=m
ifndef CONFIG_COMPAT_KERNEL_32
ifdef CONFIG_CRC7
CONFIG_WL1251_SDIO=m

View File

@ -1,8 +1,8 @@
--- a/config.mk
+++ b/config.mk
@@ -196,7 +196,7 @@ ifneq ($(CONFIG_PCMCIA),)
endif
CONFIG_B43_LEDS=y
@@ -225,7 +225,7 @@ ifdef CONFIG_PCMCIA
endif #CONFIG_PCMCIA
# CONFIG_B43_LEDS=y
CONFIG_B43_PHY_LP=y
-CONFIG_B43_NPHY=y
+# CONFIG_B43_NPHY is not set

View File

@ -1,6 +1,6 @@
--- a/config.mk
+++ b/config.mk
@@ -244,12 +244,12 @@ CONFIG_RTL8180=m
@@ -274,12 +274,12 @@ CONFIG_RTL8180=m
CONFIG_ADM8211=m
@ -8,19 +8,19 @@
+# CONFIG_RT2X00_LIB_PCI=m
CONFIG_RT2400PCI=m
CONFIG_RT2500PCI=m
ifneq ($(CONFIG_CRC_CCITT),)
ifdef CONFIG_CRC_CCITT
CONFIG_RT2800PCI=m
-CONFIG_RT2800PCI_PCI=y
+# CONFIG_RT2800PCI_PCI=y
# CONFIG_RT2800PCI_RT30XX=y
# CONFIG_RT2800PCI_RT35XX=y
# CONFIG_RT2800PCI_SOC=y
@@ -355,7 +355,7 @@ CONFIG_RT2800USB_RT30XX=y
@@ -402,7 +402,7 @@ CONFIG_RT2800USB_RT30XX=y
CONFIG_RT2800USB_RT35XX=y
CONFIG_RT2800USB_UNKNOWN=y
endif
endif #CONFIG_CRC_CCITT
-CONFIG_RT2X00_LIB_USB=m
+# CONFIG_RT2X00_LIB_USB=m
NEED_RT2X00=y
# RT73USB requires firmware
ifneq ($(CONFIG_CRC_ITU_T),)
ifdef CONFIG_CRC_ITU_T

View File

@ -3,9 +3,9 @@
@@ -112,7 +112,7 @@ CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
# This is the one used by our compat-wireless net/mac80211/rate.c
# in case you have and old kernel which is overriding this to pid.
CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstrel
CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstrel_ht
-CONFIG_MAC80211_RC_PID=y
+# CONFIG_MAC80211_RC_PID=y
CONFIG_MAC80211_RC_MINSTREL=y
CONFIG_MAC80211_RC_MINSTREL_HT=y
CONFIG_MAC80211_LEDS=y
# CONFIG_MAC80211_LEDS=y

Some files were not shown because too many files have changed in this diff Show More