1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-01-23 06:51:06 +02:00

Merge commit 'nbd/master' into xburst

This commit is contained in:
Lars-Peter Clausen 2010-03-22 20:08:09 +01:00
commit 8dbc93e92d
50 changed files with 180 additions and 158 deletions

View File

@ -62,14 +62,13 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
$(call Image/Build,jffs2-$(1))
endef
define Image/mkfs/jffs2
rm -rf $(TARGET_DIR)/jffs
$(foreach SZ,$(JFFS2_BLOCKSIZE),$(call Image/mkfs/jffs2/sub,$(SZ)))
endef
endif
ifeq ($(CONFIG_TARGET_ROOTFS_SQUASHFS),y)
define Image/mkfs/squashfs
@mkdir -p $(TARGET_DIR)/jffs
@mkdir -p $(TARGET_DIR)/overlay
$(MKSQUASHFS_CMD) $(TARGET_DIR) $(KDIR)/root.squashfs -nopad -noappend -root-owned $(SQUASHFS_OPTS)
$(call Image/Build,squashfs)
endef

View File

@ -12,7 +12,7 @@ __target_inc=1
DEVICE_TYPE?=router
# Default packages - the really basic set
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg ucitrigger
DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg
# For router targets
DEFAULT_PACKAGES.router:=dnsmasq iptables ppp ppp-mod-pppoe kmod-ipt-nathelper firewall
DEFAULT_PACKAGES.bootloader:=

View File

@ -369,7 +369,7 @@ define Package/base-files/install
mkdir -p $(1)/dev
mkdir -p $(1)/etc/crontabs
mkdir -p $(1)/etc/rc.d
mkdir -p $(1)/jffs
mkdir -p $(1)/overlay
mkdir -p $(1)/lib/firmware
$(if $(LIB_SUFFIX),-ln -s lib $(1)/lib$(LIB_SUFFIX))
mkdir -p $(1)/mnt

View File

@ -5,11 +5,11 @@
no_fo_mount_jffs() {
# initialize jffs2
mount "$mtdpart" /jffs -t jffs2 || exit
mount "$mtdpart" /overlay -t jffs2 || exit
# workaround to ensure that union can attach properly
sync
ls /jffs >/dev/null
ls /overlay >/dev/null
}
boot_hook_add no_fo no_fo_mount_jffs

View File

@ -4,7 +4,7 @@
# Copyright (C) 2010 Vertical Communications
skip_if_rootfs_mounted() {
mount "$mtdpart" /rom/jffs -t jffs2 || exit
mount "$mtdpart" /rom/overlay -t jffs2 || exit
}
boot_hook_add switch2jffs skip_if_rootfs_mounted

View File

@ -5,7 +5,7 @@
no_fo_pivot() {
# switch to the new (empty) jffs2
fopivot /jffs /rom 1
fopivot /overlay /rom 1
}
boot_hook_add no_fo no_fo_pivot

View File

@ -8,7 +8,7 @@ copy_ramoverlay() {
mount -o remount,ro none / 2>&-
# copy ramoverlay to jffs2
echo -n "copying files ... "
cp -a /tmp/root/* /rom/jffs 2>&-
cp -a /tmp/root/* /rom/overlay 2>&-
echo "done"
}

View File

@ -9,9 +9,9 @@ with_fo_pivot() {
pivot /rom /mnt
mount -o move /mnt /tmp/root
# /jffs is the overlay
# /overlay is the overlay
# /rom is the readonly
fopivot /jffs /rom
fopivot /overlay /rom
}
boot_hook_add switch2jffs with_fo_pivot

View File

@ -5,7 +5,7 @@
no_fo_cleanup() {
echo "done"
umount -l /jffs
umount -l /overlay
umount -l /tmp/root
exit 0
}

View File

@ -42,7 +42,7 @@ dupe() { # <new_root> <old_root>
{
cd $2
find . -xdev -type d
echo "./dev ./jffs ./mnt ./proc ./tmp"
echo "./dev ./overlay ./mnt ./proc ./tmp"
# xdev skips mounted directories
cd $1
} | xargs mkdir -p
@ -69,7 +69,6 @@ pivot() { # <new_root> <old_root>
mount -o move $2/dev /dev
mount -o move $2/tmp /tmp
mount -o move $2/sys /sys 2>&-
mount -o move $2/jffs /jffs 2>&-
mount -o move $2/overlay /overlay 2>&-
return 0
}

View File

@ -3,7 +3,8 @@
# Copyright (C) 2010 Vertical Communications
find_mount_jffs2() {
mount "$(find_mtd_part rootfs_data)" /jffs -t jffs2
mkdir -p /tmp/overlay
mount "$(find_mtd_part rootfs_data)" /tmp/overlay -t jffs2
}
jffs2_not_mounted() {

View File

@ -5,7 +5,8 @@
rootfs_pivot() {
check_skip || jffs2_not_mounted || {
echo "switching to jffs2"
fopivot /jffs /rom && pi_mount_skip_next=true
mount -o move /tmp/overlay /overlay 2>&-
fopivot /overlay /rom && pi_mount_skip_next=true
}
}

View File

@ -35,7 +35,7 @@ install_bin() { # <file> [ <symlink> ... ]
pivot() { # <new_root> <old_root>
mount | grep "on $1 type" 2>&- 1>&- || mount -o bind $1 $1
mkdir -p $1$2 $1/proc $1/dev $1/tmp $1/jffs && \
mkdir -p $1$2 $1/proc $1/dev $1/tmp $1/overlay && \
mount -o move /proc $1/proc && \
pivot_root $1 $1$2 || {
umount $1 $1
@ -43,7 +43,7 @@ pivot() { # <new_root> <old_root>
}
mount -o move $2/dev /dev
mount -o move $2/tmp /tmp
mount -o move $2/jffs /jffs 2>&-
mount -o move $2/overlay /overlay 2>&-
return 0
}
@ -63,9 +63,9 @@ run_ramfs() { # <command> [...]
mount -o remount,ro /mnt
umount -l /mnt
grep /jffs /proc/mounts > /dev/null && {
mount -o remount,ro /jffs
umount -l /jffs
grep /overlay /proc/mounts > /dev/null && {
mount -o remount,ro /overlay
umount -l /overlay
}
# spawn a new shell from ramdisk to reduce the probability of cache issues

View File

@ -27,8 +27,8 @@ if [ "${0##*/}" = "firstboot" ]; then
boot_run_hook jffs2reset
else
mtd erase "$partname"
mount "$mtdpart" /jffs -t jffs2
fopivot /jffs /rom 1
mount "$mtdpart" /overlay -t jffs2
fopivot /overlay /rom 1
fi
fi

View File

@ -16,8 +16,8 @@ determine_external_root() {
# extroot requires extroot and fstab config files, therefore
# we assume configuration is incomplete and not to be used if either of them
# is missing (for jffs versions of these files on squashfs image)
if [ "$jffs" = "/jffs" ] && [ -r "/jffs/etc/config/fstab" ]; then
UCI_CONFIG_DIR="/jffs/etc/config"
if [ "$jffs" = "/tmp/overlay" ] && [ -r "/tmp/overlay/etc/config/fstab" ]; then
UCI_CONFIG_DIR="/tmp/overlay/etc/config"
ER_IS_SQUASHFS=true
fi

View File

@ -10,7 +10,7 @@ external_root_pivot() {
check_skip || [ "$pi_extroot_mount_success" != "true" ] || {
echo "switching to external rootfs"
if [ "$ER_IS_SQUASHFS" = "true" ]; then
umount /jffs
umount /tmp/overlay
fi
mount -o remount,ro / && fopivot /overlay /rom && pi_mount_skip_next=true
}

View File

@ -6,7 +6,7 @@ start () {
loglevel=$(/sbin/uci get "system.@system[0].cronloglevel" 2>/dev/null)
[ -z "$(ls /etc/crontabs/)" ] && exit 1
mkdir -p /var/spool/cron
[ -L /var/spool/cron/crontabs ] || ln -s /etc/crontabs /var/spool/cron/crontabs
ln -s /etc/crontabs /var/spool/cron/ 2>/dev/null
crond -c /etc/crontabs -l ${loglevel:-5}
}

View File

@ -79,7 +79,7 @@ endef
define KernelPackage/hostap-cs
$(call KernelPackage/hostap/Default)
TITLE:=Host AP driver for PCMCIA adaptors
DEPENDS:=@PCMCIA_SUPPORT kmod-hostap +kmod-pcmcia-core
DEPENDS:=@PCMCIA_SUPPORT +kmod-hostap +kmod-pcmcia-core
KCONFIG:=CONFIG_HOSTAP_CS
AUTOLOAD:=$(call AutoLoad,60,hostap_cs)
endef
@ -103,7 +103,7 @@ endef
define KernelPackage/hostap-pci
$(call KernelPackage/hostap/Default)
TITLE:=Host AP driver for PCI adaptors
DEPENDS:= kmod-hostap
DEPENDS:=@PCI_SUPPORT +kmod-hostap
KCONFIG:=CONFIG_HOSTAP_PCI
AUTOLOAD:=$(call AutoLoad,60,hostap_pci)
endef
@ -129,7 +129,7 @@ endef
define KernelPackage/hostap-plx
$(call KernelPackage/hostap/Default)
TITLE:=Host AP driver for PLX9052 based PCI adaptors
DEPENDS:=@PCI_SUPPORT kmod-hostap
DEPENDS:=@PCI_SUPPORT +kmod-hostap
KCONFIG:=CONFIG_HOSTAP_PLX
AUTOLOAD:=$(call AutoLoad,60,hostap_plx)
endef

View File

@ -119,7 +119,7 @@ hostapd_setup_vif() {
config_get channel "$device" channel
config_get hwmode "$device" hwmode
case "$hwmode" in
bg) hwmode=g;;
*bg) hwmode=g;;
esac
[ "$channel" = auto ] && channel=
[ -n "$channel" -a -z "$hwmode" ] && wifi_fixup_hwmode "$device"
@ -127,7 +127,7 @@ hostapd_setup_vif() {
ctrl_interface=/var/run/hostapd-$ifname
driver=$driver
interface=$ifname
${hwmode:+hw_mode=$hwmode}
${hwmode:+hw_mode=${hwmode#11}}
${channel:+channel=$channel}
$hostapd_cfg
EOF

View File

@ -21,12 +21,18 @@ endef
define KernelPackage/ipt-core/description
Netfilter core kernel modules
Includes:
- limit
- LOG
- mac
- multiport
- TCPMSS
- REJECT
- ipt_limit
- xt_limit
- ipt_mac
- xt_mac
- ipt_multiport
- xt_multiport
- ipt_comment
- xt_comment
- ipt_LOG
- ipt_TCPMSS
- xt_TCPMSS
- ipt_REJECT
endef
$(eval $(call KernelPackage,ipt-core))
@ -94,6 +100,8 @@ define KernelPackage/ipt-filter/description
Includes:
- ipt_layer7
- ipt_string
- xt_layer7
- xt_string
endef
$(eval $(call KernelPackage,ipt-filter))
@ -110,14 +118,30 @@ endef
define KernelPackage/ipt-ipopt/description
Netfilter (IPv4) modules for matching/changing IP packet options
Includes:
- ipt_CLASSIFY
- ipt_dscp/DSCP
- ipt_ecn/ECN
- ipt_dscp
- xt_dscp
- xt_DSCP
- ipt_ecn
- ipt_length
- ipt_tos/TOS
- ipt_tcpmms
- ipt_ttl/TTL
- xt_length
- ipt_mark
- xt_mark
- xt_statistic
- ipt_tcpmss
- xt_tcpmss
- ipt_time
- xt_time
- ipt_unclean
- ipt_CLASSIFY
- xt_CLASSIFY
- ipt_DSCP
- ipt_ECN
- ipt_MARK
- xt_MARK
- xt_tos
- xt_TOS
- xt_hl
- xt_HL
endef
$(eval $(call KernelPackage,ipt-ipopt))
@ -136,6 +160,8 @@ define KernelPackage/ipt-ipsec/description
Includes:
- ipt_ah
- ipt_esp
- xt_esp
- xt_policy
endef
$(eval $(call KernelPackage,ipt-ipsec))
@ -188,12 +214,17 @@ endef
define KernelPackage/ipt-nathelper/description
Default Netfilter (IPv4) Conntrack and NAT helpers
Includes:
- conntrack_ftp
- nat_ftp
- conntrack_irc
- nat_irc
- conntrack_tftp
- nat_tftp
- ip_conntrack_ftp
- ip_nat_ftp
- nf_conntrack_ftp
- nf_nat_ftp
- ip_conntrack_irc
- ip_nat_irc
- nf_conntrack_irc
- nf_nat_irc
- ip_conntrack_tftp
- nf_conntrack_tftp
- nf_nat_tftp
endef
$(eval $(call KernelPackage,ipt-nathelper))
@ -211,13 +242,32 @@ define KernelPackage/ipt-nathelper-extra/description
Extra Netfilter (IPv4) Conntrack and NAT helpers
Includes:
- ip_conntrack_amanda
- nf_conntrack_amanda
- nf_nat_amanda
- ip_conntrack_proto_gre
- ip_nat_proto_gre
- nf_conntrack_proto_gre
- nf_nat_proto_gre
- ip_conntrack_h323
- ip_nat_h323
- nf_conntrack_h323
- nf_nat_h323
- ip_conntrack_mms
- ip_nat_mms
- ip_conntrack_pptp
- ip_nat_pptp
- nf_conntrack_pptp
- nf_nat_pptp
- ip_conntrack_rtsp
- ip_nat_rtsp
- nf_conntrack_rtsp
- nf_nat_rtsp
- ip_conntrack_sip
- ip_nat_sip
- nf_conntrack_sip
- nf_nat_sip
- ip_nat_snmp_basic
- nf_nat_snmp_basic
endef
$(eval $(call KernelPackage,ipt-nathelper-extra))
@ -309,10 +359,12 @@ endef
define KernelPackage/ipt-extra/description
Other Netfilter (IPv4) kernel modules
Includes:
- ipt_condition
- ipt_owner
- ipt_physdev
- xt_physdev
- ipt_pkttype
- ipt_recent
- xt_pkttype
- xt_quota
endef
$(eval $(call KernelPackage,ipt-extra))

View File

@ -106,6 +106,22 @@ endef
$(eval $(call KernelPackage,net-hermes-plx))
define KernelPackage/net-hermes-pcmcia
SUBMENU:=$(WIRELESS_MENU)
TITLE:=Hermes based PCMCIA adaptors
DEPENDS:=@PCMCIA_SUPPORT +kmod-net-hermes
KCONFIG:=CONFIG_PCMCIA_HERMES
FILES:=$(LINUX_DIR)/drivers/net/wireless/orinoco/orinoco_cs.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoLoad,55,orinoco_cs)
endef
define KernelPackage/net-hermes-pcmcia/description
Kernel modules for Hermes based PCMCIA adaptors
endef
$(eval $(call KernelPackage,net-hermes-pcmcia))
define KernelPackage/net-prism54
SUBMENU:=$(WIRELESS_MENU)
TITLE:=Intersil Prism54 support

View File

@ -2,4 +2,4 @@ src/gz snapshots http://downloads.openwrt.org/snapshots/trunk/$S/packages
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /jffs
option overlay_root /overlay

View File

@ -48,7 +48,6 @@ void __init ap91_eth_init(u8 *mac_addr, const char *port_names[])
/* WAN port */
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = 0x0;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.fifo_cfg1 = 0x0fff0000;
@ -57,7 +56,6 @@ void __init ap91_eth_init(u8 *mac_addr, const char *port_names[])
/* LAN ports */
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.phy_mask = 0x0;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
ar71xx_eth1_data.fifo_cfg1 = 0x0fff0000;

View File

@ -113,7 +113,6 @@ static void __init ap81_setup(void)
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.has_ar8216 = 1;

View File

@ -206,7 +206,6 @@ static void __init ap83_generic_setup(void)
ar71xx_add_device_eth(0);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth1_data.phy_mask = 0x0;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;

View File

@ -80,7 +80,6 @@ static void __init aw_nr580_setup(void)
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;

View File

@ -144,7 +144,6 @@ static void __init dir_615c1_setup(void)
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;

View File

@ -135,7 +135,6 @@ static void __init mzk_w04nu_setup(void)
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.has_ar8216 = 1;

View File

@ -134,7 +134,6 @@ static void __init mzk_w300nh_setup(void)
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.has_ar8216 = 1;

View File

@ -55,7 +55,6 @@ static void __init pb42_init(void)
ar71xx_eth0_data.phy_mask = PB42_WAN_PHYMASK;
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.phy_mask = PB42_LAN_PHYMASK;
ar71xx_eth1_data.speed = SPEED_100;
ar71xx_eth1_data.duplex = DUPLEX_FULL;

View File

@ -179,7 +179,6 @@ static void __init pb44_init(void)
ar71xx_add_device_eth(0);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth1_data.phy_mask = PB44_LAN_PHYMASK;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
ar71xx_eth1_pll_data.pll_1000 = 0x110000;

View File

@ -177,10 +177,10 @@ static void __init rb411_setup(void)
rb4xx_generic_setup();
rb4xx_add_device_spi();
ar71xx_add_device_mdio(0xfffffffe);
ar71xx_add_device_mdio(0xfffffffc);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = 0x00000001;
ar71xx_eth0_data.phy_mask = 0x00000003;
ar71xx_add_device_eth(0);
@ -192,16 +192,7 @@ MIPS_MACHINE(AR71XX_MACH_RB_411, "411", "MikroTik RouterBOARD 411/A/AH",
static void __init rb411u_setup(void)
{
rb4xx_generic_setup();
rb4xx_add_device_spi();
ar71xx_add_device_mdio(0xfffffffd);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = 0x00000002;
ar71xx_add_device_eth(0);
ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
rb411_setup();
ar71xx_add_device_usb();
}
@ -216,7 +207,6 @@ static void __init rb433_setup(void)
ar71xx_add_device_mdio(0xffffffe9);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = 0x00000006;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
@ -249,7 +239,6 @@ static void __init rb450_generic_setup(int gige)
ar71xx_add_device_mdio(0xffffffe0);
ar71xx_eth0_data.phy_if_mode = (gige) ? PHY_INTERFACE_MODE_RGMII : PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = 0x0000000f;
ar71xx_eth0_data.speed = (gige) ? SPEED_1000 : SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
@ -284,7 +273,6 @@ static void __init rb493_setup(void)
ar71xx_add_device_mdio(0x3fffff00);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = 0;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;

View File

@ -120,7 +120,6 @@ static void __init tew_632brp_setup(void)
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;

View File

@ -130,7 +130,6 @@ static void __init tl_wr1043nd_setup(void)
ar71xx_eth0_data.mii_bus_dev = &tl_wr1043nd_rtl8366rb_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.phy_mask = 0x0;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_pll_data.pll_1000 = 0x1a000000;

View File

@ -120,7 +120,6 @@ static void __init tl_wr841n_v1_setup(void)
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = 0x0;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;

View File

@ -121,7 +121,6 @@ static void __init tl_wr941nd_setup(void)
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = 0x0;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;

View File

@ -136,9 +136,6 @@ static void __init ubnt_generic_setup(void)
#define UBNT_RS_WAN_PHYMASK (1 << 20)
#define UBNT_RS_LAN_PHYMASK ((1 << 16) | (1 << 17) | (1 << 18) | (1 << 19))
#define UBNT_RSPRO_WAN_PHYMASK (1 << 4)
#define UBNT_RSPRO_LAN_PHYMASK ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3))
static void __init ubnt_rs_setup(void)
{
ubnt_generic_setup();
@ -149,8 +146,6 @@ static void __init ubnt_rs_setup(void)
ar71xx_eth0_data.phy_mask = UBNT_RS_WAN_PHYMASK;
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.phy_mask = UBNT_RS_LAN_PHYMASK;
ar71xx_eth1_data.speed = SPEED_100;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
@ -169,6 +164,9 @@ MIPS_MACHINE(AR71XX_MACH_UBNT_RS, "UBNT-RS", "Ubiquiti RouterStation",
MIPS_MACHINE(AR71XX_MACH_UBNT_AR71XX, "Ubiquiti AR71xx-based board",
"Ubiquiti RouterStation", ubnt_rs_setup);
#define UBNT_RSPRO_WAN_PHYMASK (1 << 4)
#define UBNT_RSPRO_LAN_PHYMASK ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3))
static void __init ubnt_rspro_setup(void)
{
ubnt_generic_setup();
@ -179,8 +177,6 @@ static void __init ubnt_rspro_setup(void)
ar71xx_eth0_data.phy_mask = UBNT_RSPRO_WAN_PHYMASK;
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth1_data.phy_mask = UBNT_RSPRO_LAN_PHYMASK;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
@ -235,7 +231,6 @@ static void __init ubnt_m_setup(void)
ar71xx_add_device_mdio(~0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = 0;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.fifo_cfg1 = 0x0010ffff;
@ -272,7 +267,6 @@ static void __init ubnt_nano_m_setup(void)
ubnt_m_setup();
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.phy_mask = 0;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
ar71xx_eth1_data.fifo_cfg1 = 0x0010ffff;

View File

@ -173,7 +173,6 @@ static void __init wndr3700_setup(void)
ar71xx_eth0_pll_data.pll_1000 = 0x11110000;
ar71xx_eth0_data.mii_bus_dev = &wndr3700_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;

View File

@ -122,7 +122,6 @@ static void __init wnr2000_setup(void)
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.has_ar8216 = 1;

View File

@ -79,7 +79,7 @@ static void __init wp543_setup(void)
ar71xx_add_device_mdio(0xfffffff7);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = 0x00000008;
ar71xx_eth0_data.phy_mask = 0x08;
ar71xx_eth0_data.reset_bit = RESET_MODULE_GE0_MAC |
RESET_MODULE_GE0_PHY;
ar71xx_add_device_eth(0);

View File

@ -143,7 +143,6 @@ static void __init wrt400n_setup(void)
ar71xx_add_device_mdio(0x0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.has_ar8216 = 1;

View File

@ -234,7 +234,6 @@ static void __init wzrhpg300nh_setup(void)
ar71xx_eth0_pll_data.pll_1000 = 0x1e000100;
ar71xx_eth0_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.phy_mask = 0xf;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;

View File

@ -38,7 +38,7 @@
#define ETH_FCS_LEN 4
#define AG71XX_DRV_NAME "ag71xx"
#define AG71XX_DRV_VERSION "0.5.32"
#define AG71XX_DRV_VERSION "0.5.33"
#define AG71XX_NAPI_WEIGHT 64
#define AG71XX_OOM_REFILL (1 + HZ/10)

View File

@ -47,10 +47,6 @@ void ag71xx_phy_start(struct ag71xx *ag)
if (ag->phy_dev) {
phy_start(ag->phy_dev);
} else {
struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
ag->duplex = pdata->duplex;
ag->speed = pdata->speed;
ag->link = 1;
ag71xx_link_adjust(ag);
}
@ -61,9 +57,7 @@ void ag71xx_phy_stop(struct ag71xx *ag)
if (ag->phy_dev) {
phy_stop(ag->phy_dev);
} else {
ag->duplex = -1;
ag->link = 0;
ag->speed = 0;
ag71xx_link_adjust(ag);
}
}
@ -81,12 +75,16 @@ static int ag71xx_phy_connect_fixed(struct ag71xx *ag)
case SPEED_1000:
break;
default:
printk(KERN_ERR "%s: invalid speed specified\n",
dev->name);
printk(KERN_ERR "%s: invalid speed specified\n", dev->name);
ret = -EINVAL;
break;
}
printk(KERN_DEBUG "%s: using fixed link parameters\n", dev->name);
ag->duplex = pdata->duplex;
ag->speed = pdata->speed;
return ret;
}
@ -95,7 +93,6 @@ static int ag71xx_phy_connect_multi(struct ag71xx *ag)
struct net_device *dev = ag->dev;
struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
struct phy_device *phydev = NULL;
int phy_count = 0;
int phy_addr;
int ret = 0;
@ -113,51 +110,40 @@ static int ag71xx_phy_connect_multi(struct ag71xx *ag)
if (phydev == NULL)
phydev = ag->mii_bus->phy_map[phy_addr];
phy_count++;
}
switch (phy_count) {
case 0:
if (!phydev) {
printk(KERN_ERR "%s: no PHY found with phy_mask=%08x\n",
dev->name, pdata->phy_mask);
ret = -ENODEV;
break;
case 1:
ag->phy_dev = phy_connect(dev, dev_name(&phydev->dev),
&ag71xx_phy_link_adjust, 0, pdata->phy_if_mode);
if (IS_ERR(ag->phy_dev)) {
printk(KERN_ERR "%s: could not connect to PHY at %s\n",
dev->name, dev_name(&phydev->dev));
return PTR_ERR(ag->phy_dev);
}
/* mask with MAC supported features */
if (pdata->has_gbit)
phydev->supported &= PHY_GBIT_FEATURES;
else
phydev->supported &= PHY_BASIC_FEATURES;
phydev->advertising = phydev->supported;
printk(KERN_DEBUG "%s: connected to PHY at %s "
"[uid=%08x, driver=%s]\n",
dev->name, dev_name(&phydev->dev),
phydev->phy_id, phydev->drv->name);
ag->link = 0;
ag->speed = 0;
ag->duplex = -1;
break;
default:
printk(KERN_DEBUG "%s: connected to %d PHYs\n",
dev->name, phy_count);
ret = ag71xx_phy_connect_fixed(ag);
break;
return -ENODEV;
}
ag->phy_dev = phy_connect(dev, dev_name(&phydev->dev),
&ag71xx_phy_link_adjust, 0,
pdata->phy_if_mode);
if (IS_ERR(ag->phy_dev)) {
printk(KERN_ERR "%s: could not connect to PHY at %s\n",
dev->name, dev_name(&phydev->dev));
return PTR_ERR(ag->phy_dev);
}
/* mask with MAC supported features */
if (pdata->has_gbit)
phydev->supported &= PHY_GBIT_FEATURES;
else
phydev->supported &= PHY_BASIC_FEATURES;
phydev->advertising = phydev->supported;
printk(KERN_DEBUG "%s: connected to PHY at %s [uid=%08x, driver=%s]\n",
dev->name, dev_name(&phydev->dev),
phydev->phy_id, phydev->drv->name);
ag->link = 0;
ag->speed = 0;
ag->duplex = -1;
return ret;
}

View File

@ -96,6 +96,7 @@ CONFIG_HAVE_IDE=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HW_HAS_PCI=y
CONFIG_HW_RANDOM=y
CONFIG_IMAGE_CMDLINE_HACK=y
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_INLINE_READ_LOCK is not set
# CONFIG_INLINE_READ_LOCK_BH is not set

View File

@ -355,7 +355,7 @@
+ tasklet_kill(&sp->rx_tasklet);
+}
+
+static int __exit ar231x_remove(struct platform_device *pdev)
+static int __devexit ar231x_remove(struct platform_device *pdev)
+{
+ struct net_device *dev = platform_get_drvdata(pdev);
+ struct ar231x_private *sp = netdev_priv(dev);
@ -392,7 +392,7 @@
+static struct platform_driver ar231x_driver = {
+ .driver.name = "ar231x-eth",
+ .probe = ar231x_probe,
+ .remove = ar231x_remove,
+ .remove = __devexit_p(ar231x_remove),
+};
+
+int __init ar231x_module_init(void)

View File

@ -355,7 +355,7 @@
+ tasklet_kill(&sp->rx_tasklet);
+}
+
+static int __exit ar231x_remove(struct platform_device *pdev)
+static int __devexit ar231x_remove(struct platform_device *pdev)
+{
+ struct net_device *dev = platform_get_drvdata(pdev);
+ struct ar231x_private *sp = netdev_priv(dev);
@ -392,7 +392,7 @@
+static struct platform_driver ar231x_driver = {
+ .driver.name = "ar231x-eth",
+ .probe = ar231x_probe,
+ .remove = ar231x_remove,
+ .remove = __devexit_p(ar231x_remove),
+};
+
+int __init ar231x_module_init(void)

View File

@ -355,7 +355,7 @@
+ tasklet_kill(&sp->rx_tasklet);
+}
+
+static int __exit ar231x_remove(struct platform_device *pdev)
+static int __devexit ar231x_remove(struct platform_device *pdev)
+{
+ struct net_device *dev = platform_get_drvdata(pdev);
+ struct ar231x_private *sp = netdev_priv(dev);
@ -392,7 +392,7 @@
+static struct platform_driver ar231x_driver = {
+ .driver.name = "ar231x-eth",
+ .probe = ar231x_probe,
+ .remove = ar231x_remove,
+ .remove = __devexit_p(ar231x_remove),
+};
+
+int __init ar231x_module_init(void)

View File

@ -355,7 +355,7 @@
+ tasklet_kill(&sp->rx_tasklet);
+}
+
+static int __exit ar231x_remove(struct platform_device *pdev)
+static int __devexit ar231x_remove(struct platform_device *pdev)
+{
+ struct net_device *dev = platform_get_drvdata(pdev);
+ struct ar231x_private *sp = netdev_priv(dev);
@ -392,7 +392,7 @@
+static struct platform_driver ar231x_driver = {
+ .driver.name = "ar231x-eth",
+ .probe = ar231x_probe,
+ .remove = ar231x_remove,
+ .remove = __devexit_p(ar231x_remove),
+};
+
+int __init ar231x_module_init(void)

View File

@ -105,10 +105,11 @@ static int jz4740_pcm_hw_params(struct snd_pcm_substream *substream,
struct jz4740_pcm_config *config;
config = rtd->dai->cpu_dai->dma_data;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
prtd->dma = jz4740_dma_request(substream, "PCM Playback");
} else {
prtd->dma = jz4740_dma_request(substream, "PCM Capture");
if (!prtd->dma) {
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
prtd->dma = jz4740_dma_request(substream, "PCM Playback");
else
prtd->dma = jz4740_dma_request(substream, "PCM Capture");
}
if (!prtd->dma)
@ -135,8 +136,10 @@ static int jz4740_pcm_hw_free(struct snd_pcm_substream *substream)
struct jz4740_runtime_data *prtd = substream->runtime->private_data;
snd_pcm_set_runtime_buffer(substream, NULL);
if (prtd->dma)
if (prtd->dma) {
jz4740_dma_free(prtd->dma);
prtd->dma = NULL;
}
return 0;
}