mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-27 19:03:08 +02:00
Merge branch 'master' of openwrt-backfire into xburst
Conflicts: target/linux/x86/image/Config.in
This commit is contained in:
commit
4ecc663fa9
@ -102,7 +102,7 @@ menu "Target Images"
|
|||||||
|
|
||||||
source "target/linux/*/image/Config.in"
|
source "target/linux/*/image/Config.in"
|
||||||
|
|
||||||
config TARGET_ROOTFS_FSPART
|
config TARGET_ROOTFS_PARTSIZE
|
||||||
int "Root filesystem partition size (in MB)"
|
int "Root filesystem partition size (in MB)"
|
||||||
depends X86_GRUB_IMAGES || TARGET_ROOTFS_EXT2FS || TARGET_rb532
|
depends X86_GRUB_IMAGES || TARGET_ROOTFS_EXT2FS || TARGET_rb532
|
||||||
default 48
|
default 48
|
||||||
|
@ -110,7 +110,7 @@ ifneq ($(CONFIG_TARGET_ROOTFS_TARGZ),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_TARGET_ROOTFS_EXT2FS),)
|
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
|
define Image/mkfs/ext2
|
||||||
$(STAGING_DIR_HOST)/bin/genext2fs -U -b $(E2SIZE) -N $(CONFIG_TARGET_ROOTFS_MAXINODE) -d $(TARGET_DIR)/ $(KDIR)/root.ext2
|
$(STAGING_DIR_HOST)/bin/genext2fs -U -b $(E2SIZE) -N $(CONFIG_TARGET_ROOTFS_MAXINODE) -d $(TARGET_DIR)/ $(KDIR)/root.ext2
|
||||||
|
@ -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.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||||||
|
|
||||||
PKG_NAME:=acx
|
PKG_NAME:=acx
|
||||||
PKG_VERSION:=20080210
|
PKG_VERSION:=20080210
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||||
PKG_SOURCE_URL:=@SF/acx100
|
PKG_SOURCE_URL:=@SF/acx100
|
||||||
|
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
PKG_NAME:=base-files
|
PKG_NAME:=base-files
|
||||||
PKG_RELEASE:=43
|
PKG_RELEASE:=43.1
|
||||||
|
|
||||||
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
|
||||||
|
|
||||||
|
@ -68,7 +68,36 @@ case "$ACTION" in
|
|||||||
ifup)
|
ifup)
|
||||||
include /lib/network
|
include /lib/network
|
||||||
scan_interfaces
|
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_route" route
|
||||||
config_foreach "add_route6" route6
|
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
|
esac
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ addif() {
|
|||||||
|
|
||||||
# PPP devices are configured by pppd, no need to run setup_interface here
|
# PPP devices are configured by pppd, no need to run setup_interface here
|
||||||
case "$INTERFACE" in
|
case "$INTERFACE" in
|
||||||
ppp*) return 0;;
|
ppp*|3g-*) return 0;;
|
||||||
ath*) return 0;;
|
ath*) return 0;;
|
||||||
wlan*) return 0;;
|
wlan*) return 0;;
|
||||||
esac
|
esac
|
||||||
@ -46,7 +46,7 @@ delif() {
|
|||||||
for ifc in $interfaces; do
|
for ifc in $interfaces; do
|
||||||
config_get iftype "$ifc" type
|
config_get iftype "$ifc" type
|
||||||
config_get ifs "$ifc" device
|
config_get ifs "$ifc" device
|
||||||
confdevs="$(uci get network.$ifc.ifname)"
|
confdevs="$(uci_get network.$ifc.ifname)"
|
||||||
for dev in $ifs; do
|
for dev in $ifs; do
|
||||||
[ "${dev%%\.*}" = "$INTERFACE" ] && {
|
[ "${dev%%\.*}" = "$INTERFACE" ] && {
|
||||||
list_contains confdevs "$dev" || list_remove ifs "$dev"
|
list_contains confdevs "$dev" || list_remove ifs "$dev"
|
||||||
|
@ -8,7 +8,6 @@ DEVICENAME ~~ (null|full|ptmx|tty|zero|gpio|hvc) {
|
|||||||
DEVICENAME ~~ (tun|tap[0-9]) {
|
DEVICENAME ~~ (tun|tap[0-9]) {
|
||||||
nothrottle
|
nothrottle
|
||||||
makedev /dev/net/%DEVICENAME% 0644
|
makedev /dev/net/%DEVICENAME% 0644
|
||||||
next
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DEVICENAME ~~ (ppp) {
|
DEVICENAME ~~ (ppp) {
|
||||||
|
@ -15,6 +15,20 @@ boot() {
|
|||||||
rm -f /etc/config/wireless
|
rm -f /etc/config/wireless
|
||||||
/sbin/wifi detect > /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() {
|
start() {
|
||||||
|
@ -32,6 +32,7 @@ find_mtd_part() {
|
|||||||
|
|
||||||
jffs2_ready () {
|
jffs2_ready () {
|
||||||
mtdpart="$(find_mtd_part rootfs_data)"
|
mtdpart="$(find_mtd_part rootfs_data)"
|
||||||
|
[ -z "$mtdpart" ] && return 1
|
||||||
magic=$(hexdump $mtdpart -n 4 -e '4/1 "%02x"')
|
magic=$(hexdump $mtdpart -n 4 -e '4/1 "%02x"')
|
||||||
[ "$magic" != "deadc0de" ]
|
[ "$magic" != "deadc0de" ]
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,52 @@ add_vlan() {
|
|||||||
return 1
|
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 the device list, drop duplicates
|
||||||
sort_list() {
|
sort_list() {
|
||||||
local arg="$*"
|
local arg="$*"
|
||||||
@ -115,7 +161,18 @@ prepare_interface() {
|
|||||||
config_get iftype "$config" type
|
config_get iftype "$config" type
|
||||||
case "$iftype" in
|
case "$iftype" in
|
||||||
bridge)
|
bridge)
|
||||||
|
local macaddr
|
||||||
|
config_get macaddr "$config" macaddr
|
||||||
[ -x /usr/sbin/brctl ] && {
|
[ -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 && {
|
ifconfig "br-$config" 2>/dev/null >/dev/null && {
|
||||||
local newdevs devices
|
local newdevs devices
|
||||||
config_get devices "$config" device
|
config_get devices "$config" device
|
||||||
@ -139,7 +196,7 @@ prepare_interface() {
|
|||||||
# result in another setup_interface() call, so we simply stop processing
|
# result in another setup_interface() call, so we simply stop processing
|
||||||
# the current event at this point.
|
# 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
|
return 1
|
||||||
}
|
}
|
||||||
;;
|
;;
|
||||||
@ -181,13 +238,7 @@ setup_interface_static() {
|
|||||||
[ -z "$ip6addr" ] || $DEBUG ifconfig "$iface" add "$ip6addr"
|
[ -z "$ip6addr" ] || $DEBUG ifconfig "$iface" add "$ip6addr"
|
||||||
[ -z "$gateway" ] || $DEBUG route add default gw "$gateway" dev "$iface"
|
[ -z "$gateway" ] || $DEBUG route add default gw "$gateway" dev "$iface"
|
||||||
[ -z "$ip6gw" ] || $DEBUG route -A inet6 add default gw "$ip6gw" dev "$iface"
|
[ -z "$ip6gw" ] || $DEBUG route -A inet6 add default gw "$ip6gw" dev "$iface"
|
||||||
[ -z "$dns" ] || {
|
[ -z "$dns" ] || add_dns "$config" $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
|
|
||||||
}
|
|
||||||
|
|
||||||
config_get type "$config" TYPE
|
config_get type "$config" TYPE
|
||||||
[ "$type" = "alias" ] && return 0
|
[ "$type" = "alias" ] && return 0
|
||||||
@ -204,6 +255,25 @@ setup_interface_alias() {
|
|||||||
config_get cfg "$config" interface
|
config_get cfg "$config" interface
|
||||||
[ "$parent" == "$cfg" ] || return 0
|
[ "$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
|
# alias counter
|
||||||
local ctr
|
local ctr
|
||||||
config_get ctr "$parent" alias_count 0
|
config_get ctr "$parent" alias_count 0
|
||||||
@ -216,14 +286,14 @@ setup_interface_alias() {
|
|||||||
append list "$config"
|
append list "$config"
|
||||||
config_set "$parent" aliases "$list"
|
config_set "$parent" aliases "$list"
|
||||||
|
|
||||||
iface="$iface:$ctr"
|
use_iface="$use_iface:$ctr"
|
||||||
set_interface_ifname "$config" "$iface"
|
set_interface_ifname "$config" "$use_iface"
|
||||||
|
|
||||||
local proto
|
local proto
|
||||||
config_get proto "$config" proto "static"
|
config_get proto "$config" proto "static"
|
||||||
case "${proto}" in
|
case "${proto}" in
|
||||||
static)
|
static)
|
||||||
setup_interface_static "$iface" "$config"
|
setup_interface_static "$use_iface" "$config"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unsupported type '$proto' for alias config '$config'"
|
echo "Unsupported type '$proto' for alias config '$config'"
|
||||||
@ -233,102 +303,110 @@ setup_interface_alias() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setup_interface() {
|
setup_interface() {
|
||||||
local iface_main="$1"
|
local iface="$1"
|
||||||
local config="$2"
|
local config="$2"
|
||||||
local proto="$3"
|
local proto="$3"
|
||||||
local vifmac="$4"
|
local vifmac="$4"
|
||||||
local ip6addr_main=
|
|
||||||
|
|
||||||
[ -n "$config" ] || {
|
[ -n "$config" ] || {
|
||||||
config=$(find_config "$iface_main")
|
config=$(find_config "$iface")
|
||||||
[ "$?" = 0 ] || return 1
|
[ "$?" = 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
|
# need to bring up the bridge and wait a second for
|
||||||
# it to switch to the 'forwarding' state, otherwise
|
# it to switch to the 'forwarding' state, otherwise
|
||||||
# it will lose its routes...
|
# it will lose its routes...
|
||||||
ifconfig "$iface_main" up
|
ifconfig "$iface" up
|
||||||
sleep 1
|
sleep 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Interface settings
|
# Interface settings
|
||||||
grep "$iface_main:" /proc/net/dev > /dev/null && {
|
grep "$iface:" /proc/net/dev > /dev/null && {
|
||||||
local mtu macaddr
|
local mtu macaddr
|
||||||
config_get mtu "$config" mtu
|
config_get mtu "$config" mtu
|
||||||
config_get macaddr "$config" macaddr
|
config_get macaddr "$config" macaddr
|
||||||
[ -n "$macaddr" ] && $DEBUG ifconfig "$iface_main" down
|
[ -n "$macaddr" ] && $DEBUG ifconfig "$iface" down
|
||||||
$DEBUG ifconfig "$iface_main" ${macaddr:+hw ether "$macaddr"} ${mtu:+mtu $mtu} up
|
$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
|
[ -n "$proto" ] || config_get proto "$config" proto
|
||||||
case "$proto" in
|
case "$proto" in
|
||||||
static)
|
static)
|
||||||
config_get ip6addr_main "$config" ip6addr
|
setup_interface_static "$iface" "$config"
|
||||||
setup_interface_static "$iface_main" "$config"
|
|
||||||
;;
|
;;
|
||||||
dhcp)
|
dhcp)
|
||||||
|
local lockfile="/var/lock/dhcp-$iface"
|
||||||
|
lock "$lockfile"
|
||||||
|
|
||||||
# prevent udhcpc from starting more than once
|
# 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)"
|
local pid="$(cat "$pidfile" 2>/dev/null)"
|
||||||
if [ -d "/proc/$pid" ] && grep udhcpc "/proc/${pid}/cmdline" >/dev/null 2>/dev/null; then
|
if [ -d "/proc/$pid" ] && grep -qs udhcpc "/proc/${pid}/cmdline"; then
|
||||||
lock -u "/var/lock/dhcp-$iface_main"
|
lock -u "$lockfile"
|
||||||
else
|
else
|
||||||
local ipaddr netmask hostname proto1 clientid
|
local ipaddr netmask hostname proto1 clientid broadcast
|
||||||
config_get ipaddr "$config" ipaddr
|
config_get ipaddr "$config" ipaddr
|
||||||
config_get netmask "$config" netmask
|
config_get netmask "$config" netmask
|
||||||
config_get hostname "$config" hostname
|
config_get hostname "$config" hostname
|
||||||
config_get proto1 "$config" proto
|
config_get proto1 "$config" proto
|
||||||
config_get clientid "$config" clientid
|
config_get clientid "$config" clientid
|
||||||
|
config_get_bool broadcast "$config" broadcast 0
|
||||||
|
|
||||||
[ -z "$ipaddr" ] || \
|
[ -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)
|
# don't stay running in background if dhcp is not the main proto on the interface (e.g. when using pptp)
|
||||||
local dhcpopts
|
local dhcpopts
|
||||||
[ ."$proto1" != ."$proto" ] && dhcpopts="-n -q"
|
[ ."$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 &}
|
[ "$broadcast" = 1 ] && broadcast="-O broadcast" || broadcast=
|
||||||
lock -u "/var/lock/dhcp-$iface_main"
|
|
||||||
|
$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
|
fi
|
||||||
;;
|
;;
|
||||||
none)
|
none)
|
||||||
setup_interface_none "$iface_main" "$config"
|
setup_interface_none "$iface" "$config"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if ( eval "type setup_interface_$proto" ) >/dev/null 2>/dev/null; then
|
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
|
else
|
||||||
echo "Interface type $proto not supported."
|
echo "Interface type $proto not supported."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
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() {
|
stop_interface_dhcp() {
|
||||||
local config="$1"
|
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"
|
uci -P /var/state revert "network.$config"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,28 +29,6 @@ config_get iface "$cfg" device
|
|||||||
# call interface stop handler
|
# call interface stop handler
|
||||||
( type "stop_interface_$proto" ) >/dev/null 2>/dev/null && eval "stop_interface_$proto '$cfg'"
|
( 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 ifname "$cfg" ifname
|
||||||
config_get device "$cfg" device
|
config_get device "$cfg" device
|
||||||
|
|
||||||
@ -62,6 +40,9 @@ done
|
|||||||
config_get iftype "$cfg" type
|
config_get iftype "$cfg" type
|
||||||
[ "bridge" = "$iftype" ] && brctl delbr "$ifname" >/dev/null 2>/dev/null
|
[ "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
|
# remove the interface's network state
|
||||||
uci_revert_state network "$1"
|
uci_revert_state network "$1"
|
||||||
|
|
||||||
|
@ -11,11 +11,6 @@ change_state () {
|
|||||||
uci_set_state "$1" "$2" "$3" "$4"
|
uci_set_state "$1" "$2" "$3" "$4"
|
||||||
}
|
}
|
||||||
|
|
||||||
uci_get() {
|
|
||||||
[ -n "$ifc" ] || return
|
|
||||||
uci -P /dev/null get "$1" 2>/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
setup_interface () {
|
setup_interface () {
|
||||||
local old_ip
|
local old_ip
|
||||||
local old_broadcast
|
local old_broadcast
|
||||||
@ -144,21 +139,21 @@ setup_interface () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# DNS
|
# 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")
|
user_dns=$(uci_get "network.$ifc.dns")
|
||||||
[ -n "$user_dns" ] && dns="$user_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 "udhcpc: setting dns servers: $dns"
|
||||||
echo -n > "${RESOLV_CONF}.tmp"
|
add_dns "$ifc" $dns
|
||||||
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"
|
|
||||||
|
|
||||||
change_state network "$ifc" dnsdomain "$domain"
|
[ -n "$domain" ] && [ "$domain" != "$old_domain" ] && {
|
||||||
change_state network "$ifc" dns "$dns"
|
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
|
[ -n "$ifc" ] || return
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2009 OpenWrt.org
|
# Copyright (C) 2009-2010 OpenWrt.org
|
||||||
# Copyright (C) 2010 Vertical Communications
|
# Copyright (C) 2010 Vertical Communications
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the GNU General Public License v2.
|
# 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_NAME:=block-extroot
|
||||||
PKG_VERSION:=0.0.1
|
PKG_VERSION:=0.0.1
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
@ -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.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
PKG_NAME:=broadcom-diag
|
PKG_NAME:=broadcom-diag
|
||||||
PKG_RELEASE:=6
|
PKG_RELEASE:=7
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
@ -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.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||||||
|
|
||||||
PKG_NAME:=broadcom-wl
|
PKG_NAME:=broadcom-wl
|
||||||
PKG_VERSION:=4.150.10.5.3
|
PKG_VERSION:=4.150.10.5.3
|
||||||
PKG_RELEASE:=6
|
PKG_RELEASE:=7
|
||||||
WLC_VERSION:=0.2
|
WLC_VERSION:=0.2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
START=50
|
START=50
|
||||||
|
|
||||||
start () {
|
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
|
[ -z "$(ls /etc/crontabs/)" ] && exit 1
|
||||||
mkdir -p /var/spool/cron
|
mkdir -p /var/spool/cron
|
||||||
ln -s /etc/crontabs /var/spool/cron/ 2>/dev/null
|
ln -s /etc/crontabs /var/spool/cron/ 2>/dev/null
|
||||||
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=comgt
|
PKG_NAME:=comgt
|
||||||
PKG_VERSION:=0.32
|
PKG_VERSION:=0.32
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=3
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
|
PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
|
||||||
PKG_SOURCE_URL:=@SF/comgt
|
PKG_SOURCE_URL:=@SF/comgt
|
||||||
|
@ -6,15 +6,9 @@ config_get proto "$INTERFACE" proto
|
|||||||
config_get iface "$INTERFACE" ifname
|
config_get iface "$INTERFACE" ifname
|
||||||
case "$ACTION" in
|
case "$ACTION" in
|
||||||
ifup)
|
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
|
set_3g_led 1 1 0
|
||||||
;;
|
;;
|
||||||
ifdown)
|
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
|
set_3g_led 0 0 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -9,8 +9,6 @@ set_3g_led() {
|
|||||||
|
|
||||||
scan_3g() {
|
scan_3g() {
|
||||||
local device
|
local device
|
||||||
|
|
||||||
scan_ppp "$@"
|
|
||||||
config_get device "$1" device
|
config_get device "$1" device
|
||||||
|
|
||||||
# try to figure out the device if it's invalid
|
# try to figure out the device if it's invalid
|
||||||
@ -24,6 +22,7 @@ scan_3g() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# enable 3G with the 3G button by default
|
# enable 3G with the 3G button by default
|
||||||
|
local button
|
||||||
config_get button "$1" button
|
config_get button "$1" button
|
||||||
[ -z "$button" ] && {
|
[ -z "$button" ] && {
|
||||||
config_set "$1" button 1
|
config_set "$1" button 1
|
||||||
@ -31,6 +30,7 @@ scan_3g() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stop_interface_3g() {
|
stop_interface_3g() {
|
||||||
|
stop_interface_ppp "$1"
|
||||||
set_3g_led 0 0 0
|
set_3g_led 0 0 0
|
||||||
killall gcom >/dev/null 2>/dev/null
|
killall gcom >/dev/null 2>/dev/null
|
||||||
}
|
}
|
||||||
@ -39,8 +39,11 @@ setup_interface_3g() {
|
|||||||
local iface="$1"
|
local iface="$1"
|
||||||
local config="$2"
|
local config="$2"
|
||||||
local chat="/etc/chatscripts/3g.chat"
|
local chat="/etc/chatscripts/3g.chat"
|
||||||
|
|
||||||
|
local device
|
||||||
config_get device "$config" device
|
config_get device "$config" device
|
||||||
|
|
||||||
|
local maxwait
|
||||||
config_get maxwait "$config" maxwait
|
config_get maxwait "$config" maxwait
|
||||||
maxwait=${maxwait:-20}
|
maxwait=${maxwait:-20}
|
||||||
while [ ! -e "$device" -a $maxwait -gt 0 ];do # wait for driver loading to catch up
|
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>&- >&-
|
/sbin/insmod $module 2>&- >&-
|
||||||
done
|
done
|
||||||
|
|
||||||
|
local apn
|
||||||
config_get apn "$config" apn
|
config_get apn "$config" apn
|
||||||
|
|
||||||
|
local service
|
||||||
config_get service "$config" service
|
config_get service "$config" service
|
||||||
|
|
||||||
|
local pincode
|
||||||
config_get pincode "$config" pincode
|
config_get pincode "$config" pincode
|
||||||
|
|
||||||
|
local mtu
|
||||||
config_get mtu "$config" mtu
|
config_get mtu "$config" mtu
|
||||||
|
|
||||||
set_3g_led 1 0 1
|
set_3g_led 1 0 1
|
||||||
@ -80,7 +90,7 @@ setup_interface_3g() {
|
|||||||
mode="AT_OPSYS=${CODE}"
|
mode="AT_OPSYS=${CODE}"
|
||||||
fi
|
fi
|
||||||
# Don't assume Option to be default as it breaks with Huawei Cards/Sticks
|
# Don't assume Option to be default as it breaks with Huawei Cards/Sticks
|
||||||
|
|
||||||
PINCODE="$pincode" gcom -d "$device" -s /etc/gcom/setpin.gcom || {
|
PINCODE="$pincode" gcom -d "$device" -s /etc/gcom/setpin.gcom || {
|
||||||
echo "$config(3g): Failed to set the PIN code."
|
echo "$config(3g): Failed to set the PIN code."
|
||||||
set_3g_led 0 0 0
|
set_3g_led 0 0 0
|
||||||
|
@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||||||
|
|
||||||
PKG_NAME:=compcache
|
PKG_NAME:=compcache
|
||||||
PKG_VERSION:=0.6.2
|
PKG_VERSION:=0.6.2
|
||||||
PKG_RELEASE:=$(PKG_VERSION)-1
|
PKG_RELEASE:=1
|
||||||
PKG_SOURCE_URL:=http://compcache.googlecode.com/files/
|
PKG_SOURCE_URL:=http://compcache.googlecode.com/files/
|
||||||
PKG_MD5SUM:=27aec78dc50e34fb800c74e879057743
|
PKG_MD5SUM:=27aec78dc50e34fb800c74e879057743
|
||||||
|
|
||||||
|
@ -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.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
#
|
#
|
||||||
# $Id: $
|
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
@ -12,6 +12,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||||||
PKG_NAME:=ifxmips-dsl-api
|
PKG_NAME:=ifxmips-dsl-api
|
||||||
PKG_BASE_NAME:=drv_dsl_cpe_api_danube
|
PKG_BASE_NAME:=drv_dsl_cpe_api_danube
|
||||||
PKG_VERSION:=3.24.4.4
|
PKG_VERSION:=3.24.4.4
|
||||||
|
PKG_RELEASE:=1
|
||||||
PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/drv_dsl_cpe_api-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/drv_dsl_cpe_api-$(PKG_VERSION)
|
||||||
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
||||||
|
@ -11,6 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||||||
|
|
||||||
PKG_BASE_NAME:=dsl_cpe_control_danube
|
PKG_BASE_NAME:=dsl_cpe_control_danube
|
||||||
PKG_VERSION:=3.24.4.4
|
PKG_VERSION:=3.24.4.4
|
||||||
|
PKG_RELEASE:=1
|
||||||
PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/dsl_cpe_control-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/dsl_cpe_control-$(PKG_VERSION)
|
||||||
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
||||||
|
@ -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.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
#
|
#
|
||||||
# $Id: $
|
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
@ -236,7 +236,7 @@ $(call KernelPackage/ipt/Depends,)
|
|||||||
FILES:= \
|
FILES:= \
|
||||||
$(LINUX_DIR)/drivers/net/imq.$(LINUX_KMOD_SUFFIX) \
|
$(LINUX_DIR)/drivers/net/imq.$(LINUX_KMOD_SUFFIX) \
|
||||||
$(foreach mod,$(IPT_IMQ-m),$(LINUX_DIR)/net/$(mod).$(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 \
|
imq \
|
||||||
$(IPT_IMQ-m) \
|
$(IPT_IMQ-m) \
|
||||||
))
|
))
|
||||||
|
@ -10,12 +10,12 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||||||
|
|
||||||
PKG_NAME:=mac80211
|
PKG_NAME:=mac80211
|
||||||
|
|
||||||
PKG_VERSION:=2010-04-28
|
PKG_VERSION:=2010-05-24
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
|
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
|
||||||
# http://www.orbit-lab.org/kernel/compat-wireless-2.6/2010/11 \
|
# http://www.orbit-lab.org/kernel/compat-wireless-2.6/2010/11 \
|
||||||
# http://wireless.kernel.org/download/compat-wireless-2.6
|
# http://wireless.kernel.org/download/compat-wireless-2.6
|
||||||
PKG_MD5SUM:=4b8c23ac7f33af7556034635af744c67
|
PKG_MD5SUM:=3d465dc6e0213964d0349f61c485817f
|
||||||
|
|
||||||
PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
|
PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
|
||||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
|
||||||
@ -550,7 +550,7 @@ endef
|
|||||||
ifneq ($(CONFIG_B43_EXPERIMENTAL),)
|
ifneq ($(CONFIG_B43_EXPERIMENTAL),)
|
||||||
PKG_B43_FWV4_NAME:=broadcom-wl
|
PKG_B43_FWV4_NAME:=broadcom-wl
|
||||||
PKG_B43_FWV4_VERSION:=4.178.10.4
|
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:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
|
||||||
PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
||||||
PKG_B43_FWV4_MD5SUM:=14477e8cbbb91b11896affac9b219fdb
|
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_SOURCE_URL:=http://downloads.openwrt.org/sources/
|
||||||
PKG_B43_FWV3_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3
|
PKG_B43_FWV3_MD5SUM:=e08665c5c5b66beb9c3b2dd54aa80cb3
|
||||||
|
|
||||||
ifneq ($(CONFIG_B43_OPENFIRMWARE),)
|
ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
|
||||||
PKG_B43_FWCUTTER_NAME:=b43-fwcutter
|
PKG_B43_FWCUTTER_NAME:=b43-fwcutter
|
||||||
PKG_B43_FWCUTTER_VERSION:=3e69531aa65b8f664a0ab00dfc3e2eefeb0cb417
|
PKG_B43_FWCUTTER_VERSION:=3e69531aa65b8f664a0ab00dfc3e2eefeb0cb417
|
||||||
PKG_B43_FWCUTTER_SOURCE:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION).tar.bz2
|
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/
|
PKG_B43_FWCUTTER_OBJECT:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION)/fwcutter/
|
||||||
else
|
else
|
||||||
PKG_B43_FWCUTTER_NAME:=b43-fwcutter
|
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_SOURCE:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION).tar.bz2
|
||||||
PKG_B43_FWCUTTER_PROTO:=default
|
PKG_B43_FWCUTTER_PROTO:=default
|
||||||
PKG_B43_FWCUTTER_SOURCE_URL:=http://bu3sch.de/b43/fwcutter/
|
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_SUBDIR:=b43-fwcutter-$(PKG_B43_FWCUTTER_VERSION)
|
||||||
PKG_B43_FWCUTTER_OBJECT:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION)/
|
PKG_B43_FWCUTTER_OBJECT:=$(PKG_B43_FWCUTTER_NAME)-$(PKG_B43_FWCUTTER_VERSION)/
|
||||||
endif
|
endif
|
||||||
@ -644,7 +644,7 @@ define KernelPackage/b43/config
|
|||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "b43 firmware version"
|
prompt "b43 firmware version"
|
||||||
default B43_EXPERIMENTAL
|
default B43_STABLE
|
||||||
help
|
help
|
||||||
This option allows you to select the version of the b43 firmware.
|
This option allows you to select the version of the b43 firmware.
|
||||||
|
|
||||||
@ -773,14 +773,13 @@ endef
|
|||||||
BUILDFLAGS:= \
|
BUILDFLAGS:= \
|
||||||
-I$(PKG_BUILD_DIR)/include \
|
-I$(PKG_BUILD_DIR)/include \
|
||||||
$(foreach opt,$(CONFOPTS),-DCONFIG_$(opt)) \
|
$(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_B43_PCI_AUTOSELECT -DCONFIG_B43_PCICORE_AUTOSELECT) \
|
||||||
$(if $(CONFIG_PCI),-DCONFIG_SSB_PCIHOST_POSSIBLE -DCONFIG_SSB_PCIHOST) \
|
|
||||||
$(if $(CONFIG_PCI),-DCONFIG_SSB_SPROM) \
|
|
||||||
$(if $(CONFIG_LEDS_TRIGGERS), -DCONFIG_MAC80211_LEDS -DCONFIG_LEDS_TRIGGERS -DCONFIG_B43_LEDS -DCONFIG_B43LEGACY_LEDS -DCONFIG_AR9170_LEDS) \
|
$(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 \
|
-DCONFIG_B43_HWRNG -DCONFIG_B43LEGACY_HWRNG \
|
||||||
$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),-DCONFIG_MAC80211_DEBUGFS -DCONFIG_ATH9K_DEBUGFS) \
|
$(if $(CONFIG_PACKAGE_MAC80211_DEBUGFS),-DCONFIG_MAC80211_DEBUGFS -DCONFIG_ATH9K_DEBUGFS) \
|
||||||
$(if $(CONFIG_PACKAGE_ATH_DEBUG),-DCONFIG_ATH_DEBUG) \
|
$(if $(CONFIG_PACKAGE_ATH_DEBUG),-DCONFIG_ATH_DEBUG) \
|
||||||
-D__CONFIG_MAC80211_RC_DEFAULT=minstrel \
|
-D__CONFIG_MAC80211_RC_DEFAULT=minstrel \
|
||||||
|
-DCONFIG_MAC80211_RC_MINSTREL_HT \
|
||||||
$(if $(CONFIG_ATH_USER_REGD),-DATH_USER_REGD=1) \
|
$(if $(CONFIG_ATH_USER_REGD),-DATH_USER_REGD=1) \
|
||||||
$(if $(CONFIG_PACKAGE_ATH9K_USE_MINSTREL),-DATH9K_USE_MINSTREL) \
|
$(if $(CONFIG_PACKAGE_ATH9K_USE_MINSTREL),-DATH9K_USE_MINSTREL) \
|
||||||
$(if $(CONFIG_PACKAGE_RT2X00_LIB_DEBUGFS),-DCONFIG_RT2X00_LIB_DEBUGFS) \
|
$(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_PCMCIA=n CONFIG_B43_PIO=n \
|
||||||
CONFIG_B43_PCI_AUTOSELECT=$(if $(CONFIG_PCI),y) \
|
CONFIG_B43_PCI_AUTOSELECT=$(if $(CONFIG_PCI),y) \
|
||||||
CONFIG_B43_PCICORE_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_B43LEGACY_LEDS=$(CONFIG_LEDS_TRIGGERS) \
|
||||||
CONFIG_B43_LEDS=$(CONFIG_LEDS_TRIGGERS) \
|
CONFIG_B43_LEDS=$(CONFIG_LEDS_TRIGGERS) \
|
||||||
CONFIG_B43_HWRNG=$(if $(CONFIG_HW_RANDOM),y) \
|
CONFIG_B43_HWRNG=$(if $(CONFIG_HW_RANDOM),y) \
|
||||||
@ -883,6 +878,7 @@ MAKE_OPTS:= \
|
|||||||
CONFIG_AR9170_LEDS=$(CONFIG_LEDS_TRIGGERS) \
|
CONFIG_AR9170_LEDS=$(CONFIG_LEDS_TRIGGERS) \
|
||||||
CONFIG_IWM= \
|
CONFIG_IWM= \
|
||||||
CONFIG_ATH9K_HTC= \
|
CONFIG_ATH9K_HTC= \
|
||||||
|
CONFIG_MAC80211_RC_MINSTREL_HT=y \
|
||||||
MADWIFI= \
|
MADWIFI= \
|
||||||
OLD_IWL= \
|
OLD_IWL= \
|
||||||
KLIB_BUILD="$(LINUX_DIR)" \
|
KLIB_BUILD="$(LINUX_DIR)" \
|
||||||
@ -993,7 +989,7 @@ define Build/b43-common
|
|||||||
$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_OBJECT)" \
|
$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_OBJECT)" \
|
||||||
CFLAGS="-I$(STAGING_DIR_HOST)/include -include endian.h"
|
CFLAGS="-I$(STAGING_DIR_HOST)/include -include endian.h"
|
||||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_OBJECT)/b43-fwcutter $(STAGING_DIR_HOST)/bin/
|
$(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/
|
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
|
||||||
$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWCUTTER_SUBDIR)/assembler/"
|
$(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/
|
$(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
|
define KernelPackage/b43/install
|
||||||
rm -rf $(1)/lib/firmware/
|
rm -rf $(1)/lib/firmware/
|
||||||
$(call Build/b43-common)
|
$(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)"
|
tar xzf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
|
||||||
else
|
else
|
||||||
tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
|
tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
|
||||||
endif
|
endif
|
||||||
$(INSTALL_DIR) $(1)/lib/firmware/
|
$(INSTALL_DIR) $(1)/lib/firmware/
|
||||||
ifneq ($(CONFIG_B43_OPENFIRMWARE),)
|
ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
|
||||||
$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
|
$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
|
||||||
$(INSTALL_DIR) $(1)/lib/firmware/b43-open/
|
$(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)/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)/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
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0initvals5.fw $(1)/lib/firmware/b43-open/b0g0initvals5.fw
|
||||||
else
|
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
|
endif
|
||||||
ifneq ($(CONFIG_B43_FW_SQUASH),)
|
ifneq ($(CONFIG_B43_FW_SQUASH),)
|
||||||
b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"
|
b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
ifeq ($(CONFIG_MAC80211),y)
|
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")
|
$(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.
|
# We need the backported rfkill module on kernel < 2.6.31.
|
||||||
# In more recent kernel versions use the in kernel rfkill module.
|
# In more recent kernel versions use the in kernel rfkill module.
|
||||||
ifdef CONFIG_COMPAT_KERNEL_31
|
ifdef CONFIG_COMPAT_KERNEL_31
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/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_NET_USB_MODULES) += drivers/net/usb/
|
||||||
|
|
||||||
obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/
|
obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/
|
||||||
@ -9,3 +9,43 @@
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
obj-$(CONFIG_COMPAT_BLUETOOTH) += net/bluetooth/
|
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
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/config.mk
|
--- a/config.mk
|
||||||
+++ b/config.mk
|
+++ b/config.mk
|
||||||
@@ -286,10 +286,10 @@ endif
|
@@ -270,10 +270,10 @@ endif
|
||||||
CONFIG_MWL8K=m
|
CONFIG_MWL8K=m
|
||||||
|
|
||||||
# Ethernet drivers go here
|
# Ethernet drivers go here
|
||||||
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
CONFIG_HERMES=m
|
CONFIG_HERMES=m
|
||||||
CONFIG_HERMES_CACHE_FW_ON_INIT=y
|
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_RNDIS_WLAN=n
|
||||||
CONFIG_USB_NET_COMPAT_CDCETHER=n
|
CONFIG_USB_NET_COMPAT_CDCETHER=n
|
||||||
else
|
else
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/config.mk
|
--- a/config.mk
|
||||||
+++ b/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
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
CONFIG_USB=y
|
CONFIG_USB=y
|
||||||
- CONFIG_PCMCIA=y
|
- CONFIG_PCMCIA=y
|
||||||
+# CONFIG_PCMCIA=y
|
+# CONFIG_PCMCIA=y
|
||||||
CONFIG_SSB=m
|
|
||||||
else
|
else
|
||||||
include $(KLIB_BUILD)/.config
|
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_HWRNG=y
|
||||||
CONFIG_B43_PCI_AUTOSELECT=y
|
CONFIG_B43_PCI_AUTOSELECT=y
|
||||||
ifneq ($(CONFIG_PCMCIA),)
|
ifneq ($(CONFIG_PCMCIA),)
|
||||||
@ -18,12 +18,3 @@
|
|||||||
endif
|
endif
|
||||||
CONFIG_B43_LEDS=y
|
CONFIG_B43_LEDS=y
|
||||||
CONFIG_B43_PHY_LP=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
|
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
--- a/config.mk
|
--- a/config.mk
|
||||||
+++ b/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),)
|
ifneq ($(CONFIG_MMC),)
|
||||||
|
|
||||||
-CONFIG_SSB_SDIOHOST=y
|
|
||||||
-CONFIG_B43_SDIO=y
|
-CONFIG_B43_SDIO=y
|
||||||
+# CONFIG_SSB_SDIOHOST=y
|
|
||||||
+# CONFIG_B43_SDIO=y
|
+# CONFIG_B43_SDIO=y
|
||||||
CONFIG_WL1251_SDIO=m
|
CONFIG_WL1251_SDIO=m
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/config.mk
|
--- a/config.mk
|
||||||
+++ b/config.mk
|
+++ b/config.mk
|
||||||
@@ -185,7 +185,7 @@ ifneq ($(CONFIG_PCMCIA),)
|
@@ -184,7 +184,7 @@ ifneq ($(CONFIG_PCMCIA),)
|
||||||
endif
|
endif
|
||||||
CONFIG_B43_LEDS=y
|
CONFIG_B43_LEDS=y
|
||||||
CONFIG_B43_PHY_LP=y
|
CONFIG_B43_PHY_LP=y
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/config.mk
|
--- a/config.mk
|
||||||
+++ b/config.mk
|
+++ b/config.mk
|
||||||
@@ -248,12 +248,12 @@ CONFIG_RTL8180=m
|
@@ -232,12 +232,12 @@ CONFIG_RTL8180=m
|
||||||
|
|
||||||
CONFIG_ADM8211=m
|
CONFIG_ADM8211=m
|
||||||
|
|
||||||
@ -15,7 +15,7 @@
|
|||||||
# CONFIG_RT2800PCI_RT30XX=y
|
# CONFIG_RT2800PCI_RT30XX=y
|
||||||
# CONFIG_RT2800PCI_RT35XX=y
|
# CONFIG_RT2800PCI_RT35XX=y
|
||||||
# CONFIG_RT2800PCI_SOC=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_RT35XX=y
|
||||||
# CONFIG_RT2800USB_UNKNOWN=y
|
# CONFIG_RT2800USB_UNKNOWN=y
|
||||||
endif
|
endif
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
#include <pcmcia/cs_types.h>
|
#include <pcmcia/cs_types.h>
|
||||||
#include <pcmcia/cistpl.h>
|
#include <pcmcia/cistpl.h>
|
||||||
#include <pcmcia/ds.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;
|
return skb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
{
|
{
|
||||||
--- a/compat/compat-2.6.29.c
|
--- a/compat/compat-2.6.29.c
|
||||||
+++ b/compat/compat-2.6.29.c
|
+++ b/compat/compat-2.6.29.c
|
||||||
@@ -16,7 +16,7 @@
|
@@ -50,7 +50,7 @@ void netdev_attach_ops(struct net_device
|
||||||
#include <linux/etherdevice.h>
|
EXPORT_SYMBOL(netdev_attach_ops);
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23))
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23))
|
||||||
-#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
|
-#if defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)
|
||||||
|
@ -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 */
|
|
@ -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)) */
|
|
@ -1,6 +1,6 @@
|
|||||||
--- a/drivers/net/wireless/ath/ath5k/reset.c
|
--- a/drivers/net/wireless/ath/ath5k/reset.c
|
||||||
+++ b/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 ;-)
|
* guess we can tweak it and see how it goes ;-)
|
||||||
*/
|
*/
|
||||||
if (ah->ah_version != AR5K_AR5210) {
|
if (ah->ah_version != AR5K_AR5210) {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include "regd_common.h"
|
#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);
|
EXPORT_SYMBOL(ath_regd_get_band_ctl);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "ath9k.h"
|
#include "ath9k.h"
|
||||||
|
|
||||||
static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = {
|
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)
|
static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||||
+++ b/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) {
|
if (ah->config.rx_intr_mitigation) {
|
||||||
REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 500);
|
REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 500);
|
||||||
|
@ -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;
|
|
9874
package/mac80211/patches/500-pending_work.patch
Normal file
9874
package/mac80211/patches/500-pending_work.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -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, ®idx))
|
|
||||||
+ 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, ®val))
|
|
||||||
+ 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;
|
|
||||||
};
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
--- a/drivers/net/wireless/ath/ath9k/init.c
|
--- a/drivers/net/wireless/ath/ath9k/init.c
|
||||||
+++ b/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->sta_data_size = sizeof(struct ath_node);
|
||||||
hw->vif_data_size = sizeof(struct ath_vif);
|
hw->vif_data_size = sizeof(struct ath_vif);
|
||||||
|
|
36
package/mac80211/patches/520-ath0k_hw_mcast_search.patch
Normal file
36
package/mac80211/patches/520-ath0k_hw_mcast_search.patch
Normal 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;
|
||||||
|
}
|
@ -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 ^
|
|
@ -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);
|
255
package/mac80211/patches/522-ath9k_remove_duplicate_code.patch
Normal file
255
package/mac80211/patches/522-ath9k_remove_duplicate_code.patch
Normal 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
@ -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)
|
|
@ -1,6 +1,6 @@
|
|||||||
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
|
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
|
||||||
+++ b/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);
|
EXPORT_SYMBOL_GPL(rt2x00pci_uninitialize);
|
||||||
|
|
||||||
@ -8,7 +8,7 @@
|
|||||||
/*
|
/*
|
||||||
* PCI driver handlers.
|
* 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);
|
EXPORT_SYMBOL_GPL(rt2x00pci_resume);
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM */
|
||||||
|
@ -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
|
|
@ -1,6 +1,6 @@
|
|||||||
--- a/drivers/net/wireless/mwl8k.c
|
--- a/drivers/net/wireless/mwl8k.c
|
||||||
+++ b/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");
|
MODULE_FIRMWARE("mwl8k/fmimage_8366.fw");
|
||||||
|
|
||||||
static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
|
static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
# Copyright (C) 2009 OpenWrt.org
|
# Copyright (C) 2009-2010 OpenWrt.org
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=mountd
|
PKG_NAME:=mountd
|
||||||
PKG_VERSION:=0.1
|
PKG_VERSION:=0.1
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||||
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
|
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
|
||||||
|
@ -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.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -8,7 +8,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=nvram
|
PKG_NAME:=nvram
|
||||||
PKG_RELEASE:=6
|
PKG_RELEASE:=7
|
||||||
|
|
||||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
@ -52,7 +52,13 @@ fixup_linksys() {
|
|||||||
}
|
}
|
||||||
;;
|
;;
|
||||||
"1071") #0x042f
|
"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 ] && {
|
[ "$COMMIT" = 1 ] && {
|
||||||
nvram_set sdram_ncdl 0x0
|
nvram_set sdram_ncdl 0x0
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||||||
|
|
||||||
PKG_NAME:=ppp
|
PKG_NAME:=ppp
|
||||||
PKG_VERSION:=2.4.4
|
PKG_VERSION:=2.4.4
|
||||||
PKG_RELEASE:=5
|
PKG_RELEASE:=7
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=ftp://ftp.samba.org/pub/ppp/
|
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-up $(1)/etc/ppp/
|
||||||
$(INSTALL_BIN) ./files/etc/ppp/ipv6-down $(1)/etc/ppp/
|
$(INSTALL_BIN) ./files/etc/ppp/ipv6-down $(1)/etc/ppp/
|
||||||
$(INSTALL_DATA) ./files/etc/ppp/options $(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
|
endef
|
||||||
|
|
||||||
define Package/ppp-mod-pppoa/install
|
define Package/ppp-mod-pppoa/install
|
||||||
@ -149,6 +149,8 @@ define Package/ppp-mod-pppoa/install
|
|||||||
$(1)/usr/lib/pppd/$(PKG_VERSION)/
|
$(1)/usr/lib/pppd/$(PKG_VERSION)/
|
||||||
$(INSTALL_DIR) $(1)/lib/network
|
$(INSTALL_DIR) $(1)/lib/network
|
||||||
$(INSTALL_BIN) ./files/pppoa.sh $(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
|
endef
|
||||||
|
|
||||||
define Package/ppp-mod-pppoe/install
|
define Package/ppp-mod-pppoe/install
|
||||||
|
25
package/ppp/files/etc/hotplug.d/atm/20-atm-modem
Normal file
25
package/ppp/files/etc/hotplug.d/atm/20-atm-modem
Normal 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
|
@ -1,22 +1,25 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
. /etc/functions.sh
|
. /etc/functions.sh
|
||||||
|
. /lib/network/config.sh
|
||||||
|
|
||||||
PPP_IFACE="$1"
|
PPP_IFACE="$1"
|
||||||
PPP_TTY="$2"
|
PPP_TTY="$2"
|
||||||
PPP_SPEED="$3"
|
PPP_SPEED="$3"
|
||||||
PPP_LOCAL="$4"
|
PPP_LOCAL="$4"
|
||||||
PPP_REMOTE="$5"
|
PPP_REMOTE="$5"
|
||||||
PPP_IPPARAM="$(echo $6 | sed 's/\./_/g')"
|
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
|
export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
|
||||||
[ -z "$PPP_IPPARAM" -o -z "$PPP_LOCAL" ] || {
|
[ -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" ipaddr "$PPP_LOCAL"
|
||||||
uci_set_state network "$PPP_IPPARAM" gateway "$PPP_REMOTE"
|
uci_set_state network "$PPP_IPPARAM" gateway "$PPP_REMOTE"
|
||||||
|
|
||||||
local dns="$DNS1${DNS2:+ $DNS2}"
|
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"
|
[ -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 ] && {
|
[ -d /etc/ppp/ip-up.d ] && {
|
||||||
|
@ -1,63 +1,40 @@
|
|||||||
scan_ppp() {
|
stop_interface_ppp() {
|
||||||
config_get ifname "$1" ifname
|
local cfg="$1"
|
||||||
pppdev="${pppdev:-0}"
|
|
||||||
config_get devunit "$1" unit
|
local proto
|
||||||
{
|
config_get proto "$cfg" proto
|
||||||
unit=
|
|
||||||
pppif=
|
local link="$proto-$cfg"
|
||||||
if [ ! -d /tmp/.ppp-counter ]; then
|
[ -f "/var/run/ppp-${link}.pid" ] && {
|
||||||
mkdir -p /tmp/.ppp-counter
|
local pid="$(head -n1 /var/run/ppp-${link}.pid 2>/dev/null)"
|
||||||
fi
|
local try=0
|
||||||
local maxunit
|
grep -qs pppd "/proc/$pid/cmdline" && kill -TERM $pid && \
|
||||||
maxunit="$(cat /tmp/.ppp-counter/max-unit 2>/dev/null)"
|
while grep -qs pppd "/proc/$pid/cmdline" && [ $((try++)) -lt 5 ]; do sleep 1; done
|
||||||
if [ -z "$maxunit" ]; then
|
grep -qs pppd "/proc/$pid/cmdline" && kill -KILL $pid && \
|
||||||
maxunit=-1
|
while grep -qs pppd "/proc/$pid/cmdline"; do sleep 1; done
|
||||||
fi
|
rm -f "/var/run/ppp-${link}.pid"
|
||||||
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"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remove_dns "$cfg"
|
||||||
|
|
||||||
|
local lock="/var/lock/ppp-$link"
|
||||||
|
[ -f "$lock" ] && lock -u "$lock"
|
||||||
}
|
}
|
||||||
|
|
||||||
start_pppd() {
|
start_pppd() {
|
||||||
local cfg="$1"; shift
|
local cfg="$1"; shift
|
||||||
local ifname
|
|
||||||
|
|
||||||
# make sure the network state references the correct ifname
|
local proto
|
||||||
scan_ppp "$cfg"
|
config_get proto "$cfg" proto
|
||||||
config_get ifname "$cfg" ifname
|
|
||||||
set_interface_ifname "$cfg" "$ifname"
|
# unique link identifier
|
||||||
|
local link="${proto:-ppp}-$cfg"
|
||||||
|
|
||||||
# make sure only one pppd process is started
|
# make sure only one pppd process is started
|
||||||
lock "/var/lock/ppp-${cfg}"
|
lock "/var/lock/ppp-${link}"
|
||||||
local pid="$(head -n1 /var/run/ppp-${cfg}.pid 2>/dev/null)"
|
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 && {
|
[ -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
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,9 +45,6 @@ start_pppd() {
|
|||||||
local device
|
local device
|
||||||
config_get device "$cfg" device
|
config_get device "$cfg" device
|
||||||
|
|
||||||
local unit
|
|
||||||
config_get unit "$cfg" unit
|
|
||||||
|
|
||||||
local username
|
local username
|
||||||
config_get username "$cfg" username
|
config_get username "$cfg" username
|
||||||
|
|
||||||
@ -91,7 +65,8 @@ start_pppd() {
|
|||||||
|
|
||||||
local defaultroute
|
local defaultroute
|
||||||
config_get_bool defaultroute "$cfg" defaultroute 1
|
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##*[, ]}"
|
local interval="${keepalive##*[, ]}"
|
||||||
[ "$interval" != "$keepalive" ] || interval=5
|
[ "$interval" != "$keepalive" ] || interval=5
|
||||||
@ -109,15 +84,11 @@ start_pppd() {
|
|||||||
local peerdns
|
local peerdns
|
||||||
config_get_bool peerdns "$cfg" peerdns $peer_default
|
config_get_bool peerdns "$cfg" peerdns $peer_default
|
||||||
|
|
||||||
echo -n "" > /tmp/resolv.conf.auto
|
|
||||||
|
|
||||||
[ "$peerdns" -eq 1 ] && {
|
[ "$peerdns" -eq 1 ] && {
|
||||||
peerdns="usepeerdns"
|
peerdns="usepeerdns"
|
||||||
} || {
|
} || {
|
||||||
peerdns=""
|
peerdns=""
|
||||||
for dns in $dns; do
|
add_dns "$cfg" $dns
|
||||||
echo "nameserver $dns" >> /tmp/resolv.conf.auto
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local demand
|
local demand
|
||||||
@ -126,8 +97,7 @@ start_pppd() {
|
|||||||
local demandargs
|
local demandargs
|
||||||
[ "$demand" -eq 1 ] && {
|
[ "$demand" -eq 1 ] && {
|
||||||
demandargs="precompiled-active-filter /etc/ppp/filter demand idle"
|
demandargs="precompiled-active-filter /etc/ppp/filter demand idle"
|
||||||
[ "$has_dns" -eq 0 ] && \
|
[ "$has_dns" -eq 0 ] && add_dns "$cfg" 1.1.1.1
|
||||||
echo "nameserver 1.1.1.1" > /tmp/resolv.conf.auto
|
|
||||||
} || {
|
} || {
|
||||||
demandargs="persist"
|
demandargs="persist"
|
||||||
}
|
}
|
||||||
@ -136,21 +106,21 @@ start_pppd() {
|
|||||||
config_get_bool ipv6 "$cfg" ipv6 0
|
config_get_bool ipv6 "$cfg" ipv6 0
|
||||||
[ "$ipv6" -eq 1 ] && ipv6="+ipv6" || ipv6=""
|
[ "$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%%[, ]*}} \
|
${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}} \
|
||||||
$demandargs \
|
$demandargs \
|
||||||
$peerdns \
|
$peerdns \
|
||||||
$defaultroute \
|
$defaultroute \
|
||||||
${username:+user "$username" password "$password"} \
|
${username:+user "$username" password "$password"} \
|
||||||
unit "$unit" \
|
|
||||||
linkname "$cfg" \
|
|
||||||
ipparam "$cfg" \
|
ipparam "$cfg" \
|
||||||
|
ifname "$link" \
|
||||||
${connect:+connect "$connect"} \
|
${connect:+connect "$connect"} \
|
||||||
${disconnect:+disconnect "$disconnect"} \
|
${disconnect:+disconnect "$disconnect"} \
|
||||||
${ipv6} \
|
${ipv6} \
|
||||||
${pppd_options}
|
${pppd_options} \
|
||||||
|
nodetach
|
||||||
|
|
||||||
lock -u "/var/lock/ppp-${cfg}"
|
lock -u "/var/lock/ppp-${link}"
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_interface_ppp() {
|
setup_interface_ppp() {
|
||||||
|
@ -1,28 +1,37 @@
|
|||||||
scan_pppoa() {
|
stop_interface_pppoa() {
|
||||||
scan_ppp "$@"
|
stop_interface_ppp "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_interface_pppoa() {
|
setup_interface_pppoa() {
|
||||||
local iface="$1"
|
local iface="$1"
|
||||||
local config="$2"
|
local config="$2"
|
||||||
|
|
||||||
|
local device
|
||||||
config_get device "$config" device
|
config_get device "$config" device
|
||||||
|
|
||||||
|
local vpi
|
||||||
config_get vpi "$config" vpi
|
config_get vpi "$config" vpi
|
||||||
|
|
||||||
|
local vci
|
||||||
config_get vci "$config" vci
|
config_get vci "$config" vci
|
||||||
|
|
||||||
for module in slhc ppp_generic pppoatm; do
|
for module in slhc ppp_generic pppoatm; do
|
||||||
/sbin/insmod $module 2>&- >&-
|
/sbin/insmod $module 2>&- >&-
|
||||||
done
|
done
|
||||||
|
|
||||||
|
local encaps
|
||||||
config_get encaps "$config" encaps
|
config_get encaps "$config" encaps
|
||||||
|
|
||||||
case "$encaps" in
|
case "$encaps" in
|
||||||
1|vc) ENCAPS="vc-encaps" ;;
|
1|vc) encaps="vc-encaps" ;;
|
||||||
*) ENCAPS="llc-encaps" ;;
|
*) encaps="llc-encaps" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
local mtu
|
||||||
config_get mtu "$config" mtu
|
config_get mtu "$config" mtu
|
||||||
mtu=${mtu:-1500}
|
mtu=${mtu:-1500}
|
||||||
|
|
||||||
start_pppd "$config" \
|
start_pppd "$config" \
|
||||||
plugin pppoatm.so ${vpi:-8}.${vci:-35} ${ENCAPS} \
|
plugin pppoatm.so ${vpi:-8}.${vci:-35} ${encaps} \
|
||||||
mtu $mtu mru $mtu
|
mtu $mtu mru $mtu
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
scan_pppoe() {
|
stop_interface_pppoe() {
|
||||||
scan_ppp "$@"
|
stop_interface_ppp "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_interface_pppoe() {
|
setup_interface_pppoe() {
|
||||||
|
128
package/ppp/patches/320-custom_iface_names.patch
Normal file
128
package/ppp/patches/320-custom_iface_names.patch
Normal 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
|
||||||
|
{
|
@ -8,12 +8,12 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=pptp
|
PKG_NAME:=pptp
|
||||||
PKG_VERSION:=1.6.0
|
PKG_VERSION:=1.7.1
|
||||||
PKG_RELEASE:=6
|
PKG_RELEASE:=3
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=@SF/pptpclient
|
PKG_SOURCE_URL:=@SF/pptpclient
|
||||||
PKG_MD5SUM:=9a706327fb9827541d7c86d48ceb9631
|
PKG_MD5SUM:=b47735ba5d6d37dfdbccb85afc044ede
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
@ -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
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +1,36 @@
|
|||||||
scan_pptp() {
|
|
||||||
scan_ppp "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
find_gw() {
|
find_gw() {
|
||||||
route -n | awk '$1 == "0.0.0.0" { print $2; exit }'
|
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() {
|
setup_interface_pptp() {
|
||||||
local config="$2"
|
local config="$2"
|
||||||
local ifname
|
local ifname
|
||||||
|
|
||||||
|
local device
|
||||||
config_get device "$config" device
|
config_get device "$config" device
|
||||||
|
|
||||||
|
local ipproto
|
||||||
config_get ipproto "$config" ipproto
|
config_get ipproto "$config" ipproto
|
||||||
|
|
||||||
|
local server
|
||||||
config_get server "$config" 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
|
for module in slhc ppp_generic ppp_async ip_gre; do
|
||||||
/sbin/insmod $module 2>&- >&-
|
/sbin/insmod $module 2>&- >&-
|
||||||
done
|
done
|
||||||
@ -23,7 +39,7 @@ setup_interface_pptp() {
|
|||||||
setup_interface "$device" "$config" "${ipproto:-dhcp}"
|
setup_interface "$device" "$config" "${ipproto:-dhcp}"
|
||||||
local gw="$(find_gw)"
|
local gw="$(find_gw)"
|
||||||
[ -n "$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"
|
route add "$server" gw "$gw"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,15 +47,10 @@ setup_interface_pptp() {
|
|||||||
config_get netmask "$config" netmask
|
config_get netmask "$config" netmask
|
||||||
[ -z "$netmask" -o -z "$device" ] || ifconfig $device netmask $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
|
config_get mtu "$config" mtu
|
||||||
mtu=${mtu:-1452}
|
mtu=${mtu:-1452}
|
||||||
start_pppd "$config" \
|
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 \
|
file /etc/ppp/options.pptp \
|
||||||
mtu $mtu mru $mtu
|
mtu $mtu mru $mtu
|
||||||
}
|
}
|
||||||
|
@ -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.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -10,6 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||||||
|
|
||||||
PKG_NAME:=siit
|
PKG_NAME:=siit
|
||||||
PKG_VERSION:=1.1
|
PKG_VERSION:=1.1
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
@ -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.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -8,7 +8,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=swconfig
|
PKG_NAME:=swconfig
|
||||||
PKG_RELEASE:=5
|
PKG_RELEASE:=6
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/package.mk
|
include $(INCLUDE_DIR)/package.mk
|
||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
/* Settings for Denali DDR SDRAM controller */
|
/* Settings for Denali DDR SDRAM controller */
|
||||||
/* Optimise for Danube Eval Board DDR 167 Mhz - by Ng Aik Ann 29th April */
|
/* Optimise for Danube Eval Board DDR 167 Mhz - by Ng Aik Ann 29th April */
|
||||||
#define MC_DC0_VALUE 0x1B1B
|
#define MC_DC0_VALUE 0x1B1B
|
||||||
#define MC_DC1_VALUE 0x0
|
#define MC_DC1_VALUE 0x0
|
||||||
#define MC_DC2_VALUE 0x0
|
#define MC_DC2_VALUE 0x0
|
||||||
#define MC_DC3_VALUE 0x0
|
#define MC_DC3_VALUE 0x0
|
||||||
#define MC_DC4_VALUE 0x0
|
#define MC_DC4_VALUE 0x0
|
||||||
#define MC_DC5_VALUE 0x200
|
#define MC_DC5_VALUE 0x200
|
||||||
#define MC_DC6_VALUE 0x605
|
#define MC_DC6_VALUE 0x605
|
||||||
#define MC_DC7_VALUE 0x303
|
#define MC_DC7_VALUE 0x303
|
||||||
#define MC_DC8_VALUE 0x102
|
#define MC_DC8_VALUE 0x102
|
||||||
#define MC_DC9_VALUE 0x70a
|
#define MC_DC9_VALUE 0x70a
|
||||||
#define MC_DC10_VALUE 0x203
|
#define MC_DC10_VALUE 0x203
|
||||||
#define MC_DC11_VALUE 0xc02
|
#define MC_DC11_VALUE 0xc02
|
||||||
#define MC_DC12_VALUE 0x1C8
|
#define MC_DC12_VALUE 0x1C8
|
||||||
#define MC_DC13_VALUE 0x1
|
#define MC_DC13_VALUE 0x1
|
||||||
#define MC_DC14_VALUE 0x0
|
#define MC_DC14_VALUE 0x0
|
||||||
#define MC_DC15_VALUE 0xf3c
|
#define MC_DC15_VALUE 0xf3c
|
||||||
#define MC_DC16_VALUE 0xC800
|
#define MC_DC16_VALUE 0xC800
|
||||||
#define MC_DC17_VALUE 0xd
|
#define MC_DC17_VALUE 0xd
|
||||||
#define MC_DC18_VALUE 0x300
|
#define MC_DC18_VALUE 0x300
|
||||||
#define MC_DC19_VALUE 0x200
|
#define MC_DC19_VALUE 0x200
|
||||||
#define MC_DC20_VALUE 0xA03
|
#define MC_DC20_VALUE 0xA03
|
||||||
#define MC_DC21_VALUE 0x1d00
|
#define MC_DC21_VALUE 0x1d00
|
||||||
#define MC_DC22_VALUE 0x1d1d
|
#define MC_DC22_VALUE 0x1d1d
|
||||||
#define MC_DC23_VALUE 0x0
|
#define MC_DC23_VALUE 0x0
|
||||||
#define MC_DC24_VALUE 0x5e /* was 0x7f */
|
#define MC_DC24_VALUE 0x5e /* was 0x7f */
|
||||||
#define MC_DC25_VALUE 0x0
|
#define MC_DC25_VALUE 0x0
|
||||||
#define MC_DC26_VALUE 0x0
|
#define MC_DC26_VALUE 0x0
|
||||||
#define MC_DC27_VALUE 0x0
|
#define MC_DC27_VALUE 0x0
|
||||||
#define MC_DC28_VALUE 0x510
|
#define MC_DC28_VALUE 0x510
|
||||||
#define MC_DC29_VALUE 0x2d89
|
#define MC_DC29_VALUE 0x2d89
|
||||||
#define MC_DC30_VALUE 0x8300
|
#define MC_DC30_VALUE 0x8300
|
||||||
#define MC_DC31_VALUE 0x0
|
#define MC_DC31_VALUE 0x0
|
||||||
#define MC_DC32_VALUE 0x0
|
#define MC_DC32_VALUE 0x0
|
||||||
#define MC_DC33_VALUE 0x0
|
#define MC_DC33_VALUE 0x0
|
||||||
#define MC_DC34_VALUE 0x0
|
#define MC_DC34_VALUE 0x0
|
||||||
#define MC_DC35_VALUE 0x0
|
#define MC_DC35_VALUE 0x0
|
||||||
#define MC_DC36_VALUE 0x0
|
#define MC_DC36_VALUE 0x0
|
||||||
#define MC_DC37_VALUE 0x0
|
#define MC_DC37_VALUE 0x0
|
||||||
#define MC_DC38_VALUE 0x0
|
#define MC_DC38_VALUE 0x0
|
||||||
#define MC_DC39_VALUE 0x0
|
#define MC_DC39_VALUE 0x0
|
||||||
#define MC_DC40_VALUE 0x0
|
#define MC_DC40_VALUE 0x0
|
||||||
#define MC_DC41_VALUE 0x0
|
#define MC_DC41_VALUE 0x0
|
||||||
#define MC_DC42_VALUE 0x0
|
#define MC_DC42_VALUE 0x0
|
||||||
#define MC_DC43_VALUE 0x0
|
#define MC_DC43_VALUE 0x0
|
||||||
#define MC_DC44_VALUE 0x0
|
#define MC_DC44_VALUE 0x0
|
||||||
#define MC_DC45_VALUE 0x500
|
#define MC_DC45_VALUE 0x500
|
||||||
//#define MC_DC45_VALUE 0x400
|
//#define MC_DC45_VALUE 0x400
|
||||||
#define MC_DC46_VALUE 0x0
|
#define MC_DC46_VALUE 0x0
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
/* Settings for Denali DDR SDRAM controller */
|
/* Settings for Denali DDR SDRAM controller */
|
||||||
/* Optimise for Danube Ref Board DDR 166 Mhz - by Ng Aik Ann 29th April */
|
/* Optimise for Danube Ref Board DDR 166 Mhz - by Ng Aik Ann 29th April */
|
||||||
#define MC_DC0_VALUE 0x1B1B
|
#define MC_DC0_VALUE 0x1B1B
|
||||||
#define MC_DC1_VALUE 0x0
|
#define MC_DC1_VALUE 0x0
|
||||||
#define MC_DC2_VALUE 0x0
|
#define MC_DC2_VALUE 0x0
|
||||||
#define MC_DC3_VALUE 0x0
|
#define MC_DC3_VALUE 0x0
|
||||||
#define MC_DC4_VALUE 0x0
|
#define MC_DC4_VALUE 0x0
|
||||||
#define MC_DC5_VALUE 0x200
|
#define MC_DC5_VALUE 0x200
|
||||||
#define MC_DC6_VALUE 0x605
|
#define MC_DC6_VALUE 0x605
|
||||||
#define MC_DC7_VALUE 0x303
|
#define MC_DC7_VALUE 0x303
|
||||||
#define MC_DC8_VALUE 0x102
|
#define MC_DC8_VALUE 0x102
|
||||||
#define MC_DC9_VALUE 0x70a
|
#define MC_DC9_VALUE 0x70a
|
||||||
#define MC_DC10_VALUE 0x203
|
#define MC_DC10_VALUE 0x203
|
||||||
#define MC_DC11_VALUE 0xc02
|
#define MC_DC11_VALUE 0xc02
|
||||||
#define MC_DC12_VALUE 0x1C8
|
#define MC_DC12_VALUE 0x1C8
|
||||||
#define MC_DC13_VALUE 0x1
|
#define MC_DC13_VALUE 0x1
|
||||||
#define MC_DC14_VALUE 0x0
|
#define MC_DC14_VALUE 0x0
|
||||||
#define MC_DC15_VALUE 0xf3c /* WDQS tuning for clk_wr*/
|
#define MC_DC15_VALUE 0xf3c /* WDQS tuning for clk_wr*/
|
||||||
#define MC_DC16_VALUE 0xC800
|
#define MC_DC16_VALUE 0xC800
|
||||||
#define MC_DC17_VALUE 0xd
|
#define MC_DC17_VALUE 0xd
|
||||||
#define MC_DC18_VALUE 0x300
|
#define MC_DC18_VALUE 0x300
|
||||||
#define MC_DC19_VALUE 0x200
|
#define MC_DC19_VALUE 0x200
|
||||||
#define MC_DC20_VALUE 0xA04 /* A04 for reference board, A03 for Eval board */
|
#define MC_DC20_VALUE 0xA04 /* A04 for reference board, A03 for Eval board */
|
||||||
#define MC_DC21_VALUE 0x1200
|
#define MC_DC21_VALUE 0x1200
|
||||||
#define MC_DC22_VALUE 0x1212
|
#define MC_DC22_VALUE 0x1212
|
||||||
#define MC_DC23_VALUE 0x0
|
#define MC_DC23_VALUE 0x0
|
||||||
#define MC_DC24_VALUE 0x5e /* WDQS Tuning for DQS */
|
#define MC_DC24_VALUE 0x5e /* WDQS Tuning for DQS */
|
||||||
#define MC_DC25_VALUE 0x0
|
#define MC_DC25_VALUE 0x0
|
||||||
#define MC_DC26_VALUE 0x0
|
#define MC_DC26_VALUE 0x0
|
||||||
#define MC_DC27_VALUE 0x0
|
#define MC_DC27_VALUE 0x0
|
||||||
#define MC_DC28_VALUE 0x510
|
#define MC_DC28_VALUE 0x510
|
||||||
#define MC_DC29_VALUE 0x2d89
|
#define MC_DC29_VALUE 0x2d89
|
||||||
#define MC_DC30_VALUE 0x8300
|
#define MC_DC30_VALUE 0x8300
|
||||||
#define MC_DC31_VALUE 0x0
|
#define MC_DC31_VALUE 0x0
|
||||||
#define MC_DC32_VALUE 0x0
|
#define MC_DC32_VALUE 0x0
|
||||||
#define MC_DC33_VALUE 0x0
|
#define MC_DC33_VALUE 0x0
|
||||||
#define MC_DC34_VALUE 0x0
|
#define MC_DC34_VALUE 0x0
|
||||||
#define MC_DC35_VALUE 0x0
|
#define MC_DC35_VALUE 0x0
|
||||||
#define MC_DC36_VALUE 0x0
|
#define MC_DC36_VALUE 0x0
|
||||||
#define MC_DC37_VALUE 0x0
|
#define MC_DC37_VALUE 0x0
|
||||||
#define MC_DC38_VALUE 0x0
|
#define MC_DC38_VALUE 0x0
|
||||||
#define MC_DC39_VALUE 0x0
|
#define MC_DC39_VALUE 0x0
|
||||||
#define MC_DC40_VALUE 0x0
|
#define MC_DC40_VALUE 0x0
|
||||||
#define MC_DC41_VALUE 0x0
|
#define MC_DC41_VALUE 0x0
|
||||||
#define MC_DC42_VALUE 0x0
|
#define MC_DC42_VALUE 0x0
|
||||||
#define MC_DC43_VALUE 0x0
|
#define MC_DC43_VALUE 0x0
|
||||||
#define MC_DC44_VALUE 0x0
|
#define MC_DC44_VALUE 0x0
|
||||||
#define MC_DC45_VALUE 0x500
|
#define MC_DC45_VALUE 0x500
|
||||||
//#define MC_DC45_VALUE 0x400
|
//#define MC_DC45_VALUE 0x400
|
||||||
#define MC_DC46_VALUE 0x0
|
#define MC_DC46_VALUE 0x0
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
/* Settings for Denali DDR SDRAM controller */
|
/* Settings for Denali DDR SDRAM controller */
|
||||||
/* Optimise for Danube Eval Board DDR 167 Mhz - by Ng Aik Ann 29th April */
|
/* Optimise for Danube Eval Board DDR 167 Mhz - by Ng Aik Ann 29th April */
|
||||||
#define MC_DC0_VALUE 0x1B1B
|
#define MC_DC0_VALUE 0x1B1B
|
||||||
#define MC_DC1_VALUE 0x0
|
#define MC_DC1_VALUE 0x0
|
||||||
#define MC_DC2_VALUE 0x0
|
#define MC_DC2_VALUE 0x0
|
||||||
#define MC_DC3_VALUE 0x0
|
#define MC_DC3_VALUE 0x0
|
||||||
#define MC_DC4_VALUE 0x0
|
#define MC_DC4_VALUE 0x0
|
||||||
#define MC_DC5_VALUE 0x200
|
#define MC_DC5_VALUE 0x200
|
||||||
#define MC_DC6_VALUE 0x605
|
#define MC_DC6_VALUE 0x605
|
||||||
#define MC_DC7_VALUE 0x303
|
#define MC_DC7_VALUE 0x303
|
||||||
#define MC_DC8_VALUE 0x102
|
#define MC_DC8_VALUE 0x102
|
||||||
#define MC_DC9_VALUE 0x70a
|
#define MC_DC9_VALUE 0x70a
|
||||||
#define MC_DC10_VALUE 0x203
|
#define MC_DC10_VALUE 0x203
|
||||||
#define MC_DC11_VALUE 0xc02
|
#define MC_DC11_VALUE 0xc02
|
||||||
#define MC_DC12_VALUE 0x1C8
|
#define MC_DC12_VALUE 0x1C8
|
||||||
#define MC_DC13_VALUE 0x1
|
#define MC_DC13_VALUE 0x1
|
||||||
#define MC_DC14_VALUE 0x0
|
#define MC_DC14_VALUE 0x0
|
||||||
#define MC_DC15_VALUE 0xf3c
|
#define MC_DC15_VALUE 0xf3c
|
||||||
#define MC_DC16_VALUE 0xC800
|
#define MC_DC16_VALUE 0xC800
|
||||||
#define MC_DC17_VALUE 0xd
|
#define MC_DC17_VALUE 0xd
|
||||||
#define MC_DC18_VALUE 0x300
|
#define MC_DC18_VALUE 0x300
|
||||||
#define MC_DC19_VALUE 0x200
|
#define MC_DC19_VALUE 0x200
|
||||||
#define MC_DC20_VALUE 0xA03
|
#define MC_DC20_VALUE 0xA03
|
||||||
#define MC_DC21_VALUE 0x1d00
|
#define MC_DC21_VALUE 0x1d00
|
||||||
#define MC_DC22_VALUE 0x1d1d
|
#define MC_DC22_VALUE 0x1d1d
|
||||||
#define MC_DC23_VALUE 0x0
|
#define MC_DC23_VALUE 0x0
|
||||||
#define MC_DC24_VALUE 0x5e /* was 0x7f */
|
#define MC_DC24_VALUE 0x5e /* was 0x7f */
|
||||||
#define MC_DC25_VALUE 0x0
|
#define MC_DC25_VALUE 0x0
|
||||||
#define MC_DC26_VALUE 0x0
|
#define MC_DC26_VALUE 0x0
|
||||||
#define MC_DC27_VALUE 0x0
|
#define MC_DC27_VALUE 0x0
|
||||||
#define MC_DC28_VALUE 0x510
|
#define MC_DC28_VALUE 0x510
|
||||||
#define MC_DC29_VALUE 0x2d89
|
#define MC_DC29_VALUE 0x2d89
|
||||||
#define MC_DC30_VALUE 0x8300
|
#define MC_DC30_VALUE 0x8300
|
||||||
#define MC_DC31_VALUE 0x0
|
#define MC_DC31_VALUE 0x0
|
||||||
#define MC_DC32_VALUE 0x0
|
#define MC_DC32_VALUE 0x0
|
||||||
#define MC_DC33_VALUE 0x0
|
#define MC_DC33_VALUE 0x0
|
||||||
#define MC_DC34_VALUE 0x0
|
#define MC_DC34_VALUE 0x0
|
||||||
#define MC_DC35_VALUE 0x0
|
#define MC_DC35_VALUE 0x0
|
||||||
#define MC_DC36_VALUE 0x0
|
#define MC_DC36_VALUE 0x0
|
||||||
#define MC_DC37_VALUE 0x0
|
#define MC_DC37_VALUE 0x0
|
||||||
#define MC_DC38_VALUE 0x0
|
#define MC_DC38_VALUE 0x0
|
||||||
#define MC_DC39_VALUE 0x0
|
#define MC_DC39_VALUE 0x0
|
||||||
#define MC_DC40_VALUE 0x0
|
#define MC_DC40_VALUE 0x0
|
||||||
#define MC_DC41_VALUE 0x0
|
#define MC_DC41_VALUE 0x0
|
||||||
#define MC_DC42_VALUE 0x0
|
#define MC_DC42_VALUE 0x0
|
||||||
#define MC_DC43_VALUE 0x0
|
#define MC_DC43_VALUE 0x0
|
||||||
#define MC_DC44_VALUE 0x0
|
#define MC_DC44_VALUE 0x0
|
||||||
#define MC_DC45_VALUE 0x500
|
#define MC_DC45_VALUE 0x500
|
||||||
//#define MC_DC45_VALUE 0x400
|
//#define MC_DC45_VALUE 0x400
|
||||||
#define MC_DC46_VALUE 0x0
|
#define MC_DC46_VALUE 0x0
|
||||||
|
@ -1,50 +1,50 @@
|
|||||||
/* Settings for Denali DDR SDRAM controller */
|
/* Settings for Denali DDR SDRAM controller */
|
||||||
/* Optimise for Danube Ref Board DDR 166 Mhz - by Ng Aik Ann 29th April */
|
/* Optimise for Danube Ref Board DDR 166 Mhz - by Ng Aik Ann 29th April */
|
||||||
#define MC_DC0_VALUE 0x1B1B
|
#define MC_DC0_VALUE 0x1B1B
|
||||||
#define MC_DC1_VALUE 0x0
|
#define MC_DC1_VALUE 0x0
|
||||||
#define MC_DC2_VALUE 0x0
|
#define MC_DC2_VALUE 0x0
|
||||||
#define MC_DC3_VALUE 0x0
|
#define MC_DC3_VALUE 0x0
|
||||||
#define MC_DC4_VALUE 0x0
|
#define MC_DC4_VALUE 0x0
|
||||||
#define MC_DC5_VALUE 0x200
|
#define MC_DC5_VALUE 0x200
|
||||||
#define MC_DC6_VALUE 0x605
|
#define MC_DC6_VALUE 0x605
|
||||||
#define MC_DC7_VALUE 0x303
|
#define MC_DC7_VALUE 0x303
|
||||||
#define MC_DC8_VALUE 0x102
|
#define MC_DC8_VALUE 0x102
|
||||||
#define MC_DC9_VALUE 0x70a
|
#define MC_DC9_VALUE 0x70a
|
||||||
#define MC_DC10_VALUE 0x203
|
#define MC_DC10_VALUE 0x203
|
||||||
#define MC_DC11_VALUE 0xc02
|
#define MC_DC11_VALUE 0xc02
|
||||||
#define MC_DC12_VALUE 0x1C8
|
#define MC_DC12_VALUE 0x1C8
|
||||||
#define MC_DC13_VALUE 0x1
|
#define MC_DC13_VALUE 0x1
|
||||||
#define MC_DC14_VALUE 0x0
|
#define MC_DC14_VALUE 0x0
|
||||||
#define MC_DC15_VALUE 0xf3c /* WDQS tuning for clk_wr*/
|
#define MC_DC15_VALUE 0xf3c /* WDQS tuning for clk_wr*/
|
||||||
#define MC_DC16_VALUE 0xC800
|
#define MC_DC16_VALUE 0xC800
|
||||||
#define MC_DC17_VALUE 0xd
|
#define MC_DC17_VALUE 0xd
|
||||||
#define MC_DC18_VALUE 0x300
|
#define MC_DC18_VALUE 0x300
|
||||||
#define MC_DC19_VALUE 0x200
|
#define MC_DC19_VALUE 0x200
|
||||||
#define MC_DC20_VALUE 0xA04 /* A04 for reference board, A03 for Eval board */
|
#define MC_DC20_VALUE 0xA04 /* A04 for reference board, A03 for Eval board */
|
||||||
#define MC_DC21_VALUE 0x1200
|
#define MC_DC21_VALUE 0x1200
|
||||||
#define MC_DC22_VALUE 0x1212
|
#define MC_DC22_VALUE 0x1212
|
||||||
#define MC_DC23_VALUE 0x0
|
#define MC_DC23_VALUE 0x0
|
||||||
#define MC_DC24_VALUE 0x5e /* WDQS Tuning for DQS */
|
#define MC_DC24_VALUE 0x5e /* WDQS Tuning for DQS */
|
||||||
#define MC_DC25_VALUE 0x0
|
#define MC_DC25_VALUE 0x0
|
||||||
#define MC_DC26_VALUE 0x0
|
#define MC_DC26_VALUE 0x0
|
||||||
#define MC_DC27_VALUE 0x0
|
#define MC_DC27_VALUE 0x0
|
||||||
#define MC_DC28_VALUE 0x510
|
#define MC_DC28_VALUE 0x510
|
||||||
#define MC_DC29_VALUE 0x2d89
|
#define MC_DC29_VALUE 0x2d89
|
||||||
#define MC_DC30_VALUE 0x8300
|
#define MC_DC30_VALUE 0x8300
|
||||||
#define MC_DC31_VALUE 0x0
|
#define MC_DC31_VALUE 0x0
|
||||||
#define MC_DC32_VALUE 0x0
|
#define MC_DC32_VALUE 0x0
|
||||||
#define MC_DC33_VALUE 0x0
|
#define MC_DC33_VALUE 0x0
|
||||||
#define MC_DC34_VALUE 0x0
|
#define MC_DC34_VALUE 0x0
|
||||||
#define MC_DC35_VALUE 0x0
|
#define MC_DC35_VALUE 0x0
|
||||||
#define MC_DC36_VALUE 0x0
|
#define MC_DC36_VALUE 0x0
|
||||||
#define MC_DC37_VALUE 0x0
|
#define MC_DC37_VALUE 0x0
|
||||||
#define MC_DC38_VALUE 0x0
|
#define MC_DC38_VALUE 0x0
|
||||||
#define MC_DC39_VALUE 0x0
|
#define MC_DC39_VALUE 0x0
|
||||||
#define MC_DC40_VALUE 0x0
|
#define MC_DC40_VALUE 0x0
|
||||||
#define MC_DC41_VALUE 0x0
|
#define MC_DC41_VALUE 0x0
|
||||||
#define MC_DC42_VALUE 0x0
|
#define MC_DC42_VALUE 0x0
|
||||||
#define MC_DC43_VALUE 0x0
|
#define MC_DC43_VALUE 0x0
|
||||||
#define MC_DC44_VALUE 0x0
|
#define MC_DC44_VALUE 0x0
|
||||||
#define MC_DC45_VALUE 0x500
|
#define MC_DC45_VALUE 0x500
|
||||||
//#define MC_DC45_VALUE 0x400
|
//#define MC_DC45_VALUE 0x400
|
||||||
#define MC_DC46_VALUE 0x0
|
#define MC_DC46_VALUE 0x0
|
||||||
|
@ -1,51 +1,51 @@
|
|||||||
/* Settings for Denali DDR SDRAM controller */
|
/* Settings for Denali DDR SDRAM controller */
|
||||||
/* Optimise for Samsung DDR K4H561638H Danube Ref Board DDR 166 Mhz - by Ng Aik Ann 27th Nov 2006 */
|
/* 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_DC0_VALUE 0x1B1B
|
||||||
#define MC_DC1_VALUE 0x0
|
#define MC_DC1_VALUE 0x0
|
||||||
#define MC_DC2_VALUE 0x0
|
#define MC_DC2_VALUE 0x0
|
||||||
#define MC_DC3_VALUE 0x0
|
#define MC_DC3_VALUE 0x0
|
||||||
#define MC_DC4_VALUE 0x0
|
#define MC_DC4_VALUE 0x0
|
||||||
#define MC_DC5_VALUE 0x200
|
#define MC_DC5_VALUE 0x200
|
||||||
#define MC_DC6_VALUE 0x306
|
#define MC_DC6_VALUE 0x306
|
||||||
#define MC_DC7_VALUE 0x303
|
#define MC_DC7_VALUE 0x303
|
||||||
#define MC_DC8_VALUE 0x102
|
#define MC_DC8_VALUE 0x102
|
||||||
#define MC_DC9_VALUE 0x80B
|
#define MC_DC9_VALUE 0x80B
|
||||||
#define MC_DC10_VALUE 0x203
|
#define MC_DC10_VALUE 0x203
|
||||||
#define MC_DC11_VALUE 0xD02
|
#define MC_DC11_VALUE 0xD02
|
||||||
#define MC_DC12_VALUE 0x1C8
|
#define MC_DC12_VALUE 0x1C8
|
||||||
#define MC_DC13_VALUE 0x1
|
#define MC_DC13_VALUE 0x1
|
||||||
#define MC_DC14_VALUE 0x0
|
#define MC_DC14_VALUE 0x0
|
||||||
#define MC_DC15_VALUE 0x144 /* WDQS tuning for clk_wr*/
|
#define MC_DC15_VALUE 0x144 /* WDQS tuning for clk_wr*/
|
||||||
#define MC_DC16_VALUE 0xC800
|
#define MC_DC16_VALUE 0xC800
|
||||||
#define MC_DC17_VALUE 0xF
|
#define MC_DC17_VALUE 0xF
|
||||||
#define MC_DC18_VALUE 0x301
|
#define MC_DC18_VALUE 0x301
|
||||||
#define MC_DC19_VALUE 0x200
|
#define MC_DC19_VALUE 0x200
|
||||||
#define MC_DC20_VALUE 0xA04 /* A04 for reference board, A03 for Eval board */
|
#define MC_DC20_VALUE 0xA04 /* A04 for reference board, A03 for Eval board */
|
||||||
#define MC_DC21_VALUE 0x1200
|
#define MC_DC21_VALUE 0x1200
|
||||||
#define MC_DC22_VALUE 0x1212
|
#define MC_DC22_VALUE 0x1212
|
||||||
#define MC_DC23_VALUE 0x0
|
#define MC_DC23_VALUE 0x0
|
||||||
#define MC_DC24_VALUE 0x66 /* WDQS Tuning for DQS */
|
#define MC_DC24_VALUE 0x66 /* WDQS Tuning for DQS */
|
||||||
#define MC_DC25_VALUE 0x0
|
#define MC_DC25_VALUE 0x0
|
||||||
#define MC_DC26_VALUE 0x0
|
#define MC_DC26_VALUE 0x0
|
||||||
#define MC_DC27_VALUE 0x0
|
#define MC_DC27_VALUE 0x0
|
||||||
#define MC_DC28_VALUE 0x5FB
|
#define MC_DC28_VALUE 0x5FB
|
||||||
#define MC_DC29_VALUE 0x35DF
|
#define MC_DC29_VALUE 0x35DF
|
||||||
#define MC_DC30_VALUE 0x99E9
|
#define MC_DC30_VALUE 0x99E9
|
||||||
#define MC_DC31_VALUE 0x0
|
#define MC_DC31_VALUE 0x0
|
||||||
#define MC_DC32_VALUE 0x0
|
#define MC_DC32_VALUE 0x0
|
||||||
#define MC_DC33_VALUE 0x0
|
#define MC_DC33_VALUE 0x0
|
||||||
#define MC_DC34_VALUE 0x0
|
#define MC_DC34_VALUE 0x0
|
||||||
#define MC_DC35_VALUE 0x0
|
#define MC_DC35_VALUE 0x0
|
||||||
#define MC_DC36_VALUE 0x0
|
#define MC_DC36_VALUE 0x0
|
||||||
#define MC_DC37_VALUE 0x0
|
#define MC_DC37_VALUE 0x0
|
||||||
#define MC_DC38_VALUE 0x0
|
#define MC_DC38_VALUE 0x0
|
||||||
#define MC_DC39_VALUE 0x0
|
#define MC_DC39_VALUE 0x0
|
||||||
#define MC_DC40_VALUE 0x0
|
#define MC_DC40_VALUE 0x0
|
||||||
#define MC_DC41_VALUE 0x0
|
#define MC_DC41_VALUE 0x0
|
||||||
#define MC_DC42_VALUE 0x0
|
#define MC_DC42_VALUE 0x0
|
||||||
#define MC_DC43_VALUE 0x0
|
#define MC_DC43_VALUE 0x0
|
||||||
#define MC_DC44_VALUE 0x0
|
#define MC_DC44_VALUE 0x0
|
||||||
#define MC_DC45_VALUE 0x600
|
#define MC_DC45_VALUE 0x600
|
||||||
//#define MC_DC45_VALUE 0x400
|
//#define MC_DC45_VALUE 0x400
|
||||||
#define MC_DC46_VALUE 0x0
|
#define MC_DC46_VALUE 0x0
|
||||||
|
@ -12,7 +12,7 @@ UCI_RELEASE=5
|
|||||||
|
|
||||||
PKG_NAME:=uci
|
PKG_NAME:=uci
|
||||||
PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
|
PKG_VERSION:=$(UCI_VERSION)$(if $(UCI_RELEASE),.$(UCI_RELEASE))
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
PKG_REV:=aa3ab8012bfbf793d2884c08ea924545a04e9544
|
PKG_REV:=aa3ab8012bfbf793d2884c08ea924545a04e9544
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Shell script compatibility wrappers for /sbin/uci
|
# Shell script compatibility wrappers for /sbin/uci
|
||||||
#
|
#
|
||||||
|
# Copyright (C) 2008-2010 OpenWrt.org
|
||||||
# Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
|
# Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
@ -41,9 +42,9 @@ uci_load() {
|
|||||||
|
|
||||||
uci_set_default() {
|
uci_set_default() {
|
||||||
local PACKAGE="$1"
|
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} -q show "$PACKAGE" > /dev/null && return 0
|
||||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} import "$1"
|
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} import "$PACKAGE"
|
||||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit "$1"
|
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit "$PACKAGE"
|
||||||
}
|
}
|
||||||
|
|
||||||
uci_revert_state() {
|
uci_revert_state() {
|
||||||
@ -73,6 +74,23 @@ uci_set() {
|
|||||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set "$PACKAGE.$CONFIG.$OPTION=$VALUE"
|
/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() {
|
uci_add() {
|
||||||
local PACKAGE="$1"
|
local PACKAGE="$1"
|
||||||
local TYPE="$2"
|
local TYPE="$2"
|
||||||
|
@ -48,7 +48,7 @@ start_instance()
|
|||||||
UHTTPD_KEY=""
|
UHTTPD_KEY=""
|
||||||
|
|
||||||
local cfg="$1"
|
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
|
local listen http https
|
||||||
|
|
||||||
append_arg "$cfg" home "-h"
|
append_arg "$cfg" home "-h"
|
||||||
|
@ -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.
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -9,6 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
|||||||
|
|
||||||
PKG_NAME:=wprobe
|
PKG_NAME:=wprobe
|
||||||
PKG_VERSION:=1
|
PKG_VERSION:=1
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_BUILD_DEPENDS:=PACKAGE_wprobe-export:libipfix
|
PKG_BUILD_DEPENDS:=PACKAGE_wprobe-export:libipfix
|
||||||
|
|
||||||
|
@ -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))
|
$(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
|
endef
|
||||||
define Image/Build/CyberTAN2
|
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
|
endef
|
||||||
define Image/Build/CyberTANHead
|
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))
|
$(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
|
define Image/Build/trxV2
|
||||||
$(call Image/Build/CyberTANHead,$(1),$(2),$(3),$(4),$(5),$(if $(6),$(6)))
|
$(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 \
|
-f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma \
|
||||||
$(call trxalign/$(1),$(1),$(KDIR)/openwrt-$(2)-header.bin)
|
$(call trxalign/$(1),$(1),$(KDIR)/openwrt-$(2)-header.bin)
|
||||||
$(call Image/Build/CyberTAN2,$(1),$(2),$(3),$(4),$(5),$(if $(6),$(6)))
|
$(call Image/Build/CyberTAN2,$(1),$(2),$(3),$(4),$(5),$(if $(6),$(6)))
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/usb/host/ehci-ssb.c
|
+++ b/drivers/usb/host/ehci-ssb.c
|
||||||
@@ -0,0 +1,201 @@
|
@@ -0,0 +1,158 @@
|
||||||
+/*
|
+/*
|
||||||
+ * Sonics Silicon Backplane
|
+ * Sonics Silicon Backplane
|
||||||
+ * Broadcom USB-core EHCI driver (SSB bus glue)
|
+ * Broadcom USB-core EHCI driver (SSB bus glue)
|
||||||
@ -90,7 +90,6 @@
|
|||||||
+ return (struct ssb_ehci_device *)(hcd->hcd_priv);
|
+ return (struct ssb_ehci_device *)(hcd->hcd_priv);
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+
|
|
||||||
+static int ssb_ehci_reset(struct usb_hcd *hcd)
|
+static int ssb_ehci_reset(struct usb_hcd *hcd)
|
||||||
+{
|
+{
|
||||||
+ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
|
+ struct ehci_hcd *ehci = hcd_to_ehci(hcd);
|
||||||
@ -115,55 +114,11 @@
|
|||||||
+ if (err)
|
+ if (err)
|
||||||
+ return err;
|
+ return err;
|
||||||
+
|
+
|
||||||
+ ehci_port_power(ehci, 0);
|
+ ehci_reset(ehci);
|
||||||
+
|
+
|
||||||
+ return err;
|
+ 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 = {
|
+static const struct hc_driver ssb_ehci_hc_driver = {
|
||||||
+ .description = "ssb-usb-ehci",
|
+ .description = "ssb-usb-ehci",
|
||||||
+ .product_desc = "SSB EHCI Controller",
|
+ .product_desc = "SSB EHCI Controller",
|
||||||
@ -173,35 +128,37 @@
|
|||||||
+ .flags = HCD_MEMORY | HCD_USB2,
|
+ .flags = HCD_MEMORY | HCD_USB2,
|
||||||
+
|
+
|
||||||
+ .reset = ssb_ehci_reset,
|
+ .reset = ssb_ehci_reset,
|
||||||
+ .start = ssb_ehci_start,
|
+ .start = ehci_run,
|
||||||
+ .stop = ehci_stop,
|
+ .stop = ehci_stop,
|
||||||
+ .shutdown = ehci_shutdown,
|
+ .shutdown = ehci_shutdown,
|
||||||
+
|
+
|
||||||
+#ifdef CONFIG_PM
|
|
||||||
+ .suspend = ssb_ehci_hcd_suspend,
|
|
||||||
+ .resume = ssb_ehci_hcd_resume,
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+ .urb_enqueue = ehci_urb_enqueue,
|
+ .urb_enqueue = ehci_urb_enqueue,
|
||||||
+ .urb_dequeue = ehci_urb_dequeue,
|
+ .urb_dequeue = ehci_urb_dequeue,
|
||||||
+ .endpoint_disable = ehci_endpoint_disable,
|
+ .endpoint_disable = ehci_endpoint_disable,
|
||||||
|
+ .endpoint_reset = ehci_endpoint_reset,
|
||||||
+
|
+
|
||||||
+ .get_frame_number = ehci_get_frame,
|
+ .get_frame_number = ehci_get_frame,
|
||||||
+
|
+
|
||||||
+ .hub_status_data = ehci_hub_status_data,
|
+ .hub_status_data = ehci_hub_status_data,
|
||||||
+ .hub_control = ehci_hub_control,
|
+ .hub_control = ehci_hub_control,
|
||||||
+#ifdef CONFIG_PM
|
|
||||||
+ .bus_suspend = ehci_bus_suspend,
|
+ .bus_suspend = ehci_bus_suspend,
|
||||||
+ .bus_resume = ehci_bus_resume,
|
+ .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)
|
+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);
|
+ usb_remove_hcd(hcd);
|
||||||
|
+
|
||||||
+ iounmap(hcd->regs);
|
+ iounmap(hcd->regs);
|
||||||
|
+ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
|
||||||
|
+
|
||||||
+ usb_put_hcd(hcd);
|
+ usb_put_hcd(hcd);
|
||||||
+}
|
+}
|
||||||
+EXPORT_SYMBOL_GPL(ssb_ehci_detach);
|
+EXPORT_SYMBOL_GPL(ssb_ehci_detach);
|
||||||
|
@ -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.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
|
+++ linux-2.6.32.10/drivers/net/bcm63xx_enet.c 2010-04-07 21:40:26.991801424 +0100
|
||||||
@@ -965,7 +965,9 @@
|
@@ -965,7 +965,9 @@
|
||||||
/* all set, enable mac and interrupts, start dma engine and
|
/* all set, enable mac and interrupts, start dma engine and
|
||||||
* kick rx dma channel */
|
* kick rx dma channel */
|
||||||
wmb();
|
wmb();
|
||||||
- enet_writel(priv, ENET_CTL_ENABLE_MASK, ENET_CTL_REG);
|
- enet_writel(priv, ENET_CTL_ENABLE_MASK, ENET_CTL_REG);
|
||||||
+ val = enet_readl(priv, ENET_CTL_REG);
|
+ val = enet_readl(priv, ENET_CTL_REG);
|
||||||
+ val |= ENET_CTL_ENABLE_MASK;
|
+ val |= ENET_CTL_ENABLE_MASK;
|
||||||
+ enet_writel(priv, val, ENET_CTL_REG);
|
+ enet_writel(priv, val, ENET_CTL_REG);
|
||||||
enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG);
|
enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG);
|
||||||
enet_dma_writel(priv, ENETDMA_CHANCFG_EN_MASK,
|
enet_dma_writel(priv, ENETDMA_CHANCFG_EN_MASK,
|
||||||
ENETDMA_CHANCFG_REG(priv->rx_chan));
|
ENETDMA_CHANCFG_REG(priv->rx_chan));
|
||||||
|
@ -2164,7 +2164,6 @@ CONFIG_SQUASHFS_LZMA=y
|
|||||||
CONFIG_SQUASHFS_SUPPORT_ZLIB=y
|
CONFIG_SQUASHFS_SUPPORT_ZLIB=y
|
||||||
# CONFIG_SQUASHFS_VMALLOC is not set
|
# CONFIG_SQUASHFS_VMALLOC is not set
|
||||||
CONFIG_SQUASHFS=y
|
CONFIG_SQUASHFS=y
|
||||||
# CONFIG_SSB_BLOCKIO is not set
|
|
||||||
# CONFIG_SSB_DEBUG is not set
|
# CONFIG_SSB_DEBUG is not set
|
||||||
# CONFIG_SSB is not set
|
# CONFIG_SSB is not set
|
||||||
# CONFIG_SSB_PCMCIAHOST is not set
|
# CONFIG_SSB_PCMCIAHOST is not set
|
||||||
|
@ -2283,7 +2283,6 @@ CONFIG_SQUASHFS_LZMA=y
|
|||||||
CONFIG_SQUASHFS_SUPPORT_ZLIB=y
|
CONFIG_SQUASHFS_SUPPORT_ZLIB=y
|
||||||
# CONFIG_SQUASHFS_VMALLOC is not set
|
# CONFIG_SQUASHFS_VMALLOC is not set
|
||||||
CONFIG_SQUASHFS=y
|
CONFIG_SQUASHFS=y
|
||||||
# CONFIG_SSB_BLOCKIO is not set
|
|
||||||
# CONFIG_SSB_DEBUG is not set
|
# CONFIG_SSB_DEBUG is not set
|
||||||
# CONFIG_SSB is not set
|
# CONFIG_SSB is not set
|
||||||
# CONFIG_SSB_PCMCIAHOST is not set
|
# CONFIG_SSB_PCMCIAHOST is not set
|
||||||
|
@ -128,7 +128,170 @@
|
|||||||
+EXPORT_SYMBOL(ssb_pmu_set_ldo_paref);
|
+EXPORT_SYMBOL(ssb_pmu_set_ldo_paref);
|
||||||
--- a/drivers/ssb/main.c
|
--- a/drivers/ssb/main.c
|
||||||
+++ b/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:
|
case SSB_BUSTYPE_SSB:
|
||||||
dev->dma_mask = &dev->coherent_dma_mask;
|
dev->dma_mask = &dev->coherent_dma_mask;
|
||||||
break;
|
break;
|
||||||
@ -137,7 +300,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
sdev->dev = dev;
|
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();
|
ssb_buses_lock();
|
||||||
err = ssb_attach_queued_buses();
|
err = ssb_attach_queued_buses();
|
||||||
ssb_buses_unlock();
|
ssb_buses_unlock();
|
||||||
@ -149,7 +312,7 @@
|
|||||||
|
|
||||||
err = b43_pci_ssb_bridge_init();
|
err = b43_pci_ssb_bridge_init();
|
||||||
if (err) {
|
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 */
|
/* don't fail SSB init because of this */
|
||||||
err = 0;
|
err = 0;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
--- a/drivers/ssb/Kconfig
|
--- a/drivers/ssb/Kconfig
|
||||||
+++ b/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
|
config SSB_B43_PCI_BRIDGE
|
||||||
bool
|
bool
|
||||||
depends on SSB_PCIHOST
|
depends on SSB_PCIHOST
|
||||||
|
@ -1,6 +1,14 @@
|
|||||||
--- a/drivers/ssb/Kconfig
|
--- a/drivers/ssb/Kconfig
|
||||||
+++ b/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
|
config SSB_B43_PCI_BRIDGE
|
||||||
bool
|
bool
|
||||||
depends on SSB_PCIHOST
|
depends on SSB_PCIHOST
|
||||||
|
@ -28,6 +28,23 @@ set system.wifi_led.mode='link tx rx'
|
|||||||
set system.wifi_led.default='0'
|
set system.wifi_led.default='0'
|
||||||
commit system
|
commit system
|
||||||
__EOF
|
__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
|
case "${hardware}" in
|
||||||
|
@ -55,7 +55,7 @@ endef
|
|||||||
define Image/Build
|
define Image/Build
|
||||||
$(CP) $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel
|
$(CP) $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel
|
||||||
$(STAGING_DIR_HOST)/bin/patch-cmdline $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel '$(strip $(call Image/cmdline/$(1))) '
|
$(STAGING_DIR_HOST)/bin/patch-cmdline $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel '$(strip $(call Image/cmdline/$(1))) '
|
||||||
./gen_image.sh $(BIN_DIR)/$(IMG_PREFIX)-$(1).bin 4 $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel $(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1)
|
./gen_image.sh $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).bin 4 $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(KDIR)/root.$(1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
|
||||||
|
@ -1,243 +1,243 @@
|
|||||||
/*
|
/*
|
||||||
* ar525w RDC321x platform devices
|
* ar525w RDC321x platform devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009 OpenWrt.org
|
* Copyright (C) 2007-2009 OpenWrt.org
|
||||||
* Copyright (C) 2007 Florian Fainelli <florian@openwrt.org>
|
* Copyright (C) 2007 Florian Fainelli <florian@openwrt.org>
|
||||||
* Copyright (C) 2008-2009 Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
|
* Copyright (C) 2008-2009 Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
* as published by the Free Software Foundation; either version 2
|
* as published by the Free Software Foundation; either version 2
|
||||||
* of the License, or (at your option) any later version.
|
* of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the
|
* along with this program; if not, write to the
|
||||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/mtd/physmap.h>
|
#include <linux/mtd/physmap.h>
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
#include <linux/vmalloc.h>
|
#include <linux/vmalloc.h>
|
||||||
#include <linux/mtd/mtd.h>
|
#include <linux/mtd/mtd.h>
|
||||||
|
|
||||||
#include <asm/rdc_boards.h>
|
#include <asm/rdc_boards.h>
|
||||||
|
|
||||||
struct image_header {
|
struct image_header {
|
||||||
char magic[4]; /* ASICII: GMTK */
|
char magic[4]; /* ASICII: GMTK */
|
||||||
u32 checksum; /* CRC32 */
|
u32 checksum; /* CRC32 */
|
||||||
u32 version; /* x.x.x.x */
|
u32 version; /* x.x.x.x */
|
||||||
u32 kernelsz; /* The size of the kernel image */
|
u32 kernelsz; /* The size of the kernel image */
|
||||||
u32 imagesz; /* The length of this image file ( kernel + romfs + this header) */
|
u32 imagesz; /* The length of this image file ( kernel + romfs + this header) */
|
||||||
u32 pid; /* Product ID */
|
u32 pid; /* Product ID */
|
||||||
u32 fastcksum; /* Partial CRC32 on (First(256), medium(256), last(512)) */
|
u32 fastcksum; /* Partial CRC32 on (First(256), medium(256), last(512)) */
|
||||||
u32 reserved;
|
u32 reserved;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct gpio_led ar525w_leds[] = {
|
static struct gpio_led ar525w_leds[] = {
|
||||||
{ .name = "rdc321x:dmz", .gpio = 1, .active_low = 1},
|
{ .name = "rdc321x:dmz", .gpio = 1, .active_low = 1},
|
||||||
};
|
};
|
||||||
static struct gpio_button ar525w_btns[] = {
|
static struct gpio_button ar525w_btns[] = {
|
||||||
{
|
{
|
||||||
.gpio = 6,
|
.gpio = 6,
|
||||||
.code = BTN_0,
|
.code = BTN_0,
|
||||||
.desc = "Reset",
|
.desc = "Reset",
|
||||||
.active_low = 1,
|
.active_low = 1,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static u32 __initdata crctab[257] = {
|
static u32 __initdata crctab[257] = {
|
||||||
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
|
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
|
||||||
0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
|
0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
|
||||||
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
|
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
|
||||||
0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
|
0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
|
||||||
0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
|
0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
|
||||||
0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
|
0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
|
||||||
0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
|
0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
|
||||||
0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
|
0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
|
||||||
0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
|
0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
|
||||||
0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
|
0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
|
||||||
0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
|
0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
|
||||||
0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
|
0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
|
||||||
0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
|
0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
|
||||||
0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
|
0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
|
||||||
0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
|
0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
|
||||||
0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
|
0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
|
||||||
0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
|
0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
|
||||||
0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
|
0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
|
||||||
0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
|
0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
|
||||||
0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
|
0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
|
||||||
0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
|
0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
|
||||||
0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
|
0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
|
||||||
0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
|
0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
|
||||||
0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
|
0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
|
||||||
0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
|
0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
|
||||||
0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
|
0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
|
||||||
0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
|
0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
|
||||||
0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
|
0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
|
||||||
0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
|
0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
|
||||||
0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
|
0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
|
||||||
0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
|
0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
|
||||||
0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
|
0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
|
||||||
0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
|
0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
|
||||||
0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
|
0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
|
||||||
0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
|
0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
|
||||||
0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
|
0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
|
||||||
0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
|
0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
|
||||||
0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
|
0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
|
||||||
0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
|
0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
|
||||||
0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
|
0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
|
||||||
0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
|
0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
|
||||||
0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
|
0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
|
||||||
0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
|
0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
|
||||||
0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
|
0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
|
||||||
0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
|
0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
|
||||||
0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
|
0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
|
||||||
0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
|
0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
|
||||||
0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
|
0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
|
||||||
0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
|
0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
|
||||||
0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
|
0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
|
||||||
0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
|
0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
|
||||||
0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
|
0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
|
||||||
0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
|
0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
|
||||||
0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
|
0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
|
||||||
0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
|
0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
|
||||||
0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
|
0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
|
||||||
0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
|
0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
|
||||||
0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
|
0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
|
||||||
0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
|
0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
|
||||||
0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
|
0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
|
||||||
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
|
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
|
||||||
0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
|
0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
|
||||||
0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
|
0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
|
||||||
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,
|
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
static u32 __init crc32(u8 * buf, u32 len)
|
static u32 __init crc32(u8 * buf, u32 len)
|
||||||
{
|
{
|
||||||
register int i;
|
register int i;
|
||||||
u32 sum;
|
u32 sum;
|
||||||
register u32 s0;
|
register u32 s0;
|
||||||
s0 = ~0;
|
s0 = ~0;
|
||||||
for (i = 0; i < len; i++) {
|
for (i = 0; i < len; i++) {
|
||||||
s0 = (s0 >> 8) ^ crctab[(u8) (s0 & 0xFF) ^ buf[i]];
|
s0 = (s0 >> 8) ^ crctab[(u8) (s0 & 0xFF) ^ buf[i]];
|
||||||
}
|
}
|
||||||
sum = ~s0;
|
sum = ~s0;
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init fixup_ar525w_header(struct mtd_info *master, struct image_header *header)
|
static int __init fixup_ar525w_header(struct mtd_info *master, struct image_header *header)
|
||||||
{
|
{
|
||||||
char *buffer;
|
char *buffer;
|
||||||
int res;
|
int res;
|
||||||
u32 bufferlength = header->kernelsz + sizeof(struct image_header);
|
u32 bufferlength = header->kernelsz + sizeof(struct image_header);
|
||||||
u32 len;
|
u32 len;
|
||||||
char crcbuf[0x400];
|
char crcbuf[0x400];
|
||||||
|
|
||||||
printk(KERN_INFO "Fixing up AR525W header, old image size: %u, new image size: %u\n",
|
printk(KERN_INFO "Fixing up AR525W header, old image size: %u, new image size: %u\n",
|
||||||
header->imagesz, bufferlength);
|
header->imagesz, bufferlength);
|
||||||
|
|
||||||
buffer = vmalloc(bufferlength);
|
buffer = vmalloc(bufferlength);
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
printk(KERN_ERR "Can't allocate %u bytes\n", bufferlength);
|
printk(KERN_ERR "Can't allocate %u bytes\n", bufferlength);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = master->read(master, 0x0, bufferlength, &len, buffer);
|
res = master->read(master, 0x0, bufferlength, &len, buffer);
|
||||||
if (res || len != bufferlength)
|
if (res || len != bufferlength)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
header = (struct image_header *) buffer;
|
header = (struct image_header *) buffer;
|
||||||
header->imagesz = bufferlength;
|
header->imagesz = bufferlength;
|
||||||
header->checksum = 0;
|
header->checksum = 0;
|
||||||
header->fastcksum = 0;
|
header->fastcksum = 0;
|
||||||
|
|
||||||
memcpy(crcbuf, buffer, 0x100);
|
memcpy(crcbuf, buffer, 0x100);
|
||||||
memcpy(crcbuf + 0x100, buffer + (bufferlength >> 1) - ((bufferlength & 0x6) >> 1), 0x100);
|
memcpy(crcbuf + 0x100, buffer + (bufferlength >> 1) - ((bufferlength & 0x6) >> 1), 0x100);
|
||||||
memcpy(crcbuf + 0x200, buffer + bufferlength - 0x200, 0x200);
|
memcpy(crcbuf + 0x200, buffer + bufferlength - 0x200, 0x200);
|
||||||
|
|
||||||
header->fastcksum = crc32(crcbuf, sizeof(crcbuf));
|
header->fastcksum = crc32(crcbuf, sizeof(crcbuf));
|
||||||
header->checksum = crc32(buffer, bufferlength);
|
header->checksum = crc32(buffer, bufferlength);
|
||||||
|
|
||||||
if (master->unlock)
|
if (master->unlock)
|
||||||
master->unlock(master, 0, master->erasesize);
|
master->unlock(master, 0, master->erasesize);
|
||||||
res = erase_write (master, 0, master->erasesize, buffer);
|
res = erase_write (master, 0, master->erasesize, buffer);
|
||||||
if (res)
|
if (res)
|
||||||
printk(KERN_ERR "Can't rewrite image header\n");
|
printk(KERN_ERR "Can't rewrite image header\n");
|
||||||
|
|
||||||
out:
|
out:
|
||||||
vfree(buffer);
|
vfree(buffer);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __init parse_ar525w_partitions(struct mtd_info *master, struct mtd_partition **pparts, unsigned long plat_data)
|
static int __init parse_ar525w_partitions(struct mtd_info *master, struct mtd_partition **pparts, unsigned long plat_data)
|
||||||
{
|
{
|
||||||
struct image_header header;
|
struct image_header header;
|
||||||
int res;
|
int res;
|
||||||
size_t len;
|
size_t len;
|
||||||
struct mtd_partition *rdc_flash_parts;
|
struct mtd_partition *rdc_flash_parts;
|
||||||
struct rdc_platform_data *pdata = (struct rdc_platform_data *) plat_data;
|
struct rdc_platform_data *pdata = (struct rdc_platform_data *) plat_data;
|
||||||
|
|
||||||
if (master->size != 0x400000) //4MB
|
if (master->size != 0x400000) //4MB
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
|
|
||||||
res = master->read(master, 0x0, sizeof(header), &len, (char *)&header);
|
res = master->read(master, 0x0, sizeof(header), &len, (char *)&header);
|
||||||
if (res)
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
if (strncmp(header.magic, "GMTK", 4))
|
if (strncmp(header.magic, "GMTK", 4))
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
|
|
||||||
if (header.kernelsz > 0x400000 || header.kernelsz < master->erasesize) {
|
if (header.kernelsz > 0x400000 || header.kernelsz < master->erasesize) {
|
||||||
printk(KERN_ERR "AR525W image header found, but seems corrupt, kernel size %u\n", header.kernelsz);
|
printk(KERN_ERR "AR525W image header found, but seems corrupt, kernel size %u\n", header.kernelsz);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (header.kernelsz + sizeof(header) != header.imagesz) {
|
if (header.kernelsz + sizeof(header) != header.imagesz) {
|
||||||
res = fixup_ar525w_header(master, &header);
|
res = fixup_ar525w_header(master, &header);
|
||||||
if (res)
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
rdc_flash_parts = kzalloc(sizeof(struct mtd_partition) * 3, GFP_KERNEL);
|
rdc_flash_parts = kzalloc(sizeof(struct mtd_partition) * 3, GFP_KERNEL);
|
||||||
|
|
||||||
rdc_flash_parts[0].name = "firmware";
|
rdc_flash_parts[0].name = "firmware";
|
||||||
rdc_flash_parts[0].offset = 0x0;
|
rdc_flash_parts[0].offset = 0x0;
|
||||||
rdc_flash_parts[0].size = 0x3E0000;
|
rdc_flash_parts[0].size = 0x3E0000;
|
||||||
rdc_flash_parts[1].name = "rootfs";
|
rdc_flash_parts[1].name = "rootfs";
|
||||||
rdc_flash_parts[1].offset = header.kernelsz + sizeof(header);
|
rdc_flash_parts[1].offset = header.kernelsz + sizeof(header);
|
||||||
rdc_flash_parts[1].size = rdc_flash_parts[0].size - rdc_flash_parts[1].offset;
|
rdc_flash_parts[1].size = rdc_flash_parts[0].size - rdc_flash_parts[1].offset;
|
||||||
rdc_flash_parts[2].name = "bootloader";
|
rdc_flash_parts[2].name = "bootloader";
|
||||||
rdc_flash_parts[2].offset = 0x3E0000;
|
rdc_flash_parts[2].offset = 0x3E0000;
|
||||||
rdc_flash_parts[2].size = 0x20000;
|
rdc_flash_parts[2].size = 0x20000;
|
||||||
|
|
||||||
*pparts = rdc_flash_parts;
|
*pparts = rdc_flash_parts;
|
||||||
|
|
||||||
pdata->led_data.num_leds = ARRAY_SIZE(ar525w_leds);
|
pdata->led_data.num_leds = ARRAY_SIZE(ar525w_leds);
|
||||||
pdata->led_data.leds = ar525w_leds;
|
pdata->led_data.leds = ar525w_leds;
|
||||||
pdata->button_data.nbuttons = ARRAY_SIZE(ar525w_btns);
|
pdata->button_data.nbuttons = ARRAY_SIZE(ar525w_btns);
|
||||||
pdata->button_data.buttons = ar525w_btns;
|
pdata->button_data.buttons = ar525w_btns;
|
||||||
|
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mtd_part_parser __initdata ar525w_parser = {
|
static struct mtd_part_parser __initdata ar525w_parser = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.parse_fn = parse_ar525w_partitions,
|
.parse_fn = parse_ar525w_partitions,
|
||||||
.name = "AR525W",
|
.name = "AR525W",
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init ar525w_setup(void)
|
static int __init ar525w_setup(void)
|
||||||
{
|
{
|
||||||
return register_mtd_parser(&ar525w_parser);
|
return register_mtd_parser(&ar525w_parser);
|
||||||
}
|
}
|
||||||
|
|
||||||
arch_initcall(ar525w_setup);
|
arch_initcall(ar525w_setup);
|
||||||
|
@ -1,91 +1,74 @@
|
|||||||
config X86_GRUB_IMAGES
|
config X86_GRUB_IMAGES
|
||||||
bool "Build GRUB images (Linux x86 or x86_64 host only)"
|
bool "Build GRUB images (Linux x86 or x86_64 host only)"
|
||||||
depends TARGET_x86 && !TARGET_x86_olpc
|
depends TARGET_x86 && !TARGET_x86_olpc
|
||||||
depends TARGET_ROOTFS_EXT2FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS || TARGET_ROOTFS_ISO
|
depends TARGET_ROOTFS_EXT2FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||||
select PACKAGE_grub
|
select PACKAGE_grub
|
||||||
default y
|
default y
|
||||||
|
|
||||||
config X86_GRUB_IMAGES_PAD
|
|
||||||
bool "Pad GRUB images to filesystem size (for JFFS2)"
|
|
||||||
depends X86_GRUB_IMAGES
|
|
||||||
|
|
||||||
config X86_GRUB_CONSOLE
|
config X86_GRUB_CONSOLE
|
||||||
bool
|
bool "Use Console Terminal (in addition to Serial)"
|
||||||
depends X86_GRUB_IMAGES
|
depends X86_GRUB_IMAGES
|
||||||
prompt "Use Console Terminal (in addition to Serial)"
|
default n if (TARGET_x86_generic_Soekris45xx || TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501)
|
||||||
default n if TARGET_x86_generic_Soekris48xx || TARGET_x86_generic_Soekris45xx || TARGET_x86_net5501
|
default y
|
||||||
default y if ! (TARGET_x86_generic_Soekris48xx || TARGET_x86_generic_Soekris45xx || TARGET_x86_net5501)
|
|
||||||
|
|
||||||
config X86_GRUB_SERIAL
|
config X86_GRUB_SERIAL
|
||||||
string
|
string "Serial port device"
|
||||||
prompt "Serial port device"
|
depends X86_GRUB_IMAGES
|
||||||
depends X86_GRUB_IMAGES
|
default "hvc0" if TARGET_x86_xen_domu
|
||||||
default "hvc0" if TARGET_x86_xen_domu
|
default "ttyS0"
|
||||||
default "ttyS0" if ! TARGET_x86_xen_domu
|
|
||||||
|
|
||||||
config X86_GRUB_BAUDRATE
|
config X86_GRUB_BAUDRATE
|
||||||
int "Serial port baud rate"
|
int "Serial port baud rate"
|
||||||
depends X86_GRUB_IMAGES
|
depends X86_GRUB_IMAGES
|
||||||
default 19200 if TARGET_x86_generic_Soekris48xx || TARGET_x86_generic_Soekris45xx || TARGET_x86_net5501
|
default 19200 if TARGET_x86_generic_Soekris45xx || TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501
|
||||||
default 38400 if ! (TARGET_x86_generic_Soekris48xx || TARGET_x86_generic_Soekris45xx || TARGET_x86_net5501)
|
default 38400
|
||||||
|
|
||||||
config X86_GRUB_KERNELPART
|
|
||||||
int "Kernel partition size (in MB)"
|
|
||||||
depends X86_GRUB_IMAGES
|
|
||||||
default 4
|
|
||||||
|
|
||||||
config X86_GRUB_ROOTPART
|
|
||||||
string
|
|
||||||
prompt "Root partition on target device" if X86_GRUB_IMAGES
|
|
||||||
default "/dev/xvda2" if TARGET_x86_xen_domu
|
|
||||||
default "/dev/sda2" if ! TARGET_x86_xen_domu
|
|
||||||
help
|
|
||||||
The root partition on the final device. If you don't know,
|
|
||||||
you probably want the default (/dev/sda2).
|
|
||||||
|
|
||||||
config X86_GRUB_BOOTOPTS
|
config X86_GRUB_BOOTOPTS
|
||||||
string
|
string "Extra kernel boot options"
|
||||||
prompt "Extra kernel boot options" if X86_GRUB_IMAGES
|
depends X86_GRUB_IMAGES
|
||||||
default "xencons=hvc" if TARGET_x86_xen_domu
|
default "xencons=hvc" if TARGET_x86_xen_domu
|
||||||
default "" if ! TARGET_x86_xen_domu
|
help
|
||||||
help
|
If you don't know, just leave it blank.
|
||||||
If you don't know, just leave it blank.
|
|
||||||
|
|
||||||
|
|
||||||
config X86_VDI_IMAGES
|
config X86_VDI_IMAGES
|
||||||
bool "Build VirtualBox image files (VDI). Requires VBoxManage"
|
bool "Build VirtualBox image files (VDI)"
|
||||||
depends TARGET_x86_generic
|
depends X86_GRUB_IMAGES
|
||||||
depends TARGET_ROOTFS_EXT2FS
|
depends TARGET_x86_generic
|
||||||
depends X86_GRUB_IMAGES
|
depends TARGET_ROOTFS_EXT2FS
|
||||||
select PACKAGE_kmod-pcnet32
|
select PACKAGE_kmod-pcnet32
|
||||||
|
help
|
||||||
|
Requires VBoxManage installed on the build system.
|
||||||
|
|
||||||
config X86_VMDK_IMAGES
|
config X86_VMDK_IMAGES
|
||||||
bool "Build VMware image files (VMDK). Requires qemu-img"
|
bool "Build VMware image files (VMDK)"
|
||||||
depends TARGET_x86_generic
|
depends X86_GRUB_IMAGES
|
||||||
depends TARGET_ROOTFS_EXT2FS
|
depends TARGET_x86_generic
|
||||||
depends X86_GRUB_IMAGES
|
depends TARGET_ROOTFS_EXT2FS
|
||||||
select PACKAGE_kmod-e1000
|
select PACKAGE_kmod-e1000
|
||||||
|
help
|
||||||
|
Requires qemu-img installed on the build system.
|
||||||
|
|
||||||
|
|
||||||
config OLPC_BOOTSCRIPT_IMAGES
|
config OLPC_BOOTSCRIPT_IMAGES
|
||||||
bool "Build images with bootscript"
|
bool "Build images with bootscript"
|
||||||
depends TARGET_x86_olpc
|
depends TARGET_x86_olpc
|
||||||
depends TARGET_ROOTFS_EXT2FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS || TARGET_ROOTFS_ISO
|
depends TARGET_ROOTFS_EXT2FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
|
||||||
default y
|
|
||||||
|
|
||||||
config OLPC_BOOTSCRIPT_IMAGES_PAD
|
|
||||||
bool "Pad bootscript images to filesystem size (for JFFS2)"
|
|
||||||
depends OLPC_BOOTSCRIPT_IMAGES
|
|
||||||
|
|
||||||
config OLPC_BOOTSCRIPT_KERNELPART
|
config TARGET_IMAGES_PAD
|
||||||
int "Kernel partition size (in MB)"
|
bool "Pad images to filesystem size (for JFFS2)"
|
||||||
depends OLPC_BOOTSCRIPT_IMAGES
|
depends OLPC_BOOTSCRIPT_IMAGES || X86_GRUB_IMAGES
|
||||||
default 4
|
|
||||||
|
|
||||||
config OLPC_BOOTSCRIPT_ROOTPART
|
config TARGET_KERNEL_PARTSIZE
|
||||||
string
|
int "Kernel partition size (in MB)"
|
||||||
prompt "Root partition on target device" if OLPC_BOOTSCRIPT_IMAGES
|
depends OLPC_BOOTSCRIPT_IMAGES || X86_GRUB_IMAGES
|
||||||
default "/dev/sda2"
|
default 4
|
||||||
help
|
|
||||||
The root partition on the final device. If you don't know,
|
|
||||||
you probably want the default (/dev/sda2).
|
|
||||||
|
|
||||||
|
config TARGET_ROOTFS_PARTNAME
|
||||||
|
string "Root partition on target device"
|
||||||
|
depends OLPC_BOOTSCRIPT_IMAGES || X86_GRUB_IMAGES
|
||||||
|
default "/dev/xvda2" if TARGET_x86_xen_domu
|
||||||
|
default "/dev/sda2"
|
||||||
|
help
|
||||||
|
The root partition on the final device. If you don't know,
|
||||||
|
you probably want the default (/dev/sda2).
|
||||||
|
@ -29,12 +29,12 @@ ifneq ($(GRUB_TERMINALS),)
|
|||||||
GRUB_TERMINAL_CONFIG := terminal --timeout=2 $(GRUB_TERMINALS)
|
GRUB_TERMINAL_CONFIG := terminal --timeout=2 $(GRUB_TERMINALS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME))
|
||||||
|
|
||||||
ifneq ($(CONFIG_X86_GRUB_IMAGES),)
|
ifneq ($(CONFIG_X86_GRUB_IMAGES),)
|
||||||
ifneq ($(HOST_OS),Darwin)
|
ifneq ($(HOST_OS),Darwin)
|
||||||
|
|
||||||
BOOTOPTS:=$(call qstrip,$(CONFIG_X86_GRUB_BOOTOPTS))
|
BOOTOPTS:=$(call qstrip,$(CONFIG_X86_GRUB_BOOTOPTS))
|
||||||
ROOTPART:=$(call qstrip,$(CONFIG_X86_GRUB_ROOTPART))
|
|
||||||
|
|
||||||
define Image/cmdline/ext2
|
define Image/cmdline/ext2
|
||||||
root=$(ROOTPART) rootfstype=ext2 rootwait
|
root=$(ROOTPART) rootfstype=ext2 rootwait
|
||||||
@ -66,10 +66,10 @@ ifneq ($(CONFIG_X86_GRUB_IMAGES),)
|
|||||||
-e 's#@TERMINAL_CONFIG@#$(strip $(GRUB_TERMINAL_CONFIG))#g' \
|
-e 's#@TERMINAL_CONFIG@#$(strip $(GRUB_TERMINAL_CONFIG))#g' \
|
||||||
-e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1)) $(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE))#g' \
|
-e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1)) $(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE))#g' \
|
||||||
./menu.lst > $(KDIR)/root.grub/boot/grub/menu.lst
|
./menu.lst > $(KDIR)/root.grub/boot/grub/menu.lst
|
||||||
PADDING="$(CONFIG_X86_GRUB_IMAGES_PAD)" PATH="$(TARGET_PATH)" ./gen_image_x86.sh \
|
PADDING="$(CONFIG_TARGET_IMAGES_PAD)" PATH="$(TARGET_PATH)" ./gen_image_x86.sh \
|
||||||
$(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \
|
$(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \
|
||||||
$(CONFIG_X86_GRUB_KERNELPART) $(KDIR)/root.grub \
|
$(CONFIG_TARGET_KERNEL_PARTSIZE) $(KDIR)/root.grub \
|
||||||
$(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1)
|
$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(KDIR)/root.$(1)
|
||||||
$(call Image/Build/grub/$(1))
|
$(call Image/Build/grub/$(1))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -88,8 +88,8 @@ ifneq ($(CONFIG_X86_GRUB_IMAGES),)
|
|||||||
define Image/Build/grub
|
define Image/Build/grub
|
||||||
PADDING="$(CONFIG_X86_GRUB_IMAGES_PAD)" PATH="$(TARGET_PATH)" NOGRUB=1 ./gen_image_x86.sh \
|
PADDING="$(CONFIG_X86_GRUB_IMAGES_PAD)" PATH="$(TARGET_PATH)" NOGRUB=1 ./gen_image_x86.sh \
|
||||||
$(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \
|
$(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \
|
||||||
$(CONFIG_X86_GRUB_KERNELPART) "" \
|
$(CONFIG_TARGET_KERNEL_PARTSIZE) "" \
|
||||||
$(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1)
|
$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(KDIR)/root.$(1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
endif
|
endif
|
||||||
@ -99,8 +99,6 @@ ROOTDELAY=10
|
|||||||
|
|
||||||
ifneq ($(CONFIG_OLPC_BOOTSCRIPT_IMAGES),)
|
ifneq ($(CONFIG_OLPC_BOOTSCRIPT_IMAGES),)
|
||||||
|
|
||||||
ROOTPART:=$(call qstrip,$(CONFIG_OLPC_BOOTSCRIPT_ROOTPART))
|
|
||||||
|
|
||||||
define Image/cmdline/ext2
|
define Image/cmdline/ext2
|
||||||
root=$(ROOTPART) rootfstype=ext2 rootwait
|
root=$(ROOTPART) rootfstype=ext2 rootwait
|
||||||
endef
|
endef
|
||||||
@ -123,10 +121,10 @@ ifneq ($(CONFIG_OLPC_BOOTSCRIPT_IMAGES),)
|
|||||||
$(CP) $(KDIR)/bzImage $(KDIR)/root.bootscript/boot/vmlinuz
|
$(CP) $(KDIR)/bzImage $(KDIR)/root.bootscript/boot/vmlinuz
|
||||||
sed -e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1))) $(BOOTOPTS)#g' \
|
sed -e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1))) $(BOOTOPTS)#g' \
|
||||||
./olpc.fth > $(KDIR)/root.bootscript/boot/olpc.fth
|
./olpc.fth > $(KDIR)/root.bootscript/boot/olpc.fth
|
||||||
PADDING="$(CONFIG_OLPC_BOOTSCRIPT_IMAGES_PAD)" PATH="$(TARGET_PATH)" ./gen_image_olpc.sh \
|
PADDING="$(CONFIG_TARGET_IMAGES_PAD)" PATH="$(TARGET_PATH)" ./gen_image_olpc.sh \
|
||||||
$(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \
|
$(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \
|
||||||
$(CONFIG_OLPC_BOOTSCRIPT_KERNELPART) $(KDIR)/root.bootscript \
|
$(CONFIG_TARGET_KERNEL_PARTSIZE) $(KDIR)/root.bootscript \
|
||||||
$(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1)
|
$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(KDIR)/root.$(1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
#
|
#
|
||||||
# linux/arch/mips/boot/compressed/Makefile
|
# linux/arch/mips/boot/compressed/Makefile
|
||||||
#
|
#
|
||||||
# create a compressed zImage from the original vmlinux
|
# create a compressed zImage from the original vmlinux
|
||||||
#
|
#
|
||||||
|
|
||||||
targets := zImage vmlinuz vmlinux.bin.gz head.o misc.o piggy.o dummy.o
|
targets := zImage vmlinuz vmlinux.bin.gz head.o misc.o piggy.o dummy.o
|
||||||
|
|
||||||
OBJS := $(obj)/head.o $(obj)/misc.o
|
OBJS := $(obj)/head.o $(obj)/misc.o
|
||||||
|
|
||||||
LD_ARGS := -T $(obj)/ld.script -Ttext 0x80600000 -Bstatic
|
LD_ARGS := -T $(obj)/ld.script -Ttext 0x80600000 -Bstatic
|
||||||
OBJCOPY_ARGS := -O elf32-tradlittlemips
|
OBJCOPY_ARGS := -O elf32-tradlittlemips
|
||||||
|
|
||||||
ENTRY := $(obj)/../tools/entry
|
ENTRY := $(obj)/../tools/entry
|
||||||
FILESIZE := $(obj)/../tools/filesize
|
FILESIZE := $(obj)/../tools/filesize
|
||||||
|
|
||||||
drop-sections = .reginfo .mdebug .comment .note .pdr .options .MIPS.options
|
drop-sections = .reginfo .mdebug .comment .note .pdr .options .MIPS.options
|
||||||
strip-flags = $(addprefix --remove-section=,$(drop-sections))
|
strip-flags = $(addprefix --remove-section=,$(drop-sections))
|
||||||
|
|
||||||
|
|
||||||
$(obj)/vmlinux.bin.gz: vmlinux
|
$(obj)/vmlinux.bin.gz: vmlinux
|
||||||
rm -f $(obj)/vmlinux.bin.gz
|
rm -f $(obj)/vmlinux.bin.gz
|
||||||
$(OBJCOPY) -O binary $(strip-flags) vmlinux $(obj)/vmlinux.bin
|
$(OBJCOPY) -O binary $(strip-flags) vmlinux $(obj)/vmlinux.bin
|
||||||
gzip -v9f $(obj)/vmlinux.bin
|
gzip -v9f $(obj)/vmlinux.bin
|
||||||
|
|
||||||
$(obj)/head.o: $(obj)/head.S $(obj)/vmlinux.bin.gz vmlinux
|
$(obj)/head.o: $(obj)/head.S $(obj)/vmlinux.bin.gz vmlinux
|
||||||
$(CC) $(KBUILD_AFLAGS) \
|
$(CC) $(KBUILD_AFLAGS) \
|
||||||
-DIMAGESIZE=$(shell sh $(FILESIZE) $(obj)/vmlinux.bin.gz) \
|
-DIMAGESIZE=$(shell sh $(FILESIZE) $(obj)/vmlinux.bin.gz) \
|
||||||
-DKERNEL_ENTRY=$(shell sh $(ENTRY) $(NM) vmlinux ) \
|
-DKERNEL_ENTRY=$(shell sh $(ENTRY) $(NM) vmlinux ) \
|
||||||
-DLOADADDR=$(loadaddr) \
|
-DLOADADDR=$(loadaddr) \
|
||||||
-c -o $(obj)/head.o $<
|
-c -o $(obj)/head.o $<
|
||||||
|
|
||||||
$(obj)/vmlinuz: $(OBJS) $(obj)/ld.script $(obj)/vmlinux.bin.gz $(obj)/dummy.o
|
$(obj)/vmlinuz: $(OBJS) $(obj)/ld.script $(obj)/vmlinux.bin.gz $(obj)/dummy.o
|
||||||
$(OBJCOPY) \
|
$(OBJCOPY) \
|
||||||
--add-section=.image=$(obj)/vmlinux.bin.gz \
|
--add-section=.image=$(obj)/vmlinux.bin.gz \
|
||||||
--set-section-flags=.image=contents,alloc,load,readonly,data \
|
--set-section-flags=.image=contents,alloc,load,readonly,data \
|
||||||
$(obj)/dummy.o $(obj)/piggy.o
|
$(obj)/dummy.o $(obj)/piggy.o
|
||||||
$(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/piggy.o
|
$(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/piggy.o
|
||||||
$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr -R .initrd -R .sysmap
|
$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr -R .initrd -R .sysmap
|
||||||
|
|
||||||
zImage: $(obj)/vmlinuz
|
zImage: $(obj)/vmlinuz
|
||||||
$(OBJCOPY) -O binary $(obj)/vmlinuz $(obj)/zImage
|
$(OBJCOPY) -O binary $(obj)/vmlinuz $(obj)/zImage
|
||||||
|
@ -1,204 +1,204 @@
|
|||||||
/*
|
/*
|
||||||
* calculate ecc code for nand flash
|
* calculate ecc code for nand flash
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 yajin <yajin@vm-kernel.org>
|
* Copyright (C) 2008 yajin <yajin@vm-kernel.org>
|
||||||
* Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
|
* Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
* published by the Free Software Foundation; either version 2 or
|
* published by the Free Software Foundation; either version 2 or
|
||||||
* (at your option) version 3 of the License.
|
* (at your option) version 3 of the License.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||||
* MA 02111-1307 USA
|
* MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define DEF_NAND_PAGE_SIZE 2048
|
#define DEF_NAND_PAGE_SIZE 2048
|
||||||
#define DEF_NAND_OOB_SIZE 64
|
#define DEF_NAND_OOB_SIZE 64
|
||||||
#define DEF_NAND_ECC_OFFSET 0x28
|
#define DEF_NAND_ECC_OFFSET 0x28
|
||||||
|
|
||||||
static int page_size = DEF_NAND_PAGE_SIZE;
|
static int page_size = DEF_NAND_PAGE_SIZE;
|
||||||
static int oob_size = DEF_NAND_OOB_SIZE;
|
static int oob_size = DEF_NAND_OOB_SIZE;
|
||||||
static int ecc_offset = DEF_NAND_ECC_OFFSET;
|
static int ecc_offset = DEF_NAND_ECC_OFFSET;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pre-calculated 256-way 1 byte column parity
|
* Pre-calculated 256-way 1 byte column parity
|
||||||
*/
|
*/
|
||||||
static const uint8_t nand_ecc_precalc_table[] = {
|
static const uint8_t nand_ecc_precalc_table[] = {
|
||||||
0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00,
|
0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00,
|
||||||
0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65,
|
0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65,
|
||||||
0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66,
|
0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66,
|
||||||
0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03,
|
0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03,
|
||||||
0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69,
|
0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69,
|
||||||
0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c,
|
0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c,
|
||||||
0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f,
|
0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f,
|
||||||
0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a,
|
0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a,
|
||||||
0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a,
|
0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30, 0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a,
|
||||||
0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f,
|
0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55, 0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f,
|
||||||
0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c,
|
0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56, 0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c,
|
||||||
0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69,
|
0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33, 0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69,
|
||||||
0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03,
|
0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59, 0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03,
|
||||||
0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66,
|
0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c, 0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66,
|
||||||
0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65,
|
0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f, 0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65,
|
||||||
0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00
|
0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a, 0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nand_calculate_ecc - [NAND Interface] Calculate 3-byte ECC for 256-byte block
|
* nand_calculate_ecc - [NAND Interface] Calculate 3-byte ECC for 256-byte block
|
||||||
* @dat: raw data
|
* @dat: raw data
|
||||||
* @ecc_code: buffer for ECC
|
* @ecc_code: buffer for ECC
|
||||||
*/
|
*/
|
||||||
int nand_calculate_ecc(const uint8_t *dat,
|
int nand_calculate_ecc(const uint8_t *dat,
|
||||||
uint8_t *ecc_code)
|
uint8_t *ecc_code)
|
||||||
{
|
{
|
||||||
uint8_t idx, reg1, reg2, reg3, tmp1, tmp2;
|
uint8_t idx, reg1, reg2, reg3, tmp1, tmp2;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Initialize variables */
|
/* Initialize variables */
|
||||||
reg1 = reg2 = reg3 = 0;
|
reg1 = reg2 = reg3 = 0;
|
||||||
|
|
||||||
/* Build up column parity */
|
/* Build up column parity */
|
||||||
for(i = 0; i < 256; i++) {
|
for(i = 0; i < 256; i++) {
|
||||||
/* Get CP0 - CP5 from table */
|
/* Get CP0 - CP5 from table */
|
||||||
idx = nand_ecc_precalc_table[*dat++];
|
idx = nand_ecc_precalc_table[*dat++];
|
||||||
reg1 ^= (idx & 0x3f);
|
reg1 ^= (idx & 0x3f);
|
||||||
|
|
||||||
/* All bit XOR = 1 ? */
|
/* All bit XOR = 1 ? */
|
||||||
if (idx & 0x40) {
|
if (idx & 0x40) {
|
||||||
reg3 ^= (uint8_t) i;
|
reg3 ^= (uint8_t) i;
|
||||||
reg2 ^= ~((uint8_t) i);
|
reg2 ^= ~((uint8_t) i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create non-inverted ECC code from line parity */
|
/* Create non-inverted ECC code from line parity */
|
||||||
tmp1 = (reg3 & 0x80) >> 0; /* B7 -> B7 */
|
tmp1 = (reg3 & 0x80) >> 0; /* B7 -> B7 */
|
||||||
tmp1 |= (reg2 & 0x80) >> 1; /* B7 -> B6 */
|
tmp1 |= (reg2 & 0x80) >> 1; /* B7 -> B6 */
|
||||||
tmp1 |= (reg3 & 0x40) >> 1; /* B6 -> B5 */
|
tmp1 |= (reg3 & 0x40) >> 1; /* B6 -> B5 */
|
||||||
tmp1 |= (reg2 & 0x40) >> 2; /* B6 -> B4 */
|
tmp1 |= (reg2 & 0x40) >> 2; /* B6 -> B4 */
|
||||||
tmp1 |= (reg3 & 0x20) >> 2; /* B5 -> B3 */
|
tmp1 |= (reg3 & 0x20) >> 2; /* B5 -> B3 */
|
||||||
tmp1 |= (reg2 & 0x20) >> 3; /* B5 -> B2 */
|
tmp1 |= (reg2 & 0x20) >> 3; /* B5 -> B2 */
|
||||||
tmp1 |= (reg3 & 0x10) >> 3; /* B4 -> B1 */
|
tmp1 |= (reg3 & 0x10) >> 3; /* B4 -> B1 */
|
||||||
tmp1 |= (reg2 & 0x10) >> 4; /* B4 -> B0 */
|
tmp1 |= (reg2 & 0x10) >> 4; /* B4 -> B0 */
|
||||||
|
|
||||||
tmp2 = (reg3 & 0x08) << 4; /* B3 -> B7 */
|
tmp2 = (reg3 & 0x08) << 4; /* B3 -> B7 */
|
||||||
tmp2 |= (reg2 & 0x08) << 3; /* B3 -> B6 */
|
tmp2 |= (reg2 & 0x08) << 3; /* B3 -> B6 */
|
||||||
tmp2 |= (reg3 & 0x04) << 3; /* B2 -> B5 */
|
tmp2 |= (reg3 & 0x04) << 3; /* B2 -> B5 */
|
||||||
tmp2 |= (reg2 & 0x04) << 2; /* B2 -> B4 */
|
tmp2 |= (reg2 & 0x04) << 2; /* B2 -> B4 */
|
||||||
tmp2 |= (reg3 & 0x02) << 2; /* B1 -> B3 */
|
tmp2 |= (reg3 & 0x02) << 2; /* B1 -> B3 */
|
||||||
tmp2 |= (reg2 & 0x02) << 1; /* B1 -> B2 */
|
tmp2 |= (reg2 & 0x02) << 1; /* B1 -> B2 */
|
||||||
tmp2 |= (reg3 & 0x01) << 1; /* B0 -> B1 */
|
tmp2 |= (reg3 & 0x01) << 1; /* B0 -> B1 */
|
||||||
tmp2 |= (reg2 & 0x01) << 0; /* B7 -> B0 */
|
tmp2 |= (reg2 & 0x01) << 0; /* B7 -> B0 */
|
||||||
|
|
||||||
/* Calculate final ECC code */
|
/* Calculate final ECC code */
|
||||||
#ifdef CONFIG_MTD_NAND_ECC_SMC
|
#ifdef CONFIG_MTD_NAND_ECC_SMC
|
||||||
ecc_code[0] = ~tmp2;
|
ecc_code[0] = ~tmp2;
|
||||||
ecc_code[1] = ~tmp1;
|
ecc_code[1] = ~tmp1;
|
||||||
#else
|
#else
|
||||||
ecc_code[0] = ~tmp1;
|
ecc_code[0] = ~tmp1;
|
||||||
ecc_code[1] = ~tmp2;
|
ecc_code[1] = ~tmp2;
|
||||||
#endif
|
#endif
|
||||||
ecc_code[2] = ((~reg1) << 2) | 0x03;
|
ecc_code[2] = ((~reg1) << 2) | 0x03;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* usage: bb-nandflash-ecc start_address size
|
* usage: bb-nandflash-ecc start_address size
|
||||||
*/
|
*/
|
||||||
void usage(const char *prog)
|
void usage(const char *prog)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Usage: %s [options] <input> <output>\n"
|
fprintf(stderr, "Usage: %s [options] <input> <output>\n"
|
||||||
"Options:\n"
|
"Options:\n"
|
||||||
" -p <pagesize> NAND page size (default: %d)\n"
|
" -p <pagesize> NAND page size (default: %d)\n"
|
||||||
" -o <oobsize> NAND OOB size (default: %d)\n"
|
" -o <oobsize> NAND OOB size (default: %d)\n"
|
||||||
" -e <offset> NAND ECC offset (default: %d)\n"
|
" -e <offset> NAND ECC offset (default: %d)\n"
|
||||||
"\n", prog, DEF_NAND_PAGE_SIZE, DEF_NAND_OOB_SIZE,
|
"\n", prog, DEF_NAND_PAGE_SIZE, DEF_NAND_OOB_SIZE,
|
||||||
DEF_NAND_ECC_OFFSET);
|
DEF_NAND_ECC_OFFSET);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*start_address/size does not include oob
|
/*start_address/size does not include oob
|
||||||
*/
|
*/
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
uint8_t *page_data = NULL;
|
uint8_t *page_data = NULL;
|
||||||
uint8_t *ecc_data;
|
uint8_t *ecc_data;
|
||||||
int infd = -1, outfd = -1;
|
int infd = -1, outfd = -1;
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
ssize_t bytes;
|
ssize_t bytes;
|
||||||
int ch;
|
int ch;
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "e:o:p:")) != -1) {
|
while ((ch = getopt(argc, argv, "e:o:p:")) != -1) {
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
case 'p':
|
case 'p':
|
||||||
page_size = strtoul(optarg, NULL, 0);
|
page_size = strtoul(optarg, NULL, 0);
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
oob_size = strtoul(optarg, NULL, 0);
|
oob_size = strtoul(optarg, NULL, 0);
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
ecc_offset = strtoul(optarg, NULL, 0);
|
ecc_offset = strtoul(optarg, NULL, 0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
argc -= optind;
|
argc -= optind;
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
|
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
infd = open(argv[0], O_RDONLY, 0);
|
infd = open(argv[0], O_RDONLY, 0);
|
||||||
if (infd < 0) {
|
if (infd < 0) {
|
||||||
perror("open input file");
|
perror("open input file");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
outfd = open(argv[1], O_WRONLY|O_CREAT|O_TRUNC, 0644);
|
outfd = open(argv[1], O_WRONLY|O_CREAT|O_TRUNC, 0644);
|
||||||
if (outfd < 0) {
|
if (outfd < 0) {
|
||||||
perror("open output file");
|
perror("open output file");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
page_data = malloc(page_size + oob_size);
|
page_data = malloc(page_size + oob_size);
|
||||||
|
|
||||||
while ((bytes = read(infd, page_data, page_size)) == page_size) {
|
while ((bytes = read(infd, page_data, page_size)) == page_size) {
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
ecc_data = page_data + page_size + ecc_offset;
|
ecc_data = page_data + page_size + ecc_offset;
|
||||||
for (j = 0; j < page_size / 256; j++)
|
for (j = 0; j < page_size / 256; j++)
|
||||||
{
|
{
|
||||||
nand_calculate_ecc(page_data + j * 256, ecc_data);
|
nand_calculate_ecc(page_data + j * 256, ecc_data);
|
||||||
ecc_data += 3;
|
ecc_data += 3;
|
||||||
}
|
}
|
||||||
write(outfd, page_data, page_size + oob_size);
|
write(outfd, page_data, page_size + oob_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
out:
|
out:
|
||||||
if (infd >= 0)
|
if (infd >= 0)
|
||||||
close(infd);
|
close(infd);
|
||||||
if (outfd >= 0)
|
if (outfd >= 0)
|
||||||
close(outfd);
|
close(outfd);
|
||||||
if (page_data)
|
if (page_data)
|
||||||
free(page_data);
|
free(page_data);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user