1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-24 20:53:22 +02:00

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

This commit is contained in:
Xiangfu Liu 2010-06-24 10:03:36 +08:00
commit 1f8cf8c934
107 changed files with 11858 additions and 3477 deletions

View File

@ -102,7 +102,7 @@ menu "Target Images"
source "target/linux/*/image/Config.in"
config TARGET_ROOTFS_FSPART
config TARGET_ROOTFS_PARTSIZE
int "Root filesystem partition size (in MB)"
depends X86_GRUB_IMAGES || TARGET_ROOTFS_EXT2FS || TARGET_rb532
default 48

View File

@ -110,7 +110,7 @@ ifneq ($(CONFIG_TARGET_ROOTFS_TARGZ),)
endif
ifneq ($(CONFIG_TARGET_ROOTFS_EXT2FS),)
E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_FSPART)*1024)))
E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024)))
define Image/mkfs/ext2
$(STAGING_DIR_HOST)/bin/genext2fs -U -b $(E2SIZE) -N $(CONFIG_TARGET_ROOTFS_MAXINODE) -d $(TARGET_DIR)/ $(KDIR)/root.ext2

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006-2008 OpenWrt.org
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=acx
PKG_VERSION:=20080210
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/acx100

View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=base-files
PKG_RELEASE:=43
PKG_RELEASE:=43.1
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/

View File

@ -68,7 +68,36 @@ case "$ACTION" in
ifup)
include /lib/network
scan_interfaces
# Setup aliases
config_set "$INTERFACE" aliases ""
config_set "$INTERFACE" alias_count 0
config_foreach setup_interface_alias alias "$INTERFACE" "$DEVICE"
# Save alias references in state vars
local aliases
config_get aliases "$INTERFACE" aliases
[ -z "$aliases" ] || uci_set_state network "$INTERFACE" aliases "$aliases"
# Make ip6addr of parent iface the main address again
local ip6addr
config_get ip6addr "$INTERFACE" ip6addr
[ -z "$ip6addr" ] || {
ifconfig "$DEVICE" del "$ip6addr"
ifconfig "$DEVICE" add "$ip6addr"
}
# Setup routes
config_foreach "add_route" route
config_foreach "add_route6" route6
;;
ifdown)
# Bring down named aliases
local device=$(uci_get_state network "$INTERFACE" device)
local ifn
for ifn in $(ifconfig | sed -ne "s/^\(\($DEVICE${device:+\|$device}\|br-$INTERFACE\):[^[:space:]]\+\).*/\1/p"); do
ifconfig "$ifn" down
done
;;
esac

View File

@ -11,7 +11,7 @@ addif() {
# PPP devices are configured by pppd, no need to run setup_interface here
case "$INTERFACE" in
ppp*) return 0;;
ppp*|3g-*) return 0;;
ath*) return 0;;
wlan*) return 0;;
esac
@ -46,7 +46,7 @@ delif() {
for ifc in $interfaces; do
config_get iftype "$ifc" type
config_get ifs "$ifc" device
confdevs="$(uci get network.$ifc.ifname)"
confdevs="$(uci_get network.$ifc.ifname)"
for dev in $ifs; do
[ "${dev%%\.*}" = "$INTERFACE" ] && {
list_contains confdevs "$dev" || list_remove ifs "$dev"

View File

@ -8,7 +8,6 @@ DEVICENAME ~~ (null|full|ptmx|tty|zero|gpio|hvc) {
DEVICENAME ~~ (tun|tap[0-9]) {
nothrottle
makedev /dev/net/%DEVICENAME% 0644
next
}
DEVICENAME ~~ (ppp) {

View File

@ -15,6 +15,20 @@ boot() {
rm -f /etc/config/wireless
/sbin/wifi detect > /etc/config/wireless
}
scan_interfaces
local ifc
for ifc in $interfaces; do
local proto
config_get proto "$ifc" proto
local auto
config_get_bool auto "$ifc" auto 1
type "coldplug_interface_$proto" >/dev/null && [ "$auto" = 1 ] && \
coldplug_interface_$proto "$ifc"
done
}
start() {

View File

@ -32,6 +32,7 @@ find_mtd_part() {
jffs2_ready () {
mtdpart="$(find_mtd_part rootfs_data)"
[ -z "$mtdpart" ] && return 1
magic=$(hexdump $mtdpart -n 4 -e '4/1 "%02x"')
[ "$magic" != "deadc0de" ]
}

View File

@ -66,6 +66,52 @@ add_vlan() {
return 1
}
# add dns entries if they are not in resolv.conf yet
add_dns() {
local cfg="$1"; shift
remove_dns "$cfg"
# We may be called by pppd's ip-up which has a nonstandard umask set.
# Create an empty file here and force its permission to 0644, otherwise
# dnsmasq will not be able to re-read the resolv.conf.auto .
[ ! -f /tmp/resolv.conf.auto ] && {
touch /tmp/resolv.conf.auto
chmod 0644 /tmp/resolv.conf.auto
}
local dns
local add
for dns in "$@"; do
grep -qsF "nameserver $dns" /tmp/resolv.conf.auto || {
add="${add:+$add }$dns"
echo "nameserver $dns" >> /tmp/resolv.conf.auto
}
done
[ -n "$cfg" ] && {
uci_set_state network "$cfg" dns "$add"
uci_set_state network "$cfg" resolv_dns "$add"
}
}
# remove dns entries of the given iface
remove_dns() {
local cfg="$1"
[ -n "$cfg" ] && {
[ -f /tmp/resolv.conf.auto ] && {
local dns=$(uci_get_state network "$cfg" resolv_dns)
for dns in $dns; do
sed -i -e "/^nameserver $dns$/d" /tmp/resolv.conf.auto
done
}
uci_revert_state network "$cfg" dns
uci_revert_state network "$cfg" resolv_dns
}
}
# sort the device list, drop duplicates
sort_list() {
local arg="$*"
@ -115,7 +161,18 @@ prepare_interface() {
config_get iftype "$config" type
case "$iftype" in
bridge)
local macaddr
config_get macaddr "$config" macaddr
[ -x /usr/sbin/brctl ] && {
# Remove IPv6 link local addr before adding the iface to the bridge
local llv6="$(ifconfig "$iface")"
case "$llv6" in
*fe80:*/64*)
llv6="${llv6#* fe80:}"
ifconfig "$iface" del "fe80:${llv6%% *}"
;;
esac
ifconfig "br-$config" 2>/dev/null >/dev/null && {
local newdevs devices
config_get devices "$config" device
@ -139,7 +196,7 @@ prepare_interface() {
# result in another setup_interface() call, so we simply stop processing
# the current event at this point.
}
ifconfig "$iface" up 2>/dev/null >/dev/null
ifconfig "$iface" ${macaddr:+hw ether "${macaddr}"} up 2>/dev/null >/dev/null
return 1
}
;;
@ -181,13 +238,7 @@ setup_interface_static() {
[ -z "$ip6addr" ] || $DEBUG ifconfig "$iface" add "$ip6addr"
[ -z "$gateway" ] || $DEBUG route add default gw "$gateway" dev "$iface"
[ -z "$ip6gw" ] || $DEBUG route -A inet6 add default gw "$ip6gw" dev "$iface"
[ -z "$dns" ] || {
for ns in $dns; do
grep "$ns" /tmp/resolv.conf.auto 2>/dev/null >/dev/null || {
echo "nameserver $ns" >> /tmp/resolv.conf.auto
}
done
}
[ -z "$dns" ] || add_dns "$config" $dns
config_get type "$config" TYPE
[ "$type" = "alias" ] && return 0
@ -204,6 +255,25 @@ setup_interface_alias() {
config_get cfg "$config" interface
[ "$parent" == "$cfg" ] || return 0
# parent device and ifname
local p_device p_type
config_get p_device "$cfg" device
config_get p_type "$cfg" type
# select alias ifname
local layer use_iface
config_get layer "$config" layer 2
case "$layer:$p_type" in
# layer 3: e.g. pppoe-wan or pptp-vpn
3:*) use_iface="$iface" ;;
# layer 2 and parent is bridge: e.g. br-wan
2:bridge) use_iface="br-$cfg" ;;
# layer 1: e.g. eth0 or ath0
*) use_iface="$p_device" ;;
esac
# alias counter
local ctr
config_get ctr "$parent" alias_count 0
@ -216,14 +286,14 @@ setup_interface_alias() {
append list "$config"
config_set "$parent" aliases "$list"
iface="$iface:$ctr"
set_interface_ifname "$config" "$iface"
use_iface="$use_iface:$ctr"
set_interface_ifname "$config" "$use_iface"
local proto
config_get proto "$config" proto "static"
case "${proto}" in
static)
setup_interface_static "$iface" "$config"
setup_interface_static "$use_iface" "$config"
;;
*)
echo "Unsupported type '$proto' for alias config '$config'"
@ -233,102 +303,110 @@ setup_interface_alias() {
}
setup_interface() {
local iface_main="$1"
local iface="$1"
local config="$2"
local proto="$3"
local vifmac="$4"
local ip6addr_main=
[ -n "$config" ] || {
config=$(find_config "$iface_main")
config=$(find_config "$iface")
[ "$?" = 0 ] || return 1
}
prepare_interface "$iface_main" "$config" "$vifmac" || return 0
prepare_interface "$iface" "$config" "$vifmac" || return 0
[ "$iface_main" = "br-$config" ] && {
[ "$iface" = "br-$config" ] && {
# need to bring up the bridge and wait a second for
# it to switch to the 'forwarding' state, otherwise
# it will lose its routes...
ifconfig "$iface_main" up
ifconfig "$iface" up
sleep 1
}
# Interface settings
grep "$iface_main:" /proc/net/dev > /dev/null && {
grep "$iface:" /proc/net/dev > /dev/null && {
local mtu macaddr
config_get mtu "$config" mtu
config_get macaddr "$config" macaddr
[ -n "$macaddr" ] && $DEBUG ifconfig "$iface_main" down
$DEBUG ifconfig "$iface_main" ${macaddr:+hw ether "$macaddr"} ${mtu:+mtu $mtu} up
[ -n "$macaddr" ] && $DEBUG ifconfig "$iface" down
$DEBUG ifconfig "$iface" ${macaddr:+hw ether "$macaddr"} ${mtu:+mtu $mtu} up
}
set_interface_ifname "$config" "$iface_main"
set_interface_ifname "$config" "$iface"
pidfile="/var/run/$iface_main.pid"
[ -n "$proto" ] || config_get proto "$config" proto
case "$proto" in
static)
config_get ip6addr_main "$config" ip6addr
setup_interface_static "$iface_main" "$config"
setup_interface_static "$iface" "$config"
;;
dhcp)
local lockfile="/var/lock/dhcp-$iface"
lock "$lockfile"
# prevent udhcpc from starting more than once
lock "/var/lock/dhcp-$iface_main"
local pidfile="/var/run/dhcp-${iface}.pid"
local pid="$(cat "$pidfile" 2>/dev/null)"
if [ -d "/proc/$pid" ] && grep udhcpc "/proc/${pid}/cmdline" >/dev/null 2>/dev/null; then
lock -u "/var/lock/dhcp-$iface_main"
if [ -d "/proc/$pid" ] && grep -qs udhcpc "/proc/${pid}/cmdline"; then
lock -u "$lockfile"
else
local ipaddr netmask hostname proto1 clientid
local ipaddr netmask hostname proto1 clientid 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_bool broadcast "$config" broadcast 0
[ -z "$ipaddr" ] || \
$DEBUG ifconfig "$iface_main" "$ipaddr" ${netmask:+netmask "$netmask"}
$DEBUG ifconfig "$iface" "$ipaddr" ${netmask:+netmask "$netmask"}
# don't stay running in background if dhcp is not the main proto on the interface (e.g. when using pptp)
local dhcpopts
[ ."$proto1" != ."$proto" ] && dhcpopts="-n -q"
$DEBUG eval udhcpc -t 0 -i "$iface_main" ${ipaddr:+-r $ipaddr} ${hostname:+-H $hostname} ${clientid:+-c $clientid} -b -p "$pidfile" ${dhcpopts:- -O rootpath -R &}
lock -u "/var/lock/dhcp-$iface_main"
[ "$broadcast" = 1 ] && broadcast="-O broadcast" || broadcast=
$DEBUG eval udhcpc -t 0 -i "$iface" \
${ipaddr:+-r $ipaddr} \
${hostname:+-H $hostname} \
${clientid:+-c $clientid} \
-b -p "$pidfile" $broadcast \
${dhcpopts:- -O rootpath -R &}
lock -u "$lockfile"
fi
;;
none)
setup_interface_none "$iface_main" "$config"
setup_interface_none "$iface" "$config"
;;
*)
if ( eval "type setup_interface_$proto" ) >/dev/null 2>/dev/null; then
eval "setup_interface_$proto '$iface_main' '$config' '$proto'"
eval "setup_interface_$proto '$iface' '$config' '$proto'"
else
echo "Interface type $proto not supported."
return 1
fi
;;
esac
[ "$proto" = none ] || {
for ifn in `ifconfig | grep "^$iface_main:" | awk '{print $1}'`; do
ifconfig "$ifn" down
done
}
local aliases
config_set "$config" aliases ""
config_set "$config" alias_count 0
config_foreach setup_interface_alias alias "$config" "$iface_main"
config_get aliases "$config" aliases
[ -z "$aliases" ] || uci_set_state network "$config" aliases "$aliases"
# put the ip6addr back to the beginning to become the main ip again
[ -z "$ip6addr_main" ] || {
$DEBUG ifconfig "$iface_main" del "$ip6addr_main"
$DEBUG ifconfig "$iface_main" add "$ip6addr_main"
}
}
stop_interface_dhcp() {
local config="$1"
local ifname
config_get ifname "$config" ifname
local lock="/var/lock/dhcp-${ifname}"
[ -f "$lock" ] && lock -u "$lock"
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"
}
uci -P /var/state revert "network.$config"
}

View File

@ -29,28 +29,6 @@ config_get iface "$cfg" device
# call interface stop handler
( type "stop_interface_$proto" ) >/dev/null 2>/dev/null && eval "stop_interface_$proto '$cfg'"
# make sure all locks are removed
for lock in "/var/lock/dhcp-$iface" "/var/lock/ppp-$iface"; do
[ -f "$lock" ] && {
lock -u "$lock"
sleep 1
}
done
# kill active ppp daemon and other processes
config_get ifname "$cfg" ifname
pids="$(head -n1 -q /var/run/${ifname}.pid /var/run/ppp-${cfg}.pid 2>/dev/null)"
for pid in $pids; do
[ -d "/proc/$pid" ] && {
kill $pid
[ -d "/proc/$pid" ] && {
sleep 1
kill -9 $pid 2>/dev/null >/dev/null
}
}
done
rm -f /var/run/${ifname}.pid /var/run/ppp-${cfg}.pid
config_get ifname "$cfg" ifname
config_get device "$cfg" device
@ -62,6 +40,9 @@ done
config_get iftype "$cfg" type
[ "bridge" = "$iftype" ] && brctl delbr "$ifname" >/dev/null 2>/dev/null
# remove the interface's dns entries
remove_dns "$cfg"
# remove the interface's network state
uci_revert_state network "$1"

View File

@ -11,11 +11,6 @@ change_state () {
uci_set_state "$1" "$2" "$3" "$4"
}
uci_get() {
[ -n "$ifc" ] || return
uci -P /dev/null get "$1" 2>/dev/null
}
setup_interface () {
local old_ip
local old_broadcast
@ -144,21 +139,21 @@ setup_interface () {
}
# DNS
config_get old_dns "$ifc" dns
old_dns=$(uci_get_state network "$ifc" dns)
old_domain=$(uci_get_state network "$ifc" dnsdomain)
user_dns=$(uci_get "network.$ifc.dns")
[ -n "$user_dns" ] && dns="$user_dns"
[ -n "$dns" ] && [ ! -s "${RESOLV_CONF}" -o "$dns" != "$old_dns" ] && {
[ -n "$dns" ] && [ "$dns" != "$old_dns" -o -n "$user_dns" ] && {
echo "udhcpc: setting dns servers: $dns"
echo -n > "${RESOLV_CONF}.tmp"
for i in $dns ; do
echo "nameserver $i" >> "${RESOLV_CONF}.tmp"
done
${domain:+echo search $domain} >> "${RESOLV_CONF}.tmp"
mv "${RESOLV_CONF}.tmp" "$RESOLV_CONF"
add_dns "$ifc" $dns
change_state network "$ifc" dnsdomain "$domain"
change_state network "$ifc" dns "$dns"
[ -n "$domain" ] && [ "$domain" != "$old_domain" ] && {
echo "udhcpc: setting dns domain: $domain"
sed -i -e "${old_domain:+/^search $old_domain$/d; }/^search $domain$/d" "${RESOLV_CONF}"
echo "search $domain" >> "${RESOLV_CONF}"
change_state network "$ifc" dnsdomain "$domain"
}
}
[ -n "$ifc" ] || return

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2009 OpenWrt.org
# Copyright (C) 2009-2010 OpenWrt.org
# Copyright (C) 2010 Vertical Communications
#
# This is free software, licensed under the GNU General Public License v2.
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=block-extroot
PKG_VERSION:=0.0.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006-2009 OpenWrt.org
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=broadcom-diag
PKG_RELEASE:=6
PKG_RELEASE:=7
include $(INCLUDE_DIR)/package.mk

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006-2009 OpenWrt.org
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=broadcom-wl
PKG_VERSION:=4.150.10.5.3
PKG_RELEASE:=6
PKG_RELEASE:=7
WLC_VERSION:=0.2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2

View File

@ -3,7 +3,7 @@
START=50
start () {
loglevel=$(/sbin/uci get "system.@system[0].cronloglevel" 2>/dev/null)
loglevel=$(uci_get "system.@system[0].cronloglevel")
[ -z "$(ls /etc/crontabs/)" ] && exit 1
mkdir -p /var/spool/cron
ln -s /etc/crontabs /var/spool/cron/ 2>/dev/null

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=comgt
PKG_VERSION:=0.32
PKG_RELEASE:=1
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
PKG_SOURCE_URL:=@SF/comgt

View File

@ -6,15 +6,9 @@ config_get proto "$INTERFACE" proto
config_get iface "$INTERFACE" ifname
case "$ACTION" in
ifup)
iptables -I LAN_ACCEPT 1 -i "$iface" -j RETURN
iptables -A FORWARD -o "$iface" -j ACCEPT
iptables -t nat -A POSTROUTING -o "$iface" -j MASQUERADE
set_3g_led 1 1 0
;;
ifdown)
iptables -D LAN_ACCEPT -i "$iface" -j RETURN
iptables -D FORWARD -o "$iface" -j ACCEPT
iptables -t nat -D POSTROUTING -o "$iface" -j MASQUERADE
set_3g_led 0 0 0
;;
esac

View File

@ -9,8 +9,6 @@ set_3g_led() {
scan_3g() {
local device
scan_ppp "$@"
config_get device "$1" device
# try to figure out the device if it's invalid
@ -24,6 +22,7 @@ scan_3g() {
}
# enable 3G with the 3G button by default
local button
config_get button "$1" button
[ -z "$button" ] && {
config_set "$1" button 1
@ -31,6 +30,7 @@ scan_3g() {
}
stop_interface_3g() {
stop_interface_ppp "$1"
set_3g_led 0 0 0
killall gcom >/dev/null 2>/dev/null
}
@ -39,8 +39,11 @@ setup_interface_3g() {
local iface="$1"
local config="$2"
local chat="/etc/chatscripts/3g.chat"
local device
config_get device "$config" device
local maxwait
config_get maxwait "$config" maxwait
maxwait=${maxwait:-20}
while [ ! -e "$device" -a $maxwait -gt 0 ];do # wait for driver loading to catch up
@ -52,9 +55,16 @@ setup_interface_3g() {
/sbin/insmod $module 2>&- >&-
done
local apn
config_get apn "$config" apn
local service
config_get service "$config" service
local pincode
config_get pincode "$config" pincode
local mtu
config_get mtu "$config" mtu
set_3g_led 1 0 1
@ -80,7 +90,7 @@ setup_interface_3g() {
mode="AT_OPSYS=${CODE}"
fi
# Don't assume Option to be default as it breaks with Huawei Cards/Sticks
PINCODE="$pincode" gcom -d "$device" -s /etc/gcom/setpin.gcom || {
echo "$config(3g): Failed to set the PIN code."
set_3g_led 0 0 0

View File

@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=compcache
PKG_VERSION:=0.6.2
PKG_RELEASE:=$(PKG_VERSION)-1
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://compcache.googlecode.com/files/
PKG_MD5SUM:=27aec78dc50e34fb800c74e879057743

View File

@ -1,10 +1,9 @@
#
# Copyright (C) 2008 OpenWrt.org
# Copyright (C) 2008-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id: $
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

View File

@ -12,6 +12,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ifxmips-dsl-api
PKG_BASE_NAME:=drv_dsl_cpe_api_danube
PKG_VERSION:=3.24.4.4
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/drv_dsl_cpe_api-$(PKG_VERSION)
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/

View File

@ -11,6 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_BASE_NAME:=dsl_cpe_control_danube
PKG_VERSION:=3.24.4.4
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/dsl_cpe_control-$(PKG_VERSION)
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/

View File

@ -1,10 +1,9 @@
#
# Copyright (C) 2009 OpenWrt.org
# Copyright (C) 2009-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id: $
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

View File

@ -236,7 +236,7 @@ $(call KernelPackage/ipt/Depends,)
FILES:= \
$(LINUX_DIR)/drivers/net/imq.$(LINUX_KMOD_SUFFIX) \
$(foreach mod,$(IPT_IMQ-m),$(LINUX_DIR)/net/$(mod).$(LINUX_KMOD_SUFFIX))
AUTOLOAD:=$(call AutoLoad,45,$(notdir \
AUTOLOAD:=$(call AutoLoad,46,$(notdir \
imq \
$(IPT_IMQ-m) \
))

View File

@ -10,12 +10,12 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mac80211
PKG_VERSION:=2010-04-28
PKG_VERSION:=2010-05-24
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:=4b8c23ac7f33af7556034635af744c67
PKG_MD5SUM:=3d465dc6e0213964d0349f61c485817f
PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
@ -550,7 +550,7 @@ endef
ifneq ($(CONFIG_B43_EXPERIMENTAL),)
PKG_B43_FWV4_NAME:=broadcom-wl
PKG_B43_FWV4_VERSION:=4.178.10.4
PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl.o
PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
PKG_B43_FWV4_MD5SUM:=14477e8cbbb91b11896affac9b219fdb
@ -578,7 +578,7 @@ PKG_B43_FWV3_SOURCE:=$(PKG_B43_FWV3_NAME)-$(PKG_B43_FWV3_VERSION).o
PKG_B43_FWV3_SOURCE_URL:=http://downloads.openwrt.org/sources/
PKG_B43_FWV3_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3
ifneq ($(CONFIG_B43_OPENFIRMWARE),)
ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
PKG_B43_FWCUTTER_NAME:=b43-fwcutter
PKG_B43_FWCUTTER_VERSION:=3e69531aa65b8f664a0ab00dfc3e2eefeb0cb417
PKG_B43_FWCUTTER_SOURCE:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION).tar.bz2
@ -588,11 +588,11 @@ ifneq ($(CONFIG_B43_OPENFIRMWARE),)
PKG_B43_FWCUTTER_OBJECT:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION)/fwcutter/
else
PKG_B43_FWCUTTER_NAME:=b43-fwcutter
PKG_B43_FWCUTTER_VERSION:=012
PKG_B43_FWCUTTER_VERSION:=013
PKG_B43_FWCUTTER_SOURCE:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION).tar.bz2
PKG_B43_FWCUTTER_PROTO:=default
PKG_B43_FWCUTTER_SOURCE_URL:=http://bu3sch.de/b43/fwcutter/
PKG_B43_FWCUTTER_MD5SUM:=69eadf67b459f313a8d6b37aaabef96c
PKG_B43_FWCUTTER_MD5SUM:=3547ec6c474ac1bc2c4a5bb765b791a4
PKG_B43_FWCUTTER_SUBDIR:=b43-fwcutter-$(PKG_B43_FWCUTTER_VERSION)
PKG_B43_FWCUTTER_OBJECT:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION)/
endif
@ -644,7 +644,7 @@ define KernelPackage/b43/config
choice
prompt "b43 firmware version"
default B43_EXPERIMENTAL
default B43_STABLE
help
This option allows you to select the version of the b43 firmware.
@ -773,14 +773,13 @@ endef
BUILDFLAGS:= \
-I$(PKG_BUILD_DIR)/include \
$(foreach opt,$(CONFOPTS),-DCONFIG_$(opt)) \
$(if $(CONFIG_PCI),-DCONFIG_B43_PCI_AUTOSELECT -DCONFIG_B43_PCICORE_AUTOSELECT -DCONFIG_SSB_DRIVER_PCICORE_POSSIBLE -DCONFIG_SSB_DRIVER_PCICORE) \
$(if $(CONFIG_PCI),-DCONFIG_SSB_PCIHOST_POSSIBLE -DCONFIG_SSB_PCIHOST) \
$(if $(CONFIG_PCI),-DCONFIG_SSB_SPROM) \
$(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_ATH_DEBUG),-DCONFIG_ATH_DEBUG) \
-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) \
@ -808,10 +807,6 @@ MAKE_OPTS:= \
CONFIG_B43_PCMCIA=n CONFIG_B43_PIO=n \
CONFIG_B43_PCI_AUTOSELECT=$(if $(CONFIG_PCI),y) \
CONFIG_B43_PCICORE_AUTOSELECT=$(if $(CONFIG_PCI),y) \
CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=$(if $(CONFIG_PCI),y) \
CONFIG_SSB_DRIVER_PCICORE=$(if $(CONFIG_PCI),y) \
CONFIG_SSB_PCIHOST_POSSIBLE=$(if $(CONFIG_PCI),y) \
CONFIG_SSB_PCIHOST=$(if $(CONFIG_PCI),y) \
CONFIG_B43LEGACY_LEDS=$(CONFIG_LEDS_TRIGGERS) \
CONFIG_B43_LEDS=$(CONFIG_LEDS_TRIGGERS) \
CONFIG_B43_HWRNG=$(if $(CONFIG_HW_RANDOM),y) \
@ -883,6 +878,7 @@ MAKE_OPTS:= \
CONFIG_AR9170_LEDS=$(CONFIG_LEDS_TRIGGERS) \
CONFIG_IWM= \
CONFIG_ATH9K_HTC= \
CONFIG_MAC80211_RC_MINSTREL_HT=y \
MADWIFI= \
OLD_IWL= \
KLIB_BUILD="$(LINUX_DIR)" \
@ -993,7 +989,7 @@ define Build/b43-common
$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_OBJECT)" \
CFLAGS="-I$(STAGING_DIR_HOST)/include -include endian.h"
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_OBJECT)/b43-fwcutter $(STAGING_DIR_HOST)/bin/
ifneq ($(CONFIG_B43_OPENFIRMWARE),)
ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_SUBDIR)/assembler/"
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_SUBDIR)/assembler/b43-asm $(STAGING_DIR_HOST)/bin/
@ -1005,20 +1001,20 @@ endef
define KernelPackage/b43/install
rm -rf $(1)/lib/firmware/
$(call Build/b43-common)
ifneq ($(CONFIG_B43_OPENFIRMWARE),)
ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
tar xzf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
else
tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
endif
$(INSTALL_DIR) $(1)/lib/firmware/
ifneq ($(CONFIG_B43_OPENFIRMWARE),)
ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
$(INSTALL_DIR) $(1)/lib/firmware/b43-open/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/ucode5.fw $(1)/lib/firmware/b43-open/ucode5.fw
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0bsinitvals5.fw $(1)/lib/firmware/b43-open/b0g0bsinitvals5.fw
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0initvals5.fw $(1)/lib/firmware/b43-open/b0g0initvals5.fw
else
b43-fwcutter --unsupported -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)
b43-fwcutter -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)
endif
ifneq ($(CONFIG_B43_FW_SQUASH),)
b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"

View File

@ -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")
@@ -481,8 +481,8 @@ endif
@@ -483,8 +483,8 @@ endif
# 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

View File

@ -1,6 +1,6 @@
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) +=
@@ -30,7 +30,7 @@ obj-$(CONFIG_COMPAT_WIRELESS_MODULES) +=
obj-$(CONFIG_COMPAT_NET_USB_MODULES) += drivers/net/usb/
obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/
@ -9,3 +9,43 @@
endif
obj-$(CONFIG_COMPAT_BLUETOOTH) += net/bluetooth/
--- a/config.mk
+++ b/config.mk
@@ -9,7 +9,6 @@ ifeq ($(wildcard $(KLIB_BUILD)/.config),
CONFIG_PCI=y
CONFIG_USB=y
CONFIG_PCMCIA=y
- CONFIG_SSB=m
else
include $(KLIB_BUILD)/.config
endif
@@ -239,21 +238,6 @@ CONFIG_IPW2200_QOS=y
#
# % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface
-ifneq ($(CONFIG_SSB),)
-# Sonics Silicon Backplane
-CONFIG_SSB_SPROM=y
-# CONFIG_SSB_DEBUG=y
-
-CONFIG_SSB_BLOCKIO=y
-CONFIG_SSB_PCIHOST=y
-CONFIG_SSB_B43_PCI_BRIDGE=y
-ifneq ($(CONFIG_PCMCIA),)
-CONFIG_SSB_PCMCIAHOST=y
-endif
-# CONFIG_SSB_DEBUG=y
-CONFIG_SSB_DRIVER_PCICORE=y
-endif
-
CONFIG_P54_PCI=m
# CONFIG_B44=m
@@ -413,7 +397,6 @@ endif # end of SPI driver list
ifneq ($(CONFIG_MMC),)
-CONFIG_SSB_SDIOHOST=y
CONFIG_B43_SDIO=y
CONFIG_WL1251_SDIO=m

View File

@ -1,6 +1,6 @@
--- a/config.mk
+++ b/config.mk
@@ -286,10 +286,10 @@ endif
@@ -270,10 +270,10 @@ endif
CONFIG_MWL8K=m
# Ethernet drivers go here
@ -15,7 +15,7 @@
CONFIG_HERMES=m
CONFIG_HERMES_CACHE_FW_ON_INIT=y
@@ -342,10 +342,10 @@ CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
@@ -326,10 +326,10 @@ CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
CONFIG_USB_NET_COMPAT_CDCETHER=n
else

View File

@ -1,6 +1,6 @@
--- a/config.mk
+++ b/config.mk
@@ -43,21 +43,6 @@ $(error "ERROR: Your 2.6.27 kernel has C
@@ -42,21 +42,6 @@ $(error "ERROR: Your 2.6.27 kernel has C
endif
endif

View File

@ -6,10 +6,10 @@
CONFIG_USB=y
- CONFIG_PCMCIA=y
+# CONFIG_PCMCIA=y
CONFIG_SSB=m
else
include $(KLIB_BUILD)/.config
@@ -181,7 +181,7 @@ CONFIG_B43=m
endif
@@ -180,7 +180,7 @@ CONFIG_B43=m
CONFIG_B43_HWRNG=y
CONFIG_B43_PCI_AUTOSELECT=y
ifneq ($(CONFIG_PCMCIA),)
@ -18,12 +18,3 @@
endif
CONFIG_B43_LEDS=y
CONFIG_B43_PHY_LP=y
@@ -233,7 +233,7 @@ CONFIG_SSB_BLOCKIO=y
CONFIG_SSB_PCIHOST=y
CONFIG_SSB_B43_PCI_BRIDGE=y
ifneq ($(CONFIG_PCMCIA),)
-CONFIG_SSB_PCMCIAHOST=y
+# CONFIG_SSB_PCMCIAHOST=y
endif
# CONFIG_SSB_DEBUG=y
CONFIG_SSB_DRIVER_PCICORE=y

View File

@ -1,12 +1,10 @@
--- a/config.mk
+++ b/config.mk
@@ -396,8 +396,8 @@ endif # end of SPI driver list
@@ -382,7 +382,7 @@ endif # end of SPI driver list
ifneq ($(CONFIG_MMC),)
-CONFIG_SSB_SDIOHOST=y
-CONFIG_B43_SDIO=y
+# CONFIG_SSB_SDIOHOST=y
+# CONFIG_B43_SDIO=y
CONFIG_WL1251_SDIO=m

View File

@ -1,6 +1,6 @@
--- a/config.mk
+++ b/config.mk
@@ -185,7 +185,7 @@ ifneq ($(CONFIG_PCMCIA),)
@@ -184,7 +184,7 @@ ifneq ($(CONFIG_PCMCIA),)
endif
CONFIG_B43_LEDS=y
CONFIG_B43_PHY_LP=y

View File

@ -1,6 +1,6 @@
--- a/config.mk
+++ b/config.mk
@@ -248,12 +248,12 @@ CONFIG_RTL8180=m
@@ -232,12 +232,12 @@ CONFIG_RTL8180=m
CONFIG_ADM8211=m
@ -15,7 +15,7 @@
# CONFIG_RT2800PCI_RT30XX=y
# CONFIG_RT2800PCI_RT35XX=y
# CONFIG_RT2800PCI_SOC=y
@@ -355,7 +355,7 @@ CONFIG_RT2800USB=m
@@ -339,7 +339,7 @@ CONFIG_RT2800USB=m
# CONFIG_RT2800USB_RT35XX=y
# CONFIG_RT2800USB_UNKNOWN=y
endif

View File

@ -53,7 +53,7 @@
#include <pcmcia/cs_types.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
@@ -70,9 +70,9 @@ static inline struct sk_buff *netdev_all
@@ -67,9 +67,9 @@ static inline struct sk_buff *netdev_all
return skb;
}

View File

@ -11,8 +11,8 @@
{
--- a/compat/compat-2.6.29.c
+++ b/compat/compat-2.6.29.c
@@ -16,7 +16,7 @@
#include <linux/etherdevice.h>
@@ -50,7 +50,7 @@ void netdev_attach_ops(struct net_device
EXPORT_SYMBOL(netdev_attach_ops);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23))
-#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)

View File

@ -1,11 +0,0 @@
--- a/include/linux/compat-2.6.34.h
+++ b/include/linux/compat-2.6.34.h
@@ -197,6 +197,8 @@ do { \
*/
#define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr)
+#define rcu_dereference_check(p, c) rcu_dereference(p)
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)) */
#endif /* LINUX_26_34_COMPAT_H */

View File

@ -1,11 +0,0 @@
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -3,6 +3,8 @@
#include <linux/version.h>
+#include <linux/version.h>
+
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27))
#include_next <linux/tracepoint.h>
#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) */

View File

@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath5k/reset.c
+++ b/drivers/net/wireless/ath/ath5k/reset.c
@@ -1377,10 +1377,18 @@ int ath5k_hw_reset(struct ath5k_hw *ah,
@@ -1374,10 +1374,18 @@ int ath5k_hw_reset(struct ath5k_hw *ah,
* guess we can tweak it and see how it goes ;-)
*/
if (ah->ah_version != AR5K_AR5210) {

View File

@ -10,7 +10,7 @@
#include "regd_common.h"
/*
@@ -588,3 +591,5 @@ u32 ath_regd_get_band_ctl(struct ath_reg
@@ -587,3 +590,5 @@ u32 ath_regd_get_band_ctl(struct ath_reg
}
}
EXPORT_SYMBOL(ath_regd_get_band_ctl);

View File

@ -8,7 +8,7 @@
#include "ath9k.h"
static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = {
@@ -53,21 +54,36 @@ static void ath_pci_read_cachesize(struc
@@ -52,21 +53,36 @@ static void ath_pci_read_cachesize(struc
static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data)
{

View File

@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1380,7 +1380,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
@@ -1400,7 +1400,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
if (ah->config.rx_intr_mitigation) {
REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 500);

View File

@ -1,130 +0,0 @@
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -78,6 +78,90 @@ static const struct file_operations fops
#define DMA_BUF_LEN 1024
+static ssize_t read_file_tx_chainmask(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath_softc *sc = file->private_data;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ char buf[32];
+ unsigned int len;
+
+ len = snprintf(buf, sizeof(buf), "0x%08x\n", common->tx_chainmask);
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+}
+
+static ssize_t write_file_tx_chainmask(struct file *file, const char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath_softc *sc = file->private_data;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ unsigned long mask;
+ char buf[32];
+ ssize_t len;
+
+ len = min(count, sizeof(buf) - 1);
+ if (copy_from_user(buf, user_buf, len))
+ return -EINVAL;
+
+ buf[len] = '\0';
+ if (strict_strtoul(buf, 0, &mask))
+ return -EINVAL;
+
+ common->tx_chainmask = mask;
+ sc->sc_ah->caps.tx_chainmask = mask;
+ return count;
+}
+
+static const struct file_operations fops_tx_chainmask = {
+ .read = read_file_tx_chainmask,
+ .write = write_file_tx_chainmask,
+ .open = ath9k_debugfs_open,
+ .owner = THIS_MODULE
+};
+
+
+static ssize_t read_file_rx_chainmask(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath_softc *sc = file->private_data;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ char buf[32];
+ unsigned int len;
+
+ len = snprintf(buf, sizeof(buf), "0x%08x\n", common->rx_chainmask);
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+}
+
+static ssize_t write_file_rx_chainmask(struct file *file, const char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath_softc *sc = file->private_data;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ unsigned long mask;
+ char buf[32];
+ ssize_t len;
+
+ len = min(count, sizeof(buf) - 1);
+ if (copy_from_user(buf, user_buf, len))
+ return -EINVAL;
+
+ buf[len] = '\0';
+ if (strict_strtoul(buf, 0, &mask))
+ return -EINVAL;
+
+ common->rx_chainmask = mask;
+ sc->sc_ah->caps.rx_chainmask = mask;
+ return count;
+}
+
+static const struct file_operations fops_rx_chainmask = {
+ .read = read_file_rx_chainmask,
+ .write = write_file_rx_chainmask,
+ .open = ath9k_debugfs_open,
+ .owner = THIS_MODULE
+};
+
+
static ssize_t read_file_dma(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
@@ -731,6 +815,16 @@ int ath9k_init_debug(struct ath_hw *ah)
goto err;
#endif
+ sc->debug.debugfs_rx_chainmask = debugfs_create_file("rx_chainmask",
+ S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, &fops_rx_chainmask);
+ if (!sc->debug.debugfs_rx_chainmask)
+ goto err;
+
+ sc->debug.debugfs_tx_chainmask = debugfs_create_file("tx_chainmask",
+ S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, &fops_tx_chainmask);
+ if (!sc->debug.debugfs_tx_chainmask)
+ goto err;
+
sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUSR,
sc->debug.debugfs_phy, sc, &fops_dma);
if (!sc->debug.debugfs_dma)
@@ -781,6 +875,8 @@ void ath9k_exit_debug(struct ath_hw *ah)
struct ath_common *common = ath9k_hw_common(ah);
struct ath_softc *sc = (struct ath_softc *) common->priv;
+ debugfs_remove(sc->debug.debugfs_tx_chainmask);
+ debugfs_remove(sc->debug.debugfs_rx_chainmask);
debugfs_remove(sc->debug.debugfs_recv);
debugfs_remove(sc->debug.debugfs_xmit);
debugfs_remove(sc->debug.debugfs_wiphy);
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -152,6 +152,8 @@ struct ath_stats {
};
struct ath9k_debug {
+ struct dentry *debugfs_rx_chainmask;
+ struct dentry *debugfs_tx_chainmask;
struct dentry *debugfs_phy;
struct dentry *debugfs_debug;
struct dentry *debugfs_dma;

File diff suppressed because it is too large Load Diff

View File

@ -1,128 +0,0 @@
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -795,6 +795,86 @@ static const struct file_operations fops
.owner = THIS_MODULE
};
+static ssize_t read_file_regidx(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath_softc *sc = file->private_data;
+ char buf[32];
+ unsigned int len;
+
+ len = snprintf(buf, sizeof(buf), "0x%08x\n", sc->debug.regidx);
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+}
+
+static ssize_t write_file_regidx(struct file *file, const char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath_softc *sc = file->private_data;
+ unsigned long regidx;
+ char buf[32];
+ ssize_t len;
+
+ len = min(count, sizeof(buf) - 1);
+ if (copy_from_user(buf, user_buf, len))
+ return -EINVAL;
+
+ buf[len] = '\0';
+ if (strict_strtoul(buf, 0, &regidx))
+ return -EINVAL;
+
+ sc->debug.regidx = regidx;
+ return count;
+}
+
+static const struct file_operations fops_regidx = {
+ .read = read_file_regidx,
+ .write = write_file_regidx,
+ .open = ath9k_debugfs_open,
+ .owner = THIS_MODULE
+};
+
+static ssize_t read_file_regval(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath_softc *sc = file->private_data;
+ struct ath_hw *ah = sc->sc_ah;
+ char buf[32];
+ unsigned int len;
+ u32 regval;
+
+ regval = REG_READ_D(ah, sc->debug.regidx);
+ len = snprintf(buf, sizeof(buf), "0x%08x\n", regval);
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+}
+
+static ssize_t write_file_regval(struct file *file, const char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath_softc *sc = file->private_data;
+ struct ath_hw *ah = sc->sc_ah;
+ unsigned long regval;
+ char buf[32];
+ ssize_t len;
+
+ len = min(count, sizeof(buf) - 1);
+ if (copy_from_user(buf, user_buf, len))
+ return -EINVAL;
+
+ buf[len] = '\0';
+ if (strict_strtoul(buf, 0, &regval))
+ return -EINVAL;
+
+ REG_WRITE_D(ah, sc->debug.regidx, regval);
+ return count;
+}
+
+static const struct file_operations fops_regval = {
+ .read = read_file_regval,
+ .write = write_file_regval,
+ .open = ath9k_debugfs_open,
+ .owner = THIS_MODULE
+};
+
int ath9k_init_debug(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
@@ -864,6 +944,17 @@ int ath9k_init_debug(struct ath_hw *ah)
if (!sc->debug.debugfs_recv)
goto err;
+ sc->debug.regidx = 0;
+ sc->debug.debugfs_regidx = debugfs_create_file("regidx",
+ S_IRUSR|S_IWUSR, sc->debug.debugfs_phy, sc, &fops_regidx);
+ if (!sc->debug.debugfs_regidx)
+ goto err;
+
+ sc->debug.debugfs_regval = debugfs_create_file("regval",
+ S_IRUSR|S_IWUSR, sc->debug.debugfs_phy, sc, &fops_regval);
+ if (!sc->debug.debugfs_regval)
+ goto err;
+
return 0;
err:
ath9k_exit_debug(ah);
@@ -877,6 +968,8 @@ void ath9k_exit_debug(struct ath_hw *ah)
debugfs_remove(sc->debug.debugfs_tx_chainmask);
debugfs_remove(sc->debug.debugfs_rx_chainmask);
+ debugfs_remove(sc->debug.debugfs_regval);
+ debugfs_remove(sc->debug.debugfs_regidx);
debugfs_remove(sc->debug.debugfs_recv);
debugfs_remove(sc->debug.debugfs_xmit);
debugfs_remove(sc->debug.debugfs_wiphy);
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -162,6 +162,9 @@ struct ath9k_debug {
struct dentry *debugfs_wiphy;
struct dentry *debugfs_xmit;
struct dentry *debugfs_recv;
+ struct dentry *debugfs_regidx;
+ struct dentry *debugfs_regval;
+ u32 regidx;
struct ath_stats stats;
};

View File

@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -686,7 +686,11 @@ void ath9k_set_hw_capab(struct ath_softc
@@ -689,7 +689,11 @@ void ath9k_set_hw_capab(struct ath_softc
hw->sta_data_size = sizeof(struct ath_node);
hw->vif_data_size = sizeof(struct ath_vif);

View File

@ -0,0 +1,36 @@
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1497,6 +1497,7 @@ EXPORT_SYMBOL(ath9k_hw_keyreset);
bool ath9k_hw_keysetmac(struct ath_hw *ah, u16 entry, const u8 *mac)
{
u32 macHi, macLo;
+ u32 unicast_flag = AR_KEYTABLE_VALID;
if (entry >= ah->caps.keycache_size) {
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
@@ -1505,6 +1506,16 @@ bool ath9k_hw_keysetmac(struct ath_hw *a
}
if (mac != NULL) {
+ /*
+ * AR_KEYTABLE_VALID indicates that the address is a unicast
+ * address, which must match the transmitter address for
+ * decrypting frames.
+ * Not setting this bit allows the hardware to use the key
+ * for multicast frame decryption.
+ */
+ if (mac[0] & 0x01)
+ unicast_flag = 0;
+
macHi = (mac[5] << 8) | mac[4];
macLo = (mac[3] << 24) |
(mac[2] << 16) |
@@ -1517,7 +1528,7 @@ bool ath9k_hw_keysetmac(struct ath_hw *a
macLo = macHi = 0;
}
REG_WRITE(ah, AR_KEYTABLE_MAC0(entry), macLo);
- REG_WRITE(ah, AR_KEYTABLE_MAC1(entry), macHi | AR_KEYTABLE_VALID);
+ REG_WRITE(ah, AR_KEYTABLE_MAC1(entry), macHi | unicast_flag);
return true;
}

View File

@ -1,34 +0,0 @@
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -76,6 +76,7 @@ struct cfg80211_registered_device {
/* current channel */
struct ieee80211_channel *channel;
+ enum nl80211_channel_type channel_type;
/* must be last because of the way we do wiphy_priv(),
* and it should at least be aligned to NETDEV_ALIGN */
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -97,6 +97,7 @@ int rdev_set_freq(struct cfg80211_regist
return result;
rdev->channel = chan;
+ rdev->channel_type = channel_type;
return 0;
}
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -887,6 +887,11 @@ static int nl80211_send_iface(struct sk_
NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx);
NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, dev->name);
NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, dev->ieee80211_ptr->iftype);
+ if (rdev->channel) {
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, rdev->channel->center_freq);
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, rdev->channel_type);
+ }
+
NLA_PUT_U32(msg, NL80211_ATTR_GENERATION,
rdev->devlist_generation ^

View File

@ -0,0 +1,72 @@
--- a/drivers/net/wireless/ath/ath9k/common.c
+++ b/drivers/net/wireless/ath/ath9k/common.c
@@ -211,10 +211,14 @@ static int ath_reserve_key_cache_slot_tk
return -1;
}
-static int ath_reserve_key_cache_slot(struct ath_common *common)
+static int ath_reserve_key_cache_slot(struct ath_common *common,
+ enum ieee80211_key_alg alg)
{
int i;
+ if (alg == ALG_TKIP)
+ return ath_reserve_key_cache_slot_tkip(common);
+
/* First, try to find slots that would not be available for TKIP. */
if (common->splitmic) {
for (i = IEEE80211_WEP_NKID; i < common->keymax / 4; i++) {
@@ -283,6 +287,7 @@ int ath9k_cmn_key_config(struct ath_comm
struct ath_hw *ah = common->ah;
struct ath9k_keyval hk;
const u8 *mac = NULL;
+ u8 gmac[ETH_ALEN];
int ret = 0;
int idx;
@@ -306,9 +311,23 @@ int ath9k_cmn_key_config(struct ath_comm
memcpy(hk.kv_val, key->key, key->keylen);
if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
- /* For now, use the default keys for broadcast keys. This may
- * need to change with virtual interfaces. */
- idx = key->keyidx;
+ switch (vif->type) {
+ case NL80211_IFTYPE_AP:
+ memcpy(gmac, vif->addr, ETH_ALEN);
+ gmac[0] |= 0x01;
+ mac = gmac;
+ idx = ath_reserve_key_cache_slot(common, key->alg);
+ break;
+ case NL80211_IFTYPE_ADHOC:
+ memcpy(gmac, sta->addr, ETH_ALEN);
+ gmac[0] |= 0x01;
+ mac = gmac;
+ idx = ath_reserve_key_cache_slot(common, key->alg);
+ break;
+ default:
+ idx = key->keyidx;
+ break;
+ }
} else if (key->keyidx) {
if (WARN_ON(!sta))
return -EOPNOTSUPP;
@@ -325,14 +344,12 @@ int ath9k_cmn_key_config(struct ath_comm
return -EOPNOTSUPP;
mac = sta->addr;
- if (key->alg == ALG_TKIP)
- idx = ath_reserve_key_cache_slot_tkip(common);
- else
- idx = ath_reserve_key_cache_slot(common);
- if (idx < 0)
- return -ENOSPC; /* no free key cache entries */
+ idx = ath_reserve_key_cache_slot(common, key->alg);
}
+ if (idx < 0)
+ return -ENOSPC; /* no free key cache entries */
+
if (key->alg == ALG_TKIP)
ret = ath_setkey_tkip(common, idx, key->key, &hk, mac,
vif->type == NL80211_IFTYPE_AP);

View File

@ -0,0 +1,255 @@
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -622,234 +622,6 @@ static u32 ath_get_extchanmode(struct at
return chanmode;
}
-static int ath_setkey_tkip(struct ath_common *common, u16 keyix, const u8 *key,
- struct ath9k_keyval *hk, const u8 *addr,
- bool authenticator)
-{
- struct ath_hw *ah = common->ah;
- const u8 *key_rxmic;
- const u8 *key_txmic;
-
- key_txmic = key + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY;
- key_rxmic = key + NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY;
-
- if (addr == NULL) {
- /*
- * Group key installation - only two key cache entries are used
- * regardless of splitmic capability since group key is only
- * used either for TX or RX.
- */
- if (authenticator) {
- memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic));
- memcpy(hk->kv_txmic, key_txmic, sizeof(hk->kv_mic));
- } else {
- memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
- memcpy(hk->kv_txmic, key_rxmic, sizeof(hk->kv_mic));
- }
- return ath9k_hw_set_keycache_entry(ah, keyix, hk, addr);
- }
- if (!common->splitmic) {
- /* TX and RX keys share the same key cache entry. */
- memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
- memcpy(hk->kv_txmic, key_txmic, sizeof(hk->kv_txmic));
- return ath9k_hw_set_keycache_entry(ah, keyix, hk, addr);
- }
-
- /* Separate key cache entries for TX and RX */
-
- /* TX key goes at first index, RX key at +32. */
- memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic));
- if (!ath9k_hw_set_keycache_entry(ah, keyix, hk, NULL)) {
- /* TX MIC entry failed. No need to proceed further */
- ath_print(common, ATH_DBG_FATAL,
- "Setting TX MIC Key Failed\n");
- return 0;
- }
-
- memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
- /* XXX delete tx key on failure? */
- return ath9k_hw_set_keycache_entry(ah, keyix + 32, hk, addr);
-}
-
-static int ath_reserve_key_cache_slot_tkip(struct ath_common *common)
-{
- int i;
-
- for (i = IEEE80211_WEP_NKID; i < common->keymax / 2; i++) {
- if (test_bit(i, common->keymap) ||
- test_bit(i + 64, common->keymap))
- continue; /* At least one part of TKIP key allocated */
- if (common->splitmic &&
- (test_bit(i + 32, common->keymap) ||
- test_bit(i + 64 + 32, common->keymap)))
- continue; /* At least one part of TKIP key allocated */
-
- /* Found a free slot for a TKIP key */
- return i;
- }
- return -1;
-}
-
-static int ath_reserve_key_cache_slot(struct ath_common *common)
-{
- int i;
-
- /* First, try to find slots that would not be available for TKIP. */
- if (common->splitmic) {
- for (i = IEEE80211_WEP_NKID; i < common->keymax / 4; i++) {
- if (!test_bit(i, common->keymap) &&
- (test_bit(i + 32, common->keymap) ||
- test_bit(i + 64, common->keymap) ||
- test_bit(i + 64 + 32, common->keymap)))
- return i;
- if (!test_bit(i + 32, common->keymap) &&
- (test_bit(i, common->keymap) ||
- test_bit(i + 64, common->keymap) ||
- test_bit(i + 64 + 32, common->keymap)))
- return i + 32;
- if (!test_bit(i + 64, common->keymap) &&
- (test_bit(i , common->keymap) ||
- test_bit(i + 32, common->keymap) ||
- test_bit(i + 64 + 32, common->keymap)))
- return i + 64;
- if (!test_bit(i + 64 + 32, common->keymap) &&
- (test_bit(i, common->keymap) ||
- test_bit(i + 32, common->keymap) ||
- test_bit(i + 64, common->keymap)))
- return i + 64 + 32;
- }
- } else {
- for (i = IEEE80211_WEP_NKID; i < common->keymax / 2; i++) {
- if (!test_bit(i, common->keymap) &&
- test_bit(i + 64, common->keymap))
- return i;
- if (test_bit(i, common->keymap) &&
- !test_bit(i + 64, common->keymap))
- return i + 64;
- }
- }
-
- /* No partially used TKIP slots, pick any available slot */
- for (i = IEEE80211_WEP_NKID; i < common->keymax; i++) {
- /* Do not allow slots that could be needed for TKIP group keys
- * to be used. This limitation could be removed if we know that
- * TKIP will not be used. */
- if (i >= 64 && i < 64 + IEEE80211_WEP_NKID)
- continue;
- if (common->splitmic) {
- if (i >= 32 && i < 32 + IEEE80211_WEP_NKID)
- continue;
- if (i >= 64 + 32 && i < 64 + 32 + IEEE80211_WEP_NKID)
- continue;
- }
-
- if (!test_bit(i, common->keymap))
- return i; /* Found a free slot for a key */
- }
-
- /* No free slot found */
- return -1;
-}
-
-static int ath_key_config(struct ath_common *common,
- struct ieee80211_vif *vif,
- struct ieee80211_sta *sta,
- struct ieee80211_key_conf *key)
-{
- struct ath_hw *ah = common->ah;
- struct ath9k_keyval hk;
- const u8 *mac = NULL;
- int ret = 0;
- int idx;
-
- memset(&hk, 0, sizeof(hk));
-
- switch (key->alg) {
- case ALG_WEP:
- hk.kv_type = ATH9K_CIPHER_WEP;
- break;
- case ALG_TKIP:
- hk.kv_type = ATH9K_CIPHER_TKIP;
- break;
- case ALG_CCMP:
- hk.kv_type = ATH9K_CIPHER_AES_CCM;
- break;
- default:
- return -EOPNOTSUPP;
- }
-
- hk.kv_len = key->keylen;
- memcpy(hk.kv_val, key->key, key->keylen);
-
- if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
- /* For now, use the default keys for broadcast keys. This may
- * need to change with virtual interfaces. */
- idx = key->keyidx;
- } else if (key->keyidx) {
- if (WARN_ON(!sta))
- return -EOPNOTSUPP;
- mac = sta->addr;
-
- if (vif->type != NL80211_IFTYPE_AP) {
- /* Only keyidx 0 should be used with unicast key, but
- * allow this for client mode for now. */
- idx = key->keyidx;
- } else
- return -EIO;
- } else {
- if (WARN_ON(!sta))
- return -EOPNOTSUPP;
- mac = sta->addr;
-
- if (key->alg == ALG_TKIP)
- idx = ath_reserve_key_cache_slot_tkip(common);
- else
- idx = ath_reserve_key_cache_slot(common);
- if (idx < 0)
- return -ENOSPC; /* no free key cache entries */
- }
-
- if (key->alg == ALG_TKIP)
- ret = ath_setkey_tkip(common, idx, key->key, &hk, mac,
- vif->type == NL80211_IFTYPE_AP);
- else
- ret = ath9k_hw_set_keycache_entry(ah, idx, &hk, mac);
-
- if (!ret)
- return -EIO;
-
- set_bit(idx, common->keymap);
- if (key->alg == ALG_TKIP) {
- set_bit(idx + 64, common->keymap);
- if (common->splitmic) {
- set_bit(idx + 32, common->keymap);
- set_bit(idx + 64 + 32, common->keymap);
- }
- }
-
- return idx;
-}
-
-static void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key)
-{
- struct ath_hw *ah = common->ah;
-
- ath9k_hw_keyreset(ah, key->hw_key_idx);
- if (key->hw_key_idx < IEEE80211_WEP_NKID)
- return;
-
- clear_bit(key->hw_key_idx, common->keymap);
- if (key->alg != ALG_TKIP)
- return;
-
- clear_bit(key->hw_key_idx + 64, common->keymap);
- if (common->splitmic) {
- ath9k_hw_keyreset(ah, key->hw_key_idx + 32);
- clear_bit(key->hw_key_idx + 32, common->keymap);
- clear_bit(key->hw_key_idx + 64 + 32, common->keymap);
- }
-}
-
static void ath9k_bss_assoc_info(struct ath_softc *sc,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf)
@@ -1814,7 +1586,7 @@ static int ath9k_set_key(struct ieee8021
switch (cmd) {
case SET_KEY:
- ret = ath_key_config(common, vif, sta, key);
+ ret = ath9k_cmn_key_config(common, vif, sta, key);
if (ret >= 0) {
key->hw_key_idx = ret;
/* push IV and Michael MIC generation to stack */
@@ -1827,7 +1599,7 @@ static int ath9k_set_key(struct ieee8021
}
break;
case DISABLE_KEY:
- ath_key_delete(common, key);
+ ath9k_cmn_key_delete(common, key);
break;
default:
ret = -EINVAL;

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +0,0 @@
--- a/drivers/net/wireless/ath/ath9k/common.c
+++ b/drivers/net/wireless/ath/ath9k/common.c
@@ -57,13 +57,19 @@ static bool ath9k_rx_accept(struct ath_c
* rs_more indicates chained descriptors which can be used
* to link buffers together for a sort of scatter-gather
* operation.
- *
+ * reject the frame, we don't support scatter-gather yet and
+ * the frame is probably corrupt anyway
+ */
+ if (rx_stats->rs_more)
+ return false;
+
+ /*
* The rx_stats->rs_status will not be set until the end of the
* chained descriptors so it can be ignored if rs_more is set. The
* rs_more will be false at the last element of the chained
* descriptors.
*/
- if (!rx_stats->rs_more && rx_stats->rs_status != 0) {
+ if (rx_stats->rs_status != 0) {
if (rx_stats->rs_status & ATH9K_RXERR_CRC)
rxs->flag |= RX_FLAG_FAILED_FCS_CRC;
if (rx_stats->rs_status & ATH9K_RXERR_PHY)

View File

@ -1,6 +1,6 @@
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -225,6 +225,7 @@ void rt2x00pci_uninitialize(struct rt2x0
@@ -216,6 +216,7 @@ void rt2x00pci_uninitialize(struct rt2x0
}
EXPORT_SYMBOL_GPL(rt2x00pci_uninitialize);
@ -8,7 +8,7 @@
/*
* PCI driver handlers.
*/
@@ -399,6 +400,7 @@ int rt2x00pci_resume(struct pci_dev *pci
@@ -390,6 +391,7 @@ int rt2x00pci_resume(struct pci_dev *pci
}
EXPORT_SYMBOL_GPL(rt2x00pci_resume);
#endif /* CONFIG_PM */

View File

@ -1,11 +0,0 @@
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -215,7 +215,7 @@ void rt2x00pci_uninitialize(struct rt2x0
/*
* Free irq line.
*/
- free_irq(to_pci_dev(rt2x00dev->dev)->irq, rt2x00dev);
+ free_irq(rt2x00dev->irq, rt2x00dev);
/*
* Free DMA

View File

@ -1,6 +1,6 @@
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -3850,6 +3850,7 @@ MODULE_FIRMWARE("mwl8k/helper_8366.fw");
@@ -3882,6 +3882,7 @@ MODULE_FIRMWARE("mwl8k/helper_8366.fw");
MODULE_FIRMWARE("mwl8k/fmimage_8366.fw");
static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {

View File

@ -1,11 +1,11 @@
# Copyright (C) 2009 OpenWrt.org
# Copyright (C) 2009-2010 OpenWrt.org
# All rights reserved.
include $(TOPDIR)/rules.mk
PKG_NAME:=mountd
PKG_VERSION:=0.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2009 Jo-Philipp Wich <xm@subsignal.org>
# Copyright (C) 2009-2010 Jo-Philipp Wich <xm@subsignal.org>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=nvram
PKG_RELEASE:=6
PKG_RELEASE:=7
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

View File

@ -52,7 +52,13 @@ fixup_linksys() {
}
;;
"1071") #0x042f
nvram_set sdram_init "$(printf 0x%04x $(( $(/usr/sbin/nvram get sdram_init) | 0x0009 )))"
# do sanity check first! max 0x0011 = 128mb
SDRAM_INIT=$(printf %d $(/usr/sbin/nvram get sdram_init))
[ "$SDRAM_INIT" -lt "9" -o "$SDRAM_INIT" -gt "17" ] && {
# set this to default: 0x09 only if value is invaild like 16MB on Asus WL-500GP
echo "sdram_init is invaild: $(printf 0x%04x $SDRAM_INIT), force to default!"
nvram_set sdram_init 0x0009
}
[ "$COMMIT" = 1 ] && {
nvram_set sdram_ncdl 0x0
}

View File

@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ppp
PKG_VERSION:=2.4.4
PKG_RELEASE:=5
PKG_RELEASE:=7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/
@ -140,7 +140,7 @@ define Package/ppp/install
$(INSTALL_BIN) ./files/etc/ppp/ipv6-up $(1)/etc/ppp/
$(INSTALL_BIN) ./files/etc/ppp/ipv6-down $(1)/etc/ppp/
$(INSTALL_DATA) ./files/etc/ppp/options $(1)/etc/ppp/
ln -sf /tmp/resolv.conf.auto $(1)/etc/ppp/resolv.conf
ln -sf /tmp/resolv.conf.ppp $(1)/etc/ppp/resolv.conf
endef
define Package/ppp-mod-pppoa/install
@ -149,6 +149,8 @@ define Package/ppp-mod-pppoa/install
$(1)/usr/lib/pppd/$(PKG_VERSION)/
$(INSTALL_DIR) $(1)/lib/network
$(INSTALL_BIN) ./files/pppoa.sh $(1)/lib/network/
$(INSTALL_DIR) $(1)/etc/hotplug.d/atm
$(INSTALL_DATA) ./files/etc/hotplug.d/atm/20-atm-modem $(1)/etc/hotplug.d/atm/
endef
define Package/ppp-mod-pppoe/install

View File

@ -0,0 +1,25 @@
#!/bin/sh
if [ "$ACTION" = "add" ]; then
include /lib/network
scan_interfaces
local found=0
local ifc
for ifc in $interfaces; do
local up
config_get_bool up "$ifc" up 0
local proto
config_get proto "$ifc" proto
if [ "$proto" = "pppoa" ] && [ "$up" != 1 ]; then
found=1
( sleep 1; ifup "$ifc" ) &
fi
done
if [ "$found" != 1 ]; then
logger "Found no matching interface for DSL device $DEVICENAME"
fi
fi

View File

@ -1,22 +1,25 @@
#!/bin/sh
. /etc/functions.sh
. /lib/network/config.sh
PPP_IFACE="$1"
PPP_TTY="$2"
PPP_SPEED="$3"
PPP_LOCAL="$4"
PPP_REMOTE="$5"
PPP_IPPARAM="$(echo $6 | sed 's/\./_/g')"
PPP_UNIT="${PPP_IFACE##ppp}"
export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
[ -z "$PPP_IPPARAM" -o -z "$PPP_LOCAL" ] || {
uci_set_state network "$PPP_IPPARAM" unit "$PPP_UNIT"
uci_set_state network "$PPP_IPPARAM" ifname "$PPP_IFACE"
uci_set_state network "$PPP_IPPARAM" ipaddr "$PPP_LOCAL"
uci_set_state network "$PPP_IPPARAM" gateway "$PPP_REMOTE"
local dns="$DNS1${DNS2:+ $DNS2}"
[ -n "$dns" ] && uci_set_state network "$PPP_IPPARAM" dns "$dns"
[ -n "$dns" ] && add_dns "$PPP_IPPARAM" $dns
}
[ -z "$PPP_IPPARAM" ] || env -i ACTION="ifup" INTERFACE="$PPP_IPPARAM" DEVICE="$PPP_IFACE" PROTO=ppp /sbin/hotplug-call "iface"
[ -d /etc/ppp/ip-up.d ] && {

View File

@ -1,63 +1,40 @@
scan_ppp() {
config_get ifname "$1" ifname
pppdev="${pppdev:-0}"
config_get devunit "$1" unit
{
unit=
pppif=
if [ ! -d /tmp/.ppp-counter ]; then
mkdir -p /tmp/.ppp-counter
fi
local maxunit
maxunit="$(cat /tmp/.ppp-counter/max-unit 2>/dev/null)"
if [ -z "$maxunit" ]; then
maxunit=-1
fi
local i
i=0
while [ $i -le $maxunit ]; do
local unitdev
unitdev="$(cat /tmp/.ppp-counter/ppp${i} 2>/dev/null)"
if [ "$unitdev" = "$1" ]; then
unit="$i"
pppif="ppp${i}"
break
fi
i="$(($i + 1))"
done
if [ -z "$unit" ] || [ -z "$pppif" ]; then
maxunit="$(($maxunit + 1))"
if [ -n "$devunit" ]; then
unit="$devunit"
elif [ "${ifname%%[0-9]*}" = ppp ]; then
unit="${ifname##ppp}"
else
unit="$maxunit"
fi
[ "$maxunit" -lt "$unit" ] && maxunit="$unit"
pppif="ppp${unit}"
echo "$1" >/tmp/.ppp-counter/$pppif 2>/dev/null
echo "$maxunit" >/tmp/.ppp-counter/max-unit 2>/dev/null
fi
config_set "$1" ifname "ppp$unit"
config_set "$1" unit "$unit"
stop_interface_ppp() {
local cfg="$1"
local proto
config_get proto "$cfg" proto
local link="$proto-$cfg"
[ -f "/var/run/ppp-${link}.pid" ] && {
local pid="$(head -n1 /var/run/ppp-${link}.pid 2>/dev/null)"
local try=0
grep -qs pppd "/proc/$pid/cmdline" && kill -TERM $pid && \
while grep -qs pppd "/proc/$pid/cmdline" && [ $((try++)) -lt 5 ]; do sleep 1; done
grep -qs pppd "/proc/$pid/cmdline" && kill -KILL $pid && \
while grep -qs pppd "/proc/$pid/cmdline"; do sleep 1; done
rm -f "/var/run/ppp-${link}.pid"
}
remove_dns "$cfg"
local lock="/var/lock/ppp-$link"
[ -f "$lock" ] && lock -u "$lock"
}
start_pppd() {
local cfg="$1"; shift
local ifname
# make sure the network state references the correct ifname
scan_ppp "$cfg"
config_get ifname "$cfg" ifname
set_interface_ifname "$cfg" "$ifname"
local proto
config_get proto "$cfg" proto
# unique link identifier
local link="${proto:-ppp}-$cfg"
# make sure only one pppd process is started
lock "/var/lock/ppp-${cfg}"
local pid="$(head -n1 /var/run/ppp-${cfg}.pid 2>/dev/null)"
lock "/var/lock/ppp-${link}"
local pid="$(head -n1 /var/run/ppp-${link}.pid 2>/dev/null)"
[ -d "/proc/$pid" ] && grep pppd "/proc/$pid/cmdline" 2>/dev/null >/dev/null && {
lock -u "/var/lock/ppp-${cfg}"
lock -u "/var/lock/ppp-${link}"
return 0
}
@ -68,9 +45,6 @@ start_pppd() {
local device
config_get device "$cfg" device
local unit
config_get unit "$cfg" unit
local username
config_get username "$cfg" username
@ -91,7 +65,8 @@ start_pppd() {
local defaultroute
config_get_bool defaultroute "$cfg" defaultroute 1
[ "$defaultroute" -eq 1 ] && defaultroute="defaultroute replacedefaultroute" || defaultroute=""
[ "$defaultroute" -eq 1 ] && \
defaultroute="defaultroute replacedefaultroute" || defaultroute="nodefaultroute"
local interval="${keepalive##*[, ]}"
[ "$interval" != "$keepalive" ] || interval=5
@ -109,15 +84,11 @@ start_pppd() {
local peerdns
config_get_bool peerdns "$cfg" peerdns $peer_default
echo -n "" > /tmp/resolv.conf.auto
[ "$peerdns" -eq 1 ] && {
peerdns="usepeerdns"
} || {
peerdns=""
for dns in $dns; do
echo "nameserver $dns" >> /tmp/resolv.conf.auto
done
add_dns "$cfg" $dns
}
local demand
@ -126,8 +97,7 @@ start_pppd() {
local demandargs
[ "$demand" -eq 1 ] && {
demandargs="precompiled-active-filter /etc/ppp/filter demand idle"
[ "$has_dns" -eq 0 ] && \
echo "nameserver 1.1.1.1" > /tmp/resolv.conf.auto
[ "$has_dns" -eq 0 ] && add_dns "$cfg" 1.1.1.1
} || {
demandargs="persist"
}
@ -136,21 +106,21 @@ start_pppd() {
config_get_bool ipv6 "$cfg" ipv6 0
[ "$ipv6" -eq 1 ] && ipv6="+ipv6" || ipv6=""
/usr/sbin/pppd "$@" \
start-stop-daemon -S -b -x /usr/sbin/pppd -m -p /var/run/ppp-$link.pid -- "$@" \
${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}} \
$demandargs \
$peerdns \
$defaultroute \
${username:+user "$username" password "$password"} \
unit "$unit" \
linkname "$cfg" \
ipparam "$cfg" \
ifname "$link" \
${connect:+connect "$connect"} \
${disconnect:+disconnect "$disconnect"} \
${ipv6} \
${pppd_options}
${pppd_options} \
nodetach
lock -u "/var/lock/ppp-${cfg}"
lock -u "/var/lock/ppp-${link}"
}
setup_interface_ppp() {

View File

@ -1,28 +1,37 @@
scan_pppoa() {
scan_ppp "$@"
stop_interface_pppoa() {
stop_interface_ppp "$1"
}
setup_interface_pppoa() {
local iface="$1"
local config="$2"
local device
config_get device "$config" device
local vpi
config_get vpi "$config" vpi
local vci
config_get vci "$config" vci
for module in slhc ppp_generic pppoatm; do
/sbin/insmod $module 2>&- >&-
done
local encaps
config_get encaps "$config" encaps
case "$encaps" in
1|vc) ENCAPS="vc-encaps" ;;
*) ENCAPS="llc-encaps" ;;
1|vc) encaps="vc-encaps" ;;
*) encaps="llc-encaps" ;;
esac
local mtu
config_get mtu "$config" mtu
mtu=${mtu:-1500}
start_pppd "$config" \
plugin pppoatm.so ${vpi:-8}.${vci:-35} ${ENCAPS} \
plugin pppoatm.so ${vpi:-8}.${vci:-35} ${encaps} \
mtu $mtu mru $mtu
}

View File

@ -1,5 +1,5 @@
scan_pppoe() {
scan_ppp "$@"
stop_interface_pppoe() {
stop_interface_ppp "$1"
}
setup_interface_pppoe() {

View File

@ -0,0 +1,128 @@
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -742,8 +742,11 @@ void
set_ifunit(iskey)
int iskey;
{
- info("Using interface %s%d", PPP_DRV_NAME, ifunit);
- slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
+ if (use_ifname[0] == 0)
+ slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
+ else
+ slprintf(ifname, sizeof(ifname), "%s", use_ifname);
+ info("Using interface %s", ifname);
script_setenv("IFNAME", ifname, iskey);
if (iskey) {
create_pidfile(getpid()); /* write pid to file */
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -111,6 +111,7 @@ int log_to_fd = 1; /* send log messages
bool log_default = 1; /* log_to_fd is default (stdout) */
int maxfail = 10; /* max # of unsuccessful connection attempts */
char linkname[MAXPATHLEN]; /* logical name for link */
+char use_ifname[IFNAMSIZ]; /* physical name for PPP link */
bool tune_kernel; /* may alter kernel settings */
int connect_delay = 1000; /* wait this many ms after connect script */
int req_unit = -1; /* requested interface unit */
@@ -264,6 +265,9 @@ option_t general_options[] = {
{ "linkname", o_string, linkname,
"Set logical name for link",
OPT_PRIO | OPT_PRIV | OPT_STATIC, NULL, MAXPATHLEN },
+ { "ifname", o_string, use_ifname,
+ "Set physical name for PPP interface",
+ OPT_PRIO | OPT_PRIV | OPT_STATIC, NULL, IFNAMSIZ },
{ "maxfail", o_int, &maxfail,
"Maximum number of unsuccessful connection attempts to allow",
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -71,6 +71,10 @@
#include "eui64.h"
#endif
+#ifndef IFNAMSIZ
+#define IFNAMSIZ 16
+#endif
+
/*
* Limits.
*/
@@ -308,6 +312,7 @@ extern char *record_file; /* File to rec
extern bool sync_serial; /* Device is synchronous serial device */
extern int maxfail; /* Max # of unsuccessful connection attempts */
extern char linkname[MAXPATHLEN]; /* logical name for link */
+extern char use_ifname[IFNAMSIZ]; /* physical name for PPP interface */
extern bool tune_kernel; /* May alter kernel settings as necessary */
extern int connect_delay; /* Time to delay after connect script */
extern int max_data_rate; /* max bytes/sec through charshunt */
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -168,6 +168,10 @@ struct in6_ifreq {
/* We can get an EIO error on an ioctl if the modem has hung up */
#define ok_error(num) ((num)==EIO)
+#if !defined(PPP_DRV_NAME)
+#define PPP_DRV_NAME "ppp"
+#endif /* !defined(PPP_DRV_NAME) */
+
static int tty_disc = N_TTY; /* The TTY discipline */
static int ppp_disc = N_PPP; /* The PPP discpline */
static int initfdflags = -1; /* Initial file descriptor flags for fd */
@@ -622,7 +626,8 @@ void generic_disestablish_ppp(int dev_fd
*/
static int make_ppp_unit()
{
- int x, flags;
+ struct ifreq ifr;
+ int x, flags, s;
if (ppp_dev_fd >= 0) {
dbglog("in make_ppp_unit, already had /dev/ppp open?");
@@ -645,6 +650,32 @@ static int make_ppp_unit()
}
if (x < 0)
error("Couldn't create new ppp unit: %m");
+
+ if (use_ifname[0] != 0) {
+ s = socket(PF_INET, SOCK_DGRAM, 0);
+ if (s < 0)
+ s = socket(PF_PACKET, SOCK_DGRAM, 0);
+ if (s < 0)
+ s = socket(PF_INET6, SOCK_DGRAM, 0);
+ if (s < 0)
+ s = socket(PF_UNIX, SOCK_DGRAM, 0);
+ if (s >= 0) {
+ slprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s%d", PPP_DRV_NAME, ifunit);
+ slprintf(ifr.ifr_newname, sizeof(ifr.ifr_newname), "%s", use_ifname);
+ x = ioctl(s, SIOCSIFNAME, &ifr);
+ close(s);
+ } else {
+ x = s;
+ }
+ if (x < 0) {
+ error("Couldn't rename %s to %s", ifr.ifr_name, ifr.ifr_newname);
+ close(ppp_dev_fd);
+ ppp_dev_fd = -1;
+ } else {
+ info("Renamed %s to %s", ifr.ifr_name, ifr.ifr_newname);
+ }
+ }
+
return x;
}
--- a/pppstats/pppstats.c
+++ b/pppstats/pppstats.c
@@ -506,10 +506,12 @@ main(argc, argv)
if (argc > 0)
interface = argv[0];
+/*
if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) {
fprintf(stderr, "%s: invalid interface '%s' specified\n",
progname, interface);
}
+*/
#ifndef STREAMS
{

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=pptp
PKG_VERSION:=1.6.0
PKG_RELEASE:=6
PKG_VERSION:=1.7.1
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/pptpclient
PKG_MD5SUM:=9a706327fb9827541d7c86d48ceb9631
PKG_MD5SUM:=b47735ba5d6d37dfdbccb85afc044ede
include $(INCLUDE_DIR)/package.mk

View File

@ -1,33 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=41
STOP=30
updown_pptp_interface () {
config_get proto "$1" proto
if [ "$proto" = "pptp" ]; then
if$2 "$1"
fi
}
boot () {
start
}
start() {
config_load network
config_foreach updown_pptp_interface interface up
}
restart() {
config_load network
config_foreach updown_pptp_interface interface down
config_foreach updown_pptp_interface interface up
}
stop() {
config_load network
config_foreach updown_pptp_interface interface down
}

View File

@ -1,20 +1,36 @@
scan_pptp() {
scan_ppp "$@"
}
find_gw() {
route -n | awk '$1 == "0.0.0.0" { print $2; exit }'
}
scan_pptp() {
config_set "$1" device "pptp-$1"
}
stop_interface_pptp() {
stop_interface_ppp "$1"
}
coldplug_interface_pptp() {
setup_interface_pptp "pptp-$1" "$1"
}
setup_interface_pptp() {
local config="$2"
local ifname
local device
config_get device "$config" device
local ipproto
config_get ipproto "$config" ipproto
local server
config_get server "$config" server
local buffering
config_get_bool buffering "$config" buffering 1
[ "$buffering" == 0 ] && buffering="--nobuffer" || buffering=
for module in slhc ppp_generic ppp_async ip_gre; do
/sbin/insmod $module 2>&- >&-
done
@ -23,7 +39,7 @@ setup_interface_pptp() {
setup_interface "$device" "$config" "${ipproto:-dhcp}"
local gw="$(find_gw)"
[ -n "$gw" ] && {
route delete "$server" 2>/dev/null >/dev/null
[ "$gw" != 0.0.0.0 ] && route delete "$server" 2>/dev/null >/dev/null
route add "$server" gw "$gw"
}
@ -31,15 +47,10 @@ setup_interface_pptp() {
config_get netmask "$config" netmask
[ -z "$netmask" -o -z "$device" ] || ifconfig $device netmask $netmask
# make sure the network state references the correct ifname
scan_ppp "$config"
config_get ifname "$config" ifname
uci_set_state network "$config" ifname "$ifname"
config_get mtu "$config" mtu
mtu=${mtu:-1452}
start_pppd "$config" \
pty "/usr/sbin/pptp $server --loglevel 0 --nolaunchpppd" \
pty "/usr/sbin/pptp $server --loglevel 0 --nolaunchpppd $buffering" \
file /etc/ppp/options.pptp \
mtu $mtu mru $mtu
}

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -10,6 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=siit
PKG_VERSION:=1.1
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2008-2009 OpenWrt.org
# Copyright (C) 2008-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=swconfig
PKG_RELEASE:=5
PKG_RELEASE:=6
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk

View File

@ -1,50 +1,50 @@
/* Settings for Denali DDR SDRAM controller */
/* Optimise for Danube Eval Board DDR 167 Mhz - by Ng Aik Ann 29th April */
#define MC_DC0_VALUE 0x1B1B
#define MC_DC1_VALUE 0x0
#define MC_DC2_VALUE 0x0
#define MC_DC3_VALUE 0x0
#define MC_DC4_VALUE 0x0
#define MC_DC5_VALUE 0x200
#define MC_DC6_VALUE 0x605
#define MC_DC7_VALUE 0x303
#define MC_DC8_VALUE 0x102
#define MC_DC9_VALUE 0x70a
#define MC_DC10_VALUE 0x203
#define MC_DC11_VALUE 0xc02
#define MC_DC12_VALUE 0x1C8
#define MC_DC13_VALUE 0x1
#define MC_DC14_VALUE 0x0
#define MC_DC15_VALUE 0xf3c
#define MC_DC16_VALUE 0xC800
#define MC_DC17_VALUE 0xd
#define MC_DC18_VALUE 0x300
#define MC_DC19_VALUE 0x200
#define MC_DC20_VALUE 0xA03
#define MC_DC21_VALUE 0x1d00
#define MC_DC22_VALUE 0x1d1d
#define MC_DC23_VALUE 0x0
#define MC_DC24_VALUE 0x5e /* was 0x7f */
#define MC_DC25_VALUE 0x0
#define MC_DC26_VALUE 0x0
#define MC_DC27_VALUE 0x0
#define MC_DC28_VALUE 0x510
#define MC_DC29_VALUE 0x2d89
#define MC_DC30_VALUE 0x8300
#define MC_DC31_VALUE 0x0
#define MC_DC32_VALUE 0x0
#define MC_DC33_VALUE 0x0
#define MC_DC34_VALUE 0x0
#define MC_DC35_VALUE 0x0
#define MC_DC36_VALUE 0x0
#define MC_DC37_VALUE 0x0
#define MC_DC38_VALUE 0x0
#define MC_DC39_VALUE 0x0
#define MC_DC40_VALUE 0x0
#define MC_DC41_VALUE 0x0
#define MC_DC42_VALUE 0x0
#define MC_DC43_VALUE 0x0
#define MC_DC44_VALUE 0x0
#define MC_DC45_VALUE 0x500
//#define MC_DC45_VALUE 0x400
#define MC_DC46_VALUE 0x0
/* Settings for Denali DDR SDRAM controller */
/* Optimise for Danube Eval Board DDR 167 Mhz - by Ng Aik Ann 29th April */
#define MC_DC0_VALUE 0x1B1B
#define MC_DC1_VALUE 0x0
#define MC_DC2_VALUE 0x0
#define MC_DC3_VALUE 0x0
#define MC_DC4_VALUE 0x0
#define MC_DC5_VALUE 0x200
#define MC_DC6_VALUE 0x605
#define MC_DC7_VALUE 0x303
#define MC_DC8_VALUE 0x102
#define MC_DC9_VALUE 0x70a
#define MC_DC10_VALUE 0x203
#define MC_DC11_VALUE 0xc02
#define MC_DC12_VALUE 0x1C8
#define MC_DC13_VALUE 0x1
#define MC_DC14_VALUE 0x0
#define MC_DC15_VALUE 0xf3c
#define MC_DC16_VALUE 0xC800
#define MC_DC17_VALUE 0xd
#define MC_DC18_VALUE 0x300
#define MC_DC19_VALUE 0x200
#define MC_DC20_VALUE 0xA03
#define MC_DC21_VALUE 0x1d00
#define MC_DC22_VALUE 0x1d1d
#define MC_DC23_VALUE 0x0
#define MC_DC24_VALUE 0x5e /* was 0x7f */
#define MC_DC25_VALUE 0x0
#define MC_DC26_VALUE 0x0
#define MC_DC27_VALUE 0x0
#define MC_DC28_VALUE 0x510
#define MC_DC29_VALUE 0x2d89
#define MC_DC30_VALUE 0x8300
#define MC_DC31_VALUE 0x0
#define MC_DC32_VALUE 0x0
#define MC_DC33_VALUE 0x0
#define MC_DC34_VALUE 0x0
#define MC_DC35_VALUE 0x0
#define MC_DC36_VALUE 0x0
#define MC_DC37_VALUE 0x0
#define MC_DC38_VALUE 0x0
#define MC_DC39_VALUE 0x0
#define MC_DC40_VALUE 0x0
#define MC_DC41_VALUE 0x0
#define MC_DC42_VALUE 0x0
#define MC_DC43_VALUE 0x0
#define MC_DC44_VALUE 0x0
#define MC_DC45_VALUE 0x500
//#define MC_DC45_VALUE 0x400
#define MC_DC46_VALUE 0x0

View File

@ -1,50 +1,50 @@
/* Settings for Denali DDR SDRAM controller */
/* Optimise for Danube Ref Board DDR 166 Mhz - by Ng Aik Ann 29th April */
#define MC_DC0_VALUE 0x1B1B
#define MC_DC1_VALUE 0x0
#define MC_DC2_VALUE 0x0
#define MC_DC3_VALUE 0x0
#define MC_DC4_VALUE 0x0
#define MC_DC5_VALUE 0x200
#define MC_DC6_VALUE 0x605
#define MC_DC7_VALUE 0x303
#define MC_DC8_VALUE 0x102
#define MC_DC9_VALUE 0x70a
#define MC_DC10_VALUE 0x203
#define MC_DC11_VALUE 0xc02
#define MC_DC12_VALUE 0x1C8
#define MC_DC13_VALUE 0x1
#define MC_DC14_VALUE 0x0
#define MC_DC15_VALUE 0xf3c /* WDQS tuning for clk_wr*/
#define MC_DC16_VALUE 0xC800
#define MC_DC17_VALUE 0xd
#define MC_DC18_VALUE 0x300
#define MC_DC19_VALUE 0x200
#define MC_DC20_VALUE 0xA04 /* A04 for reference board, A03 for Eval board */
#define MC_DC21_VALUE 0x1200
#define MC_DC22_VALUE 0x1212
#define MC_DC23_VALUE 0x0
#define MC_DC24_VALUE 0x5e /* WDQS Tuning for DQS */
#define MC_DC25_VALUE 0x0
#define MC_DC26_VALUE 0x0
#define MC_DC27_VALUE 0x0
#define MC_DC28_VALUE 0x510
#define MC_DC29_VALUE 0x2d89
#define MC_DC30_VALUE 0x8300
#define MC_DC31_VALUE 0x0
#define MC_DC32_VALUE 0x0
#define MC_DC33_VALUE 0x0
#define MC_DC34_VALUE 0x0
#define MC_DC35_VALUE 0x0
#define MC_DC36_VALUE 0x0
#define MC_DC37_VALUE 0x0
#define MC_DC38_VALUE 0x0
#define MC_DC39_VALUE 0x0
#define MC_DC40_VALUE 0x0
#define MC_DC41_VALUE 0x0
#define MC_DC42_VALUE 0x0
#define MC_DC43_VALUE 0x0
#define MC_DC44_VALUE 0x0
#define MC_DC45_VALUE 0x500
//#define MC_DC45_VALUE 0x400
#define MC_DC46_VALUE 0x0
/* Settings for Denali DDR SDRAM controller */
/* Optimise for Danube Ref Board DDR 166 Mhz - by Ng Aik Ann 29th April */
#define MC_DC0_VALUE 0x1B1B
#define MC_DC1_VALUE 0x0
#define MC_DC2_VALUE 0x0
#define MC_DC3_VALUE 0x0
#define MC_DC4_VALUE 0x0
#define MC_DC5_VALUE 0x200
#define MC_DC6_VALUE 0x605
#define MC_DC7_VALUE 0x303
#define MC_DC8_VALUE 0x102
#define MC_DC9_VALUE 0x70a
#define MC_DC10_VALUE 0x203
#define MC_DC11_VALUE 0xc02
#define MC_DC12_VALUE 0x1C8
#define MC_DC13_VALUE 0x1
#define MC_DC14_VALUE 0x0
#define MC_DC15_VALUE 0xf3c /* WDQS tuning for clk_wr*/
#define MC_DC16_VALUE 0xC800
#define MC_DC17_VALUE 0xd
#define MC_DC18_VALUE 0x300
#define MC_DC19_VALUE 0x200
#define MC_DC20_VALUE 0xA04 /* A04 for reference board, A03 for Eval board */
#define MC_DC21_VALUE 0x1200
#define MC_DC22_VALUE 0x1212
#define MC_DC23_VALUE 0x0
#define MC_DC24_VALUE 0x5e /* WDQS Tuning for DQS */
#define MC_DC25_VALUE 0x0
#define MC_DC26_VALUE 0x0
#define MC_DC27_VALUE 0x0
#define MC_DC28_VALUE 0x510
#define MC_DC29_VALUE 0x2d89
#define MC_DC30_VALUE 0x8300
#define MC_DC31_VALUE 0x0
#define MC_DC32_VALUE 0x0
#define MC_DC33_VALUE 0x0
#define MC_DC34_VALUE 0x0
#define MC_DC35_VALUE 0x0
#define MC_DC36_VALUE 0x0
#define MC_DC37_VALUE 0x0
#define MC_DC38_VALUE 0x0
#define MC_DC39_VALUE 0x0
#define MC_DC40_VALUE 0x0
#define MC_DC41_VALUE 0x0
#define MC_DC42_VALUE 0x0
#define MC_DC43_VALUE 0x0
#define MC_DC44_VALUE 0x0
#define MC_DC45_VALUE 0x500
//#define MC_DC45_VALUE 0x400
#define MC_DC46_VALUE 0x0

View File

@ -1,50 +1,50 @@
/* Settings for Denali DDR SDRAM controller */
/* Optimise for Danube Eval Board DDR 167 Mhz - by Ng Aik Ann 29th April */
#define MC_DC0_VALUE 0x1B1B
#define MC_DC1_VALUE 0x0
#define MC_DC2_VALUE 0x0
#define MC_DC3_VALUE 0x0
#define MC_DC4_VALUE 0x0
#define MC_DC5_VALUE 0x200
#define MC_DC6_VALUE 0x605
#define MC_DC7_VALUE 0x303
#define MC_DC8_VALUE 0x102
#define MC_DC9_VALUE 0x70a
#define MC_DC10_VALUE 0x203
#define MC_DC11_VALUE 0xc02
#define MC_DC12_VALUE 0x1C8
#define MC_DC13_VALUE 0x1
#define MC_DC14_VALUE 0x0
#define MC_DC15_VALUE 0xf3c
#define MC_DC16_VALUE 0xC800
#define MC_DC17_VALUE 0xd
#define MC_DC18_VALUE 0x300
#define MC_DC19_VALUE 0x200
#define MC_DC20_VALUE 0xA03
#define MC_DC21_VALUE 0x1d00
#define MC_DC22_VALUE 0x1d1d
#define MC_DC23_VALUE 0x0
#define MC_DC24_VALUE 0x5e /* was 0x7f */
#define MC_DC25_VALUE 0x0
#define MC_DC26_VALUE 0x0
#define MC_DC27_VALUE 0x0
#define MC_DC28_VALUE 0x510
#define MC_DC29_VALUE 0x2d89
#define MC_DC30_VALUE 0x8300
#define MC_DC31_VALUE 0x0
#define MC_DC32_VALUE 0x0
#define MC_DC33_VALUE 0x0
#define MC_DC34_VALUE 0x0
#define MC_DC35_VALUE 0x0
#define MC_DC36_VALUE 0x0
#define MC_DC37_VALUE 0x0
#define MC_DC38_VALUE 0x0
#define MC_DC39_VALUE 0x0
#define MC_DC40_VALUE 0x0
#define MC_DC41_VALUE 0x0
#define MC_DC42_VALUE 0x0
#define MC_DC43_VALUE 0x0
#define MC_DC44_VALUE 0x0
#define MC_DC45_VALUE 0x500
//#define MC_DC45_VALUE 0x400
#define MC_DC46_VALUE 0x0
/* Settings for Denali DDR SDRAM controller */
/* Optimise for Danube Eval Board DDR 167 Mhz - by Ng Aik Ann 29th April */
#define MC_DC0_VALUE 0x1B1B
#define MC_DC1_VALUE 0x0
#define MC_DC2_VALUE 0x0
#define MC_DC3_VALUE 0x0
#define MC_DC4_VALUE 0x0
#define MC_DC5_VALUE 0x200
#define MC_DC6_VALUE 0x605
#define MC_DC7_VALUE 0x303
#define MC_DC8_VALUE 0x102
#define MC_DC9_VALUE 0x70a
#define MC_DC10_VALUE 0x203
#define MC_DC11_VALUE 0xc02
#define MC_DC12_VALUE 0x1C8
#define MC_DC13_VALUE 0x1
#define MC_DC14_VALUE 0x0
#define MC_DC15_VALUE 0xf3c
#define MC_DC16_VALUE 0xC800
#define MC_DC17_VALUE 0xd
#define MC_DC18_VALUE 0x300
#define MC_DC19_VALUE 0x200
#define MC_DC20_VALUE 0xA03
#define MC_DC21_VALUE 0x1d00
#define MC_DC22_VALUE 0x1d1d
#define MC_DC23_VALUE 0x0
#define MC_DC24_VALUE 0x5e /* was 0x7f */
#define MC_DC25_VALUE 0x0
#define MC_DC26_VALUE 0x0
#define MC_DC27_VALUE 0x0
#define MC_DC28_VALUE 0x510
#define MC_DC29_VALUE 0x2d89
#define MC_DC30_VALUE 0x8300
#define MC_DC31_VALUE 0x0
#define MC_DC32_VALUE 0x0
#define MC_DC33_VALUE 0x0
#define MC_DC34_VALUE 0x0
#define MC_DC35_VALUE 0x0
#define MC_DC36_VALUE 0x0
#define MC_DC37_VALUE 0x0
#define MC_DC38_VALUE 0x0
#define MC_DC39_VALUE 0x0
#define MC_DC40_VALUE 0x0
#define MC_DC41_VALUE 0x0
#define MC_DC42_VALUE 0x0
#define MC_DC43_VALUE 0x0
#define MC_DC44_VALUE 0x0
#define MC_DC45_VALUE 0x500
//#define MC_DC45_VALUE 0x400
#define MC_DC46_VALUE 0x0

View File

@ -1,50 +1,50 @@
/* Settings for Denali DDR SDRAM controller */
/* Optimise for Danube Ref Board DDR 166 Mhz - by Ng Aik Ann 29th April */
#define MC_DC0_VALUE 0x1B1B
#define MC_DC1_VALUE 0x0
#define MC_DC2_VALUE 0x0
#define MC_DC3_VALUE 0x0
#define MC_DC4_VALUE 0x0
#define MC_DC5_VALUE 0x200
#define MC_DC6_VALUE 0x605
#define MC_DC7_VALUE 0x303
#define MC_DC8_VALUE 0x102
#define MC_DC9_VALUE 0x70a
#define MC_DC10_VALUE 0x203
#define MC_DC11_VALUE 0xc02
#define MC_DC12_VALUE 0x1C8
#define MC_DC13_VALUE 0x1
#define MC_DC14_VALUE 0x0
#define MC_DC15_VALUE 0xf3c /* WDQS tuning for clk_wr*/
#define MC_DC16_VALUE 0xC800
#define MC_DC17_VALUE 0xd
#define MC_DC18_VALUE 0x300
#define MC_DC19_VALUE 0x200
#define MC_DC20_VALUE 0xA04 /* A04 for reference board, A03 for Eval board */
#define MC_DC21_VALUE 0x1200
#define MC_DC22_VALUE 0x1212
#define MC_DC23_VALUE 0x0
#define MC_DC24_VALUE 0x5e /* WDQS Tuning for DQS */
#define MC_DC25_VALUE 0x0
#define MC_DC26_VALUE 0x0
#define MC_DC27_VALUE 0x0
#define MC_DC28_VALUE 0x510
#define MC_DC29_VALUE 0x2d89
#define MC_DC30_VALUE 0x8300
#define MC_DC31_VALUE 0x0
#define MC_DC32_VALUE 0x0
#define MC_DC33_VALUE 0x0
#define MC_DC34_VALUE 0x0
#define MC_DC35_VALUE 0x0
#define MC_DC36_VALUE 0x0
#define MC_DC37_VALUE 0x0
#define MC_DC38_VALUE 0x0
#define MC_DC39_VALUE 0x0
#define MC_DC40_VALUE 0x0
#define MC_DC41_VALUE 0x0
#define MC_DC42_VALUE 0x0
#define MC_DC43_VALUE 0x0
#define MC_DC44_VALUE 0x0
#define MC_DC45_VALUE 0x500
//#define MC_DC45_VALUE 0x400
#define MC_DC46_VALUE 0x0
/* Settings for Denali DDR SDRAM controller */
/* Optimise for Danube Ref Board DDR 166 Mhz - by Ng Aik Ann 29th April */
#define MC_DC0_VALUE 0x1B1B
#define MC_DC1_VALUE 0x0
#define MC_DC2_VALUE 0x0
#define MC_DC3_VALUE 0x0
#define MC_DC4_VALUE 0x0
#define MC_DC5_VALUE 0x200
#define MC_DC6_VALUE 0x605
#define MC_DC7_VALUE 0x303
#define MC_DC8_VALUE 0x102
#define MC_DC9_VALUE 0x70a
#define MC_DC10_VALUE 0x203
#define MC_DC11_VALUE 0xc02
#define MC_DC12_VALUE 0x1C8
#define MC_DC13_VALUE 0x1
#define MC_DC14_VALUE 0x0
#define MC_DC15_VALUE 0xf3c /* WDQS tuning for clk_wr*/
#define MC_DC16_VALUE 0xC800
#define MC_DC17_VALUE 0xd
#define MC_DC18_VALUE 0x300
#define MC_DC19_VALUE 0x200
#define MC_DC20_VALUE 0xA04 /* A04 for reference board, A03 for Eval board */
#define MC_DC21_VALUE 0x1200
#define MC_DC22_VALUE 0x1212
#define MC_DC23_VALUE 0x0
#define MC_DC24_VALUE 0x5e /* WDQS Tuning for DQS */
#define MC_DC25_VALUE 0x0
#define MC_DC26_VALUE 0x0
#define MC_DC27_VALUE 0x0
#define MC_DC28_VALUE 0x510
#define MC_DC29_VALUE 0x2d89
#define MC_DC30_VALUE 0x8300
#define MC_DC31_VALUE 0x0
#define MC_DC32_VALUE 0x0
#define MC_DC33_VALUE 0x0
#define MC_DC34_VALUE 0x0
#define MC_DC35_VALUE 0x0
#define MC_DC36_VALUE 0x0
#define MC_DC37_VALUE 0x0
#define MC_DC38_VALUE 0x0
#define MC_DC39_VALUE 0x0
#define MC_DC40_VALUE 0x0
#define MC_DC41_VALUE 0x0
#define MC_DC42_VALUE 0x0
#define MC_DC43_VALUE 0x0
#define MC_DC44_VALUE 0x0
#define MC_DC45_VALUE 0x500
//#define MC_DC45_VALUE 0x400
#define MC_DC46_VALUE 0x0

View File

@ -1,51 +1,51 @@
/* Settings for Denali DDR SDRAM controller */
/* Optimise for Samsung DDR K4H561638H Danube Ref Board DDR 166 Mhz - by Ng Aik Ann 27th Nov 2006 */
#define MC_DC0_VALUE 0x1B1B
#define MC_DC1_VALUE 0x0
#define MC_DC2_VALUE 0x0
#define MC_DC3_VALUE 0x0
#define MC_DC4_VALUE 0x0
#define MC_DC5_VALUE 0x200
#define MC_DC6_VALUE 0x306
#define MC_DC7_VALUE 0x303
#define MC_DC8_VALUE 0x102
#define MC_DC9_VALUE 0x80B
#define MC_DC10_VALUE 0x203
#define MC_DC11_VALUE 0xD02
#define MC_DC12_VALUE 0x1C8
#define MC_DC13_VALUE 0x1
#define MC_DC14_VALUE 0x0
#define MC_DC15_VALUE 0x144 /* WDQS tuning for clk_wr*/
#define MC_DC16_VALUE 0xC800
#define MC_DC17_VALUE 0xF
#define MC_DC18_VALUE 0x301
#define MC_DC19_VALUE 0x200
#define MC_DC20_VALUE 0xA04 /* A04 for reference board, A03 for Eval board */
#define MC_DC21_VALUE 0x1200
#define MC_DC22_VALUE 0x1212
#define MC_DC23_VALUE 0x0
#define MC_DC24_VALUE 0x66 /* WDQS Tuning for DQS */
#define MC_DC25_VALUE 0x0
#define MC_DC26_VALUE 0x0
#define MC_DC27_VALUE 0x0
#define MC_DC28_VALUE 0x5FB
#define MC_DC29_VALUE 0x35DF
#define MC_DC30_VALUE 0x99E9
#define MC_DC31_VALUE 0x0
#define MC_DC32_VALUE 0x0
#define MC_DC33_VALUE 0x0
#define MC_DC34_VALUE 0x0
#define MC_DC35_VALUE 0x0
#define MC_DC36_VALUE 0x0
#define MC_DC37_VALUE 0x0
#define MC_DC38_VALUE 0x0
#define MC_DC39_VALUE 0x0
#define MC_DC40_VALUE 0x0
#define MC_DC41_VALUE 0x0
#define MC_DC42_VALUE 0x0
#define MC_DC43_VALUE 0x0
#define MC_DC44_VALUE 0x0
#define MC_DC45_VALUE 0x600
//#define MC_DC45_VALUE 0x400
#define MC_DC46_VALUE 0x0
/* Settings for Denali DDR SDRAM controller */
/* Optimise for Samsung DDR K4H561638H Danube Ref Board DDR 166 Mhz - by Ng Aik Ann 27th Nov 2006 */
#define MC_DC0_VALUE 0x1B1B
#define MC_DC1_VALUE 0x0
#define MC_DC2_VALUE 0x0
#define MC_DC3_VALUE 0x0
#define MC_DC4_VALUE 0x0
#define MC_DC5_VALUE 0x200
#define MC_DC6_VALUE 0x306
#define MC_DC7_VALUE 0x303
#define MC_DC8_VALUE 0x102
#define MC_DC9_VALUE 0x80B
#define MC_DC10_VALUE 0x203
#define MC_DC11_VALUE 0xD02
#define MC_DC12_VALUE 0x1C8
#define MC_DC13_VALUE 0x1
#define MC_DC14_VALUE 0x0
#define MC_DC15_VALUE 0x144 /* WDQS tuning for clk_wr*/
#define MC_DC16_VALUE 0xC800
#define MC_DC17_VALUE 0xF
#define MC_DC18_VALUE 0x301
#define MC_DC19_VALUE 0x200
#define MC_DC20_VALUE 0xA04 /* A04 for reference board, A03 for Eval board */
#define MC_DC21_VALUE 0x1200
#define MC_DC22_VALUE 0x1212
#define MC_DC23_VALUE 0x0
#define MC_DC24_VALUE 0x66 /* WDQS Tuning for DQS */
#define MC_DC25_VALUE 0x0
#define MC_DC26_VALUE 0x0
#define MC_DC27_VALUE 0x0
#define MC_DC28_VALUE 0x5FB
#define MC_DC29_VALUE 0x35DF
#define MC_DC30_VALUE 0x99E9
#define MC_DC31_VALUE 0x0
#define MC_DC32_VALUE 0x0
#define MC_DC33_VALUE 0x0
#define MC_DC34_VALUE 0x0
#define MC_DC35_VALUE 0x0
#define MC_DC36_VALUE 0x0
#define MC_DC37_VALUE 0x0
#define MC_DC38_VALUE 0x0
#define MC_DC39_VALUE 0x0
#define MC_DC40_VALUE 0x0
#define MC_DC41_VALUE 0x0
#define MC_DC42_VALUE 0x0
#define MC_DC43_VALUE 0x0
#define MC_DC44_VALUE 0x0
#define MC_DC45_VALUE 0x600
//#define MC_DC45_VALUE 0x400
#define MC_DC46_VALUE 0x0

View File

@ -12,7 +12,7 @@ UCI_RELEASE=5
PKG_NAME:=uci
PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_REV:=aa3ab8012bfbf793d2884c08ea924545a04e9544
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz

View File

@ -1,6 +1,7 @@
#!/bin/sh
# Shell script compatibility wrappers for /sbin/uci
#
# Copyright (C) 2008-2010 OpenWrt.org
# Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
#
# This program is free software; you can redistribute it and/or modify
@ -41,9 +42,9 @@ uci_load() {
uci_set_default() {
local PACKAGE="$1"
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show "$1" > /dev/null && return 0
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} import "$1"
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit "$1"
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} -q show "$PACKAGE" > /dev/null && return 0
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} import "$PACKAGE"
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit "$PACKAGE"
}
uci_revert_state() {
@ -73,6 +74,23 @@ uci_set() {
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set "$PACKAGE.$CONFIG.$OPTION=$VALUE"
}
uci_get_state() {
uci_get "$1" "$2" "$3" "$4" "/var/state"
}
uci_get() {
local PACKAGE="$1"
local CONFIG="$2"
local OPTION="$3"
local DEFAULT="$4"
local STATE="$5"
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} ${STATE:+-P $STATE} -q get "$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}"
RET="$?"
[ "$RET" -ne 0 ] && [ -n "$DEFAULT" ] && echo "$DEFAULT"
return "$RET"
}
uci_add() {
local PACKAGE="$1"
local TYPE="$2"

View File

@ -48,7 +48,7 @@ start_instance()
UHTTPD_KEY=""
local cfg="$1"
local realm="$(uci get system.@system[0].hostname 2>/dev/null)"
local realm="$(uci_get system.@system[0].hostname)"
local listen http https
append_arg "$cfg" home "-h"

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2008 OpenWrt.org
# Copyright (C) 2008-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -9,6 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=wprobe
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_BUILD_DEPENDS:=PACKAGE_wprobe-export:libipfix

View File

@ -12,10 +12,11 @@ WORKING_DIR="${HOME}/.qi/nanonote/ben/${VERSION}"
LOG_FILE="${WORKING_DIR}/log.txt"
# URL to images ($URL/$VERSION/$[images])
BASE_URL_HTTP="http://downloads.qi-hardware.com/software/images/Ben_NanoNote_2GB_NAND"
#BASE_URL_HTTP="http://downloads.qi-hardware.com/software/images/Ben_NanoNote_2GB_NAND"
BASE_URL_HTTP="http://downloads.qi-hardware.com/software/images/NanoNote/Ben"
# names of images
LOADER="openwrt-xburst-u-boot.bin"
LOADER="openwrt-xburst-qi_lb60-u-boot.bin"
#KERNEL="openwrt-xburst-uImage.bin"
KERNEL="openwrt-xburst-qi_lb60-uImage.bin"
#ROOTFS="openwrt-xburst-rootfs.ubi"

View File

@ -35,7 +35,7 @@ define Image/Build/CyberTAN
$(STAGING_DIR_HOST)/bin/addpattern -4 -p $(3) -v v$(4) -i $(BIN_DIR)/$(IMG_PREFIX)-$(1).trx -o $(BIN_DIR)/openwrt-$(2)-$(5).bin $(if $(6),-s $(6))
endef
define Image/Build/CyberTAN2
$(STAGING_DIR_HOST)/bin/addpattern -4 -p $(3) -v v$(4) -i $(BIN_DIR)/$(IMG_PREFIX)-$(1).trx2 -o $(BIN_DIR)/openwrt-$(2)-$(5).bin $(if $(6),-s $(6))
$(STAGING_DIR_HOST)/bin/addpattern -4 -p $(3) -v v$(4) -i $(BIN_DIR)/openwrt-$(2)-$(5)-sysupgrade.bin -o $(BIN_DIR)/openwrt-$(2)-$(5)-factory.bin $(if $(6),-s $(6))
endef
define Image/Build/CyberTANHead
$(STAGING_DIR_HOST)/bin/addpattern -5 -p $(3) -v v$(4) -i /dev/null -o $(KDIR)/openwrt-$(2)-header.bin $(if $(6),-s $(6))
@ -61,7 +61,7 @@ endef
define Image/Build/trxV2
$(call Image/Build/CyberTANHead,$(1),$(2),$(3),$(4),$(5),$(if $(6),$(6)))
$(STAGING_DIR_HOST)/bin/trx -2 -o $(BIN_DIR)/$(IMG_PREFIX)-$(1).trx2 \
$(STAGING_DIR_HOST)/bin/trx -2 -o $(BIN_DIR)/openwrt-$(2)-$(5)-sysupgrade.bin \
-f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma \
$(call trxalign/$(1),$(1),$(KDIR)/openwrt-$(2)-header.bin)
$(call Image/Build/CyberTAN2,$(1),$(2),$(3),$(4),$(5),$(if $(6),$(6)))

View File

@ -50,7 +50,7 @@
--- /dev/null
+++ b/drivers/usb/host/ehci-ssb.c
@@ -0,0 +1,201 @@
@@ -0,0 +1,158 @@
+/*
+ * Sonics Silicon Backplane
+ * Broadcom USB-core EHCI driver (SSB bus glue)
@ -90,7 +90,6 @@
+ return (struct ssb_ehci_device *)(hcd->hcd_priv);
+}
+
+
+static int ssb_ehci_reset(struct usb_hcd *hcd)
+{
+ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
@ -115,55 +114,11 @@
+ if (err)
+ return err;
+
+ ehci_port_power(ehci, 0);
+ ehci_reset(ehci);
+
+ return err;
+}
+
+static int ssb_ehci_start(struct usb_hcd *hcd)
+{
+ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
+ int err;
+
+ err = ehci_run(hcd);
+ if (err < 0) {
+ ehci_err(ehci, "can't start\n");
+ ehci_stop(hcd);
+ }
+
+ return err;
+}
+
+#ifdef CONFIG_PM
+static int ssb_ehci_hcd_suspend(struct usb_hcd *hcd, pm_message_t message)
+{
+ struct ssb_ehci_device *ehcidev = hcd_to_ssb_ehci(hcd);
+ struct ehci_hcd *ehci = &ehcidev->ehci;
+ unsigned long flags;
+
+ spin_lock_irqsave(&ehci->lock, flags);
+
+ ehci_writel(ehci, EHCI_INTR_MIE, &ehci->regs->intrdisable);
+ ehci_readl(ehci, &ehci->regs->intrdisable); /* commit write */
+
+ /* make sure snapshot being resumed re-enumerates everything */
+ if (message.event == PM_EVENT_PRETHAW)
+ ehci_usb_reset(ehci);
+
+ clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+
+ spin_unlock_irqrestore(&ehci->lock, flags);
+ return 0;
+}
+
+static int ssb_ehci_hcd_resume(struct usb_hcd *hcd)
+{
+ set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+ usb_hcd_resume_root_hub(hcd);
+ return 0;
+}
+#endif /* CONFIG_PM */
+
+static const struct hc_driver ssb_ehci_hc_driver = {
+ .description = "ssb-usb-ehci",
+ .product_desc = "SSB EHCI Controller",
@ -173,35 +128,37 @@
+ .flags = HCD_MEMORY | HCD_USB2,
+
+ .reset = ssb_ehci_reset,
+ .start = ssb_ehci_start,
+ .start = ehci_run,
+ .stop = ehci_stop,
+ .shutdown = ehci_shutdown,
+
+#ifdef CONFIG_PM
+ .suspend = ssb_ehci_hcd_suspend,
+ .resume = ssb_ehci_hcd_resume,
+#endif
+
+ .urb_enqueue = ehci_urb_enqueue,
+ .urb_dequeue = ehci_urb_dequeue,
+ .endpoint_disable = ehci_endpoint_disable,
+ .endpoint_reset = ehci_endpoint_reset,
+
+ .get_frame_number = ehci_get_frame,
+
+ .hub_status_data = ehci_hub_status_data,
+ .hub_control = ehci_hub_control,
+#ifdef CONFIG_PM
+ .bus_suspend = ehci_bus_suspend,
+ .bus_resume = ehci_bus_resume,
+#endif
+ .relinquish_port = ehci_relinquish_port,
+ .port_handed_over = ehci_port_handed_over,
+
+ .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
+};
+
+static void ssb_ehci_detach(struct ssb_device *dev, struct usb_hcd *hcd)
+{
+ if (hcd->driver->shutdown)
+ hcd->driver->shutdown(hcd);
+
+ usb_remove_hcd(hcd);
+
+ iounmap(hcd->regs);
+ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+
+ usb_put_hcd(hcd);
+}
+EXPORT_SYMBOL_GPL(ssb_ehci_detach);

View File

@ -1,13 +1,13 @@
--- linux-2.6.32.10.orig/drivers/net/bcm63xx_enet.c 2010-04-06 19:25:52.612158288 +0100
+++ linux-2.6.32.10/drivers/net/bcm63xx_enet.c 2010-04-07 21:40:26.991801424 +0100
@@ -965,7 +965,9 @@
/* all set, enable mac and interrupts, start dma engine and
* kick rx dma channel */
wmb();
- enet_writel(priv, ENET_CTL_ENABLE_MASK, ENET_CTL_REG);
+ val = enet_readl(priv, ENET_CTL_REG);
+ val |= ENET_CTL_ENABLE_MASK;
+ enet_writel(priv, val, ENET_CTL_REG);
enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG);
enet_dma_writel(priv, ENETDMA_CHANCFG_EN_MASK,
ENETDMA_CHANCFG_REG(priv->rx_chan));
--- linux-2.6.32.10.orig/drivers/net/bcm63xx_enet.c 2010-04-06 19:25:52.612158288 +0100
+++ linux-2.6.32.10/drivers/net/bcm63xx_enet.c 2010-04-07 21:40:26.991801424 +0100
@@ -965,7 +965,9 @@
/* all set, enable mac and interrupts, start dma engine and
* kick rx dma channel */
wmb();
- enet_writel(priv, ENET_CTL_ENABLE_MASK, ENET_CTL_REG);
+ val = enet_readl(priv, ENET_CTL_REG);
+ val |= ENET_CTL_ENABLE_MASK;
+ enet_writel(priv, val, ENET_CTL_REG);
enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG);
enet_dma_writel(priv, ENETDMA_CHANCFG_EN_MASK,
ENETDMA_CHANCFG_REG(priv->rx_chan));

View File

@ -2164,7 +2164,6 @@ CONFIG_SQUASHFS_LZMA=y
CONFIG_SQUASHFS_SUPPORT_ZLIB=y
# CONFIG_SQUASHFS_VMALLOC is not set
CONFIG_SQUASHFS=y
# CONFIG_SSB_BLOCKIO is not set
# CONFIG_SSB_DEBUG is not set
# CONFIG_SSB is not set
# CONFIG_SSB_PCMCIAHOST is not set

View File

@ -2283,7 +2283,6 @@ CONFIG_SQUASHFS_LZMA=y
CONFIG_SQUASHFS_SUPPORT_ZLIB=y
# CONFIG_SQUASHFS_VMALLOC is not set
CONFIG_SQUASHFS=y
# CONFIG_SSB_BLOCKIO is not set
# CONFIG_SSB_DEBUG is not set
# CONFIG_SSB is not set
# CONFIG_SSB_PCMCIAHOST is not set

View File

@ -128,7 +128,170 @@
+EXPORT_SYMBOL(ssb_pmu_set_ldo_paref);
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -472,6 +472,8 @@ static int ssb_devices_register(struct s
@@ -120,6 +120,19 @@ static void ssb_device_put(struct ssb_de
put_device(dev->dev);
}
+static inline struct ssb_driver *ssb_driver_get(struct ssb_driver *drv)
+{
+ if (drv)
+ get_driver(&drv->drv);
+ return drv;
+}
+
+static inline void ssb_driver_put(struct ssb_driver *drv)
+{
+ if (drv)
+ put_driver(&drv->drv);
+}
+
static int ssb_device_resume(struct device *dev)
{
struct ssb_device *ssb_dev = dev_to_ssb_dev(dev);
@@ -190,90 +203,81 @@ int ssb_bus_suspend(struct ssb_bus *bus)
EXPORT_SYMBOL(ssb_bus_suspend);
#ifdef CONFIG_SSB_SPROM
-int ssb_devices_freeze(struct ssb_bus *bus)
+/** ssb_devices_freeze - Freeze all devices on the bus.
+ *
+ * After freezing no device driver will be handling a device
+ * on this bus anymore. ssb_devices_thaw() must be called after
+ * a successful freeze to reactivate the devices.
+ *
+ * @bus: The bus.
+ * @ctx: Context structure. Pass this to ssb_devices_thaw().
+ */
+int ssb_devices_freeze(struct ssb_bus *bus, struct ssb_freeze_context *ctx)
{
- struct ssb_device *dev;
- struct ssb_driver *drv;
- int err = 0;
- int i;
- pm_message_t state = PMSG_FREEZE;
+ struct ssb_device *sdev;
+ struct ssb_driver *sdrv;
+ unsigned int i;
+
+ memset(ctx, 0, sizeof(*ctx));
+ ctx->bus = bus;
+ SSB_WARN_ON(bus->nr_devices > ARRAY_SIZE(ctx->device_frozen));
- /* First check that we are capable to freeze all devices. */
for (i = 0; i < bus->nr_devices; i++) {
- dev = &(bus->devices[i]);
- if (!dev->dev ||
- !dev->dev->driver ||
- !device_is_registered(dev->dev))
- continue;
- drv = drv_to_ssb_drv(dev->dev->driver);
- if (!drv)
+ sdev = ssb_device_get(&bus->devices[i]);
+
+ if (!sdev->dev || !sdev->dev->driver ||
+ !device_is_registered(sdev->dev)) {
+ ssb_device_put(sdev);
continue;
- if (!drv->suspend) {
- /* Nope, can't suspend this one. */
- return -EOPNOTSUPP;
}
- }
- /* Now suspend all devices */
- for (i = 0; i < bus->nr_devices; i++) {
- dev = &(bus->devices[i]);
- if (!dev->dev ||
- !dev->dev->driver ||
- !device_is_registered(dev->dev))
- continue;
- drv = drv_to_ssb_drv(dev->dev->driver);
- if (!drv)
+ sdrv = ssb_driver_get(drv_to_ssb_drv(sdev->dev->driver));
+ if (!sdrv || SSB_WARN_ON(!sdrv->remove)) {
+ ssb_device_put(sdev);
continue;
- err = drv->suspend(dev, state);
- if (err) {
- ssb_printk(KERN_ERR PFX "Failed to freeze device %s\n",
- dev_name(dev->dev));
- goto err_unwind;
}
+ sdrv->remove(sdev);
+ ctx->device_frozen[i] = 1;
}
return 0;
-err_unwind:
- for (i--; i >= 0; i--) {
- dev = &(bus->devices[i]);
- if (!dev->dev ||
- !dev->dev->driver ||
- !device_is_registered(dev->dev))
- continue;
- drv = drv_to_ssb_drv(dev->dev->driver);
- if (!drv)
- continue;
- if (drv->resume)
- drv->resume(dev);
- }
- return err;
}
-int ssb_devices_thaw(struct ssb_bus *bus)
+/** ssb_devices_thaw - Unfreeze all devices on the bus.
+ *
+ * This will re-attach the device drivers and re-init the devices.
+ *
+ * @ctx: The context structure from ssb_devices_freeze()
+ */
+int ssb_devices_thaw(struct ssb_freeze_context *ctx)
{
- struct ssb_device *dev;
- struct ssb_driver *drv;
- int err;
- int i;
+ struct ssb_bus *bus = ctx->bus;
+ struct ssb_device *sdev;
+ struct ssb_driver *sdrv;
+ unsigned int i;
+ int err, result = 0;
for (i = 0; i < bus->nr_devices; i++) {
- dev = &(bus->devices[i]);
- if (!dev->dev ||
- !dev->dev->driver ||
- !device_is_registered(dev->dev))
+ if (!ctx->device_frozen[i])
continue;
- drv = drv_to_ssb_drv(dev->dev->driver);
- if (!drv)
+ sdev = &bus->devices[i];
+
+ if (SSB_WARN_ON(!sdev->dev || !sdev->dev->driver))
continue;
- if (SSB_WARN_ON(!drv->resume))
+ sdrv = drv_to_ssb_drv(sdev->dev->driver);
+ if (SSB_WARN_ON(!sdrv || !sdrv->probe))
continue;
- err = drv->resume(dev);
+
+ err = sdrv->probe(sdev, &sdev->id);
if (err) {
ssb_printk(KERN_ERR PFX "Failed to thaw device %s\n",
- dev_name(dev->dev));
+ dev_name(sdev->dev));
+ result = err;
}
+ ssb_driver_put(sdrv);
+ ssb_device_put(sdev);
}
- return 0;
+ return result;
}
#endif /* CONFIG_SSB_SPROM */
@@ -472,6 +476,8 @@ static int ssb_devices_register(struct s
case SSB_BUSTYPE_SSB:
dev->dma_mask = &dev->coherent_dma_mask;
break;
@ -137,7 +300,7 @@
}
sdev->dev = dev;
@@ -1358,8 +1360,10 @@ static int __init ssb_modinit(void)
@@ -1358,8 +1364,10 @@ static int __init ssb_modinit(void)
ssb_buses_lock();
err = ssb_attach_queued_buses();
ssb_buses_unlock();
@ -149,7 +312,7 @@
err = b43_pci_ssb_bridge_init();
if (err) {
@@ -1375,7 +1379,7 @@ static int __init ssb_modinit(void)
@@ -1375,7 +1383,7 @@ static int __init ssb_modinit(void)
/* don't fail SSB init because of this */
err = 0;
}

View File

@ -1,6 +1,14 @@
--- a/drivers/ssb/Kconfig
+++ b/drivers/ssb/Kconfig
@@ -49,7 +49,7 @@ config SSB_PCIHOST
@@ -29,6 +29,7 @@ config SSB_SPROM
config SSB_BLOCKIO
bool
depends on SSB
+ default y
config SSB_PCIHOST_POSSIBLE
bool
@@ -49,7 +50,7 @@ config SSB_PCIHOST
config SSB_B43_PCI_BRIDGE
bool
depends on SSB_PCIHOST

View File

@ -1,6 +1,14 @@
--- a/drivers/ssb/Kconfig
+++ b/drivers/ssb/Kconfig
@@ -49,7 +49,7 @@ config SSB_PCIHOST
@@ -29,6 +29,7 @@ config SSB_SPROM
config SSB_BLOCKIO
bool
depends on SSB
+ default y
config SSB_PCIHOST_POSSIBLE
bool
@@ -49,7 +50,7 @@ config SSB_PCIHOST
config SSB_B43_PCI_BRIDGE
bool
depends on SSB_PCIHOST

View File

@ -1,24 +0,0 @@
#
# Copyright (C) 2006-2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
ARCH:=arm
BOARD:=mx2
BOARDNAME:=Freescale MX2
FEATURES:=jffs2
CFLAGS:=-Os -pipe -march=armv5te -mtune=arm926ej-s -funit-at-a-time
LINUX_VERSION:=2.6.34-rc3
DEVICE_TYPE=phone
define Target/Description
endef
include $(INCLUDE_DIR)/target.mk
$(eval $(call BuildTarget))

View File

@ -1,174 +0,0 @@
# CONFIG_AEABI is not set
CONFIG_ALIGNMENT_TRAP=y
# CONFIG_ARCH_MX1 is not set
CONFIG_ARCH_MX2=y
# CONFIG_ARCH_MX25 is not set
# CONFIG_ARCH_MX3 is not set
# CONFIG_ARCH_MX5 is not set
CONFIG_ARCH_MXC=y
# CONFIG_ARCH_MXC91231 is not set
CONFIG_ARCH_MXC_AUDMUX_V1=y
# CONFIG_ARCH_NUC93X is not set
CONFIG_ARCH_REQUIRE_GPIOLIB=y
# CONFIG_ARCH_S5P6440 is not set
# CONFIG_ARCH_S5P6442 is not set
# CONFIG_ARCH_S5PV210 is not set
# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
# CONFIG_ARCH_SHMOBILE is not set
# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
# CONFIG_ARCH_SUPPORTS_MSI is not set
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARM=y
CONFIG_ARM_L1_CACHE_SHIFT=5
CONFIG_ARM_THUMB=y
CONFIG_BITREVERSE=y
# CONFIG_BLK_DEV is not set
# CONFIG_BLK_DEV_INITRD is not set
CONFIG_BRIDGE_IGMP_SNOOPING=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_CEPH_FS is not set
CONFIG_CMDLINE="unused -- bootloader passes ATAG list"
CONFIG_COMMON_CLKDEV=y
CONFIG_COMPAT_BRK=y
CONFIG_CPU_32v5=y
CONFIG_CPU_ABRT_EV5TJ=y
CONFIG_CPU_ARM926T=y
# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
CONFIG_CPU_CACHE_VIVT=y
CONFIG_CPU_COPY_V4WB=y
CONFIG_CPU_CP15=y
CONFIG_CPU_CP15_MMU=y
# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
# CONFIG_CPU_ICACHE_DISABLE is not set
CONFIG_CPU_PABRT_LEGACY=y
CONFIG_CPU_TLB_V4WBI=y
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_USER is not set
CONFIG_DECOMPRESS_LZMA=y
# CONFIG_DEFAULT_SECURITY_SELINUX is not set
# CONFIG_DEFAULT_SECURITY_SMACK is not set
# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_FPE_FASTFPE is not set
# CONFIG_FPE_NWFPE is not set
CONFIG_FRAME_POINTER=y
# CONFIG_FSNOTIFY is not set
CONFIG_GENERIC_ATOMIC64=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_FIND_LAST_BIT=y
CONFIG_GENERIC_GPIO=y
CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
CONFIG_GPIOLIB=y
# CONFIG_GPIO_IT8761E is not set
CONFIG_GPIO_SYSFS=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAVE_AOUT=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_HAVE_CLK=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_HAVE_IDE=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_HAVE_PROC_CPU=y
# CONFIG_HW_RANDOM is not set
CONFIG_IMX_HAVE_IOMUX_V1=y
# CONFIG_INLINE_READ_LOCK is not set
# CONFIG_INLINE_READ_LOCK_BH is not set
# CONFIG_INLINE_READ_LOCK_IRQ is not set
# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
# CONFIG_INLINE_READ_TRYLOCK is not set
CONFIG_INLINE_READ_UNLOCK=y
# CONFIG_INLINE_READ_UNLOCK_BH is not set
CONFIG_INLINE_READ_UNLOCK_IRQ=y
# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_SPIN_LOCK is not set
# CONFIG_INLINE_SPIN_LOCK_BH is not set
# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
# CONFIG_INLINE_SPIN_TRYLOCK is not set
# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
CONFIG_INLINE_SPIN_UNLOCK=y
# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
# CONFIG_INLINE_WRITE_LOCK is not set
# CONFIG_INLINE_WRITE_LOCK_BH is not set
# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
# CONFIG_INLINE_WRITE_TRYLOCK is not set
CONFIG_INLINE_WRITE_UNLOCK=y
# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
CONFIG_INPUT=y
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_KEYBOARD=y
# CONFIG_INPUT_MISC is not set
# CONFIG_ISDN_CAPI is not set
# CONFIG_ISDN_DRV_GIGASET is not set
# CONFIG_ISDN_I4L is not set
CONFIG_KEYBOARD_ATKBD=y
CONFIG_KEYBOARD_GPIO=y
CONFIG_KEYBOARD_IMX=y
# CONFIG_KEYBOARD_LKKBD is not set
# CONFIG_KEYBOARD_MATRIX is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_XTKBD is not set
CONFIG_LEDS_GPIO=y
# CONFIG_LEDS_TRIGGER_NETDEV is not set
# CONFIG_LKDTM is not set
# CONFIG_LOGFS is not set
CONFIG_MACH_MX21=y
# CONFIG_MACH_MX21ADS is not set
# CONFIG_MACH_MX27 is not set
CONFIG_MACH_VP6500=y
# CONFIG_MFD_T7L66XB is not set
# CONFIG_MTD_CFI_INTELEXT is not set
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_PHYSMAP=y
# CONFIG_MUTEX_SPIN_ON_OWNER is not set
# CONFIG_MXC_IRQ_PRIOR is not set
# CONFIG_MXC_PWM is not set
CONFIG_NEED_DMA_MAP_STATE=y
# CONFIG_NETDEV_1000 is not set
# CONFIG_NET_ETHERNET is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_PAGE_OFFSET=0xC0000000
# CONFIG_PCI_SYSCALL is not set
CONFIG_PERF_USE_VMALLOC=y
CONFIG_RATIONAL=y
# CONFIG_SCSI_DMA is not set
CONFIG_SCSI_MOD=y
# CONFIG_SERIAL_8250 is not set
CONFIG_SERIAL_IMX=y
CONFIG_SERIAL_IMX_CONSOLE=y
# CONFIG_SERIAL_TIMBERDALE is not set
CONFIG_SERIO=y
# CONFIG_SERIO_ALTERA_PS2 is not set
CONFIG_SERIO_LIBPS2=y
# CONFIG_SERIO_RAW is not set
CONFIG_SERIO_SERPORT=y
CONFIG_SPLIT_PTLOCK_CPUS=999999
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
# CONFIG_TREE_PREEMPT_RCU is not set
# CONFIG_UID16 is not set
CONFIG_VECTORS_BASE=0xffff0000
# CONFIG_VFP is not set
# CONFIG_WATCHDOG is not set
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZONE_DMA_FLAG=0

View File

@ -1,255 +0,0 @@
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/physmap.h>
#include <linux/gpio.h>
#include <linux/leds.h>
#include <mach/common.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/time.h>
#include <asm/mach/map.h>
#include <mach/imx-uart.h>
#include <mach/imxfb.h>
#include <mach/iomux-mx21.h>
#include <mach/board-vp6500.h>
#include "devices.h"
#include <linux/input.h>
#include <linux/input/matrix_keypad.h>
#include <linux/gpio_keys.h>
#include <linux/pwm_backlight.h>
static unsigned int vp6500_pins[] = {
/* UART1 */
PE12_PF_UART1_TXD,
PE13_PF_UART1_RXD,
#if 0
/* LCDC */
PA5_PF_LSCLK,
PA6_PF_LD0,
PA7_PF_LD1,
PA8_PF_LD2,
PA9_PF_LD3,
PA10_PF_LD4,
PA11_PF_LD5,
PA12_PF_LD6,
PA13_PF_LD7,
PA14_PF_LD8,
PA15_PF_LD9,
PA16_PF_LD10,
PA17_PF_LD11,
PA18_PF_LD12,
PA19_PF_LD13,
PA20_PF_LD14,
PA21_PF_LD15,
PA22_PF_LD16,
PA28_PF_HSYNC,
PA29_PF_VSYNC,
PA30_PF_CONTRAST,
PA31_PF_OE_ACD,
#endif
/* LCD Backlight */
PE5_PF_PWMO,
VP6500_GPIO_BACKLIGHT_EN | GPIO_GPIO | GPIO_OUT,
};
/* Flash */
static struct physmap_flash_data vp6500_flash_data = {
.width = 2,
};
static struct resource vp6500_flash_resource = {
.start = MX21_CS0_BASE_ADDR,
.end = MX21_CS0_BASE_ADDR + SZ_64M - 1,
.flags = IORESOURCE_MEM,
};
static struct platform_device vp6500_nor_mtd_device = {
.name = "physmap-flash",
.id = -1,
.dev = {
.platform_data = &vp6500_flash_data,
},
.num_resources = 1,
.resource = &vp6500_flash_resource,
};
/* LEDs */
static struct gpio_led vp6500_leds[] = {
{
.name = "vp6500:orange:keypad",
.gpio = VP6500_GPIO_LED_KEYPAD,
},
{
.name = "vp6500:green:",
.gpio = VP6500_GPIO_LED_GREEN,
.active_low = 1,
.default_state = LEDS_GPIO_DEFSTATE_ON,
},
{
.name = "vp6500:red:",
.gpio = VP6500_GPIO_LED_RED,
},
{
.name = "vp6500:red:camera",
.gpio = VP6500_GPIO_LED_CAMERA,
},
};
static struct gpio_led_platform_data vp6500_leds_data = {
.leds = vp6500_leds,
.num_leds = ARRAY_SIZE(vp6500_leds),
};
static struct platform_device vp6500_leds_device = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = &vp6500_leds_data,
},
};
/* Keypad */
static const uint32_t vp6500_keypad_keys[] = {
KEY(0, 3, KEY_F2),
KEY(0, 4, KEY_RIGHT),
KEY(1, 0, KEY_ZOOM),
KEY(1, 1, KEY_NUMERIC_POUND),
KEY(1, 2, KEY_0),
KEY(1, 3, KEY_ENTER),
KEY(1, 4, KEY_8),
KEY(2, 0, KEY_5),
KEY(2, 1, KEY_2),
KEY(2, 2, KEY_DOWN),
KEY(2, 3, KEY_OK),
KEY(2, 4, KEY_UP),
KEY(3, 0, KEY_CAMERA),
KEY(3, 1, KEY_NUMERIC_STAR),
KEY(3, 2, KEY_9),
KEY(3, 3, KEY_LEFT),
KEY(3, 4, KEY_6),
KEY(4, 0, KEY_7),
KEY(4, 1, KEY_4),
KEY(4, 2, KEY_1),
KEY(4, 3, KEY_3),
KEY(4, 4, KEY_F1),
};
static struct matrix_keymap_data vp6500_keypad_data = {
.keymap = vp6500_keypad_keys,
.keymap_size = ARRAY_SIZE(vp6500_keypad_keys),
};
static struct resource vp6500_keypad_resources[] = {
{
.start = MX21_KPP_BASE_ADDR,
.end = MX21_KPP_BASE_ADDR + 0x10 - 1,
.flags = IORESOURCE_MEM,
},
{
.start = MX21_INT_KPP,
.flags = IORESOURCE_IRQ,
}
};
static struct platform_device vp6500_keypad_device = {
.name = "imx-keypad",
.id = 0,
.dev = {
.platform_data = &vp6500_keypad_data,
},
.resource = vp6500_keypad_resources,
.num_resources = ARRAY_SIZE(vp6500_keypad_resources),
};
static struct gpio_keys_button vp6500_keys = {
.gpio = VP6500_GPIO_POWER_KEY,
.code = KEY_POWER,
.desc = "Power button",
.active_low = 1,
};
static struct gpio_keys_platform_data vp6500_key_data = {
.buttons = &vp6500_keys,
.nbuttons = 1,
};
static struct platform_device vp6500_key_device = {
.name = "gpio-keys",
.id = -1,
.dev = {
.platform_data = &vp6500_key_data,
},
};
/* LCD backlight */
static int vp6500_backlight_notify(struct device *dev, int brightness)
{
gpio_set_value(VP6500_GPIO_BACKLIGHT_EN, !!brightness);
return brightness;
}
static struct platform_pwm_backlight_data vp6500_backlight_data = {
.max_brightness = 255,
.dft_brightness = 100,
.pwm_period_ns = 15000000,
.notify = vp6500_backlight_notify,
};
static struct platform_device vp6500_backlight_device = {
.name = "pwm-backlight",
.id = -1,
.dev = {
.parent = &mxc_pwm_device.dev,
.platform_data = &vp6500_backlight_data,
},
};
static struct platform_device *platform_devices[] __initdata = {
&vp6500_nor_mtd_device,
&vp6500_leds_device,
&vp6500_keypad_device,
&vp6500_key_device,
&vp6500_backlight_device,
};
static void __init vp6500_board_init(void)
{
mxc_gpio_setup_multiple_pins(vp6500_pins, ARRAY_SIZE(vp6500_pins),
"vp6500");
mxc_register_device(&mxc_uart_device0, NULL);
mxc_register_device(&mxc_pwm_device, NULL);
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
}
static void __init vp6500_timer_init(void)
{
mx21_clocks_init(32768, 26000000);
}
static struct sys_timer vp6500_timer = {
.init = vp6500_timer_init,
};
MACHINE_START(VP6500, "Phillips VP6500")
.phys_io = MX21_AIPI_BASE_ADDR,
.io_pg_offst = ((MX21_AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
.boot_params = MX21_PHYS_OFFSET + 0x100,
.map_io = mx21_map_io,
.init_irq = mx21_init_irq,
.init_machine = vp6500_board_init,
.timer = &vp6500_timer,
MACHINE_END

View File

@ -1,17 +0,0 @@
#ifndef __BOARD_VP6500__
#define __BOARD_VP6500__
#define VP6500_GPIO_POWER_KEY GPIO_PORTB | 5
#define VP6500_GPIO_CAMERA_DIRECTION GPIO_PORTB | 13
#define VP6500_GPIO_LED_KEYPAD GPIO_PORTC | 18
#define VP6500_GPIO_AMP_ENABLE GPIO_PORTC | 25
#define VP6500_GPIO_LED_RED GPIO_PORTC | 27
#define VP6500_GPIO_LED_GREEN GPIO_PORTC | 28
#define VP6500_GPIO_LED_CAMERA GPIO_PORTC | 29
#define VP6500_GPIO_BACKLIGHT_EN GPIO_PORTE | 10
#define VP6500_GPIO_TLV_RESET GPIO_PORTB | 27
#define VP6500_GPIO_TLV_ENABLE GPIO_PORTC | 25
#endif

View File

@ -1,28 +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)/image.mk
JFFS2_BLOCKSIZE=128k 16k
#JFFS2OPTS += -n -s 2048
JFFS2OPTS += -n
define Image/BuildKernel
mkdir -p $(BIN_DIR)
cp $(KDIR)/vmlinuz $(BIN_DIR)/$(IMG_PREFIX)-zImage
endef
define Image/Prepare
cp $(LINUX_DIR)/arch/arm/boot/zImage $(KDIR)/vmlinuz
endef
define Image/Build/squashfs
$(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-root.$(1))
endef
$(eval $(call BuildImage))

View File

@ -1,22 +0,0 @@
--- a/arch/arm/mach-mx2/Kconfig 2010-04-10 13:56:17.000000000 +0200
+++ b/arch/arm/mach-mx2/Kconfig 2010-04-10 13:42:38.000000000 +0200
@@ -27,6 +27,12 @@
Include support for MX21ADS platform. This includes specific
configurations for the board and its peripherals.
+config MACH_VP6500
+ bool "Phillips VP6500 VoIP phone"
+ depends on MACH_MX21
+ help
+ Include support for the Phillips VP6500 VoIP phone.
+
config MACH_MX27ADS
bool "MX27ADS platform"
depends on MACH_MX27
--- a/arch/arm/mach-mx2/Makefile 2010-04-10 13:56:17.000000000 +0200
+++ b/arch/arm/mach-mx2/Makefile 2010-04-10 13:49:32.000000000 +0200
@@ -21,3 +21,4 @@
obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o
obj-$(CONFIG_MACH_PCA100) += mach-pca100.o
obj-$(CONFIG_MACH_MXT_TD60) += mach-mxt_td60.o
+obj-$(CONFIG_MACH_VP6500) += mach-vp6500.o

View File

@ -1,11 +0,0 @@
--- a/arch/arm/tools/mach-types 2010-04-10 13:56:20.000000000 +0200
+++ b/arch/arm/tools/mach-types 2010-04-10 15:24:46.000000000 +0200
@@ -530,7 +530,7 @@
dp1000 MACH_DP1000 DP1000 514
omap_osk MACH_OMAP_OSK OMAP_OSK 515
rg100v3 MACH_RG100V3 RG100V3 516
-mx2ads MACH_MX2ADS MX2ADS 517
+vp6500 MACH_VP6500 VP6500 517
pxa_kilo MACH_PXA_KILO PXA_KILO 518
ixp4xx_eagle MACH_IXP4XX_EAGLE IXP4XX_EAGLE 519
tosa MACH_TOSA TOSA 520

View File

@ -1,22 +0,0 @@
--- a/arch/arm/mach-mx2/devices.c 2010-04-10 13:56:17.000000000 +0200
+++ b/arch/arm/mach-mx2/devices.c 2010-04-10 15:15:17.000000000 +0200
@@ -304,7 +304,7 @@
#ifdef CONFIG_MACH_MX27
static struct resource otg_resources[] = {
{
- .start = MX27_USBOTG_BASE_ADDR,
+ .start = MX27_usbotg_BASE_ADDR,
.end = MX27_USBOTG_BASE_ADDR + 0x1ff,
.flags = IORESOURCE_MEM,
}, {
@@ -483,8 +483,8 @@
#ifdef CONFIG_MACH_MX21
static struct resource mx21_usbhc_resources[] = {
{
- .start = MX21_BASE_ADDR,
- .end = MX21_BASE_ADDR + 0x1FFF,
+ .start = MX21_USBOTG_BASE_ADDR,
+ .end = MX21_USBOTG_BASE_ADDR + 0x1FFF,
.flags = IORESOURCE_MEM,
},
{

View File

@ -1,73 +0,0 @@
This patch allows using a kernel image compressed with LZMA on ARM.
Extracting the image is fairly slow, but it might be useful on machines
with a very limited amount of storage, as the size benefit is quite
significant:
Gzip: Data Size: 1586352 Bytes = 1549.17 kB = 1.51 MB
LZMA: Data Size: 2135916 Bytes = 2085.86 kB = 2.04 MB
Signed-off-by: Albin Tonnerre <albin.tonnerre <at> free-electrons.com>
Tested-by: Martin Michlmayr <tbm <at> cyrius.com>
---
v2: Updated to apply on top of 2.6.34-rc1
arch/arm/Kconfig | 1 +
arch/arm/boot/compressed/Makefile | 1 +
arch/arm/boot/compressed/decompress.c | 4 ++++
arch/arm/boot/compressed/piggy.lzma.S | 6 ++++++
4 files changed, 12 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/boot/compressed/piggy.lzma.S
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3b18128..3ebc7c3 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -21,6 +21,7 @@ config ARM
select HAVE_GENERIC_DMA_COHERENT
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_LZO
+ select HAVE_KERNEL_LZMA
select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC
help
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 97c89e7..53faa90 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -65,6 +65,7 @@ SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
suffix_$(CONFIG_KERNEL_GZIP) = gzip
suffix_$(CONFIG_KERNEL_LZO) = lzo
+suffix_$(CONFIG_KERNEL_LZMA) = lzma
targets := vmlinux vmlinux.lds \
piggy.$(suffix_y) piggy.$(suffix_y).o \
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
index 0da382f..d554df6 100644
--- a/arch/arm/boot/compressed/decompress.c
+++ b/arch/arm/boot/compressed/decompress.c
@@ -39,6 +39,10 @@ extern void error(char *);
#include "../../../../lib/decompress_unlzo.c"
#endif
+#ifdef CONFIG_KERNEL_LZMA
+#include "../../../../lib/decompress_unlzma.c"
+#endif
+
void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
{
decompress(input, len, NULL, NULL, output, NULL, error);
diff --git a/arch/arm/boot/compressed/piggy.lzma.S b/arch/arm/boot/compressed/piggy.lzma.S
new file mode 100644
index 0000000..d7e69cf
--- /dev/null
+++ b/arch/arm/boot/compressed/piggy.lzma.S
@@ -0,0 +1,6 @@
+ .section .piggydata,#alloc
+ .globl input_data
+input_data:
+ .incbin "arch/arm/boot/compressed/piggy.lzma"
+ .globl input_data_end
+input_data_end:
--
1.7.0

View File

@ -1,137 +0,0 @@
diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c
index c36f263..acc5dc1 100644
--- a/arch/arm/plat-mxc/pwm.c
+++ b/arch/arm/plat-mxc/pwm.c
@@ -25,6 +25,11 @@
#define MX1_PWMS 0x04 /* PWM Sample Register */
#define MX1_PWMP 0x08 /* PWM Period Register */
+#define MX1_PWMC_EN (1 << 4)
+#define MX1_PWMC_PRESCALER_MASK (0x7f << 8)
+#define MX1_PWMC_PRESCALER(x) ((x & 0x7f) << 8)
+#define MX1_PWMC_CLKSEL_MASK 0x3
+#define MX1_PWMC_CLKSEL(x) ((x & 0x3))
/* i.MX27, i.MX31, i.MX35 share the same PWM function block: */
@@ -54,25 +59,32 @@ struct pwm_device {
int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
{
+ unsigned long long c;
+ unsigned long period_cycles, duty_cycles, prescale;
+
if (pwm == NULL || period_ns == 0 || duty_ns > period_ns)
return -EINVAL;
- if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) {
- unsigned long long c;
- unsigned long period_cycles, duty_cycles, prescale;
- u32 cr;
+ c = clk_get_rate(pwm->clk);
+
+ c = c * period_ns;
+
+ if (cpu_is_mx1() || cpu_is_mx2())
+ c >>= 1;
- c = clk_get_rate(pwm->clk);
- c = c * period_ns;
- do_div(c, 1000000000);
- period_cycles = c;
+ do_div(c, 1000000000);
+ period_cycles = c;
- prescale = period_cycles / 0x10000 + 1;
+ prescale = period_cycles / 0x10000 + 1;
- period_cycles /= prescale;
- c = (unsigned long long)period_cycles * duty_ns;
- do_div(c, period_ns);
- duty_cycles = c;
+ period_cycles /= prescale;
+ c = (unsigned long long)period_cycles * duty_ns;
+ do_div(c, period_ns);
+ duty_cycles = c;
+
+
+ if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) {
+ u32 cr;
writel(duty_cycles, pwm->mmio_base + MX3_PWMSAR);
writel(period_cycles, pwm->mmio_base + MX3_PWMPR);
@@ -86,25 +98,28 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
writel(cr, pwm->mmio_base + MX3_PWMCR);
} else if (cpu_is_mx1() || cpu_is_mx21()) {
- /* The PWM subsystem allows for exact frequencies. However,
- * I cannot connect a scope on my device to the PWM line and
- * thus cannot provide the program the PWM controller
- * exactly. Instead, I'm relying on the fact that the
- * Bootloader (u-boot or WinCE+haret) has programmed the PWM
- * function group already. So I'll just modify the PWM sample
- * register to follow the ratio of duty_ns vs. period_ns
- * accordingly.
- *
- * This is good enough for programming the brightness of
- * the LCD backlight.
- *
- * The real implementation would divide PERCLK[0] first by
- * both the prescaler (/1 .. /128) and then by CLKSEL
- * (/2 .. /16).
- */
- u32 max = readl(pwm->mmio_base + MX1_PWMP);
- u32 p = max * duty_ns / period_ns;
- writel(max - p, pwm->mmio_base + MX1_PWMS);
+ unsigned long clksel = 0;
+ u32 ctrl;
+
+ while (prescale >= 0x80 && clksel < 4) {
+ prescale >>= 1;
+ ++clksel;
+ }
+
+ if (clksel > 3)
+ return -EINVAL;
+
+ ctrl = readl(pwm->mmio_base + MX1_PWMC);
+ writel(ctrl & ~MX1_PWMC_EN, pwm->mmio_base + MX1_PWMC);
+
+ writel(duty_cycles, pwm->mmio_base + MX1_PWMS);
+ writel(period_cycles, pwm->mmio_base + MX1_PWMP);
+
+ ctrl &= ~(MX1_PWMC_PRESCALER_MASK | MX1_PWMC_CLKSEL_MASK);
+ ctrl |= MX1_PWMC_PRESCALER(prescale);
+ ctrl |= MX1_PWMC_CLKSEL(clksel);
+ writel(ctrl, pwm->mmio_base + MX1_PWMC);
+
} else {
BUG();
}
@@ -116,6 +130,11 @@ EXPORT_SYMBOL(pwm_config);
int pwm_enable(struct pwm_device *pwm)
{
int rc = 0;
+ if (cpu_is_mx1() || cpu_is_mx2()) {
+ u32 ctrl;
+ ctrl = readl(pwm->mmio_base + MX1_PWMC);
+ writel(ctrl | MX1_PWMC_EN, pwm->mmio_base + MX1_PWMC);
+ }
if (!pwm->clk_enabled) {
rc = clk_enable(pwm->clk);
@@ -128,7 +147,13 @@ EXPORT_SYMBOL(pwm_enable);
void pwm_disable(struct pwm_device *pwm)
{
- writel(0, pwm->mmio_base + MX3_PWMCR);
+ if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) {
+ writel(0, pwm->mmio_base + MX3_PWMCR);
+ } else if (cpu_is_mx1() || cpu_is_mx2()) {
+ u32 ctrl;
+ ctrl = readl(pwm->mmio_base + MX1_PWMC);
+ writel(ctrl & ~MX1_PWMC_EN, pwm->mmio_base + MX1_PWMC);
+ }
if (pwm->clk_enabled) {
clk_disable(pwm->clk);

View File

@ -28,6 +28,23 @@ set system.wifi_led.mode='link tx rx'
set system.wifi_led.default='0'
commit system
__EOF
# add mac address from U-Boot partition to lan and wan devices
MTD=`grep -e 'u-boot' /proc/mtd`
MTD=`echo ${MTD} | sed 's/[a-z]*\([0-9]*\):.*/\1/'`
[ -n "${MTD}" ] && {
MACADDR=`dd if=/dev/mtdblock${MTD} bs=1 skip=262048 count=6 2>/dev/null | hexdump -e '1/1 "%02x"'`
MACADDR2=$(( 0x${MACADDR} + 1))
MACADDR2=`printf "%012x" ${MACADDR2}`
MACADDR=`echo ${MACADDR} | sed 's/\(..\)/\1:/g' | sed 's/:$//'`
MACADDR2=`echo ${MACADDR2} | sed 's/\(..\)/\1:/g' | sed 's/:$//'`
uci set network.eth0.macaddr=${MACADDR}
uci set network.lan.macaddr=${MACADDR}
uci set network.wan.macaddr=${MACADDR2}
uci commit network
}
}
case "${hardware}" in

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