www.usr.com/support/gpl/USR9107_release.1.4.tar.gz
authorDobrica Pavlinusic <dpavlin@mjesec.ffzg.hr>
Sun, 7 Oct 2007 13:45:36 +0000 (15:45 +0200)
committerDobrica Pavlinusic <dpavlin@mjesec.ffzg.hr>
Sun, 7 Oct 2007 13:45:36 +0000 (15:45 +0200)
USR910x_3.04L.01_consumer.tar.gz

BRCM_VERSION=3
BRCM_RELEASE=04
BRCM_EXTRAVERSION=01

494 files changed:
Makefile
bcmdrivers/Makefile
bcmdrivers/broadcom/atm/impl1/Makefile
bcmdrivers/broadcom/char/adsl/impl1/adsl_phy96348R.bin_save
bcmdrivers/broadcom/char/adsl/impl1/adsl_phy96348RB.bin_save
bcmdrivers/broadcom/char/adsl/impl1/adsldd96348R.o_save
bcmdrivers/broadcom/char/adsl/impl1/adsldd96348RB.o_save
bcmdrivers/broadcom/char/atmapi/impl1/atmapi96348R.o_save
bcmdrivers/broadcom/char/atmapi/impl1/atmapi96348RB.o_save
bcmdrivers/broadcom/char/bcmprocfs/impl1/bcmprocfs96348R.o_save
bcmdrivers/broadcom/char/bcmprocfs/impl1/bcmprocfs96348RB.o_save
bcmdrivers/broadcom/include/bcm963xx/AdslMibDef.h
bcmdrivers/broadcom/include/bcm963xx/DiagDef.h
bcmdrivers/broadcom/include/bcm963xx/atmapidrv.h
bcmdrivers/broadcom/include/bcm963xx/bcmadsl.h
bcmdrivers/broadcom/include/bcm963xx/bcmnet.h
bcmdrivers/broadcom/net/enet/impl2/bcm_enet96348R.o_save
bcmdrivers/broadcom/net/enet/impl2/bcm_enet96348RB.o_save
bcmdrivers/opensource/char/board/bcm963xx/impl1/Makefile
bcmdrivers/opensource/char/board/bcm963xx/impl1/bcm63xx_flash.c
bcmdrivers/opensource/char/board/bcm963xx/impl1/board.c
bcmdrivers/opensource/include/bcm963xx/6338_intr.h
bcmdrivers/opensource/include/bcm963xx/6338_map_part.h
bcmdrivers/opensource/include/bcm963xx/6345_intr.h
bcmdrivers/opensource/include/bcm963xx/6345_map_part.h
bcmdrivers/opensource/include/bcm963xx/6348_map_part.h
bcmdrivers/opensource/include/bcm963xx/bcmTag.h
bcmdrivers/opensource/include/bcm963xx/board.h
hostTools/bcmImageBuilder
hostTools/createimg
hostTools/scripts/defconfig-bcm.template
hostTools/scripts/gendefconfig
kernel/linux/Makefile
kernel/linux/arch/mips/brcm-boards/bcm963xx/Kconfig
kernel/linux/arch/mips/brcm-boards/bcm963xx/irq.c
kernel/linux/arch/mips/brcm-boards/bcm963xx/setup.c
kernel/linux/arch/mips/mm/fault.c
kernel/linux/drivers/mtd/maps/bcm963xx.c
kernel/linux/fs/partitions/Kconfig
kernel/linux/fs/seq_file.c
kernel/linux/include/asm-mips/mach-generic/param.h
kernel/linux/include/asm-mips/param.h
kernel/linux/include/linux/atmbr2684.h
kernel/linux/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
kernel/linux/include/linux/netfilter_ipv4/ip_conntrack_protocol.h
kernel/linux/include/linux/skbuff.h
kernel/linux/include/linux/syscalls.h
kernel/linux/include/net/pkt_sched.h
kernel/linux/include/net/sock.h
kernel/linux/kernel/timer.c
kernel/linux/mm/slab.c
kernel/linux/net/atm/Makefile
kernel/linux/net/atm/br2684.c
kernel/linux/net/bridge/br_device.c
kernel/linux/net/bridge/br_fdb.c
kernel/linux/net/bridge/br_forward.c
kernel/linux/net/bridge/br_if.c
kernel/linux/net/bridge/br_input.c
kernel/linux/net/bridge/br_ioctl.c
kernel/linux/net/bridge/br_private.h
kernel/linux/net/bridge/netfilter/Makefile
kernel/linux/net/core/Makefile
kernel/linux/net/core/dev.c
kernel/linux/net/core/skbuff.c
kernel/linux/net/core/sock.c
kernel/linux/net/ipv4/af_inet.c
kernel/linux/net/ipv4/netfilter/Makefile
kernel/linux/net/ipv4/netfilter/broadcom/ip_conntrack_ipsec96348R.o_save
kernel/linux/net/ipv4/netfilter/broadcom/ip_conntrack_ipsec96348RB.o_save
kernel/linux/net/ipv4/netfilter/broadcom/ip_conntrack_pt96348R.o_save
kernel/linux/net/ipv4/netfilter/broadcom/ip_conntrack_pt96348RB.o_save
kernel/linux/net/ipv4/netfilter/broadcom/ip_nat_ipsec.mod96348R.o_save
kernel/linux/net/ipv4/netfilter/broadcom/ip_nat_ipsec.mod96348RB.o_save
kernel/linux/net/ipv4/netfilter/broadcom/ip_nat_ipsec96348R.o_save
kernel/linux/net/ipv4/netfilter/broadcom/ip_nat_ipsec96348RB.o_save
kernel/linux/net/ipv4/netfilter/ip_conntrack_core.c
kernel/linux/net/ipv4/netfilter/ip_conntrack_gre.c
kernel/linux/net/ipv4/netfilter/ip_conntrack_h323.c
kernel/linux/net/ipv4/netfilter/ip_conntrack_pptp.c
kernel/linux/net/ipv4/netfilter/ip_conntrack_proto_esp.c
kernel/linux/net/ipv4/netfilter/ip_conntrack_rtsp.c
kernel/linux/net/ipv4/netfilter/ip_nat_gre.c
kernel/linux/net/ipv4/netfilter/ip_nat_h323.c
kernel/linux/net/ipv4/netfilter/ip_nat_pptp.c
kernel/linux/net/ipv4/netfilter/ip_nat_rtsp.c
kernel/linux/net/ipv4/netfilter/ipt_dscp.c
kernel/linux/net/ipv4/netfilter/ipt_ecn.c
kernel/linux/net/ipv4/netfilter/ipt_tos.c
kernel/linux/net/ipv4/raw.c
kernel/linux/net/sched/Kconfig
kernel/linux/net/sched/Makefile
kernel/linux/net/sched/sch_generic.c
kernel/linux/net/socket.c
targets/96348R/96348R
targets/96348RB/96348RB
targets/boardparms/bcm963xx/boardparms.c
targets/boardparms/bcm963xx/boardparms.h
targets/buildFS
targets/cfe/cfe6338.bin
targets/cfe/cfe6345.bin
targets/cfe/cfe6348.bin
targets/fs.src/etc/fstab
targets/fs.src/etc/profile
targets/fs.src/etc/rsa_host_key
targets/fs.src/etc/wlan/bcm4318_map.bin
targets/makeDevs
userapps/broadcom/adslctl/adslctl_96348RB_save
userapps/broadcom/adslctl/adslctl_96348R_save
userapps/broadcom/atmctl/atmctl_96348RB_save
userapps/broadcom/atmctl/atmctl_96348R_save
userapps/broadcom/cfm/Makefile
userapps/broadcom/cfm/cfm_96348RB_save
userapps/broadcom/cfm/cfm_96348R_save
userapps/broadcom/cfm/html/adslcfg.html
userapps/broadcom/cfm/html/adslcfgadv.html
userapps/broadcom/cfm/html/adslcfgc.html
userapps/broadcom/cfm/html/adslcfgtone.html
userapps/broadcom/cfm/html/backupsettings.html
userapps/broadcom/cfm/html/berrun.html
userapps/broadcom/cfm/html/berstart.html
userapps/broadcom/cfm/html/berstop.html
userapps/broadcom/cfm/html/ddnsadd.html
userapps/broadcom/cfm/html/defaultsettings.html
userapps/broadcom/cfm/html/dhcpinfo.html
userapps/broadcom/cfm/html/diag.html
userapps/broadcom/cfm/html/diagbr.html
userapps/broadcom/cfm/html/diagipow.html
userapps/broadcom/cfm/html/diaglan.html
userapps/broadcom/cfm/html/diagmer.html
userapps/broadcom/cfm/html/diagpppoa.html
userapps/broadcom/cfm/html/diagpppoe.html
userapps/broadcom/cfm/html/dnscfg.html
userapps/broadcom/cfm/html/enblbridge.html
userapps/broadcom/cfm/html/enblservice.html
userapps/broadcom/cfm/html/hlpadslsync.html
userapps/broadcom/cfm/html/hlpatmetoe.html
userapps/broadcom/cfm/html/hlpatmseg.html
userapps/broadcom/cfm/html/hlpethconn.html
userapps/broadcom/cfm/html/hlppngdns.html
userapps/broadcom/cfm/html/hlppnggw.html
userapps/broadcom/cfm/html/hlppppoasess.html
userapps/broadcom/cfm/html/hlppppoeauth.html
userapps/broadcom/cfm/html/hlppppoeconn.html
userapps/broadcom/cfm/html/hlppppoeip.html
userapps/broadcom/cfm/html/hlptstdns.html
userapps/broadcom/cfm/html/hlpwlconn.html
userapps/broadcom/cfm/html/index-wireless.html
userapps/broadcom/cfm/html/info.html
userapps/broadcom/cfm/html/ipoacfg.html
userapps/broadcom/cfm/html/ippcfg.html
userapps/broadcom/cfm/html/lancfg.html
userapps/broadcom/cfm/html/lancfg2.html
userapps/broadcom/cfm/html/lancfgbr.html
userapps/broadcom/cfm/html/logconfig.html
userapps/broadcom/cfm/html/logintro.html
userapps/broadcom/cfm/html/natcfg2.html
userapps/broadcom/cfm/html/ntwkprtcl.html
userapps/broadcom/cfm/html/ntwksum2.html
userapps/broadcom/cfm/html/password.html
userapps/broadcom/cfm/html/portName.js
userapps/broadcom/cfm/html/portmapadd.html
userapps/broadcom/cfm/html/portmapedit.html
userapps/broadcom/cfm/html/pppautherr.html
userapps/broadcom/cfm/html/pppauthinfo.html
userapps/broadcom/cfm/html/pppoe.html
userapps/broadcom/cfm/html/pvccfg.html
userapps/broadcom/cfm/html/pvccfgerr.html
userapps/broadcom/cfm/html/pvcindex.html
userapps/broadcom/cfm/html/qoscls.html
userapps/broadcom/cfm/html/quicksetuperr.html
userapps/broadcom/cfm/html/rebootinfo.html
userapps/broadcom/cfm/html/resetrouter.html
userapps/broadcom/cfm/html/restoreinfo.html
userapps/broadcom/cfm/html/routeadd.html
userapps/broadcom/cfm/html/routeremove.html
userapps/broadcom/cfm/html/rtdefaultcfg.html
userapps/broadcom/cfm/html/rtdefaultcfgerr.html
userapps/broadcom/cfm/html/scacccntr.html
userapps/broadcom/cfm/html/scdmz.html
userapps/broadcom/cfm/html/scinflt.html
userapps/broadcom/cfm/html/scintro.html
userapps/broadcom/cfm/html/scmacflt.html
userapps/broadcom/cfm/html/scmacpolicy.html
userapps/broadcom/cfm/html/scoutflt.html
userapps/broadcom/cfm/html/scprttrg.html
userapps/broadcom/cfm/html/scvrtsrv.html
userapps/broadcom/cfm/html/setup.html
userapps/broadcom/cfm/html/setup_dsl.html
userapps/broadcom/cfm/html/setup_finish.html
userapps/broadcom/cfm/html/setup_login.html
userapps/broadcom/cfm/html/setup_sec.html
userapps/broadcom/cfm/html/snmpconfig.html
userapps/broadcom/cfm/html/sntpcfg.html
userapps/broadcom/cfm/html/statsadsl.html
userapps/broadcom/cfm/html/statsadslerr.html
userapps/broadcom/cfm/html/statsadslreset.html
userapps/broadcom/cfm/html/statsatm.html
userapps/broadcom/cfm/html/statsatmerr.html
userapps/broadcom/cfm/html/statsatmreset.html
userapps/broadcom/cfm/html/statsifc.html
userapps/broadcom/cfm/html/statsifcreset.html
userapps/broadcom/cfm/html/statswanreset.html
userapps/broadcom/cfm/html/todadd.html
userapps/broadcom/cfm/html/updatesettings.html
userapps/broadcom/cfm/html/upload.html
userapps/broadcom/cfm/html/uploadinfo.html
userapps/broadcom/cfm/html/usr_common.js
userapps/broadcom/cfm/html/usr_custom.js
userapps/broadcom/cfm/html/usr_main.css
userapps/broadcom/cfm/html/usr_menus.js
userapps/broadcom/cfm/html/util.js
userapps/broadcom/cfm/html/wanadderr.html
userapps/broadcom/cfm/html/wancfg.html
userapps/broadcom/cfm/html/wlcfg.html
userapps/broadcom/cfm/html/wlcfgadv.html
userapps/broadcom/cfm/html/wlmacflt.html
userapps/broadcom/cfm/html/wlsecurity.html
userapps/broadcom/cfm/html/wlses.html
userapps/broadcom/cfm/html/wlsetup.html
userapps/broadcom/cfm/inc/board_api.h
userapps/broadcom/cfm/inc/clidefs.h
userapps/broadcom/cfm/inc/psidefs.h
userapps/broadcom/cfm/inc/psixml.h
userapps/broadcom/cfm/inc/syscall.h
userapps/broadcom/cfm/inc/version.h
userapps/broadcom/cfm/inc/wldefs.h
userapps/broadcom/cfm/util/psi/board_api.c
userapps/broadcom/cfm/util/system/syscall.c
userapps/broadcom/ddnsd/ddnsd_96348RB_save
userapps/broadcom/ddnsd/ddnsd_96348R_save
userapps/broadcom/dhcpr/dhcpr_96348RB_save
userapps/broadcom/dhcpr/dhcpr_96348R_save
userapps/broadcom/dnsprobe/dnsprobe_96348RB_save
userapps/broadcom/dnsprobe/dnsprobe_96348R_save
userapps/broadcom/epittcp/Makefile
userapps/broadcom/ethctl/ethctl_96348RB_save
userapps/broadcom/ethctl/ethctl_96348R_save
userapps/broadcom/hotplug/Makefile
userapps/broadcom/igmp/igmp_96348RB_save
userapps/broadcom/igmp/igmp_96348R_save
userapps/broadcom/ippd/ippd_96348RB_save
userapps/broadcom/ippd/ippd_96348R_save
userapps/broadcom/nas/Makefile
userapps/broadcom/netctl/netctl_96348RB_save
userapps/broadcom/netctl/netctl_96348R_save
userapps/broadcom/nvram/Makefile
userapps/broadcom/ses/Makefile
userapps/broadcom/sntp/sntp_96348RB_save
userapps/broadcom/sntp/sntp_96348R_save
userapps/broadcom/upnp/igd/linux/upnp_96348RB_save
userapps/broadcom/upnp/igd/linux/upnp_96348R_save
userapps/broadcom/wlctl/Makefile
userapps/opensource/atm2684/pvc2684ctl/atmbr2684.h
userapps/opensource/atm2684/pvc2684ctl/brpvc.h
userapps/opensource/atm2684/pvc2684ctl/pvc2684ctl.c
userapps/opensource/atm2684/pvc2684ctl/pvc2684d.c
userapps/opensource/bridge-utils/brctl/brctl.c
userapps/opensource/bridge-utils/brctl/brctl_cmd.c
userapps/opensource/bridge-utils/libbridge/libbridge.h
userapps/opensource/bridge-utils/libbridge/libbridge_devif.c
userapps/opensource/busybox/.config
userapps/opensource/busybox/.config.cmd
userapps/opensource/busybox/.depend
userapps/opensource/busybox/brcm.config
userapps/opensource/busybox/include/config.h
userapps/opensource/busybox/networking/ping.c
userapps/opensource/busybox/networking/tftpd.c
userapps/opensource/busybox/procps/ps.c
userapps/opensource/ebtables/extensions/Makefile
userapps/opensource/ftpd/fwsyscall.h
userapps/opensource/libcreduction/Makefile
userapps/opensource/libcreduction/mklibs.py
userapps/opensource/libosip2.tar.bz2
userapps/opensource/net-snmp/agent/mibgroup/mibII/interfaces.c
userapps/opensource/ppp/pppoe/auth.c
userapps/opensource/ppp/pppoe/ipcp.c
userapps/opensource/ppp/pppoe/lcp.c
userapps/opensource/ppp/pppoe/main.c
userapps/opensource/ppp/pppoe/options.c
userapps/opensource/ppp/pppoe/plugins/pppoe/libpppoe.c
userapps/opensource/ppp/pppoe/pppd.h
userapps/opensource/ppp/pppoe/sys-linux.c
userapps/opensource/ppp/pppoe/utils.c
userapps/opensource/siproxd.tar.bz2
userapps/opensource/siproxd/Makefile
userapps/opensource/sshd.tar.bz2
userapps/opensource/sshd/CHANGES
userapps/opensource/sshd/LICENSE
userapps/opensource/sshd/Makefile
userapps/opensource/sshd/Makefile.in
userapps/opensource/sshd/README
userapps/opensource/sshd/TODO
userapps/opensource/sshd/agentfwd.h
userapps/opensource/sshd/algo.h
userapps/opensource/sshd/atomicio.c
userapps/opensource/sshd/auth.h
userapps/opensource/sshd/bignum.c
userapps/opensource/sshd/bignum.h
userapps/opensource/sshd/buffer.c
userapps/opensource/sshd/buffer.h
userapps/opensource/sshd/channel.h
userapps/opensource/sshd/chansession.h
userapps/opensource/sshd/config.h
userapps/opensource/sshd/config.h.in
userapps/opensource/sshd/configure
userapps/opensource/sshd/configure.in
userapps/opensource/sshd/debian/README.Debian
userapps/opensource/sshd/debian/changelog
userapps/opensource/sshd/debian/control
userapps/opensource/sshd/debian/copyright.in
userapps/opensource/sshd/debian/dropbear.init
userapps/opensource/sshd/debian/rules
userapps/opensource/sshd/debug.h
userapps/opensource/sshd/dropbearconvert.c
userapps/opensource/sshd/dropbearkey.c
userapps/opensource/sshd/dss.c
userapps/opensource/sshd/gendss.c
userapps/opensource/sshd/genkey/Makefile
userapps/opensource/sshd/genrsa.c
userapps/opensource/sshd/includes.h
userapps/opensource/sshd/kex.h
userapps/opensource/sshd/keyimport.c
userapps/opensource/sshd/keyimport.h
userapps/opensource/sshd/libtomcrypt/changes
userapps/opensource/sshd/libtomcrypt/crypt.tex
userapps/opensource/sshd/libtomcrypt/demos/encrypt.c
userapps/opensource/sshd/libtomcrypt/demos/hashsum.c
userapps/opensource/sshd/libtomcrypt/demos/small.c
userapps/opensource/sshd/libtomcrypt/demos/test.c
userapps/opensource/sshd/libtomcrypt/makefile.msvc
userapps/opensource/sshd/libtomcrypt/notes/tech0001.txt
userapps/opensource/sshd/libtomcrypt/notes/tech0003.txt
userapps/opensource/sshd/libtommath/bn.tex
userapps/opensource/sshd/libtommath/bn_fast_mp_invmod.c
userapps/opensource/sshd/libtommath/bn_fast_mp_montgomery_reduce.c
userapps/opensource/sshd/libtommath/bn_fast_s_mp_mul_digs.c
userapps/opensource/sshd/libtommath/bn_fast_s_mp_mul_high_digs.c
userapps/opensource/sshd/libtommath/bn_fast_s_mp_sqr.c
userapps/opensource/sshd/libtommath/bn_mp_2expt.c
userapps/opensource/sshd/libtommath/bn_mp_abs.c
userapps/opensource/sshd/libtommath/bn_mp_add.c
userapps/opensource/sshd/libtommath/bn_mp_add_d.c
userapps/opensource/sshd/libtommath/bn_mp_addmod.c
userapps/opensource/sshd/libtommath/bn_mp_and.c
userapps/opensource/sshd/libtommath/bn_mp_clamp.c
userapps/opensource/sshd/libtommath/bn_mp_clear.c
userapps/opensource/sshd/libtommath/bn_mp_cmp.c
userapps/opensource/sshd/libtommath/bn_mp_cmp_d.c
userapps/opensource/sshd/libtommath/bn_mp_cmp_mag.c
userapps/opensource/sshd/libtommath/bn_mp_copy.c
userapps/opensource/sshd/libtommath/bn_mp_count_bits.c
userapps/opensource/sshd/libtommath/bn_mp_div.c
userapps/opensource/sshd/libtommath/bn_mp_div_2.c
userapps/opensource/sshd/libtommath/bn_mp_div_2d.c
userapps/opensource/sshd/libtommath/bn_mp_div_3.c
userapps/opensource/sshd/libtommath/bn_mp_div_d.c
userapps/opensource/sshd/libtommath/bn_mp_dr_is_modulus.c
userapps/opensource/sshd/libtommath/bn_mp_dr_reduce.c
userapps/opensource/sshd/libtommath/bn_mp_dr_setup.c
userapps/opensource/sshd/libtommath/bn_mp_exch.c
userapps/opensource/sshd/libtommath/bn_mp_expt_d.c
userapps/opensource/sshd/libtommath/bn_mp_exptmod.c
userapps/opensource/sshd/libtommath/bn_mp_exptmod_fast.c
userapps/opensource/sshd/libtommath/bn_mp_gcd.c
userapps/opensource/sshd/libtommath/bn_mp_grow.c
userapps/opensource/sshd/libtommath/bn_mp_init.c
userapps/opensource/sshd/libtommath/bn_mp_init_copy.c
userapps/opensource/sshd/libtommath/bn_mp_init_size.c
userapps/opensource/sshd/libtommath/bn_mp_invmod.c
userapps/opensource/sshd/libtommath/bn_mp_jacobi.c
userapps/opensource/sshd/libtommath/bn_mp_karatsuba_mul.c
userapps/opensource/sshd/libtommath/bn_mp_karatsuba_sqr.c
userapps/opensource/sshd/libtommath/bn_mp_lcm.c
userapps/opensource/sshd/libtommath/bn_mp_lshd.c
userapps/opensource/sshd/libtommath/bn_mp_mod.c
userapps/opensource/sshd/libtommath/bn_mp_mod_2d.c
userapps/opensource/sshd/libtommath/bn_mp_mod_d.c
userapps/opensource/sshd/libtommath/bn_mp_montgomery_calc_normalization.c
userapps/opensource/sshd/libtommath/bn_mp_montgomery_reduce.c
userapps/opensource/sshd/libtommath/bn_mp_montgomery_setup.c
userapps/opensource/sshd/libtommath/bn_mp_mul.c
userapps/opensource/sshd/libtommath/bn_mp_mul_2.c
userapps/opensource/sshd/libtommath/bn_mp_mul_2d.c
userapps/opensource/sshd/libtommath/bn_mp_mul_d.c
userapps/opensource/sshd/libtommath/bn_mp_mulmod.c
userapps/opensource/sshd/libtommath/bn_mp_n_root.c
userapps/opensource/sshd/libtommath/bn_mp_neg.c
userapps/opensource/sshd/libtommath/bn_mp_or.c
userapps/opensource/sshd/libtommath/bn_mp_prime_fermat.c
userapps/opensource/sshd/libtommath/bn_mp_prime_is_divisible.c
userapps/opensource/sshd/libtommath/bn_mp_prime_is_prime.c
userapps/opensource/sshd/libtommath/bn_mp_prime_miller_rabin.c
userapps/opensource/sshd/libtommath/bn_mp_prime_next_prime.c
userapps/opensource/sshd/libtommath/bn_mp_rand.c
userapps/opensource/sshd/libtommath/bn_mp_read_signed_bin.c
userapps/opensource/sshd/libtommath/bn_mp_read_unsigned_bin.c
userapps/opensource/sshd/libtommath/bn_mp_reduce.c
userapps/opensource/sshd/libtommath/bn_mp_reduce_2k.c
userapps/opensource/sshd/libtommath/bn_mp_reduce_2k_setup.c
userapps/opensource/sshd/libtommath/bn_mp_reduce_is_2k.c
userapps/opensource/sshd/libtommath/bn_mp_reduce_setup.c
userapps/opensource/sshd/libtommath/bn_mp_rshd.c
userapps/opensource/sshd/libtommath/bn_mp_set.c
userapps/opensource/sshd/libtommath/bn_mp_set_int.c
userapps/opensource/sshd/libtommath/bn_mp_shrink.c
userapps/opensource/sshd/libtommath/bn_mp_signed_bin_size.c
userapps/opensource/sshd/libtommath/bn_mp_sqr.c
userapps/opensource/sshd/libtommath/bn_mp_sqrmod.c
userapps/opensource/sshd/libtommath/bn_mp_sub.c
userapps/opensource/sshd/libtommath/bn_mp_sub_d.c
userapps/opensource/sshd/libtommath/bn_mp_submod.c
userapps/opensource/sshd/libtommath/bn_mp_to_signed_bin.c
userapps/opensource/sshd/libtommath/bn_mp_to_unsigned_bin.c
userapps/opensource/sshd/libtommath/bn_mp_toom_mul.c
userapps/opensource/sshd/libtommath/bn_mp_toom_sqr.c
userapps/opensource/sshd/libtommath/bn_mp_unsigned_bin_size.c
userapps/opensource/sshd/libtommath/bn_mp_xor.c
userapps/opensource/sshd/libtommath/bn_mp_zero.c
userapps/opensource/sshd/libtommath/bn_prime_tab.c
userapps/opensource/sshd/libtommath/bn_reverse.c
userapps/opensource/sshd/libtommath/bn_s_mp_add.c
userapps/opensource/sshd/libtommath/bn_s_mp_exptmod.c
userapps/opensource/sshd/libtommath/bn_s_mp_mul_digs.c
userapps/opensource/sshd/libtommath/bn_s_mp_mul_high_digs.c
userapps/opensource/sshd/libtommath/bn_s_mp_sqr.c
userapps/opensource/sshd/libtommath/bn_s_mp_sub.c
userapps/opensource/sshd/libtommath/bncore.c
userapps/opensource/sshd/libtommath/booker.pl
userapps/opensource/sshd/libtommath/changes.txt
userapps/opensource/sshd/libtommath/demo/demo.c
userapps/opensource/sshd/libtommath/etc/2kprime.1
userapps/opensource/sshd/libtommath/etc/2kprime.c
userapps/opensource/sshd/libtommath/etc/drprime.c
userapps/opensource/sshd/libtommath/etc/drprimes.txt
userapps/opensource/sshd/libtommath/etc/makefile
userapps/opensource/sshd/libtommath/etc/makefile.msvc
userapps/opensource/sshd/libtommath/etc/mersenne.c
userapps/opensource/sshd/libtommath/etc/mont.c
userapps/opensource/sshd/libtommath/etc/pprime.c
userapps/opensource/sshd/libtommath/etc/tune.c
userapps/opensource/sshd/libtommath/logs/add.log
userapps/opensource/sshd/libtommath/logs/addsub.png
userapps/opensource/sshd/libtommath/logs/expt.log
userapps/opensource/sshd/libtommath/logs/expt.png
userapps/opensource/sshd/libtommath/logs/expt_2k.log
userapps/opensource/sshd/libtommath/logs/expt_dr.log
userapps/opensource/sshd/libtommath/logs/graphs.dem
userapps/opensource/sshd/libtommath/logs/index.html
userapps/opensource/sshd/libtommath/logs/invmod.log
userapps/opensource/sshd/libtommath/logs/invmod.png
userapps/opensource/sshd/libtommath/logs/mult.log
userapps/opensource/sshd/libtommath/logs/mult.png
userapps/opensource/sshd/libtommath/logs/mult_kara.log
userapps/opensource/sshd/libtommath/logs/sqr.log
userapps/opensource/sshd/libtommath/logs/sqr_kara.log
userapps/opensource/sshd/libtommath/logs/sub.log
userapps/opensource/sshd/libtommath/makefile.bcc
userapps/opensource/sshd/libtommath/makefile.msvc
userapps/opensource/sshd/libtommath/mtest/logtab.h
userapps/opensource/sshd/libtommath/mtest/mpi-config.h
userapps/opensource/sshd/libtommath/mtest/mpi.c
userapps/opensource/sshd/libtommath/mtest/mpi.h
userapps/opensource/sshd/libtommath/mtest/mtest.c
userapps/opensource/sshd/libtommath/pics/makefile
userapps/opensource/sshd/libtommath/poster.tex
userapps/opensource/sshd/libtommath/pre_gen/mpi.c
userapps/opensource/sshd/libtommath/tommath.h
userapps/opensource/sshd/libtommath/tommath.src
userapps/opensource/sshd/loginrec.c
userapps/opensource/sshd/loginrec.h
userapps/opensource/sshd/options.h
userapps/opensource/sshd/packet.c
userapps/opensource/sshd/packet.h
userapps/opensource/sshd/queue.c
userapps/opensource/sshd/random.c
userapps/opensource/sshd/random.h
userapps/opensource/sshd/rsa.c
userapps/opensource/sshd/runopts.h
userapps/opensource/sshd/service.h
userapps/opensource/sshd/session.h
userapps/opensource/sshd/signkey.c
userapps/opensource/sshd/signkey.h
userapps/opensource/sshd/ssh.h
userapps/opensource/sshd/sshpty.c
userapps/opensource/sshd/termcodes.c
userapps/opensource/sshd/x11fwd.h
userapps/opensource/udhcp/Makefile
userapps/opensource/udhcp/dhcpc.c
userapps/opensource/udhcp/dhcpd.c
userapps/opensource/udhcp/dhcpd.h
userapps/opensource/udhcp/files.c
userapps/opensource/udhcp/files.h
userapps/opensource/udhcp/leases.h
version.make

index a28d476..1ab7837 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -41,6 +41,7 @@ DEFAULTCFG_DIR = $(TARGETS_DIR)/defaultcfg
 XCHANGE_DIR = $(BUILD_DIR)/xChange
 FSSRC_DIR = $(TARGETS_DIR)/fs.src
 CFE_FILE = $(TARGETS_DIR)/cfe/cfe$(BRCM_CHIP).bin
+SHARED_DIR = $(BUILD_DIR)/shared
 CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
           else if [ -x /bin/bash ]; then echo /bin/bash; \
           else echo sh; fi ; fi)
@@ -78,7 +79,7 @@ endif
 ifeq ($(strip $(BRCM_UCLIBC)),y)
 NTC=1
 ifeq ($(strip $(NTC)),1)
-TOOLCHAIN=/opt/toolchains/uclibc-crosstools
+TOOLCHAIN=/opt/toolchains/uclibc-crosstools_gcc-3.4.2_uclibc-20050502
 CROSS_COMPILE = $(TOOLCHAIN)/bin/mips-linux-uclibc-
 else
 TOOLCHAIN=/opt/toolchains/uclibc
@@ -128,12 +129,19 @@ INC_ADSLDRV_PATH=$(BRCMDRIVERS_DIR)/broadcom/char/adsl/impl1
 BROADCOM_CFM_DIR=$(BROADCOM_DIR)/cfm
 INC_BRCMCFM_PATH=$(BROADCOM_CFM_DIR)/inc
 VENDOR_COUNTRY = ALL
+INC_BRCMSHARED_INC_PATH=$(SHARED_DIR)/include
+INC_BRCMSHARED_SRC_PATH=$(SHARED_DIR)/src
 
 
 ifeq ($(strip $(BRCM_APP_PHONE)),sip)
 export VOXXXLOAD=1
 export VOIPLOAD=1
 export SIPLOAD=1
+
+ifeq ($(strip $(BRCM_VODSL_CONFIG_MANAGER)),y)
+       export BRCM_VODSL_CFGMGR=1
+endif
+
 BRCM_RELEASETAG := $(BRCM_RELEASETAG).sip
 endif
 
@@ -141,13 +149,24 @@ ifeq ($(strip $(BRCM_APP_PHONE)),mgcp)
 export VOXXXLOAD=1
 export VOIPLOAD=1
 export MGCPLOAD=1
+export BRCM_VODSL_CFGMGR=0
 BRCM_RELEASETAG := $(BRCM_RELEASETAG).mgcp
 endif
 
+ifeq ($(strip $(BRCM_PROFILER_ENABLED)),y)
+export BRCM_PROFILER_TOOL=1
+else
+export BRCM_PROFILER_TOOL=0
+endif
+
 ifneq ($(strip $(BUILD_VODSL)),)
 export VOXXXLOAD=1
 endif
 
+ifeq ($(strip $(BRCM_VODSL_STUNC)),y)
+       export BRCM_VODSL_STUN_CLIENT=1
+endif
+
 BRCM_DSP_HAL := gw
 BRCM_DSP_HAL_EXTENSION :=
 XCHANGE_DSP_APP_EXTENSION :=
@@ -158,22 +177,14 @@ XCHANGE_DSP_APP := dspApp3341_tdm
 BRCM_DSP_HAL_EXTENSION := _pcm
 endif
 
-ifeq ($(strip $(BRCM_DSP_HYBRID)),y)
-XCHANGE_DSP_APP := dspApp3341_hybrid
-BRCM_DSP_HAL_EXTENSION := _hybrid
-endif
-
-ifeq ($(strip $(BRCM_DSP_HYBRID_EXT)),y)
-BRCM_DSP_HAL_EXTENSION := _hybrid
-XCHANGE_DSP_APP := dspApp3341_hybrid
-XCHANGE_DSP_APP_EXTENSION := _ext
+ifeq ($(strip $(BRCM_DSP_PCM_G726)),y)
+XCHANGE_DSP_APP := dspApp3341_tdm_g726
+BRCM_DSP_HAL_EXTENSION := _pcm
 endif
 
-# APM application with FXO uses the hybrid HAL, as the FXO is provided by TDM port
-ifeq ($(strip $(BRCM_DSP_APM_FXO)),y)
-XCHANGE_DSP_APP := dspApp3341
-BRCM_DSP_HAL_EXTENSION := _hybrid
-XCHANGE_DSP_APP_EXTENSION := _fxo
+ifeq ($(strip $(BRCM_DSP_PCM_T38_EXT)),y)
+XCHANGE_DSP_APP := dspApp3341_tdm_t38
+BRCM_DSP_HAL_EXTENSION := _pcm
 endif
 
 ifeq ($(strip $(BRCM_DSP_APM_FXO_EXT)),y)
@@ -182,18 +193,94 @@ BRCM_DSP_HAL_EXTENSION := _hybrid
 XCHANGE_DSP_APP_EXTENSION := _fxo_ext
 endif
 
-ifeq ($(strip $(BRCM_DSP_HYBRID_FXO)),y)
-XCHANGE_DSP_APP := dspApp3341_hybrid
-BRCM_DSP_HAL_EXTENSION := _hybrid
-XCHANGE_DSP_APP_EXTENSION := _fxo
+#
+#  Warning here, we do re-assign some of the variables defined earlier:
+#  BRCM_DSP_HAL and BRCM_DSP_HAL_EXTENSION for example, in order to pickup
+#  the correct board HAL application.
+#
+ifeq ($(strip $(BRCM_DSP_FXO)),y)
+ifeq ($(strip $(BRCM_SLIC_LE9502)),y)
+export XCHANGE_BUILD_APP=Bcm$(BRCM_CHIP)_Le9502FXO
+BRCM_RELEASETAG := $(BRCM_RELEASETAG)._LE9502
+BRCM_DSP_HAL := _Le9502FXO
+BRCM_DSP_HAL_EXTENSION :=
+export BRCM_SLIC_LE9502
+else
+ifeq ($(strip $(BRCM_SLIC_LE9500)),y)
+export XCHANGE_BUILD_APP=Bcm$(BRCM_CHIP)_Le9500FXO
+BRCM_RELEASETAG := $(BRCM_RELEASETAG)._LE9500
+BRCM_DSP_HAL := _Le9500FXO
+BRCM_DSP_HAL_EXTENSION :=
+export BRCM_SLIC_LE9500
+endif
+endif
 endif
 
-ifeq ($(strip $(BRCM_DSP_HYBRID_FXO_EXT)),y)
-XCHANGE_DSP_APP := dspApp3341_hybrid
-BRCM_DSP_HAL_EXTENSION := _fxo
-XCHANGE_DSP_APP_EXTENSION := _fxo_ext
+
+#
+# DSP codec flags definition.  To be used throughout the application (for configuration and vodsl)
+#
+
+BRCM_DSP_CODEC_DEFINES := -DXCFG_G711_SUPPORT=1
+
+ifeq ($(strip $(BRCM_DSP_CODEC_G723)),y)
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G7231_SUPPORT=1
+endif
+
+ifeq ($(strip $(BRCM_DSP_CODEC_G726)),y)
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G726_SUPPORT=1
+endif
+
+ifeq ($(strip $(BRCM_DSP_CODEC_G729)),y)
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G729_SUPPORT=1
+endif
+
+ifeq ($(strip $(BRCM_DSP_CODEC_G7xx)),y)
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G7231_SUPPORT=1
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G726_SUPPORT=1
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G729_SUPPORT=1
+endif
+
+ifeq ($(strip $(BRCM_DSP_PCM)),y)
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G729_SUPPORT=1
+endif
+
+ifeq ($(strip $(BRCM_DSP_PCM_G726)),y)
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G726_SUPPORT=1
+BRCM_DSP_CODEC_DEFINES += -DXCFG_FAX_SUPPORT=1
+endif
+
+ifeq ($(strip $(BRCM_DSP_PCM_T38_EXT)),y)
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G729_SUPPORT=1
+BRCM_DSP_CODEC_DEFINES += -DXCFG_FAX_SUPPORT=1
+endif
+
+ifeq ($(strip $(BRCM_DSP_CODEC_T38_EXT)),y)
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G726_SUPPORT=1
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G729_SUPPORT=1
+BRCM_DSP_CODEC_DEFINES += -DXCFG_FAX_SUPPORT=1
+endif
+
+ifeq ($(strip $(BRCM_DSP_APM_FXO_EXT)),y)
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G729_SUPPORT=1
+BRCM_DSP_CODEC_DEFINES += -DXCFG_G726_SUPPORT=1
+BRCM_DSP_CODEC_DEFINES += -DXCFG_FAX_SUPPORT=1
+endif
+
+
+#
+#  Definition of the number of voice channels supported based on the specific
+#  application being created.
+#
+
+ifeq ($(strip $(BRCM_DSP_APM_FXO_EXT)), y)
+BRCM_DSP_CHAN_DEFINES = -DNUM_APM_VOICE_CHANNELS=2 -DNUM_TDM_VOICE_CHANNELS=0 -DNUM_FXO_CHANNELS=1
+else
+BRCM_DSP_CHAN_DEFINES = -DNUM_APM_VOICE_CHANNELS=0 -DNUM_TDM_VOICE_CHANNELS=0 -DNUM_FXO_CHANNELS=0
 endif
 
+export BRCM_DSP_CODEC_DEFINES
+export BRCM_DSP_CHAN_DEFINES
 export BRCM_DSP_FXO
 export XCHANGE_BUILD_APP=Bcm$(BRCM_CHIP)$(BRCM_DSP_HAL)$(BRCM_DSP_HAL_EXTENSION)
 export XCHANGE_DSP_APP_EXTENSION
@@ -210,21 +297,18 @@ export XCHANGE_DSP_APP=g711
 BRCM_RELEASETAG := $(BRCM_RELEASETAG).g711
 endif
 endif
-                                                                                
-ifeq ($(strip $(XCHG_LE9502_SLIC)),y)
-ifeq ($(strip $(BRCM_DSP_FXO)),y)
-export XCHANGE_BUILD_APP=Bcm$(BRCM_CHIP)_Le9502FXO
-BRCM_RELEASETAG := $(BRCM_RELEASETAG)._LE9502
-BRCM_DSP_HAL := LE9502_FXO
-else
-export XCHANGE_BUILD_APP=Bcm$(BRCM_CHIP)_Le9502
-BRCM_RELEASETAG := $(BRCM_RELEASETAG)._LE9502
-BRCM_DSP_HAL := LE9502
+
+ifeq ($(strip $(BRCM_MIPS_ONLY_BUILD)),y)
+export XCHANGE_BUILD_APP=Bcm$(BRCM_CHIP)lv
+BRCM_DSP_HAL := lv
+BRCM_DSP_HAL_EXTENSION :=
+XCHANGE_DSP_APP_EXTENSION=
 endif
-export XCHG_LE9502_SLIC
+
+ifeq ($(strip $(BRCM_VODSL_DUAL_3341)),y)
+BRCM_RELEASETAG := $(BRCM_RELEASETAG).dual3341
 endif
-                                                                                
-                                                                                
+
 #Set up ADSL standard
 export ADSL=$(BRCM_ADSL_STANDARD)
 
@@ -241,13 +325,16 @@ export ADSL_SELF_TEST=$(BRCM_ADSL_SELF_TEST)
 ###########################################
 export OPENSOURCE_DIR=$(USERAPPS_DIR)/opensource
 SUBDIRS_OPENSOURCE = $(OPENSOURCE_DIR)/atm2684/pvc2684ctl \
+        $(OPENSOURCE_DIR)/openssl \
+        $(OPENSOURCE_DIR)/ipsec-tools \
         $(OPENSOURCE_DIR)/bridge-utils \
         $(OPENSOURCE_DIR)/ppp/pppoe \
         $(OPENSOURCE_DIR)/udhcp \
         $(OPENSOURCE_DIR)/iptables \
         $(OPENSOURCE_DIR)/ebtables \
         $(OPENSOURCE_DIR)/reaim  \
-        $(OPENSOURCE_DIR)/gdbserver  \
+        $(OPENSOURCE_DIR)/iproute2  \
+        $(OPENSOURCE_DIR)/libosip2 \
         $(OPENSOURCE_DIR)/siproxd \
         $(OPENSOURCE_DIR)/zebra  \
         $(OPENSOURCE_DIR)/net-snmp  \
@@ -277,21 +364,27 @@ SUBDIRS_BROADCOM = $(BROADCOM_DIR)/nvram \
        $(BROADCOM_DIR)/ethctl \
         $(BROADCOM_DIR)/hotplug \
         $(BROADCOM_DIR)/epittcp \
-        $(BROADCOM_DIR)/ses 
+        $(BROADCOM_DIR)/snmp \
+        $(BROADCOM_DIR)/tr69c \
+        $(BROADCOM_DIR)/ses
 
 SUBDIRS_APP = $(SUBDIRS_BROADCOM) $(SUBDIRS_OPENSOURCE)
 SUBDIRS = $(foreach dir, $(SUBDIRS_APP), $(shell if [ -d "$(dir)" ]; then echo $(dir); fi))
 
-OPENSOURCE_APPS = pvc2684ctl pvc2684d brctl pppd udhcp iptables ebtables \
-                  reaim siproxd snmp zebra bftpd busybox gdbserver
+OPENSOURCE_APPS = ipsec-tools pvc2684ctl pvc2684d brctl pppd udhcp iptables ebtables \
+                  reaim tc libosip2 siproxd snmp zebra bftpd busybox 
 
 BROADCOM_APPS = nvram cfm upnp nas wlctl vodsl atmctl adslctl netctl dnsprobe \
-                igmp dhcpr diagapp sntp ddnsd ilmi ippd hotplug ethctl epittcp ses
+                igmp dhcpr diagapp sntp ddnsd ilmi ippd hotplug ethctl epittcp snmp ses
 LIBC_OPTIMIZATION = libcreduction
 
+ifneq ($(strip $(BUILD_GDBSERVER)),)
+TOOLCHAIN_UTIL_APPS = gdbserver
+endif
+
 BUSYBOX_DIR = $(OPENSOURCE_DIR)/busybox
 
-BRCMAPPS = $(BROADCOM_APPS) $(OPENSOURCE_APPS) $(LIBC_OPTIMIZATION)
+BRCMAPPS = openssl $(BROADCOM_APPS) $(OPENSOURCE_APPS) $(TOOLCHAIN_UTIL_APPS) $(LIBC_OPTIMIZATION)
 
 all: sanity_check profile_check kernelbuild modbuild app hosttools buildimage
 
@@ -353,11 +446,15 @@ endif
 
 modules: profile_check modbuild hosttools buildimage
 
-app: profile_check prebuild $(BRCMAPPS) hosttools buildimage
+app: profile_check prebuild $(BRCMAPPS) hosttools rm_cvs buildimage 
 
 prebuild:
        mkdir -p $(INSTALL_DIR)/bin $(INSTALL_DIR)/lib
 
+rm_cvs:
+       @echo "Removing CVS info"
+       find $(INSTALL_DIR) -name 'CVS' -print -exec rm -rf "{}" ";"
+
 # touch_voice_files doesn't clean up voice, just enables incremental build of voice code
 touch_voice_files:
        find bcmdrivers/broadcom/char/endpoint/ \( -name '*.o' -o -name '*.a' -o -name '*.lib' -o -name '*.ko' -o -name '*.cmd' -o -name '.*.cmd' -o -name '*.c' -o -name '*.mod' \) -print -exec rm -f "{}" ";"
@@ -444,9 +541,18 @@ else
 reaim:
 endif
 
+ifneq ($(strip $(BRCM_KERNEL_NETQOS)),)
+tc:
+       cd $(OPENSOURCE_DIR);   (tar xkfj iproute2.tar.bz2 2> /dev/null || true)
+       $(MAKE) -C $(OPENSOURCE_DIR)/iproute2 dynamic
+else
+tc:
+endif
+
 ifneq ($(strip $(BUILD_GDBSERVER)),)
 gdbserver:
-       $(MAKE) -C $(OPENSOURCE_DIR)/gdbserver dynamic
+       install -m 755 $(TOOLCHAIN)/mips-linux-uclibc/target-apps/usr/bin/gdbserver $(INSTALL_DIR)/bin
+       $(STRIP) $(INSTALL_DIR)/bin/gdbserver
 else
 gdbserver:
 endif
@@ -475,14 +581,35 @@ upnp:
        @echo Warning: You need to build iptables first !!!!!
 endif
 
+ifneq ($(strip $(BUILD_IPSEC_TOOLS)),)
+ipsec-tools:
+       cd $(OPENSOURCE_DIR);   (tar xkfj ipsec-tools.tar.bz2 2> /dev/null || true)
+       $(MAKE) -C $(OPENSOURCE_DIR)/ipsec-tools $(BUILD_IPSEC_TOOLS)
+else
+ipsec-tools:
+endif
+
+ifneq ($(strip $(BUILD_CERT)),)
+openssl:
+       cd $(OPENSOURCE_DIR);   (tar xkfj openssl.tar.bz2 2> /dev/null || true)
+       $(MAKE) -C $(OPENSOURCE_DIR)/openssl dynamic
+else
+openssl:
+endif
+
 
 ifneq ($(strip $(BUILD_SIPROXD)),)
 siproxd:
-       cd $(OPENSOURCE_DIR);   (tar xkfj libosip2.tar.bz2 2> /dev/null || true)
        cd $(OPENSOURCE_DIR);   (tar xkfj siproxd.tar.bz2 2> /dev/null || true)
        $(MAKE) -C $(OPENSOURCE_DIR)/siproxd $(BUILD_SIPROXD)
+libosip2:
+       cd $(OPENSOURCE_DIR);   (tar xkfj libosip2.tar.bz2 2> /dev/null || true)
+       $(MAKE) -C $(OPENSOURCE_DIR)/libosip2
 else
 siproxd:
+
+libosip2:
+
 endif
 
 ifneq ($(strip $(BUILD_SNMP)),)
@@ -553,9 +680,49 @@ else
 export BUILD_SNMP_ATMFORUM_MIB=0
 endif
 
+ifneq ($(strip $(BRCM_SNMP)),)
+
+ifneq ($(strip $(BUILD_SNMP_CHINA_TELECOM_CPE_MIB)),)
+export BUILD_SNMP_CHINA_TELECOM_CPE_MIB=y
+export BUILD_SNMP_MIB2=y
+endif
+
+ifneq ($(strip $(BUILD_SNMP_UDP)),)
+export BUILD_SNMP_UDP=y
+endif
+
+ifneq ($(strip $(BUILD_SNMP_EOC)),)
+export BUILD_SNMP_EOC=y
+endif
+
+ifneq ($(strip $(BUILD_SNMP_AAL5)),)
+export BUILD_SNMP_AAL5=y
+endif
+
+ifneq ($(strip $(BUILD_SNMP_AUTO)),)
+export BUILD_SNMP_AUTO=y
+endif
+
+ifneq ($(strip $(BUILD_SNMP_DEBUG)),)
+export BUILD_SNMP_DEBUG=y
+endif
+
+ifneq ($(strip $(BUILD_SNMP_TRANSPORT_DEBUG)),)
+export BUILD_SNMP_TRANSPORT_DEBUG=y
+endif
+
+ifneq ($(strip $(BUILD_SNMP_LAYER_DEBUG)),)
+export BUILD_SNMP_LAYER_DEBUG=y
+endif
+endif
+
 snmp:
+ifneq ($(strip $(BRCM_SNMP)),)
+##     $(MAKE) -C $(BROADCOM_DIR)/snmp $(BUILD_SNMP)
+else
        cd $(OPENSOURCE_DIR);   (tar xkfj net-snmp.tar.bz2 2> /dev/null || true)
        $(MAKE) -C $(OPENSOURCE_DIR)/net-snmp $(BUILD_SNMP)
+endif
 else
 snmp:
 endif
@@ -596,7 +763,7 @@ nas:
 #add hotplug here, for nas use only
 hotplug:
        $(MAKE) -C $(BROADCOM_DIR)/hotplug $(BUILD_NAS)
-       
+
 else
 export WIRELESS=0
 nas:
@@ -746,6 +913,12 @@ else
 ippd:
 endif
 
+ifneq ($(strip $(BUILD_PORT_MIRRORING)),)
+export BUILD_PORT_MIRRORING=1
+else
+export BUILD_PORT_MIRRORING=0
+endif
+
 hosttools:
        $(MAKE) -C $(HOSTTOOLS_DIR)
 
@@ -797,8 +970,8 @@ endif
 #
 # System code clean-up
 #
-###########################################    
-       
+###########################################
+
 subdirs: $(patsubst %, _dir_%, $(SUBDIRS))
 
 $(patsubst %, _dir_%, $(SUBDIRS)) :
@@ -844,23 +1017,140 @@ target_clean: sanity_check
 
 hosttools_clean:
        $(MAKE) -C $(HOSTTOOLS_DIR) clean
-       
+
 ###########################################
 #
 # System-wide exported variables
+# (in alphabetical order)
 #
-###########################################    
-
-export  BRCM_VERSION BRCM_RELEASE BRCM_EXTRAVERSION BRCM_RELEASETAG BRCM_BOARD RUN_NOISE \
-       INC_KERNEL_BASE KERNEL_DIR BRCMDRIVERS_DIR USERAPPS_DIR HOSTTOOLS_DIR TARGETS_DIR DEFAULTCFG_DIR XCHANGE_DIR FSSRC_DIR BUSYBOX_DIR \
-       PROFILE_DIR INSTALL_DIR LINUXDIR INC_BRCMDRIVER_PUB_PATH INC_BRCMDRIVER_PRIV_PATH INC_BRCMBOARDPARMS_PATH INC_ENDPOINT_PATH INC_ADSLDRV_PATH BROADCOM_CFM_DIR INC_BRCMCFM_PATH BRCM_KERNEL_ROOTFS BRCMAPPS \
-       BRCM_UCLIBC CROSS_COMPILE TOOLCHAIN AS LD CC CXX AR NM STRIP SSTRIP OBJCOPY OBJDUMP RANLIB LIB_PATH LIBCDIR LIBDIR  \
-       BUILD_BR2684CTL BUILD_PVC2684CTL BUILD_RT2684D BUILD_BRCTL BUILD_CFM BUILD_CFM_CLI BUILD_IPTABLES BUILD_EBTABLES BUILD_VODSL BUILD_SIPROXD \
-       BRCM_APP_PHONE BUILD_SOAP BUILD_SOAP_VER BRCM_DSP_CODEC_G711 BRCM_DSP_CODEC_G723 BRCM_DSP_CODEC_G726 BRCM_DSP_CODEC_G729 \
-   BRCM_DSP_CODEC_G7xx BRCM_DSP_PCM BRCM_DSP_HYBRID BRCM_DSP_HYBRID_EXT BRCM_DSP_APM_FXO BRCM_DSP_APM_FXO_EXT BRCM_DSP_HYBRID_FXO \
-   BRCM_DSP_HYBRID_FXO_EXT BRCM_DSP_CODEC_T38_EXT BRCM_DSP_CODEC_T38_INT BRCM_DSP_HAL BRCM_DSP_HAL_EXTENSION  XCHANGE_DSP_APP_EXTENSION BRCM_VOICE_COUNTRY_JAPAN BRCM_VOICE_GLOBAL_CFLAGS \
-       BUILD_PPPD BUILD_REAIM BUILD_GDBSERVER BUILD_UDHCP BUILD_DHCPR BUILD_UPNP BUILD_SNMP BUILD_NAS BUILD_WLCTL BUILD_BUSYBOX BUILD_DNSPROBE BUILD_SLACTEST BUILD_VCONFIG BUILD_ETHWAN \
-       BUILD_ZEBRA BUILD_ATMCTL BUILD_ADSLCTL BUILD_NETCTL BUILD_IGMP BRCM_PTHREADS BUILD_DIAGAPP \
-       BUILD_CFM_TELNETD BUILD_CFM_SSHD BUILD_SSHD_MIPS_GENKEY BUILD_FTPD BRCM_DRIVER_PCI \
-       BRCM_PSI_VERSION WEB_POPUP BUILD_DIR BUILD_DDNSD BUILD_SNTP BUILD_TOD BUILD_IPPD BUILD_VCONFIG JTAG_KERNEL_DEBUG \
-       BUILD_EPITTCP BUILD_NVRAM BUILD_SES
+###########################################
+
+export \
+AR                         \
+AS                         \
+BRCM_APP_PHONE             \
+BRCMAPPS                   \
+BRCM_BOARD                 \
+BRCM_DRIVER_PCI            \
+BRCMDRIVERS_DIR            \
+BRCM_DSP_APM_FXO           \
+BRCM_DSP_APM_FXO_EXT       \
+BRCM_DSP_CODEC_G711        \
+BRCM_DSP_CODEC_G723        \
+BRCM_DSP_CODEC_G726        \
+BRCM_DSP_CODEC_G729        \
+BRCM_DSP_CODEC_G7xx        \
+BRCM_DSP_CODEC_T38_EXT     \
+BRCM_DSP_CODEC_T38_INT     \
+BRCM_DSP_HAL               \
+BRCM_DSP_HAL_EXTENSION     \
+BRCM_DSP_PCM               \
+BRCM_DSP_PCM_G726          \
+BRCM_DSP_PCM_T38_EXT       \
+BRCM_EXTRAVERSION          \
+BRCM_KERNEL_NETQOS         \
+BRCM_KERNEL_ROOTFS         \
+BRCM_LDX_APP               \
+BRCM_MIPS_ONLY_BUILD       \
+BRCM_MIPS_ONLY_BUILD       \
+BRCM_PSI_VERSION           \
+BRCM_PTHREADS              \
+BRCM_RELEASE               \
+BRCM_RELEASETAG            \
+BRCM_SNMP                  \
+BRCM_UCLIBC                \
+BRCM_VERSION               \
+BRCM_VODSL_DUAL_3341       \
+BRCM_VOICE_COUNTRY_JAPAN   \
+BRCM_VOICE_GLOBAL_CFLAGS   \
+BROADCOM_CFM_DIR           \
+BUILD_ADSLCTL              \
+BUILD_ATMCTL               \
+BUILD_BR2684CTL            \
+BUILD_BRCM_VLAN            \
+BUILD_BRCTL                \
+BUILD_BUSYBOX              \
+BUILD_CERT                 \
+BUILD_CFM                  \
+BUILD_CFM_CLI              \
+BUILD_CFM_SSHD             \
+BUILD_CFM_TELNETD          \
+BUILD_DDNSD                \
+BUILD_DHCPR                \
+BUILD_DIAGAPP              \
+BUILD_DIR                  \
+BUILD_DNSPROBE             \
+BUILD_EBTABLES             \
+BUILD_EPITTCP              \
+BUILD_ETHWAN               \
+BUILD_FTPD                 \
+BUILD_GDBSERVER            \
+BUILD_IGMP                 \
+BUILD_IPPD                 \
+BUILD_IPSEC_TOOLS          \
+BUILD_IPTABLES             \
+BUILD_NAS                  \
+BUILD_NETCTL               \
+BUILD_NVRAM                \
+BUILD_PORT_MIRRORING                    \
+BUILD_PPPD                 \
+BUILD_PVC2684CTL           \
+BUILD_REAIM                \
+BUILD_RT2684D              \
+BUILD_SES                  \
+BUILD_SIPROXD              \
+BUILD_SLACTEST             \
+BUILD_SNMP                 \
+BUILD_SNTP                 \
+BUILD_SOAP                 \
+BUILD_SOAP_VER             \
+BUILD_SSHD_MIPS_GENKEY     \
+BUILD_TOD                  \
+BUILD_TR69C                \
+BUILD_TR69C_SSL            \
+BUILD_UDHCP                \
+BUILD_UPNP                 \
+BUILD_VCONFIG              \
+BUILD_VCONFIG              \
+BUILD_VODSL                \
+BUILD_WLCTL                \
+BUILD_ZEBRA                \
+BUSYBOX_DIR                \
+CC                         \
+CROSS_COMPILE              \
+CXX                        \
+DEFAULTCFG_DIR             \
+FSSRC_DIR                  \
+HOSTTOOLS_DIR              \
+INC_ADSLDRV_PATH           \
+INC_BRCMBOARDPARMS_PATH    \
+INC_BRCMCFM_PATH           \
+INC_BRCMDRIVER_PRIV_PATH   \
+INC_BRCMDRIVER_PUB_PATH    \
+INC_BRCMSHARED_INC_PATH    \
+INC_BRCMSHARED_SRC_PATH    \
+INC_ENDPOINT_PATH          \
+INC_KERNEL_BASE            \
+INSTALL_DIR                \
+JTAG_KERNEL_DEBUG          \
+KERNEL_DIR                 \
+LD                         \
+LIBCDIR                    \
+LIBDIR                     \
+LIB_PATH                   \
+LINUXDIR                   \
+NM                         \
+OBJCOPY                    \
+OBJDUMP                    \
+PROFILE_DIR                \
+RANLIB                     \
+RUN_NOISE                  \
+SSTRIP                     \
+STRIP                      \
+TARGETS_DIR                \
+TOOLCHAIN                  \
+USERAPPS_DIR               \
+WEB_POPUP                  \
+XCHANGE_DIR                \
+XCHANGE_DSP_APP_EXTENSION
+
index b94c121..369ebc7 100755 (executable)
@@ -2,15 +2,95 @@
 #
 # Makefile for the Linux kernel modules.
 #
+
+LN_NAME=bcm9$(BRCM_CHIP)
+LN_DRIVER_DIRS =
+
 -include $(KERNEL_DIR)/.config
 
-obj-y += opensource/
+ifneq ($(CONFIG_BCM_BOARD),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_BOARD_IMPL) opensource/char/board/$(BRCM_BOARD)/$(LN_NAME);
+obj-$(CONFIG_BCM_BOARD) += opensource/char/board/$(BRCM_BOARD)/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_SERIAL),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_SERIAL_IMPL) opensource/char/serial/$(LN_NAME);
+obj-$(CONFIG_BCM_SERIAL) += opensource/char/serial/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_ATMAPI),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_BLAA_IMPL) broadcom/atm/$(LN_NAME);
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_ATMAPI_IMPL) broadcom/char/atmapi/$(LN_NAME);
+  obj-$(CONFIG_BCM_ATMAPI) += broadcom/atm/$(LN_NAME)/
+  obj-$(CONFIG_BCM_ATMAPI) += broadcom/char/atmapi/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_ADSL),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_ADSL_IMPL) broadcom/char/adsl/$(LN_NAME);
+  obj-$(CONFIG_BCM_ADSL) += broadcom/char/adsl/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_PROCFS),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_PROCFS_IMPL) broadcom/char/bcmprocfs/$(LN_NAME);
+  obj-$(CONFIG_BCM_PROCFS) += broadcom/char/bcmprocfs/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_ENDPOINT),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_ENDPOINT_IMPL) broadcom/char/endpoint/$(LN_NAME);
+  obj-$(CONFIG_BCM_ENDPOINT) += broadcom/char/endpoint/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_BCMPROF),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_BCMPROF_IMPL) broadcom/char/profiler/$(LN_NAME);
+  obj-$(CONFIG_BCM_BCMPROF) += broadcom/char/profiler/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_SECURITY),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_SECURITY_IMPL) broadcom/char/smdrv/$(LN_NAME);
+  obj-$(CONFIG_BCM_SECURITY) += broadcom/char/smdrv/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_VDSL),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_VDSL_IMPL) broadcom/char/vdsl/$(LN_NAME);
+  obj-$(CONFIG_BCM_VDSL) += broadcom/char/vdsl/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_ATMTEST),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_ATMTEST_IMPL) broadcom/char/test/atm/$(LN_NAME);
+  obj-$(CONFIG_BCM_ATMTEST) += broadcom/char/test/atm/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_ENET),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_ENET_IMPL) broadcom/net/enet/$(LN_NAME);
+  obj-$(CONFIG_BCM_ENET) += broadcom/net/enet/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_USB),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_USB_IMPL) broadcom/net/usb/$(LN_NAME);
+  obj-$(CONFIG_BCM_USB) += broadcom/net/usb/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_WLAN),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_WLAN_IMPL) broadcom/net/wl/$(LN_NAME);
+  obj-$(CONFIG_BCM_WLAN) += broadcom/net/wl/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_HPNA),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_HPNA_IMPL) broadcom/net/hpna/$(LN_NAME);
+  obj-$(CONFIG_BCM_HPNA) += broadcom/net/hpna/$(LN_NAME)/
+endif
+
+ifneq ($(CONFIG_BCM_NETDEVTEST),)
+  LN_DRIVER_DIRS +=ln -sn impl$(CONFIG_BCM_NETDEVTEST_IMPL) broadcom/net/test/$(LN_NAME);
+  obj-$(CONFIG_BCM_NETDEVTEST) += broadcom/net/test/$(LN_NAME)/
+endif
 
-# If rootfs is nfs, we have to build Ethernet
-# driver as built-n
-ifeq ($(CONFIG_ROOTFS_NFS),y)
-obj-y += broadcom/
+ifneq ($(CONFIG_BCM_WLAN),)
+ IMPL_NAME=bcm9$(BRCM_CHIP)
+ obj-y += broadcom/net/wl/$(IMPL_NAME)/shared/
 endif
 
-obj-m += broadcom/
+symlinks:
+       find . -lname "*" -name "$(LN_NAME)" -print -exec rm -f "{}" ";"
+       $(CONFIG_SHELL) -c "$(LN_DRIVER_DIRS)"
 
index f000a43..e489103 100644 (file)
@@ -1,8 +1,8 @@
-obj-$(CONFIG_BCM_ATMAPI) += blaadd.o
+obj-$(CONFIG_BCM_ATMAPI) += blaa_dd.o
 
-blaadd-objs += blaadd_dep.o
+blaa_dd-objs += blaa_dd_dep.o
 
-$(obj)/blaadd_dep.o:
-       cp $(obj)/blaadd$(PROFILE).o_save $(obj)/blaadd_dep.o
+$(obj)/blaa_dd_dep.o:
+       cp $(obj)/blaa_dd$(PROFILE).o_save $(obj)/blaa_dd_dep.o
 
 
index 584cb7f..fd4ed81 100644 (file)
Binary files a/bcmdrivers/broadcom/char/adsl/impl1/adsl_phy96348R.bin_save and b/bcmdrivers/broadcom/char/adsl/impl1/adsl_phy96348R.bin_save differ
index 0deb848..fafad10 100644 (file)
Binary files a/bcmdrivers/broadcom/char/adsl/impl1/adsl_phy96348RB.bin_save and b/bcmdrivers/broadcom/char/adsl/impl1/adsl_phy96348RB.bin_save differ
index bf4082b..450150a 100644 (file)
Binary files a/bcmdrivers/broadcom/char/adsl/impl1/adsldd96348R.o_save and b/bcmdrivers/broadcom/char/adsl/impl1/adsldd96348R.o_save differ
index 3224ab6..54ef0bb 100644 (file)
Binary files a/bcmdrivers/broadcom/char/adsl/impl1/adsldd96348RB.o_save and b/bcmdrivers/broadcom/char/adsl/impl1/adsldd96348RB.o_save differ
index 4e6b22c..c225b9e 100644 (file)
Binary files a/bcmdrivers/broadcom/char/atmapi/impl1/atmapi96348R.o_save and b/bcmdrivers/broadcom/char/atmapi/impl1/atmapi96348R.o_save differ
index 4e6b22c..c225b9e 100644 (file)
Binary files a/bcmdrivers/broadcom/char/atmapi/impl1/atmapi96348RB.o_save and b/bcmdrivers/broadcom/char/atmapi/impl1/atmapi96348RB.o_save differ
index 4a09ffa..0ae7d7a 100644 (file)
Binary files a/bcmdrivers/broadcom/char/bcmprocfs/impl1/bcmprocfs96348R.o_save and b/bcmdrivers/broadcom/char/bcmprocfs/impl1/bcmprocfs96348R.o_save differ
index 4a09ffa..0ae7d7a 100644 (file)
Binary files a/bcmdrivers/broadcom/char/bcmprocfs/impl1/bcmprocfs96348RB.o_save and b/bcmdrivers/broadcom/char/bcmprocfs/impl1/bcmprocfs96348RB.o_save differ
index 4f503d7..e6048f0 100755 (executable)
  * Copyright (c) 1993-1998 AltoCom, Inc. All rights reserved.
  * Authors: Ilya Stomakhin
  *
- * $Revision: 1.17 $
+ * $Revision: 1.19 $
  *
- * $Id: AdslMibDef.h,v 1.17 2004/07/27 19:24:40 ilyas Exp $
+ * $Id: AdslMibDef.h,v 1.19 2005/08/11 15:08:38 ilyas Exp $
  *
  * $Log: AdslMibDef.h,v $
+ * Revision 1.19  2005/08/11 15:08:38  ilyas
+ * Added string scrambling checking and AnnexL/M submodes display
+ *
+ * Revision 1.18  2005/04/01 21:57:42  ilyas
+ * Added definition for PwmClock (ADSL driver)
+ *
  * Revision 1.17  2004/07/27 19:24:40  ilyas
  * Added AnnexM configuration option
  *
@@ -168,6 +174,32 @@ extern "C" {
 #define kAdsl2CfgReachExOn                                     0x00000001
 #define kAdsl2CfgAnnexMEnabled                         0x00000002
 
+#define kAdsl2CfgAnnexMPsdShift                                2
+#define kAdsl2CfgAnnexMPsdBits                         12
+#define kAdsl2CfgAnnexMPsdMask                         (0xFFF << kAdsl2CfgAnnexMPsdShift)
+
+#if (((1 << kAdsl2CfgAnnexMPsdBits) - 1) != (kAdsl2CfgAnnexMPsdMask >> kAdsl2CfgAnnexMPsdShift))
+#error Inconsistent kAdsl2CfgAnnexM definitions
+#endif
+
+#define kAdsl2CfgAnnexMUp32                 (0x00000001 << kAdsl2CfgAnnexMPsdShift)
+#define kAdsl2CfgAnnexMUp36                 (0x00000002 << kAdsl2CfgAnnexMPsdShift) 
+#define kAdsl2CfgAnnexMUp40                 (0x00000004 << kAdsl2CfgAnnexMPsdShift) 
+#define kAdsl2CfgAnnexMUp44                 (0x00000008 << kAdsl2CfgAnnexMPsdShift)
+#define kAdsl2CfgAnnexMUp48                 (0x00000010 << kAdsl2CfgAnnexMPsdShift)
+#define kAdsl2CfgAnnexMUp52                 (0x00000020 << kAdsl2CfgAnnexMPsdShift)
+#define kAdsl2CfgAnnexMUp56                 (0x00000040 << kAdsl2CfgAnnexMPsdShift)
+#define kAdsl2CfgAnnexMUp60                 (0x00000080 << kAdsl2CfgAnnexMPsdShift)
+#define kAdsl2CfgAnnexMUp64                 (0x00000100 << kAdsl2CfgAnnexMPsdShift)
+#define kAdsl2CfgAnnexMCustomPsd            (0x00000200 << kAdsl2CfgAnnexMPsdShift)
+
+#define kAdsl2CfgAnnexLShift                           (2 + kAdsl2CfgAnnexMPsdBits)
+#define kAdsl2CfgAnnexLMask                                    (0x7 << kAdsl2CfgAnnexLShift)
+
+#define kAdsl2CfgAnnexLUpWide               (0x00000001 << kAdsl2CfgAnnexLShift)
+#define kAdsl2CfgAnnexLUpNarrow             (0x00000002 << kAdsl2CfgAnnexLShift)
+#define kAdsl2CfgAnnexLDnOvlap                         (0x00000004 << kAdsl2CfgAnnexLShift)
+
 typedef struct _adslCfgProfile {
        long            adslAnnexCParam;
        long            adslAnnexAParam;
@@ -178,6 +210,7 @@ typedef struct _adslCfgProfile {
        long            adslDemodCapValue;
        long            adsl2Param;
        long            adslPwmSyncClockFreq;
+       long            adslHsModeSwitchTime;
 } adslCfgProfile;
 
 /* 
@@ -438,6 +471,8 @@ typedef struct _adslPhysEntry {
        long            adslCurrStatus;
        long            adslCurrOutputPwr;
        long            adslCurrAttainableRate;
+       long            adslSignalAttn;
+       long            adslHlinScaleFactor;
 } adslPhysEntry;
 
 #define kAdslPhysVendorIdLen           8
@@ -453,6 +488,8 @@ typedef struct _adslFullPhysEntry {
        long            adslCurrStatus;
        long            adslCurrOutputPwr;
        long            adslCurrAttainableRate;
+       long            adslSignalAttn;
+       long            adslHlinScaleFactor;
 } adslFullPhysEntry;
 
 /* Adsl channel entry definitions */
@@ -477,8 +514,20 @@ typedef struct _adslPerfCounters {
        unsigned long           adslSES;        /* Count of Severely Errored Seconds */
        unsigned long           adslLOSS;       /* Count of LOS seconds */
        unsigned long           adslFECs;       /* Count of FEC seconds  */
+       unsigned long           adslLCDS;       /* Count of LCD Errored Seconds */
 } adslPerfCounters;
 
+typedef struct _adslFailureCounters {
+       unsigned long           adslRetr;               /* Count of total retrains */
+       unsigned long           adslRetrLof;    /* Count of retrains due to LOF */
+       unsigned long           adslRetrLos;    /* Count of retrains due to LOS */
+       unsigned long           adslRetrLpr;    /* Count of retrains due to LPR */
+       unsigned long           adslRetrLom;    /* Count of retrains due to LOM */
+       unsigned long           adslInitErr;    /* Count of training failures */
+       unsigned long           adslInitTo;             /* Count of training timeouts */
+       unsigned long           adslLineSearch; /* Count of line search inits */
+} adslFailureCounters;
+
 typedef struct _adslPerfDataEntry {
        adslPerfCounters        perfTotal;
        unsigned long                           adslPerfValidIntervals;
@@ -489,6 +538,7 @@ typedef struct _adslPerfDataEntry {
        unsigned long                           adslPerfCurr1DayTimeElapsed;
        adslPerfCounters        perfPrev1Day;
        unsigned long                           adslAturPerfPrev1DayMoniSecs;
+       adslFailureCounters failTotal;
 } adslPerfDataEntry;
 
 #define kAdslMibPerfIntervals          4
@@ -597,6 +647,31 @@ typedef struct _adsl2DataConnectionInfo {
        unsigned short          B;
 } adsl2DataConnectionInfo;
 
+/* ADSL2 connection parameters */
+
+#define kAdsl2ModeAnnexMask                                    0xF
+
+#define kAdsl2ModeAnnexMUp32                           1
+#define kAdsl2ModeAnnexMUp36                           2 
+#define kAdsl2ModeAnnexMUp40                           3 
+#define kAdsl2ModeAnnexMUp44                4
+#define kAdsl2ModeAnnexMUp48                5
+#define kAdsl2ModeAnnexMUp52                           6
+#define kAdsl2ModeAnnexMUp56                7
+#define kAdsl2ModeAnnexMUp60                8
+#define kAdsl2ModeAnnexMUp64                9
+
+#define kAdsl2ModeAnnexLShift                          4
+#define kAdsl2ModeAnnexLMask                           (0x3 << kAdsl2ModeAnnexLShift)
+
+#define kAdsl2ModeAnnexLUpMask                         (0x00000001 << kAdsl2ModeAnnexLShift)
+#define kAdsl2ModeAnnexLUpWide              (0x00000000 << kAdsl2ModeAnnexLShift)
+#define kAdsl2ModeAnnexLUpNarrow            (0x00000001 << kAdsl2ModeAnnexLShift)
+
+#define kAdsl2ModeAnnexLDnMask                         (0x00000002 << kAdsl2ModeAnnexLShift)
+#define kAdsl2ModeAnnexLDnNonOvlap                     (0x00000000 << kAdsl2ModeAnnexLShift)
+#define kAdsl2ModeAnnexLDnOvlap                                (0x00000002 << kAdsl2ModeAnnexLShift)
+
 typedef struct _adsl2ConnectionInfo {
        long                                    adsl2Mode;
        long                                    rcvRate;
@@ -703,6 +778,8 @@ typedef struct _adslMibInfo {
        adslDiagModeData                adslDiag;
        adsl2ConnectionInfo             adsl2Info;
        adslPerfCounters                adslTxPerfTotal;
+       adslPerfCounters                adslTxPerfLast15Min;
+       adslPerfCounters                adslTxPerfLast1Day;
 } adslMibInfo;
 
 #if defined(__cplusplus)
index 5331a68..247c9e2 100755 (executable)
  *     Description:
  *             Diag definitions
  *
- * $Revision: 1.20 $
+ * $Revision: 1.23 $
  *
- * $Id: DiagDef.h,v 1.20 2004/04/28 16:52:32 ilyas Exp $
+ * $Id: DiagDef.h,v 1.23 2005/07/14 23:43:20 ilyas Exp $
  *
  * $Log: DiagDef.h,v $
+ * Revision 1.23  2005/07/14 23:43:20  ilyas
+ * Added command to start data logging
+ *
+ * Revision 1.22  2004/10/16 23:43:19  ilyas
+ * Added playback resume command
+ *
+ * Revision 1.21  2004/10/16 23:24:08  ilyas
+ * Improved FileRead command support for LOG file playback (RecordTest on the board)
+ *
  * Revision 1.20  2004/04/28 16:52:32  ilyas
  * Added GDB frame processing
  *
@@ -166,6 +175,13 @@ typedef struct {
 #define        DIAG_DEBUG_CMD_PRINT_TIME                       12
 #define        DIAG_DEBUG_CMD_LOG_SAMPLES                      13
 
+#define        DIAG_DEBUG_CMD_PLAYBACK_STOP            14
+#define        DIAG_DEBUG_CMD_PLAYBACK_RESUME          15
+
+#define        DIAG_DEBUG_CMD_LOG_DATA                         16
+#define DIAG_DEBUG_CMD_CLEAREOC_LOOPBACK    17
+#define DIAG_DEBUG_CMD_ANNEXM_CFG                      18
+
 #define        DIAG_DEBUG_CMD_PRINT_STAT                       21
 #define        DIAG_DEBUG_CMD_CLEAR_STAT                       22
 
index d53d07f..585a9fd 100755 (executable)
@@ -68,9 +68,11 @@ extern "C" {
     _IOWR(ATMDRV_MAJOR, 14, ATMDRV_TEST)
 #define ATMIOCTL_OAM_LOOPBACK_TEST \
     _IOWR(ATMDRV_MAJOR, 15, ATMDRV_OAM_LOOPBACK)
+#define ATMIOCTL_PORT_MIRRORING   \
+    _IOWR(ATMDRV_MAJOR, 16, MirrorCfg)
 
 
-#define MAX_ATMDRV_IOCTL_COMMANDS   16
+#define MAX_ATMDRV_IOCTL_COMMANDS   17
 
 /* Typedefs. */
 typedef struct
@@ -164,6 +166,8 @@ typedef struct
     BCMATM_STATUS baStatus;
 } ATMDRV_OAM_LOOPBACK, *PATMDRV_OAM_LOOPBACK;
 
+#include "portMirror.h"
+
 #define OAM_TYPE_FUNCTION_BYTE_OFFSET       0
 #define OAM_LB_INDICATION_BYTE_OFFSET       1
 #define OAM_LB_CORRELATION_TAG_BYTE_OFFSET  2
index 00de921..0fc84d2 100755 (executable)
@@ -189,6 +189,7 @@ BCMADSL_STATUS BcmAdsl_G997SendData(void *buf, int len);
 void *BcmAdsl_G997FrameGet(int *pLen);
 void *BcmAdsl_G997FrameGetNext(int *pLen);
 void  BcmAdsl_G997FrameFinished(void);
+void BcmAdsl_DyingGaspHandler(void *context);
 
 #if defined(__cplusplus)
 }
index 53d4548..8ef4af3 100755 (executable)
@@ -32,7 +32,15 @@ extern "C" {
 
 #define LINKSTATE_DOWN      0
 #define LINKSTATE_UP        1
-
+/*
+*  Note, we need CHIP_6348 so that user application can also use this.
+*/
+#if defined(CHIP_6348) || defined(CONFIG_BCM96348)
+#define NR_RX_BDS              120 
+#else
+#define NR_RX_BDS               80
+#endif
+#define NR_TX_BDS               200
 /*---------------------------------------------------------------------*/
 /* Ethernet Switch Type                                                */
 /*---------------------------------------------------------------------*/
@@ -58,6 +66,8 @@ enum {
     SIOCGQUERYNUMVLANPORTS,
     SIOCGSWITCHTYPE,
     SIOCGQUERYNUMPORTS,
+    SIOCGMACTOPORT,
+    SIOCGLINKSTATUS,
     SIOCLAST
 };
 
index 1d70eac..72d1343 100644 (file)
Binary files a/bcmdrivers/broadcom/net/enet/impl2/bcm_enet96348R.o_save and b/bcmdrivers/broadcom/net/enet/impl2/bcm_enet96348R.o_save differ
index af76311..8ccd134 100644 (file)
Binary files a/bcmdrivers/broadcom/net/enet/impl2/bcm_enet96348RB.o_save and b/bcmdrivers/broadcom/net/enet/impl2/bcm_enet96348RB.o_save differ
index 40a8eee..c872fbf 100755 (executable)
@@ -2,9 +2,9 @@
 #
 
 
-obj-y := board.o cfiflash.o bcm63xx_flash.o bcm63xx_led.o
+obj-y := board.o bcm63xx_flash.o bcm63xx_led.o
 
-EXTRA_CFLAGS += -I. -I$(INC_BRCMBOARDPARMS_PATH)/$(BRCM_BOARD) -I$(INC_BRCMDRIVER_PUB_PATH)/$(BRCM_BOARD)
+EXTRA_CFLAGS += -I. -I$(INC_BRCMBOARDPARMS_PATH)/$(BRCM_BOARD) -I$(INC_BRCMDRIVER_PUB_PATH)/$(BRCM_BOARD) -I$(INC_BRCMSHARED_INC_PATH)
 
 ifeq ($(strip $(WIRELESS)),1)
        EXTRA_CFLAGS += -DWIRELESS
index 5006790..0c7fb9f 100755 (executable)
 #include <board.h>
 #define  BCMTAG_EXE_USE
 #include <bcmTag.h>
-#include "cfiflash.h"
+#include "flash_api.h"
 #include "boardparms.h"
 
 //#define DEBUG_FLASH
 
+extern PFILE_TAG kerSysImageTagGet(void);
+
 static FLASH_ADDR_INFO fInfo;
 static int flashInitialized = 0;
 
@@ -103,48 +105,6 @@ unsigned long get_scratch_pad_start_addr(void)
         (flash_get_memptr(fInfo.flash_scratch_pad_start_blk) + fInfo.flash_scratch_pad_blk_offset));
 }
 
-
-
-/*  *********************************************************************
-    *  kerSysImageTagGet()
-    *   Get the image tag
-    *  Input parameters:
-    *      none
-    *  Return value:
-    *      point to tag -- Found
-    *      NULL -- failed
-    ********************************************************************* */
-PFILE_TAG kerSysImageTagGet(void)
-{
-    int i;
-    int totalBlks = flash_get_numsectors();
-    UINT32 crc;
-    unsigned char *sectAddr;
-    PFILE_TAG pTag;
-
-#if defined(DEBUG_FLASH)
-    printk("totalblks in tagGet=%d\n", totalBlks);
-#endif
-
-    // start from 2nd blk, assume 1st one is always CFE
-    for (i = 1; i < totalBlks; i++)
-    {
-        sectAddr =  flash_get_memptr((byte) i);
-        crc = CRC32_INIT_VALUE;
-        crc = getCrc32(sectAddr, (UINT32)TAG_LEN-TOKEN_LEN, crc);      
-        pTag = (PFILE_TAG) sectAddr;
-
-#if defined(DEBUG_FLASH)
-        printk("Check Tag crc on blk [%d]\n", i);
-#endif
-
-        if (crc == (UINT32)(*(UINT32*)(pTag->tagValidationToken)))
-            return pTag;
-    }
-
-    return (PFILE_TAG) NULL;
-}
-
 // Initialize the flash and fill out the fInfo structure
 void kerSysFlashInit( void )
 {
@@ -171,7 +131,7 @@ void kerSysFlashInit( void )
     printk("Total Flash size: %dK with %d sectors\n", totalSize/1024, totalBlks);
 
     /* nvram is always at the end of flash */
-    fInfo.flash_nvram_length = FLASH45_LENGTH_NVRAM;
+    fInfo.flash_nvram_length = NVRAM_LENGTH;
     fInfo.flash_nvram_start_blk = 0;  /* always the first block */
     fInfo.flash_nvram_number_blk = 1; /*always fits in the first block */
     fInfo.flash_nvram_blk_offset = NVRAM_DATA_OFFSET;
@@ -204,7 +164,7 @@ void kerSysFlashInit( void )
 
     fInfo.flash_persistent_length *= ONEK;
     startAddr = totalSize - fInfo.flash_persistent_length;
-    fInfo.flash_persistent_start_blk = flash_get_blk(startAddr+FLASH_BASE_ADDR_REG);
+    fInfo.flash_persistent_start_blk = flash_get_blk(startAddr+FLASH_BASE);
     fInfo.flash_persistent_number_blk = totalBlks - fInfo.flash_persistent_start_blk;
     // save abs SP address (Scratch Pad). it is before PSI 
     spAddr = startAddr - SP_MAX_LEN ;
@@ -213,7 +173,7 @@ void kerSysFlashInit( void )
     for (i = fInfo.flash_persistent_start_blk; 
         i < (fInfo.flash_persistent_start_blk + fInfo.flash_persistent_number_blk); i++)
     {
-        usedBlkSize += flash_get_sector_size((byte) i);
+        usedBlkSize += flash_get_sector_size((unsigned short) i);
     }
     fInfo.flash_persistent_blk_offset =  usedBlkSize - fInfo.flash_persistent_length;
 
@@ -223,17 +183,17 @@ void kerSysFlashInit( void )
         printk("Failed to read image tag from flash\n");
         return;
     }
-    kernelEndAddr = (unsigned long) simple_strtoul(pTag->kernelAddress, NULL, 10) + \
-        (unsigned long) simple_strtoul(pTag->kernelLen, NULL, 10);
+    kernelEndAddr = (unsigned long)simple_strtoul(pTag->kernelAddress,NULL,10)+ \
+        (unsigned long) simple_strtoul(pTag->kernelLen, NULL, 10) + BOOT_OFFSET;
 
     // make suer sp does not share kernel block
-    fInfo.flash_scratch_pad_start_blk = flash_get_blk(spAddr+FLASH_BASE_ADDR_REG);
+    fInfo.flash_scratch_pad_start_blk = flash_get_blk(spAddr+FLASH_BASE);
     if (fInfo.flash_scratch_pad_start_blk != flash_get_blk(kernelEndAddr))
     {
         fInfo.flash_scratch_pad_length = SP_MAX_LEN;
         if (fInfo.flash_persistent_start_blk == fInfo.flash_scratch_pad_start_blk)  // share blk
         {
-#if 1 /* do not used scratch pad unless it's in its own sector */
+#if 0 /* do not used scratch pad unless it's in its own sector */
             printk("Scratch pad is not used for this flash part.\n");  
             fInfo.flash_scratch_pad_length = 0;     // no sp
 #else /* allow scratch pad to share a sector with another section such as PSI */
@@ -249,7 +209,7 @@ void kerSysFlashInit( void )
             usedBlkSize = 0;
             for (i = fInfo.flash_scratch_pad_start_blk; 
                 i < (fInfo.flash_scratch_pad_start_blk + fInfo.flash_scratch_pad_number_blk); i++)
-                usedBlkSize += flash_get_sector_size((byte) i);
+                usedBlkSize += flash_get_sector_size((unsigned short) i);
                 fInfo.flash_scratch_pad_blk_offset =  usedBlkSize - fInfo.flash_scratch_pad_length;
         }
     }
@@ -269,7 +229,7 @@ void kerSysFlashInit( void )
     printk("fInfo.flash_nvram_blk_offset = 0x%x\n", (unsigned int)fInfo.flash_nvram_blk_offset);
     printk("fInfo.flash_nvram_number_blk = %d\n", fInfo.flash_nvram_number_blk);
 
-    printk("psi startAddr = %x\n", startAddr+FLASH_BASE_ADDR_REG);
+    printk("psi startAddr = %x\n", startAddr+FLASH_BASE);
     printk("fInfo.flash_persistent_start_blk = %d\n", fInfo.flash_persistent_start_blk);
     printk("fInfo.flash_persistent_blk_offset = 0x%x\n", (unsigned int)fInfo.flash_persistent_blk_offset);
     printk("fInfo.flash_persistent_number_blk = %d\n", fInfo.flash_persistent_number_blk);
@@ -312,7 +272,7 @@ static char *getSharedBlks(int start_blk, int end_blk)
     char *pBuf = NULL;
 
     for (i = start_blk; i < end_blk; i++)
-        usedBlkSize += flash_get_sector_size((byte) i);
+        usedBlkSize += flash_get_sector_size((unsigned short) i);
 
 #if defined(DEBUG_FLASH)
     printk("usedBlkSize = %d\n", usedBlkSize);
@@ -327,12 +287,12 @@ static char *getSharedBlks(int start_blk, int end_blk)
     pBuf = pTempBuf;
     for (i = start_blk; i < end_blk; i++)
     {
-        sect_size = flash_get_sector_size((byte) i);
+        sect_size = flash_get_sector_size((unsigned short) i);
 
 #if defined(DEBUG_FLASH)
         printk("i = %d, sect_size = %d, end_blk = %d\n", i, sect_size, end_blk);
 #endif
-        flash_read_buf((byte)i, 0, pBuf, sect_size);
+        flash_read_buf((unsigned short)i, 0, pBuf, sect_size);
         pBuf += sect_size;
     }
     
@@ -354,7 +314,7 @@ static int setSharedBlks(int start_blk, int end_blk, char *pTempBuf)
 
     for (i = start_blk; i < end_blk; i++)
     {
-        sect_size = flash_get_sector_size((byte) i);
+        sect_size = flash_get_sector_size((unsigned short) i);
         flash_sector_erase_int(i);
         if (flash_write_buf(i, 0, pBuf, sect_size) != sect_size)
         {
@@ -385,7 +345,7 @@ int kerSysNvRamGet(char *string, int strLen, int offset)
     if (!flashInitialized)
         kerSysFlashInit();
 
-    if (strLen > FLASH45_LENGTH_NVRAM)
+    if (strLen > NVRAM_LENGTH)
         return -1;
 
     if ((pBuf = getSharedBlks(fInfo.flash_nvram_start_blk,
@@ -410,7 +370,7 @@ int kerSysNvRamSet(char *string, int strLen, int offset)
     int sts = 0;
     char *pBuf = NULL;
 
-    if (strLen > FLASH45_LENGTH_NVRAM)
+    if (strLen > NVRAM_LENGTH)
         return -1;
 
     if ((pBuf = getSharedBlks(fInfo.flash_nvram_start_blk,
@@ -438,15 +398,15 @@ int kerSysNvRamSet(char *string, int strLen, int offset)
 int kerSysEraseNvRam(void)
 {
     int sts = 1;
-    char *tempStorage = retriedKmalloc(FLASH45_LENGTH_NVRAM);
+    char *tempStorage = retriedKmalloc(NVRAM_LENGTH);
     
     // just write the whole buf with '0xff' to the flash
     if (!tempStorage)
         sts = 0;
     else
     {
-        memset(tempStorage, 0xff, FLASH45_LENGTH_NVRAM);
-        if (kerSysNvRamSet(tempStorage, FLASH45_LENGTH_NVRAM, 0) != 0)
+        memset(tempStorage, 0xff, NVRAM_LENGTH);
+        if (kerSysNvRamSet(tempStorage, NVRAM_LENGTH, 0) != 0)
             sts = 0;
         retriedKfree(tempStorage);
     }
@@ -500,7 +460,10 @@ int kerSysPersistentSet(char *string, int strLen, int offset)
 
     // set string to the memory buffer
     memcpy((pBuf + fInfo.flash_persistent_blk_offset + offset), string, strLen);
-
+    // USR9108 add two terminating zeros to the end of the string
+    if ( strLen <= fInfo.flash_persistent_length - 2 )
+        memcpy((pBuf + fInfo.flash_persistent_blk_offset + offset + strLen), "\0\0", 2);
+       
     if (setSharedBlks(fInfo.flash_persistent_start_blk, 
         (fInfo.flash_persistent_number_blk + fInfo.flash_persistent_start_blk), pBuf) != 0)
         sts = -1;
@@ -528,7 +491,7 @@ int kerSysBcmImageSet( int flash_start_addr, char *string, int size)
     if( blk_start < 0 )
         return( -1 );
 
-    if (flash_start_addr == FLASH_BASE && size > FLASH45_LENGTH_BOOT_ROM)
+    if (flash_start_addr == FLASH_BASE && size > FLASH_LENGTH_BOOT_ROM)
         whole_image = 1;
 
    /* write image to flash memory */
@@ -554,7 +517,7 @@ int kerSysBcmImageSet( int flash_start_addr, char *string, int size)
                printk("Failed to allocate memory with size: %d.  Reset the router...\n", sect_size);
                kerSysMipsSoftReset();     // reset the board right away.
             }
-            flash_read_buf((byte)blk_start, 0, pTempBuf, sect_size);
+            flash_read_buf((unsigned short)blk_start, 0, pTempBuf, sect_size);
             if (copy_from_user((void *)pTempBuf,(void *)string, size) != 0)
                 break;  // failed ?
             flash_sector_erase_int(blk_start);     // erase blk before flash
@@ -607,58 +570,64 @@ int kerSysBcmImageSet( int flash_start_addr, char *string, int size)
  *******************************************************************************/
 // get sp data.  NOTE: memcpy work here -- not using copy_from/to_user
 // return:
-//  0 - ok
+//  >0 - number of bytes copied to tokBuf
 //  -1 - fail
 int kerSysScratchPadGet(char *tokenId, char *tokBuf, int bufLen)
 {
-    PSP_HEADER pHead = NULL;
     PSP_TOKEN pToken = NULL;
     char *pBuf = NULL;
     char *pShareBuf = NULL;
     char *startPtr = NULL;
-    char *endPtr = NULL;
-    char *spEndPtr = NULL;
+    int usedLen;
     int sts = -1;
 
     if (fInfo.flash_scratch_pad_length == 0)
         return sts;
 
-    if (bufLen >= (fInfo.flash_scratch_pad_length - sizeof(SP_HEADER) - sizeof(SP_TOKEN))) 
+    if( bufLen >= (fInfo.flash_scratch_pad_length - sizeof(SP_HEADER) -
+        sizeof(SP_TOKEN)) ) 
     {
-        printk("Exceed scratch pad space by %d\n", bufLen  - fInfo.flash_scratch_pad_length \
-            - sizeof(SP_HEADER) - sizeof(SP_TOKEN));
+        printk("Exceed scratch pad space by %d\n", bufLen -
+            fInfo.flash_scratch_pad_length - sizeof(SP_HEADER) -
+            sizeof(SP_TOKEN));
         return sts;
     }
 
-    if ((pShareBuf = getSharedBlks(fInfo.flash_scratch_pad_start_blk,
-        (fInfo.flash_scratch_pad_start_blk + fInfo.flash_scratch_pad_number_blk))) == NULL)
+    if( (pShareBuf = getSharedBlks(fInfo.flash_scratch_pad_start_blk,
+        (fInfo.flash_scratch_pad_start_blk +
+        fInfo.flash_scratch_pad_number_blk))) == NULL )
+    {
         return sts;
+    }
 
     // pBuf points to SP buf
     pBuf = pShareBuf + fInfo.flash_scratch_pad_blk_offset;  
 
-    pHead = (PSP_HEADER) pBuf;
-    if (memcmp(pHead->SPMagicNum, MAGIC_NUMBER, MAGIC_NUM_LEN) != 0) 
+    if(memcmp(((PSP_HEADER)pBuf)->SPMagicNum, MAGIC_NUMBER, MAGIC_NUM_LEN) != 0) 
     {
-        printk("Scrap pad is not initialized.\n");
+        printk("Scratch pad is not initialized.\n");
         return sts;
     }
 
-    // search up to SPUsedLen for the token
+    // search for the token
+    usedLen = sizeof(SP_HEADER);
     startPtr = pBuf + sizeof(SP_HEADER);
-    endPtr = pBuf + pHead->SPUsedLen;
-    spEndPtr = pBuf + SP_MAX_LEN;
-    while (startPtr < endPtr && startPtr < spEndPtr)
+    pToken = (PSP_TOKEN) startPtr;
+    while( pToken->tokenName[0] != '\0' && pToken->tokenLen > 0 &&
+        pToken->tokenLen < fInfo.flash_scratch_pad_length &&
+        usedLen < fInfo.flash_scratch_pad_length )
     {
-        pToken = (PSP_TOKEN) startPtr;
+
         if (strncmp(pToken->tokenName, tokenId, TOKEN_NAME_LEN) == 0)
         {
-            memcpy(tokBuf, startPtr + sizeof(SP_TOKEN), bufLen);
-            sts = 0;
+            sts = pToken->tokenLen;
+            memcpy(tokBuf, startPtr + sizeof(SP_TOKEN), sts);
             break;
         }
-        // get next token
-        startPtr += sizeof(SP_TOKEN) + pToken->tokenLen;
+
+        usedLen += ((pToken->tokenLen + 0x03) & ~0x03);
+        startPtr += sizeof(SP_TOKEN) + ((pToken->tokenLen + 0x03) & ~0x03);
+        pToken = (PSP_TOKEN) startPtr;
     }
 
     retriedKfree(pShareBuf);
@@ -674,7 +643,6 @@ int kerSysScratchPadGet(char *tokenId, char *tokBuf, int bufLen)
 int kerSysScratchPadSet(char *tokenId, char *tokBuf, int bufLen)
 {
     PSP_TOKEN pToken = NULL;
-    PSP_HEADER pHead = NULL;
     char *pShareBuf = NULL;
     char *pBuf = NULL;
     SP_HEADER SPHead;
@@ -685,22 +653,26 @@ int kerSysScratchPadSet(char *tokenId, char *tokBuf, int bufLen)
     if (fInfo.flash_scratch_pad_length == 0)
         return sts;
 
-    if (bufLen >= (fInfo.flash_scratch_pad_length - sizeof(SP_HEADER) - sizeof(SP_TOKEN))) 
+    if( bufLen >= fInfo.flash_scratch_pad_length - sizeof(SP_HEADER) -
+        sizeof(SP_TOKEN) )
     {
-        printk("Exceed scratch pad space by %d\n", bufLen  - fInfo.flash_scratch_pad_length \
-            - sizeof(SP_HEADER) - sizeof(SP_TOKEN));
+        printk("Scratch pad overflow by %d bytes.  Information not saved.\n",
+            bufLen  - fInfo.flash_scratch_pad_length - sizeof(SP_HEADER) -
+            sizeof(SP_TOKEN));
         return sts;
     }
 
-    if ((pShareBuf = getSharedBlks(fInfo.flash_scratch_pad_start_blk,
-        (fInfo.flash_scratch_pad_start_blk + fInfo.flash_scratch_pad_number_blk))) == NULL)
+    if( (pShareBuf = getSharedBlks( fInfo.flash_scratch_pad_start_blk,
+        (fInfo.flash_scratch_pad_start_blk +
+        fInfo.flash_scratch_pad_number_blk) )) == NULL )
+    {
         return sts;
+    }
 
     // pBuf points to SP buf
     pBuf = pShareBuf + fInfo.flash_scratch_pad_blk_offset;  
-    pHead = (PSP_HEADER) pBuf;
 
-    // form header info.  SPUsedLen later on...
+    // form header info.
     memset((char *)&SPHead, 0, sizeof(SP_HEADER));
     memcpy(SPHead.SPMagicNum, MAGIC_NUMBER, MAGIC_NUM_LEN);
     SPHead.SPVersion = SP_VERSION;
@@ -709,57 +681,102 @@ int kerSysScratchPadSet(char *tokenId, char *tokBuf, int bufLen)
     memset((char*)&SPToken, 0, sizeof(SP_TOKEN));
     strncpy(SPToken.tokenName, tokenId, TOKEN_NAME_LEN - 1);
     SPToken.tokenLen = bufLen;
-    if (memcmp(pHead->SPMagicNum, MAGIC_NUMBER, MAGIC_NUM_LEN) != 0) 
+
+    if(memcmp(((PSP_HEADER)pBuf)->SPMagicNum, MAGIC_NUMBER, MAGIC_NUM_LEN) != 0)
     {
         // new sp, so just flash the token
-        printk("No Scrap pad found.  Initialize scratch pad...\n");
-        SPHead.SPUsedLen = sizeof(SP_HEADER) + sizeof(SP_TOKEN) + bufLen;
+        printk("No scratch pad found.  Initialize scratch pad...\n");
         memcpy(pBuf, (char *)&SPHead, sizeof(SP_HEADER));
         curPtr = pBuf + sizeof(SP_HEADER);
         memcpy(curPtr, (char *)&SPToken, sizeof(SP_TOKEN));
         curPtr += sizeof(SP_TOKEN);
-        memcpy(curPtr, tokBuf, bufLen);
+        if( tokBuf )
+            memcpy(curPtr, tokBuf, bufLen);
     }
     else  
     {
-        // need search for the token, if exist with same size overwrite it. if sizes differ, 
-        // move over the later token data over and put the new one at the end
-        char *endPtr = pBuf + pHead->SPUsedLen;
-        char *spEndPtr = pBuf + SP_MAX_LEN;
+        int putAtEnd = 1;
+        int curLen;
+        int usedLen;
+        int skipLen;
+
+        /* Calculate the used length. */
+        usedLen = sizeof(SP_HEADER);
+        curPtr = pBuf + sizeof(SP_HEADER);
+        pToken = (PSP_TOKEN) curPtr;
+        skipLen = (pToken->tokenLen + 0x03) & ~0x03;
+        while( pToken->tokenName[0] >= 'A' && pToken->tokenName[0] <= 'z' &&
+            strlen(pToken->tokenName) < TOKEN_NAME_LEN &&
+            pToken->tokenLen > 0 &&
+            pToken->tokenLen < fInfo.flash_scratch_pad_length &&
+            usedLen < fInfo.flash_scratch_pad_length )
+        {
+            usedLen += sizeof(SP_TOKEN) + skipLen;
+            curPtr += sizeof(SP_TOKEN) + skipLen;
+            pToken = (PSP_TOKEN) curPtr;
+            skipLen = (pToken->tokenLen + 0x03) & ~0x03;
+        }
+
+        if( usedLen + SPToken.tokenLen + sizeof(SP_TOKEN) >
+            fInfo.flash_scratch_pad_length )
+        {
+            printk("Scratch pad overflow by %d bytes.  Information not saved.\n",
+                (usedLen + SPToken.tokenLen + sizeof(SP_TOKEN)) -
+                fInfo.flash_scratch_pad_length);
+            return sts;
+        }
+
         curPtr = pBuf + sizeof(SP_HEADER);
-        while (curPtr < endPtr && curPtr < spEndPtr)
+        curLen = sizeof(SP_HEADER);
+        while( curLen < usedLen )
         {
             pToken = (PSP_TOKEN) curPtr;
+            skipLen = (pToken->tokenLen + 0x03) & ~0x03;
             if (strncmp(pToken->tokenName, tokenId, TOKEN_NAME_LEN) == 0)
             {
-                if (pToken->tokenLen == bufLen) // overwirte it
+                // The token id already exists.
+                if( tokBuf && pToken->tokenLen == bufLen )
                 {
+                    // The length of the new data and the existing data is the
+                    // same.  Overwrite the existing data.
                     memcpy((curPtr+sizeof(SP_TOKEN)), tokBuf, bufLen);
-                    break;
+                    putAtEnd = 0;
                 }
-                else // move later data over and put the new token at the end
+                else
                 {
-                    memcpy((curPtr+sizeof(SP_TOKEN)), tokBuf, bufLen);  // ~~~
-                    break;
+                    // The length of the new data and the existing data is
+                    // different.  Shift the rest of the scratch pad to this
+                    // token's location and put this token's data at the end.
+                    char *nextPtr = curPtr + sizeof(SP_TOKEN) + skipLen;
+                    int copyLen = usedLen - (curLen+sizeof(SP_TOKEN) + skipLen);
+                    memcpy( curPtr, nextPtr, copyLen );
+                    memset( curPtr + copyLen, 0x00, 
+                        fInfo.flash_scratch_pad_length - (curLen + copyLen) );
+                    usedLen -= sizeof(SP_TOKEN) + skipLen;
                 }
+                break;
             }
-            else // not same token ~~~
-            {
-            }
+
             // get next token
-            curPtr += sizeof(SP_TOKEN) + pToken->tokenLen;
+            curPtr += sizeof(SP_TOKEN) + skipLen;
+            curLen += sizeof(SP_TOKEN) + skipLen;
         } // end while
-        SPHead.SPUsedLen = sizeof(SP_HEADER) + sizeof(SP_TOKEN) + bufLen; // ~~~
-        if (SPHead.SPUsedLen > SP_MAX_LEN)
+
+        if( putAtEnd )
         {
-            printk("No more Scratch pad space left! Over limit by %d bytes\n", SPHead.SPUsedLen - SP_MAX_LEN);
-            return sts;
+            if( tokBuf )
+            {
+                memcpy( pBuf + usedLen, &SPToken, sizeof(SP_TOKEN) );
+                memcpy( pBuf + usedLen + sizeof(SP_TOKEN), tokBuf, bufLen );
+            }
+            memcpy( pBuf, &SPHead, sizeof(SP_HEADER) );
         }
 
     } // else if not new sp
 
     sts = setSharedBlks(fInfo.flash_scratch_pad_start_blk, 
-        (fInfo.flash_scratch_pad_number_blk + fInfo.flash_scratch_pad_start_blk), pShareBuf);
+        (fInfo.flash_scratch_pad_number_blk + fInfo.flash_scratch_pad_start_blk),
+        pShareBuf);
     
     retriedKfree(pShareBuf);
 
@@ -773,3 +790,18 @@ int kerSysFlashSizeGet(void)
    return flash_get_total_size();
 }
 
+int kerSysMemoryMappedFlashSizeGet(void)
+{
+    return( flash_get_total_memory_mapped_size() );
+}
+
+unsigned long kerSysReadFromFlash( void *toaddr, unsigned long fromaddr,
+    unsigned long len )
+{
+    int sect = flash_get_blk((int) fromaddr);
+    unsigned char *start = flash_get_memptr(sect);
+    flash_read_buf( sect, (int) fromaddr - (int) start, toaddr, len );
+
+    return( len );
+}
+
index 3de06a4..58df4c7 100755 (executable)
@@ -29,6 +29,7 @@
 
 
 /* Includes. */
+#include <linux/version.h>
 #include <linux/init.h>
 #include <linux/fs.h>
 #include <linux/interrupt.h>
 #include <linux/wait.h>
 #include <linux/poll.h>
 #include <linux/sched.h>
+#include <linux/list.h>
+#include <linux/if.h>
 
 #include <bcm_map_part.h>
 #include <board.h>
 #include <bcmTag.h>
 #include "boardparms.h"
-#include "cfiflash.h"
+#include "flash_api.h"
 #include "bcm_intr.h"
 #include "board.h"
+#include "bcm_map_part.h"
 
 /* Typedefs. */
-#if defined (NON_CONSECUTIVE_MAC)
-// used to be the last octet. Now changed to the first 5 bits of the the forth octet
-// to reduced the duplicated MAC addresses.
-#define CHANGED_OCTET   3
-#define SHIFT_BITS      3
-#else
-#define CHANGED_OCTET   1
-#define SHIFT_BITS      0
-#endif
 
 #if defined (WIRELESS)
 #define SES_BTN_PRESSED 0x00000001
@@ -81,7 +76,7 @@ typedef struct
     unsigned long ulSdramSize;
     unsigned long ulPsiSize;
     unsigned long ulNumMacAddrs;
-    unsigned long ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN];
+    unsigned char ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN];
     char chCountry[4]; // USR9108
     MAC_ADDR_INFO MacAddrs[1];
 } NVRAM_INFO, *PNVRAM_INFO;
@@ -92,6 +87,17 @@ typedef struct
 } BOARD_IOC, *PBOARD_IOC;
 
 
+/*Dyinggasp callback*/
+typedef void (*cb_dgasp_t)(void *arg);
+typedef struct _CB_DGASP__LIST
+{
+    struct list_head list;
+    char name[IFNAMSIZ];
+    cb_dgasp_t cb_dgasp_fn;
+    void *context;
+}CB_DGASP_LIST , *PCB_DGASP_LIST;
+
+
 static LED_MAP_PAIR LedMapping[] =
 {   // led name     Initial state       physical pin (ledMask)
     {kLedEnd,       kLedStateOff,       0, 0, 0, 0},
@@ -106,6 +112,7 @@ static LED_MAP_PAIR LedMapping[] =
 };
 
 /* Externs. */
+extern struct file fastcall *fget_light(unsigned int fd, int *fput_needed);
 extern unsigned int nr_free_pages (void);
 extern const char *get_system_type(void);
 extern void kerSysFlashInit(void);
@@ -116,6 +123,7 @@ extern void __init boardLedInit(PLED_MAP_PAIR);
 extern void boardLedCtrl(BOARD_LED_NAME, BOARD_LED_STATE);
 extern void kerSysLedRegisterHandler( BOARD_LED_NAME ledName,
     HANDLE_LED_FUNC ledHwFunc, int ledFailType );
+extern UINT32 getCrc32(byte *pdata, UINT32 size, UINT32 crc);
 
 /* Prototypes. */
 void __init InitNvramInfo( void );
@@ -128,6 +136,18 @@ static int board_release(struct inode *inode, struct file *filp);
 static BOARD_IOC* borad_ioc_alloc(void);
 static void borad_ioc_free(BOARD_IOC* board_ioc);
 
+/* DyingGasp function prototype */
+static void __init kerSysDyingGaspMapIntr(void);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+static irqreturn_t kerSysDyingGaspIsr(int irq, void * dev_id, struct pt_regs * regs);
+#else
+static unsigned int kerSysDyingGaspIsr(void);
+#endif
+static void __init kerSysInitDyingGaspHandler( void );
+static void __exit kerSysDeinitDyingGaspHandler( void );
+/* -DyingGasp function prototype - */
+
+
 #if defined (WIRELESS)
 static irqreturn_t sesBtn_isr(int irq, void *dev_id, struct pt_regs *ptregs);
 static void __init sesBtn_mapGpio(void);
@@ -143,6 +163,13 @@ static void __exit ses_board_deinit(void);
 static PNVRAM_INFO g_pNvramInfo = NULL;
 static int g_ledInitialized = 0;
 static wait_queue_head_t g_board_wait_queue;
+static CB_DGASP_LIST *g_cb_dgasp_list_head = NULL;
+
+static int g_wakeup_monitor = 0;
+static struct file *g_monitor_file = NULL;
+static struct task_struct *g_monitor_task = NULL;
+static unsigned int (*g_orig_fop_poll)
+    (struct file *, struct poll_table_struct *) = NULL;
 
 static struct file_operations board_fops =
 {
@@ -235,6 +262,9 @@ static int __init brcm_board_init( void )
 #if defined (WIRELESS)
         ses_board_init();
 #endif        
+        kerSysInitDyingGaspHandler();
+        kerSysDyingGaspMapIntr();
+
         boardLedInit(LedMapping);
         g_ledInitialized = 1;
     }
@@ -278,12 +308,13 @@ void __init InitNvramInfo( void )
 void __exit brcm_board_cleanup( void )
 {
     printk("brcm_board_cleanup()\n");
-
+       
     if (board_major != -1) 
     {
 #if defined (WIRELESS)         
        ses_board_deinit();
 #endif         
+        kerSysDeinitDyingGaspHandler();
         unregister_chrdev(board_major, "board_ioctl");
     }
 } 
@@ -332,7 +363,9 @@ static int board_release(struct inode *inode, struct file *filp)
 static unsigned int board_poll(struct file *filp, struct poll_table_struct *wait)
 {
     unsigned int mask = 0;
+#if defined (WIRELESS)         
     BOARD_IOC *board_ioc = filp->private_data;         
+#endif
        
     poll_wait(filp, &g_board_wait_queue, wait);
 #if defined (WIRELESS)         
@@ -340,14 +373,15 @@ static unsigned int board_poll(struct file *filp, struct poll_table_struct *wait
         mask |= sesBtn_poll(filp, wait);
     }                  
 #endif    
+
     return mask;
 }
 
 
 static ssize_t board_read(struct file *filp,  char __user *buffer, size_t count, loff_t *ppos)
 {
-    BOARD_IOC *board_ioc = filp->private_data;
 #if defined (WIRELESS)    
+    BOARD_IOC *board_ioc = filp->private_data;
     if(board_ioc->eventmask & SES_EVENTS){
        return sesBtn_read(filp, buffer, count, ppos);
     }
@@ -438,11 +472,18 @@ void kerSysMipsSoftReset(void)
 
 int kerSysGetMacAddress( unsigned char *pucaMacAddr, unsigned long ulId )
 {
+    const unsigned long constMacAddrIncIndex = 3;
     int nRet = 0;
     PMAC_ADDR_INFO pMai = NULL;
     PMAC_ADDR_INFO pMaiFreeNoId = NULL;
     PMAC_ADDR_INFO pMaiFreeId = NULL;
-    unsigned long i = 0, ulIdxNoId = 0, ulIdxId = 0, shiftedIdx = 0;
+    unsigned long i = 0, ulIdxNoId = 0, ulIdxId = 0, baseMacAddr = 0;
+
+    /* baseMacAddr = last 3 bytes of the base MAC address treated as a 24 bit integer */
+    memcpy((unsigned char *) &baseMacAddr,
+        &g_pNvramInfo->ucaBaseMacAddr[constMacAddrIncIndex],
+        NVRAM_MAC_ADDRESS_LEN - constMacAddrIncIndex);
+    baseMacAddr >>= 8;
 
     for( i = 0, pMai = g_pNvramInfo->MacAddrs; i < g_pNvramInfo->ulNumMacAddrs;
         i++, pMai++ )
@@ -450,10 +491,11 @@ int kerSysGetMacAddress( unsigned char *pucaMacAddr, unsigned long ulId )
         if( ulId == pMai->ulId || ulId == MAC_ADDRESS_ANY )
         {
             /* This MAC address has been used by the caller in the past. */
+            baseMacAddr = (baseMacAddr + i) << 8;
             memcpy( pucaMacAddr, g_pNvramInfo->ucaBaseMacAddr,
-                NVRAM_MAC_ADDRESS_LEN );
-            shiftedIdx = i;
-            pucaMacAddr[NVRAM_MAC_ADDRESS_LEN - CHANGED_OCTET] += (shiftedIdx << SHIFT_BITS);
+                constMacAddrIncIndex);
+            memcpy( pucaMacAddr + constMacAddrIncIndex, (unsigned char *)
+                &baseMacAddr, NVRAM_MAC_ADDRESS_LEN - constMacAddrIncIndex );
             pMai->chInUse = 1;
             pMaiFreeNoId = pMaiFreeId = NULL;
             break;
@@ -488,15 +530,21 @@ int kerSysGetMacAddress( unsigned char *pucaMacAddr, unsigned long ulId )
         memcpy(pucaMacAddr, g_pNvramInfo->ucaBaseMacAddr,NVRAM_MAC_ADDRESS_LEN);
         if( pMaiFreeNoId )
         {
-            shiftedIdx = ulIdxNoId;
-            pucaMacAddr[NVRAM_MAC_ADDRESS_LEN - CHANGED_OCTET] += (shiftedIdx << SHIFT_BITS);
+            baseMacAddr = (baseMacAddr + ulIdxNoId) << 8;
+            memcpy( pucaMacAddr, g_pNvramInfo->ucaBaseMacAddr,
+                constMacAddrIncIndex);
+            memcpy( pucaMacAddr + constMacAddrIncIndex, (unsigned char *)
+                &baseMacAddr, NVRAM_MAC_ADDRESS_LEN - constMacAddrIncIndex );
             pMaiFreeNoId->ulId = ulId;
             pMaiFreeNoId->chInUse = 1;
         }
         else
         {
-            shiftedIdx = ulIdxId;
-            pucaMacAddr[NVRAM_MAC_ADDRESS_LEN - CHANGED_OCTET] += (shiftedIdx << SHIFT_BITS);
+            baseMacAddr = (baseMacAddr + ulIdxId) << 8;
+            memcpy( pucaMacAddr, g_pNvramInfo->ucaBaseMacAddr,
+                constMacAddrIncIndex);
+            memcpy( pucaMacAddr + constMacAddrIncIndex, (unsigned char *)
+                &baseMacAddr, NVRAM_MAC_ADDRESS_LEN - constMacAddrIncIndex );
             pMaiFreeId->ulId = ulId;
             pMaiFreeId->chInUse = 1;
         }
@@ -510,15 +558,24 @@ int kerSysGetMacAddress( unsigned char *pucaMacAddr, unsigned long ulId )
 
 int kerSysReleaseMacAddress( unsigned char *pucaMacAddr )
 {
+    const unsigned long constMacAddrIncIndex = 3;
     int nRet = -EINVAL;
     unsigned long ulIdx = 0;
-    int idx = (pucaMacAddr[NVRAM_MAC_ADDRESS_LEN - CHANGED_OCTET] -
-        g_pNvramInfo->ucaBaseMacAddr[NVRAM_MAC_ADDRESS_LEN - CHANGED_OCTET]);
+    unsigned long baseMacAddr = 0;
+    unsigned long relMacAddr = 0;
 
-    // if overflow 255 (negitive), add 256 to have the correct index
-    if (idx < 0)
-        idx += 256;
-    ulIdx = (unsigned long) (idx >> SHIFT_BITS);
+    /* baseMacAddr = last 3 bytes of the base MAC address treated as a 24 bit integer */
+    memcpy((unsigned char *) &baseMacAddr,
+        &g_pNvramInfo->ucaBaseMacAddr[constMacAddrIncIndex],
+        NVRAM_MAC_ADDRESS_LEN - constMacAddrIncIndex);
+    baseMacAddr >>= 8;
+
+    /* Get last 3 bytes of MAC address to release. */
+    memcpy((unsigned char *) &relMacAddr, &pucaMacAddr[constMacAddrIncIndex],
+        NVRAM_MAC_ADDRESS_LEN - constMacAddrIncIndex);
+    relMacAddr >>= 8;
+
+    ulIdx = relMacAddr - baseMacAddr;
 
     if( ulIdx < g_pNvramInfo->ulNumMacAddrs )
     {
@@ -545,6 +602,248 @@ void kerSysLedCtrl(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState)
       boardLedCtrl(ledName, ledState);
 }
 
+unsigned int kerSysMonitorPollHook( struct file *f, struct poll_table_struct *t)
+{
+    int mask = (*g_orig_fop_poll) (f, t);
+
+    if( g_wakeup_monitor == 1 && g_monitor_file == f )
+    {
+        /* If g_wakeup_monitor is non-0, the user mode application needs to
+         * return from a blocking select function.  Return POLLPRI which will
+         * cause the select to return with the exception descriptor set.
+         */
+        mask |= POLLPRI;
+        g_wakeup_monitor = 0;
+    }
+
+    return( mask );
+}
+
+/* Put the user mode application that monitors link state on a run queue. */
+void kerSysWakeupMonitorTask( void )
+{
+    g_wakeup_monitor = 1;
+    if( g_monitor_task )
+        wake_up_process( g_monitor_task );
+}
+
+static PFILE_TAG getTagFromPartition(int imageNumber)
+{
+    static unsigned char sectAddr1[sizeof(FILE_TAG)];
+    static unsigned char sectAddr2[sizeof(FILE_TAG)];
+    int blk = 0;
+    UINT32 crc;
+    PFILE_TAG pTag = NULL;
+    unsigned char *pBase = flash_get_memptr(0);
+    unsigned char *pSectAddr = NULL;
+
+    /* The image tag for the first image is always after the boot loader.
+     * The image tag for the second image, if it exists, is at one half
+     * of the flash size.
+     */
+    if( imageNumber == 1 )
+    {
+        blk = flash_get_blk((int) (pBase + FLASH_LENGTH_BOOT_ROM));
+        pSectAddr = sectAddr1;
+    }
+    else
+        if( imageNumber == 2 )
+        {
+            blk = flash_get_blk((int) (pBase + (flash_get_total_size() / 2)));
+            pSectAddr = sectAddr2;
+        }
+
+    if( blk )
+    {
+        memset(pSectAddr, 0x00, sizeof(FILE_TAG));
+        flash_read_buf((unsigned short) blk, 0, pSectAddr, sizeof(FILE_TAG));
+        crc = CRC32_INIT_VALUE;
+        crc = getCrc32(pSectAddr, (UINT32)TAG_LEN-TOKEN_LEN, crc);      
+        pTag = (PFILE_TAG) pSectAddr;
+        if (crc != (UINT32)(*(UINT32*)(pTag->tagValidationToken)))
+            pTag = NULL;
+    }
+
+    return( pTag );
+}
+
+static int getPartitionFromTag( PFILE_TAG pTag )
+{
+    int ret = 0;
+
+    if( pTag )
+    {
+        PFILE_TAG pTag1 = getTagFromPartition(1);
+        PFILE_TAG pTag2 = getTagFromPartition(2);
+        int sequence = simple_strtoul(pTag->imageSequence,  NULL, 10);
+        int sequence1 = (pTag1) ? simple_strtoul(pTag1->imageSequence, NULL, 10)
+            : -1;
+        int sequence2 = (pTag2) ? simple_strtoul(pTag2->imageSequence, NULL, 10)
+            : -1;
+
+        if( pTag1 && sequence == sequence1 )
+            ret = 1;
+        else
+            if( pTag2 && sequence == sequence2 )
+                ret = 2;
+    }
+
+    return( ret );
+}
+
+static PFILE_TAG getBootImageTag(void)
+{
+    PFILE_TAG pTag = NULL;
+    PFILE_TAG pTag1 = getTagFromPartition(1);
+    PFILE_TAG pTag2 = getTagFromPartition(2);
+
+    if( pTag1 && pTag2 )
+    {
+        /* Two images are flashed. */
+        int sequence1 = simple_strtoul(pTag1->imageSequence, NULL, 10);
+        int sequence2 = simple_strtoul(pTag2->imageSequence, NULL, 10);
+        char *p;
+        char bootPartition = BOOT_LATEST_IMAGE;
+        NVRAM_DATA nvramData;
+
+        memcpy((char *) &nvramData, (char *) get_nvram_start_addr(),
+            sizeof(nvramData));
+        for( p = nvramData.szBootline; p[2] != '\0'; p++ )
+            if( p[0] == 'p' && p[1] == '=' )
+            {
+                bootPartition = p[2];
+                break;
+            }
+
+        if( bootPartition == BOOT_LATEST_IMAGE )
+            pTag = (sequence2 > sequence1) ? pTag2 : pTag1;
+        else /* Boot from the image configured. */
+            pTag = (sequence2 < sequence1) ? pTag2 : pTag1;
+    }
+    else
+        /* One image is flashed. */
+        pTag = (pTag2) ? pTag2 : pTag1;
+
+    return( pTag );
+}
+
+static void UpdateImageSequenceNumber( unsigned char *imageSequence )
+{
+    int newImageSequence = 0;
+    PFILE_TAG pTag = getTagFromPartition(1);
+
+    if( pTag )
+        newImageSequence = simple_strtoul(pTag->imageSequence, NULL, 10);
+
+    pTag = getTagFromPartition(2);
+    if(pTag && simple_strtoul(pTag->imageSequence, NULL, 10) > newImageSequence)
+        newImageSequence = simple_strtoul(pTag->imageSequence, NULL, 10);
+
+    newImageSequence++;
+    sprintf(imageSequence, "%d", newImageSequence);
+}
+
+static int flashFsKernelImage( int destAddr, unsigned char *imagePtr,
+    int imageLen )
+{
+    int status = 0;
+    PFILE_TAG pTag = (PFILE_TAG) imagePtr;
+    int rootfsAddr = simple_strtoul(pTag->rootfsAddress, NULL, 10) + BOOT_OFFSET;
+    int kernelAddr = simple_strtoul(pTag->kernelAddress, NULL, 10) + BOOT_OFFSET;
+    char *p;
+    char *tagFs = imagePtr;
+    unsigned int baseAddr = (unsigned int) flash_get_memptr(0);
+    unsigned int totalSize = (unsigned int) flash_get_total_size();
+    unsigned int availableSizeOneImg = totalSize -
+        ((unsigned int) rootfsAddr - baseAddr) - FLASH_RESERVED_AT_END;
+    unsigned int reserveForTwoImages =
+        (FLASH_LENGTH_BOOT_ROM > FLASH_RESERVED_AT_END)
+        ? FLASH_LENGTH_BOOT_ROM : FLASH_RESERVED_AT_END;
+    unsigned int availableSizeTwoImgs =
+        (totalSize / 2) - reserveForTwoImages;
+    unsigned int newImgSize = simple_strtoul(pTag->rootfsLen, NULL, 10) +
+        simple_strtoul(pTag->kernelLen, NULL, 10);
+    PFILE_TAG pCurTag = getBootImageTag();
+    UINT32 crc = CRC32_INIT_VALUE;
+    unsigned int curImgSize = 0;
+    NVRAM_DATA nvramData;
+
+    memcpy((char *)&nvramData, (char *)get_nvram_start_addr(),sizeof(nvramData));
+
+    if( pCurTag )
+    {
+        curImgSize = simple_strtoul(pCurTag->rootfsLen, NULL, 10) +
+            simple_strtoul(pCurTag->kernelLen, NULL, 10);
+    }
+
+    if( newImgSize > availableSizeOneImg)
+    {
+        printk("Illegal image size %d.  Image size must not be greater "
+            "than %d.\n", newImgSize, availableSizeOneImg);
+        return -1;
+    }
+
+    if( getTagFromPartition(1) != NULL && getTagFromPartition(2) != NULL &&
+        newImgSize > availableSizeTwoImgs )
+    {
+        printk("Illegal image size %d.  Image size must not be greater "
+            "than %d.\n", newImgSize, availableSizeTwoImgs);
+        return -1;
+    }
+
+    // If the current image fits in half the flash space and the new
+    // image to flash also fits in half the flash space, then flash it
+    // in the partition that is not currently being used to boot from.
+    if( curImgSize <= availableSizeTwoImgs &&
+        newImgSize <= availableSizeTwoImgs &&
+        getPartitionFromTag( pCurTag ) == 1 )
+    {
+        // Update rootfsAddr to point to the second boot partition.
+        int offset = (totalSize / 2) + TAG_LEN;
+
+        sprintf(((PFILE_TAG) tagFs)->kernelAddress, "%lu",
+            (unsigned long) IMAGE_BASE + offset + (kernelAddr - rootfsAddr));
+        kernelAddr = baseAddr + offset + (kernelAddr - rootfsAddr);
+
+        sprintf(((PFILE_TAG) tagFs)->rootfsAddress, "%lu",
+            (unsigned long) IMAGE_BASE + offset);
+        rootfsAddr = baseAddr + offset;
+    }
+
+    UpdateImageSequenceNumber( ((PFILE_TAG) tagFs)->imageSequence );
+    crc = getCrc32((unsigned char *)tagFs, (UINT32)TAG_LEN-TOKEN_LEN, crc);      
+    *(unsigned long *) &((PFILE_TAG) tagFs)->tagValidationToken[0] = crc;
+
+    if( (status = kerSysBcmImageSet((rootfsAddr-TAG_LEN), tagFs,
+        TAG_LEN + newImgSize)) != 0 )
+    {
+        printk("Failed to flash root file system. Error: %d\n", status);
+        return status;
+    }
+
+    for( p = nvramData.szBootline; p[2] != '\0'; p++ )
+        if( p[0] == 'p' && p[1] == '=' && p[2] != BOOT_LATEST_IMAGE )
+        {
+            UINT32 crc = CRC32_INIT_VALUE;
+    
+            // Change boot partition to boot from new image.
+            p[2] = BOOT_LATEST_IMAGE;
+
+            nvramData.ulCheckSum = 0;
+            crc = getCrc32((char *)&nvramData, (UINT32) sizeof(NVRAM_DATA), crc);      
+            nvramData.ulCheckSum = crc;
+            kerSysNvRamSet( (char *) &nvramData, sizeof(nvramData), 0);
+            break;
+        }
+
+    return(status);
+}
+
+PFILE_TAG kerSysImageTagGet(void)
+{
+    return( getBootImageTag() );
+}
+
 
 //********************************************************************************************
 // misc. ioctl calls come to here. (flash, led, reset, kernel memory access, etc.)
@@ -555,7 +854,6 @@ static int board_ioctl( struct inode *inode, struct file *flip,
     int ret = 0;
     BOARD_IOCTL_PARMS ctrlParms;
     unsigned char ucaMacAddr[NVRAM_MAC_ADDRESS_LEN];
-    int allowedSize;
 
     switch (command) 
     {
@@ -585,10 +883,10 @@ static int board_ioctl( struct inode *inode, struct file *flip,
                         break;
 
                     case BCM_IMAGE_CFE:
-                        if( ctrlParms.strLen <= 0 || ctrlParms.strLen > FLASH45_LENGTH_BOOT_ROM )
+                        if( ctrlParms.strLen <= 0 || ctrlParms.strLen > FLASH_LENGTH_BOOT_ROM )
                         {
                             printk("Illegal CFE size [%d]. Size allowed: [%d]\n",
-                                ctrlParms.strLen, FLASH45_LENGTH_BOOT_ROM);
+                                ctrlParms.strLen, FLASH_LENGTH_BOOT_ROM);
                             ret = -1;
                             break;
                         }
@@ -599,7 +897,7 @@ static int board_ioctl( struct inode *inode, struct file *flip,
                         // set memory type field
                         BpGetSdramSize( (unsigned long *) &ctrlParms.string[SDRAM_TYPE_ADDRESS_OFFSET] );
 
-                        ret = kerSysBcmImageSet(ctrlParms.offset, ctrlParms.string, ctrlParms.strLen);
+                        ret = kerSysBcmImageSet(ctrlParms.offset + BOOT_OFFSET, ctrlParms.string, ctrlParms.strLen);
 
                         // if nvram is not valid, restore the current nvram settings
                         if( BpSetBoardId( pNvramData->szBoardId ) != BP_SUCCESS &&
@@ -610,17 +908,11 @@ static int board_ioctl( struct inode *inode, struct file *flip,
                         break;
                         
                     case BCM_IMAGE_FS:
-                        allowedSize = (int) flash_get_total_size() - \
-                            FLASH_RESERVED_AT_END - TAG_LEN - FLASH45_LENGTH_BOOT_ROM;
-                        if( ctrlParms.strLen <= 0 || ctrlParms.strLen > allowedSize)
+                        if( (ret = flashFsKernelImage( ctrlParms.offset,
+                            ctrlParms.string, ctrlParms.strLen)) == 0 )
                         {
-                            printk("Illegal root file system size [%d]. Size allowed: [%d]\n",
-                                ctrlParms.strLen,  allowedSize);
-                            ret = -1;
-                            break;
+                            kerSysMipsSoftReset();
                         }
-                        ret = kerSysBcmImageSet(ctrlParms.offset, ctrlParms.string, ctrlParms.strLen);
-                        kerSysMipsSoftReset();
                         break;
 
                     case BCM_IMAGE_KERNEL:  // not used for now.
@@ -1023,6 +1315,27 @@ static int board_ioctl( struct inode *inode, struct file *flip,
                 ret = -EFAULT;
             break;
 
+        case BOARD_IOCTL_SET_MONITOR_FD:
+            if (copy_from_user((void*)&ctrlParms, (void*)arg, sizeof(ctrlParms)) == 0) {
+                int fput_needed = 0;
+
+                g_monitor_file = fget_light( ctrlParms.offset, &fput_needed );
+                if( g_monitor_file ) {
+                    /* Hook this file descriptor's poll function in order to set
+                     * the exception descriptor when there is a change in link
+                     * state.
+                     */
+                    g_monitor_task = current;
+                    g_orig_fop_poll = g_monitor_file->f_op->poll;
+                    g_monitor_file->f_op->poll = kerSysMonitorPollHook;
+                }
+            }
+            break;
+
+        case BOARD_IOCTL_WAKEUP_MONITOR_TASK:
+            kerSysWakeupMonitorTask();
+            break;
+
         default:
             ret = -EINVAL;
             ctrlParms.result = 0;
@@ -1193,7 +1506,7 @@ static void sesLed_ctrl(int action)
             led = kLedStateSlowBlinkContinues;                         
             break;
         case SES_LED_OFF:
-        default:
+            default:
             //printk("SES: led off\n");
             led = kLedStateOff;                                                
     }  
@@ -1214,6 +1527,242 @@ static void __exit ses_board_deinit()
 }
 #endif
 
+/***************************************************************************
+ * Dying gasp ISR and functions.
+ ***************************************************************************/
+#define KERSYS_DBG     printk
+
+#if defined(CONFIG_BCM96345)
+#define        CYCLE_PER_US    70
+#elif defined(CONFIG_BCM96348) || defined(CONFIG_BCM96338)
+/* The BCM6348 cycles per microsecond is really variable since the BCM6348
+ * MIPS speed can vary depending on the PLL settings.  However, an appoximate
+ * value of 120 will still work OK for the test being done.
+ */
+#define        CYCLE_PER_US    120
+#endif
+#define        DG_GLITCH_TO    (100*CYCLE_PER_US)
+static void __init kerSysDyingGaspMapIntr()
+{
+    unsigned long ulIntr;
+       
+#if defined(CONFIG_BCM96348) || defined(_BCM96348_) || defined(CONFIG_BCM96338) || defined(_BCM96338_)
+    if( BpGetAdslDyingGaspExtIntr( &ulIntr ) == BP_SUCCESS ) {
+               BcmHalMapInterrupt((FN_HANDLER)kerSysDyingGaspIsr, 0, INTERRUPT_ID_DG);
+               BcmHalInterruptEnable( INTERRUPT_ID_DG );
+    }
+#elif defined(CONFIG_BCM96345) || defined(_BCM96345_)
+    if( BpGetAdslDyingGaspExtIntr( &ulIntr ) == BP_SUCCESS ) {
+        ulIntr += INTERRUPT_ID_EXTERNAL_0;
+        BcmHalMapInterrupt((FN_HANDLER)kerSysDyingGaspIsr, 0, ulIntr);
+        BcmHalInterruptEnable( ulIntr );
+    }
+#endif
+
+} 
+
+void kerSysSetWdTimer(ulong timeUs)
+{
+       TIMER->WatchDogDefCount = timeUs * (FPERIPH/1000000);
+       TIMER->WatchDogCtl = 0xFF00;
+       TIMER->WatchDogCtl = 0x00FF;
+}
+
+ulong kerSysGetCycleCount(void)
+{
+    ulong cnt; 
+#ifdef _WIN32_WCE
+    cnt = 0;
+#else
+    __asm volatile("mfc0 %0, $9":"=d"(cnt));
+#endif
+    return(cnt); 
+}
+
+static Bool kerSysDyingGaspCheckPowerLoss(void)
+{
+    ulong clk0;
+    ulong ulIntr;
+
+    ulIntr = 0;
+    clk0 = kerSysGetCycleCount();
+
+    UART->Data = 'D';
+    UART->Data = '%';
+    UART->Data = 'G';
+
+#if defined(CONFIG_BCM96345)
+    BpGetAdslDyingGaspExtIntr( &ulIntr );
+
+    do {
+        ulong clk1;
+        
+        clk1 = kerSysGetCycleCount();          /* time cleared */
+       /* wait a little to get new reading */
+        while ((kerSysGetCycleCount()-clk1) < CYCLE_PER_US*2)
+            ;
+    } while ((0 == (PERF->ExtIrqCfg & (1 << (ulIntr + EI_STATUS_SHFT)))) && ((kerSysGetCycleCount() - clk0) < DG_GLITCH_TO));
+
+    if (PERF->ExtIrqCfg & (1 << (ulIntr + EI_STATUS_SHFT))) {  /* power glitch */
+        BcmHalInterruptEnable( ulIntr + INTERRUPT_ID_EXTERNAL_0);
+        KERSYS_DBG(" - Power glitch detected. Duration: %ld us\n", (kerSysGetCycleCount() - clk0)/CYCLE_PER_US);
+        return 0;
+    }
+#elif (defined(CONFIG_BCM96348) || defined(CONFIG_BCM96338)) && !defined(VXWORKS)
+    do {
+        ulong clk1;
+        
+        clk1 = kerSysGetCycleCount();          /* time cleared */
+       /* wait a little to get new reading */
+        while ((kerSysGetCycleCount()-clk1) < CYCLE_PER_US*2)
+            ;
+     } while ((PERF->IrqStatus & (1 << (INTERRUPT_ID_DG - INTERNAL_ISR_TABLE_OFFSET))) && ((kerSysGetCycleCount() - clk0) < DG_GLITCH_TO));
+
+    if (!(PERF->IrqStatus & (1 << (INTERRUPT_ID_DG - INTERNAL_ISR_TABLE_OFFSET)))) {
+        BcmHalInterruptEnable( INTERRUPT_ID_DG );
+        KERSYS_DBG(" - Power glitch detected. Duration: %ld us\n", (kerSysGetCycleCount() - clk0)/CYCLE_PER_US);
+        return 0;
+    }
+#endif
+    return 1;
+}
+
+static void kerSysDyingGaspShutdown( void )
+{
+    kerSysSetWdTimer(1000000);
+#if defined(CONFIG_BCM96345)
+    PERF->blkEnables &= ~(EMAC_CLK_EN | USB_CLK_EN | CPU_CLK_EN);   
+#elif defined(CONFIG_BCM96348)
+    PERF->blkEnables &= ~(EMAC_CLK_EN | USBS_CLK_EN | USBH_CLK_EN | SAR_CLK_EN);
+#endif
+}
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+static irqreturn_t kerSysDyingGaspIsr(int irq, void * dev_id, struct pt_regs * regs)
+#else
+static unsigned int kerSysDyingGaspIsr(void)
+#endif
+{      
+    struct list_head *pos;
+    CB_DGASP_LIST *tmp, *dsl = NULL;   
+
+    if (kerSysDyingGaspCheckPowerLoss()) {        
+
+        /* first to turn off everything other than dsl */        
+        list_for_each(pos, &g_cb_dgasp_list_head->list) {      
+            tmp = list_entry(pos, CB_DGASP_LIST, list);
+           if(strncmp(tmp->name, "dsl", 3)) {
+               (tmp->cb_dgasp_fn)(tmp->context); 
+           }else {
+               dsl = tmp;                      
+           }       
+        }  
+        
+        /* now send dgasp */
+        if(dsl)
+            (dsl->cb_dgasp_fn)(dsl->context); 
+
+        /* reset and shutdown system */
+        kerSysDyingGaspShutdown();
+    }
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+return( IRQ_HANDLED );
+#else
+    return( 1 );
+#endif
+}
+
+static void __init kerSysInitDyingGaspHandler( void )
+{
+    CB_DGASP_LIST *new_node;
+
+    if( g_cb_dgasp_list_head != NULL) {
+        printk("Error: kerSysInitDyingGaspHandler: list head is not null\n");
+        return;        
+    }
+    new_node= (CB_DGASP_LIST *)kmalloc(sizeof(CB_DGASP_LIST), GFP_KERNEL);
+    memset(new_node, 0x00, sizeof(CB_DGASP_LIST));
+    INIT_LIST_HEAD(&new_node->list);    
+    g_cb_dgasp_list_head = new_node; 
+               
+} /* kerSysInitDyingGaspHandler */
+
+static void __exit kerSysDeinitDyingGaspHandler( void )
+{
+    struct list_head *pos;
+    CB_DGASP_LIST *tmp; 
+       
+    if(g_cb_dgasp_list_head == NULL)
+        return;
+        
+    list_for_each(pos, &g_cb_dgasp_list_head->list) {          
+       tmp = list_entry(pos, CB_DGASP_LIST, list);
+        list_del(pos);
+       kfree(tmp);
+    }       
+
+    kfree(g_cb_dgasp_list_head);       
+    g_cb_dgasp_list_head = NULL;
+    
+} /* kerSysDeinitDyingGaspHandler */
+
+void kerSysRegisterDyingGaspHandler(char *devname, void *cbfn, void *context)
+{
+    CB_DGASP_LIST *new_node;
+
+    if( g_cb_dgasp_list_head == NULL) {
+        printk("Error: kerSysRegisterDyingGaspHandler: list head is null\n");  
+        return;    
+    }
+    
+    if( devname == NULL || cbfn == NULL ) {
+        printk("Error: kerSysRegisterDyingGaspHandler: register info not enough (%s,%x,%x)\n", devname, (unsigned int)cbfn, (unsigned int)context);            
+        return;
+    }
+       
+    new_node= (CB_DGASP_LIST *)kmalloc(sizeof(CB_DGASP_LIST), GFP_KERNEL);
+    memset(new_node, 0x00, sizeof(CB_DGASP_LIST));    
+    INIT_LIST_HEAD(&new_node->list);
+    strncpy(new_node->name, devname, IFNAMSIZ);
+    new_node->cb_dgasp_fn = (cb_dgasp_t)cbfn;
+    new_node->context = context;
+    list_add(&new_node->list, &g_cb_dgasp_list_head->list);
+    
+    printk("dgasp: kerSysRegisterDyingGaspHandler: %s registered \n", devname);
+               
+} /* kerSysRegisterDyingGaspHandler */
+
+void kerSysDeregisterDyingGaspHandler(char *devname)
+{
+    struct list_head *pos;
+    CB_DGASP_LIST *tmp;    
+    
+    if(g_cb_dgasp_list_head == NULL) {
+        printk("Error: kerSysDeregisterDyingGaspHandler: list head is null\n");
+        return;        
+    }
+
+    if(devname == NULL) {
+        printk("Error: kerSysDeregisterDyingGaspHandler: devname is null\n");
+        return;        
+    }
+    
+    printk("kerSysDeregisterDyingGaspHandler: %s is deregistering\n", devname);
+
+    list_for_each(pos, &g_cb_dgasp_list_head->list) {          
+       tmp = list_entry(pos, CB_DGASP_LIST, list);
+       if(!strcmp(tmp->name, devname)) {
+            list_del(pos);
+           kfree(tmp);
+           printk("kerSysDeregisterDyingGaspHandler: %s is deregistered\n", devname);
+           return;
+       }
+    }  
+    printk("kerSysDeregisterDyingGaspHandler: %s not (de)registered\n", devname);
+       
+} /* kerSysDeregisterDyingGaspHandler */
+
 /***************************************************************************
  * MACRO to call driver initialization and cleanup functions.
  ***************************************************************************/
@@ -1255,3 +1804,9 @@ EXPORT_SYMBOL(BpGetVoipChipSelect);
 EXPORT_SYMBOL(BpGetWirelessSesBtnGpio);
 EXPORT_SYMBOL(BpGetWirelessSesExtIntr);
 EXPORT_SYMBOL(BpGetWirelessSesLedGpio);
+EXPORT_SYMBOL(kerSysRegisterDyingGaspHandler);
+EXPORT_SYMBOL(kerSysDeregisterDyingGaspHandler);
+EXPORT_SYMBOL(kerSysGetCycleCount);
+EXPORT_SYMBOL(kerSysSetWdTimer);
+EXPORT_SYMBOL(kerSysWakeupMonitorTask);
+
index eba90d3..744bf19 100755 (executable)
@@ -63,6 +63,7 @@
 #define INTERRUPT_ID_EMAC1_RX_DMA        (INTERNAL_ISR_TABLE_OFFSET + 15)
 #define INTERRUPT_ID_EMAC1_TX_DMA        (INTERNAL_ISR_TABLE_OFFSET + 16)
 #define INTERRUPT_ID_SDIO                (INTERNAL_ISR_TABLE_OFFSET + 17)
+#define INTERRUPT_ID_ACLC                (INTERNAL_ISR_TABLE_OFFSET + 18)
 
 #ifdef __cplusplus
     }
index cc3b98d..85e8b9f 100755 (executable)
@@ -27,14 +27,20 @@ extern "C" {
 #include "bcmtypes.h"
 
 #define PERF_BASE           0xfffe0000
+#define TIMR_BASE           0xfffe0200 
 #define UART_BASE           0xfffe0300
 #define GPIO_BASE           0xfffe0400
+#define SPI_BASE            0xfffe0c00
 
 typedef struct PerfControl {
   uint32        RevID;
   uint16        testControl;
   uint16        blkEnables;
-#define USBH_CLK_EN     0x0100
+#define EMAC_CLK_EN     0x0010
+#define USBS_CLK_EN     0x0010
+#define SAR_CLK_EN      0x0020
+
+#define SPI_CLK_EN      0x0200
 
   uint32        pll_control;
 #define SOFT_RESET 0x00000001
@@ -68,6 +74,39 @@ typedef struct PerfControl {
 
 #define PERF ((volatile PerfControl * const) PERF_BASE)
 
+
+typedef struct Timer {
+  uint16        unused0;
+  byte          TimerMask;
+#define TIMER0EN        0x01
+#define TIMER1EN        0x02
+#define TIMER2EN        0x04
+  byte          TimerInts;
+#define TIMER0          0x01
+#define TIMER1          0x02
+#define TIMER2          0x04
+#define WATCHDOG        0x08
+  uint32        TimerCtl0;
+  uint32        TimerCtl1;
+  uint32        TimerCtl2;
+#define TIMERENABLE     0x80000000
+#define RSTCNTCLR       0x40000000      
+  uint32        TimerCnt0;
+  uint32        TimerCnt1;
+  uint32        TimerCnt2;
+  uint32        WatchDogDefCount;
+
+  /* Write 0xff00 0x00ff to Start timer
+   * Write 0xee00 0x00ee to Stop and re-load default count
+   * Read from this register returns current watch dog count
+   */
+  uint32        WatchDogCtl;
+
+  /* Number of 40-MHz ticks for WD Reset pulse to last */
+  uint32        WDResetCount;
+} Timer;
+
+#define TIMER ((volatile Timer * const) TIMR_BASE)
 typedef struct UartChannel {
   byte          unused0;
   byte          control;
@@ -209,6 +248,50 @@ typedef struct GpioControl {
 #define GPIO_NUM_MAX_BITS_MASK          0x0f
 #define GPIO_NUM_TO_MASK(X)             (1 << ((X) & GPIO_NUM_MAX_BITS_MASK))
 
+/*
+** Spi Controller
+*/
+
+typedef struct SpiControl {
+  uint16        spiCmd;                 /* (0x0): SPI command */
+#define SPI_CMD_START_IMMEDIATE         3
+
+#define SPI_CMD_COMMAND_SHIFT           0
+#define SPI_CMD_DEVICE_ID_SHIFT         4
+#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT  8
+
+  byte          spiIntStatus;           /* (0x2): SPI interrupt status */
+  byte          spiMaskIntStatus;       /* (0x3): SPI masked interrupt status */
+
+  byte          spiIntMask;             /* (0x4): SPI interrupt mask */
+#define SPI_INTR_CMD_DONE               0x01
+#define SPI_INTR_CLEAR_ALL              0x1f
+
+  byte          spiStatus;              /* (0x5): SPI status */
+
+  byte          spiClkCfg;              /* (0x6): SPI clock configuration */
+
+  byte          spiFillByte;            /* (0x7): SPI fill byte */
+
+  byte          unused0; 
+  byte          spiMsgTail;             /* (0x9): msgtail */
+  byte          unused1; 
+  byte          spiRxTail;              /* (0xB): rxtail */
+
+  uint32        unused2[13];            /* (0x0c - 0x3c) reserved */
+
+  byte          spiMsgCtl;              /* (0x40) control byte */
+#define HALF_DUPLEX_W                   1
+#define HALF_DUPLEX_R                   2
+#define SPI_MSG_TYPE_SHIFT              6
+#define SPI_BYTE_CNT_SHIFT              0
+  byte          spiMsgData[63];         /* (0x41 - 0x7f) msg data */
+  byte          spiRxDataFifo[64];      /* (0x80 - 0xbf) rx data */
+  byte          unused3[64];            /* (0xc0 - 0xff) reserved */
+} SpiControl;
+
+#define SPI ((volatile SpiControl * const) SPI_BASE)
+
 /*
 ** External Bus Interface
 */
index eaa77e6..05f4758 100755 (executable)
@@ -54,6 +54,7 @@
 #define INTERRUPT_ID_ATM                (INTERNAL_ISR_TABLE_OFFSET +  4)
 #define INTERRUPT_ID_USB                (INTERNAL_ISR_TABLE_OFFSET +  5)
 #define INTERRUPT_ID_EMAC               (INTERNAL_ISR_TABLE_OFFSET +  8)
+#define INTERRUPT_ID_ACLC                (INTERNAL_ISR_TABLE_OFFSET + 11)
 #define INTERRUPT_ID_EPHY               (INTERNAL_ISR_TABLE_OFFSET +  12)
 
 /* DMA channel interrupt IDs */        
index 4da2358..2a18859 100755 (executable)
@@ -31,7 +31,10 @@ typedef struct IntControl {
   uint32        RevID;
   uint16        testControl;
   uint16        blkEnables;
+#define USB_CLK_EN      0x0100
+#define EMAC_CLK_EN     0x0080
 #define UART_CLK_EN     0x0008
+#define CPU_CLK_EN      0x0001
 
   uint32        pll_control;
 #define SOFT_RESET     0x00000001
@@ -51,6 +54,40 @@ typedef struct IntControl {
 #define INTC_BASE     0xfffe0000
 #define PERF ((volatile IntControl * const) INTC_BASE)
 
+#define TIMR_BASE     0xfffe0200    
+typedef struct Timer {
+  uint16        unused0;
+  byte          TimerMask;
+#define TIMER0EN        0x01
+#define TIMER1EN        0x02
+#define TIMER2EN        0x04
+  byte          TimerInts;
+#define TIMER0          0x01
+#define TIMER1          0x02
+#define TIMER2          0x04
+#define WATCHDOG        0x08
+  uint32        TimerCtl0;
+  uint32        TimerCtl1;
+  uint32        TimerCtl2;
+#define TIMERENABLE     0x80000000
+#define RSTCNTCLR       0x40000000      
+  uint32        TimerCnt0;
+  uint32        TimerCnt1;
+  uint32        TimerCnt2;
+  uint32        WatchDogDefCount;
+
+  /* Write 0xff00 0x00ff to Start timer
+   * Write 0xee00 0x00ee to Stop and re-load default count
+   * Read from this register returns current watch dog count
+   */
+  uint32        WatchDogCtl;
+
+  /* Number of 40-MHz ticks for WD Reset pulse to last */
+  uint32        WDResetCount;
+} Timer;
+
+#define TIMER ((volatile Timer * const) TIMR_BASE)
+
 typedef struct UartChannel {
   byte          unused0;
   byte          control;
index c2eda26..695ffde 100755 (executable)
@@ -27,6 +27,7 @@ extern "C" {
 #include "bcmtypes.h"
 
 #define PERF_BASE           0xfffe0000
+#define TIMR_BASE           0xfffe0200    
 #define UART_BASE           0xfffe0300
 #define GPIO_BASE           0xfffe0400
 #define MPI_BASE            0xfffe2000    /* MPI control registers */
@@ -37,6 +38,9 @@ typedef struct PerfControl {
   uint32        RevID;
   uint16        testControl;
   uint16        blkEnables;
+#define EMAC_CLK_EN     0x0010
+#define SAR_CLK_EN      0x0020
+#define USBS_CLK_EN     0x0040
 #define USBH_CLK_EN     0x0100
 
   uint32        pll_control;
@@ -87,6 +91,39 @@ typedef struct PerfControl {
 
 #define PERF ((volatile PerfControl * const) PERF_BASE)
 
+typedef struct Timer {
+  uint16        unused0;
+  byte          TimerMask;
+#define TIMER0EN        0x01
+#define TIMER1EN        0x02
+#define TIMER2EN        0x04
+  byte          TimerInts;
+#define TIMER0          0x01
+#define TIMER1          0x02
+#define TIMER2          0x04
+#define WATCHDOG        0x08
+  uint32        TimerCtl0;
+  uint32        TimerCtl1;
+  uint32        TimerCtl2;
+#define TIMERENABLE     0x80000000
+#define RSTCNTCLR       0x40000000      
+  uint32        TimerCnt0;
+  uint32        TimerCnt1;
+  uint32        TimerCnt2;
+  uint32        WatchDogDefCount;
+
+  /* Write 0xff00 0x00ff to Start timer
+   * Write 0xee00 0x00ee to Stop and re-load default count
+   * Read from this register returns current watch dog count
+   */
+  uint32        WatchDogCtl;
+
+  /* Number of 40-MHz ticks for WD Reset pulse to last */
+  uint32        WDResetCount;
+} Timer;
+
+#define TIMER ((volatile Timer * const) TIMR_BASE)
+
 typedef struct UartChannel {
   byte          unused0;
   byte          control;
index e1917b2..f837ed5 100755 (executable)
@@ -30,7 +30,7 @@
 
 
 #define BCM_SIG_1   "U.S. Robotics"
-#define BCM_SIG_2   "ver. 300L0305"          // was "firmware version 2.0" now it is split 6 char out for chip id.
+#define BCM_SIG_2   "ver. 304L0110"          // was "firmware version 2.0" now it is split 6 char out for chip id.
 
 #define BCM_TAG_VER         "6"
 #define BCM_TAG_VER_LAST    "26"
@@ -66,8 +66,7 @@ typedef struct _FILE_TAG
     unsigned char rootfsLen[IMAGE_LEN];          // if non zero, filesystem size in clear ASCII text.
     unsigned char kernelAddress[ADDRESS_LEN];    // if non zero, kernel starting address
     unsigned char kernelLen[IMAGE_LEN];          // if non zero, kernel size in clear ASCII text.
-    unsigned char dualImage[FLAG_LEN];           // if 1, dual image
-    unsigned char inactiveLen[FLAG_LEN];         // if 1, the image is INACTIVE; if 0, active 
+    unsigned char imageSequence[FLAG_LEN * 2];   // incrments everytime an image is flashed
     unsigned char reserved[RESERVED_LEN];        // reserved for later use
     unsigned char imageValidationToken[TOKEN_LEN];// image validation token - can be crc, md5, sha;  for
                                                  // now will be 4 unsigned char crc
index 1e51e2d..770373b 100755 (executable)
@@ -19,7 +19,6 @@
 /***********************************************************************/
 /*                                                                     */
 /*   MODULE:  board.h                                                  */
-/*   DATE:    97/02/18                                                 */
 /*   PURPOSE: Board specific information.  This module should include  */
 /*            all base device addresses and board specific macros.     */
 /*                                                                     */
 #if __cplusplus
 extern "C" {
 #endif
-/*****************************************************************************/
-/*                    Misc board definitions                                 */
-/*****************************************************************************/
+
+#define        DYING_GASP_API
 
 /*****************************************************************************/
 /*                    Physical Memory Map                                    */
 /*****************************************************************************/
 
 #define PHYS_DRAM_BASE           0x00000000     /* Dynamic RAM Base */
-#define PHYS_FLASH_BASE          0x1FC00000     /* Flash Memory         */
+#define PHYS_FLASH_BASE          0x1FC00000     /* Flash Memory     */
 
 /*****************************************************************************/
 /* Note that the addresses above are physical addresses and that programs    */
@@ -47,53 +45,42 @@ extern "C" {
 /*****************************************************************************/
 #define DRAM_BASE           (0x80000000 | PHYS_DRAM_BASE)   /* cached DRAM */
 #define DRAM_BASE_NOCACHE   (0xA0000000 | PHYS_DRAM_BASE)   /* uncached DRAM */
-#define FLASH_BASE          (0xA0000000 | PHYS_FLASH_BASE)  /* uncached Flash  */
 
-/*****************************************************************************/
-/*  Select the PLL value to get the desired CPU clock frequency.             */
-/*                                                                           */
-/*                                                                           */
-/*****************************************************************************/
-#define FPERIPH            50000000
+/* Binary images are always built for a standard MIPS boot address */
+#define IMAGE_BASE          (0xA0000000 | 0x1FC00000)
 
-#define ONEK                            1024
-#define BLK64K                          (64*ONEK)
-#define FLASH45_BLKS_BOOT_ROM           1
-#define FLASH45_LENGTH_BOOT_ROM         (FLASH45_BLKS_BOOT_ROM * BLK64K)
-#define FLASH_RESERVED_AT_END           (64*ONEK) /*reserved for PSI, scratch pad*/
-    
-/*****************************************************************************/
-/* Note that the addresses above are physical addresses and that programs    */
-/* have to use converted addresses defined below:                            */
-/*****************************************************************************/
-#define DRAM_BASE           (0x80000000 | PHYS_DRAM_BASE)   /* cached DRAM */
-#define DRAM_BASE_NOCACHE   (0xA0000000 | PHYS_DRAM_BASE)   /* uncached DRAM */
+/* Some chips support alternative boot vector */
+#if defined(_BCM96348_) || defined(CONFIG_BCM96348)
+#define FLASH_BASE          (0xA0000000 | (MPI->cs[0].base & 0xFFFFFF00))
+#define BOOT_OFFSET         (FLASH_BASE - IMAGE_BASE)
+#else
 #define FLASH_BASE          (0xA0000000 | PHYS_FLASH_BASE)  /* uncached Flash  */
+#define BOOT_OFFSET         0
+#endif
 
 /*****************************************************************************/
 /*  Select the PLL value to get the desired CPU clock frequency.             */
-/*                                                                           */
-/*                                                                           */
 /*****************************************************************************/
 #define FPERIPH            50000000
-    
-#define SDRAM_TYPE_ADDRESS_OFFSET   16
-#define NVRAM_DATA_OFFSET           0x0580
-#define NVRAM_DATA_ID               0x0f1e2d3c
-#define BOARD_SDRAM_TYPE            *(unsigned long *) \
-                                    (FLASH_BASE + SDRAM_TYPE_ADDRESS_OFFSET)
 
-#define ONEK                1024
-#define BLK64K              (64*ONEK)
-
-// nvram and psi flash definitions for 45
-#define FLASH45_LENGTH_NVRAM            ONEK            // 1k nvram 
-#define NVRAM_PSI_DEFAULT               24              // default psi in K byes
+/*****************************************************************************/
+/* Board memory type offset                                                  */
+/*****************************************************************************/
+#define SDRAM_TYPE_ADDRESS_OFFSET       16
+#define NVRAM_DATA_OFFSET               0x0580
+#define NVRAM_DATA_ID                   0x0f1e2d3c
+#define BOARD_SDRAM_TYPE                *(unsigned long *)(FLASH_BASE + SDRAM_TYPE_ADDRESS_OFFSET)
+#define BOARD_SDRAM_TYPE_ADDRESS        (0xA0000000 + PHYS_FLASH_BASE + SDRAM_TYPE_ADDRESS_OFFSET)
 
 /*****************************************************************************/
 /*       NVRAM Offset and definition                                         */
 /*****************************************************************************/
+#define NVRAM_PSI_DEFAULT               24              // default psi in K byes
+#define ONEK                            1024
+#define FLASH_LENGTH_BOOT_ROM           (64*ONEK)
+#define FLASH_RESERVED_AT_END           (64*ONEK) /*reserved for PSI, scratch pad*/
 
+#define NVRAM_LENGTH                    ONEK            // 1k nvram 
 #define NVRAM_VERSION_NUMBER            2
 #define NVRAM_VERSION_NUMBER_ADDRESS    0
 
@@ -101,15 +88,18 @@ extern "C" {
 #define NVRAM_BOARD_ID_STRING_LEN       16
 #define NVRAM_MAC_ADDRESS_LEN           6
 #define NVRAM_MAC_COUNT_MAX             32
+#define NVRAM_MAC_COUNT_DEFAULT         0 
 
 /*****************************************************************************/
 /*       Misc Offsets                                                        */
 /*****************************************************************************/
-
 #define CFE_VERSION_OFFSET           0x0570
 #define CFE_VERSION_MARK_SIZE        5
 #define CFE_VERSION_SIZE             5
 
+#define BOOT_LATEST_IMAGE   '0'
+#define BOOT_PREVIOUS_IMAGE '1'
+
 typedef struct
 {
     unsigned long ulVersion;
@@ -174,10 +164,10 @@ typedef struct
 #define BOARD_IOCTL_GET_SDRAM_SIZE \
     _IOWR(BOARD_IOCTL_MAGIC, 12, BOARD_IOCTL_PARMS)
 
-#define BOARD_IOCTL_GET_ENET_MODE_FLAG \
+#define BOARD_IOCTL_SET_MONITOR_FD \
     _IOWR(BOARD_IOCTL_MAGIC, 13, BOARD_IOCTL_PARMS)
-
-#define BOARD_IOCTL_SET_ENET_MODE_FLAG \
+    
+#define BOARD_IOCTL_WAKEUP_MONITOR_TASK \
     _IOWR(BOARD_IOCTL_MAGIC, 14, BOARD_IOCTL_PARMS)
 
 #define BOARD_IOCTL_GET_BOOTLINE \
@@ -317,13 +307,12 @@ typedef struct flashaddrinfo
 #define TOKEN_NAME_LEN      16
 #define SP_VERSION          1
 #define SP_MAX_LEN          8 * 1024            // 8k buf before psi
-#define SP_RESERVERD        16
+#define SP_RESERVERD        20
 
 typedef struct _SP_HEADER
 {
     char SPMagicNum[MAGIC_NUM_LEN];             // 8 bytes of magic number
     int SPVersion;                              // version number
-    int SPUsedLen;                              // used sp len   
     char SPReserved[SP_RESERVERD];              // reservied, total 32 bytes
 } SP_HEADER, *PSP_HEADER;
 
@@ -357,6 +346,12 @@ void kerSysMipsSoftReset(void);
 void kerSysLedCtrl(BOARD_LED_NAME, BOARD_LED_STATE);
 void kerSysLedRegisterHwHandler( BOARD_LED_NAME, HANDLE_LED_FUNC, int );
 int kerSysFlashSizeGet(void);
+int kerSysMemoryMappedFlashSizeGet(void);
+unsigned long kerSysReadFromFlash( void *toaddr, unsigned long fromaddr,
+    unsigned long len );
+void kerSysRegisterDyingGaspHandler(char *devname, void *cbfn, void *context);
+void kerSysDeregisterDyingGaspHandler(char *devname);    
+void kerSysWakeupMonitorTask( void );
 #endif
 
 #if __cplusplus
index 86af92b..2f5a6a2 100755 (executable)
Binary files a/hostTools/bcmImageBuilder and b/hostTools/bcmImageBuilder differ
index 522c6e5..0c654f7 100755 (executable)
Binary files a/hostTools/createimg and b/hostTools/createimg differ
index ceb6cb9..51e5dc7 100755 (executable)
@@ -54,6 +54,7 @@ CONFIG_MIPS_BRCM=y
 # CONFIG_BCM96338 is not set
 # CONFIG_BCM96345 is not set
 # CONFIG_BCM96348 is not set
+# CONFIG_BCM96358 is not set
 
 # CONFIG_BCM_BOARD is not set
 # CONFIG_BCM_SERIAL is not set
@@ -69,6 +70,7 @@ CONFIG_MIPS_BRCM=y
 # CONFIG_BCM_VDSL is not set
 # CONFIG_BCM_SECURITY is not set
 # CONFIG_BCM_HPNA is not set
+# CONFIG_BCM_BCMPROF is not set
 
 # CONFIG_BCM96338_BOARD_IMPL=1
 # CONFIG_BCM96338_SERIAL_IMPL=1
@@ -84,6 +86,7 @@ CONFIG_MIPS_BRCM=y
 # CONFIG_BCM96338_VDSL_IMPL=1
 # CONFIG_BCM96338_SECURITY_IMPL=1
 # CONFIG_BCM96338_HPNA_IMPL=0
+# CONFIG_BCM96338_BCMPROF_IMPL=1
 
 # CONFIG_BCM96345_BOARD_IMPL=1
 # CONFIG_BCM96345_SERIAL_IMPL=1
@@ -99,6 +102,7 @@ CONFIG_MIPS_BRCM=y
 # CONFIG_BCM96345_VDSL_IMPL=1
 # CONFIG_BCM96345_SECURITY_IMPL=1
 # CONFIG_BCM96345_HPNA_IMPL=0
+# CONFIG_BCM96345_BCMPROF_IMPL=1
 
 # CONFIG_BCM96348_BOARD_IMPL=1
 # CONFIG_BCM96348_SERIAL_IMPL=1
@@ -114,6 +118,23 @@ CONFIG_MIPS_BRCM=y
 # CONFIG_BCM96348_VDSL_IMPL=1
 # CONFIG_BCM96348_SECURITY_IMPL=1
 # CONFIG_BCM96348_HPNA_IMPL=0
+# CONFIG_BCM96348_BCMPROF_IMPL=1
+
+# CONFIG_BCM96358_BOARD_IMPL=1
+# CONFIG_BCM96358_SERIAL_IMPL=1
+# CONFIG_BCM96358_ENET_IMPL=2
+# CONFIG_BCM96358_ATMAPI_IMPL=1
+# CONFIG_BCM96358_BLAA_IMPL=1
+# CONFIG_BCM96358_ATMTEST_IMPL=1
+# CONFIG_BCM96358_USB_IMPL=2
+# CONFIG_BCM96358_ADSL_IMPL=1
+# CONFIG_BCM96358_WLAN_IMPL=1
+# CONFIG_BCM96358_ENDPOINT_IMPL=1
+# CONFIG_BCM96358_PROCFS_IMPL=1
+# CONFIG_BCM96358_VDSL_IMPL=1
+# CONFIG_BCM96358_SECURITY_IMPL=1
+# CONFIG_BCM96358_HPNA_IMPL=0
+# CONFIG_BCM96358_BCMPROF_IMPL=1
 
 # CONFIG_ROOTFS_SQUASHFS is not set
 # CONFIG_ROOTFS_CRAMFS is not set
@@ -396,6 +417,7 @@ CONFIG_INET=y
 # CONFIG_INET_AH is not set
 # CONFIG_INET_ESP is not set
 # CONFIG_INET_IPCOMP is not set
+# CONFIG_XFRM_USER is not set
 
 #
 # IP: Virtual Server Configuration
@@ -534,14 +556,17 @@ CONFIG_ATM_RT2684=y
 # QoS and/or fair queueing
 #
 # CONFIG_NET_SCHED is not set
-# CONFIG_NET_SCH_CBQ is not set
-# CONFIG_NET_SCH_HTB is not set
+# CONFIG_NET_SCH_CLK_JIFFIES is not set
+# NET_SCH_CLK_GETTIMEOFDAY is not set
+# NET_SCH_CLK_CPU is not set
+# CONFIG_NET_SCH_CBQ is not sety
+# CONFIG_NET_SCH_HTB is not sety
 # CONFIG_NET_SCH_HFSC is not set
 # CONFIG_NET_SCH_CSZ is not set
 # CONFIG_NET_SCH_ATM is not set
-# CONFIG_NET_SCH_PRIO is not set
+# CONFIG_NET_SCH_PRIO is not sety
 # CONFIG_NET_SCH_RED is not set
-# CONFIG_NET_SCH_SFQ is not set
+# CONFIG_NET_SCH_SFQ is not sety
 # CONFIG_NET_SCH_TEQL is not set
 # CONFIG_NET_SCH_TBF is not set
 # CONFIG_NET_SCH_GRED is not set
@@ -550,7 +575,7 @@ CONFIG_ATM_RT2684=y
 # CONFIG_NET_SCH_INGRESS is not set
 # CONFIG_NET_QOS is not set
 # CONFIG_NET_ESTIMATOR is not set
-# CONFIG_NET_CLS is not set
+# CONFIG_NET_CLS is not sety
 # CONFIG_NET_CLS_TCINDEX is not set
 # CONFIG_NET_CLS_ROUTE4 is not set
 # CONFIG_NET_CLS_FW is not set
@@ -558,6 +583,11 @@ CONFIG_ATM_RT2684=y
 # CONFIG_NET_CLS_RSVP is not set
 # CONFIG_NET_CLS_RSVP6 is not set
 # CONFIG_NET_CLS_POLICE is not set
+# CONFIG_NET_SCH_NETEM is not set
+# CONFIG_NET_CLS_IND is not set
+# CONFIG_NET_CLS_ACT is not set
+# CONFIG_CLS_U32_PERF is not set
+
 
 #
 # Network testing
@@ -693,6 +723,11 @@ CONFIG_PPPOATM=y
 #
 # CONFIG_PHONE is not set
 
+#
+# Profiling Support
+#
+# CONFIG_BCMPROF is not set
+
 #
 # Input device support
 #
@@ -1013,6 +1048,30 @@ CONFIG_CMDLINE=""
 # Cryptographic options
 #
 # CONFIG_CRYPTO is not set
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+# CONFIG_CRYPTO_MD5 is not set
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA1_Z990 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_DES_Z990 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_AES_586 is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_TEST is not set
 
 #
 # Library routines
index 6057a09..af931de 100755 (executable)
@@ -104,6 +104,8 @@ driver_setup "VDSL" "VDSL"
 
 driver_setup "PHONE" "ENDPOINT"
 
+driver_setup "BCMPROF" "BCMPROF"
+
 driver_setup "HPNA" "HPNA"
 
 driver_setup "SECURITY" "SECURITY"
@@ -194,6 +196,16 @@ SEDCMD="$SEDCMD -e 's/# CONFIG_KALLSYMS is not set/CONFIG_KALLSYMS=y/'"
 SEDCMD="$SEDCMD -e 's/# CONFIG_KALLSYMS_EXTRA_PASS is not set/CONFIG_KALLSYMS_EXTRA_PASS=y/'"
 fi
 
+
+############################################################
+#      Kernel preemption
+############################################################
+
+if [ "$BRCM_KERNEL_PREEMPT" = "y" ]; then
+SEDCMD="$SEDCMD -e 's/# CONFIG_PREEMPT is not set/CONFIG_PREEMPT=y/'"
+fi
+
+
 ############################################################
 #      Netfilter config generation
 ############################################################
@@ -282,12 +294,46 @@ if [ "$BRCM_KERNEL_NETFILTER" != "" ]; then
 
 fi
 
+############################################################
+#      Cryptographic config generation
+############################################################
+if [ "$BRCM_KERNEL_CRYPTO" != "" ]; then
+
+   # set up networking options
+   SEDCMD="$SEDCMD -e 's/# CONFIG_NET_KEY is not set/CONFIG_NET_KEY=y/'"
+   SEDCMD="$SEDCMD -e 's/# CONFIG_INET_AH is not set/CONFIG_INET_AH=y/'"
+   SEDCMD="$SEDCMD -e 's/# CONFIG_INET_ESP is not set/CONFIG_INET_ESP=y/'"
+   SEDCMD="$SEDCMD -e 's/# CONFIG_XFRM_USER is not set/CONFIG_XFRM_USER=y/'"
+   
+   # set up cryptographic options
+   SEDCMD="$SEDCMD -e 's/# CONFIG_CRYPTO is not set/CONFIG_CRYPTO=y/'"
+   if [ "$BRCM_KERNEL_CRYPTO_HMAC" != "" ]; then
+         SEDCMD="$SEDCMD -e 's/# CONFIG_CRYPTO_HMAC is not set/CONFIG_CRYPTO_HMAC=y/'"
+   fi
+   if [ "$BRCM_KERNEL_CRYPTO_NULL" != "" ]; then
+         SEDCMD="$SEDCMD -e 's/# CONFIG_CRYPTO_NULL is not set/CONFIG_CRYPTO_NULL=y/'"
+   fi
+   if [ "$BRCM_KERNEL_CRYPTO_MD5" != "" ]; then
+         SEDCMD="$SEDCMD -e 's/# CONFIG_CRYPTO_MD5 is not set/CONFIG_CRYPTO_MD5=y/'"
+   fi
+   if [ "$BRCM_KERNEL_CRYPTO_SHA1" != "" ]; then
+         SEDCMD="$SEDCMD -e 's/# CONFIG_CRYPTO_SHA1 is not set/CONFIG_CRYPTO_SHA1=y/'"
+   fi
+   if [ "$BRCM_KERNEL_CRYPTO_DES" != "" ]; then
+         SEDCMD="$SEDCMD -e 's/# CONFIG_CRYPTO_DES is not set/CONFIG_CRYPTO_DES=y/'"
+   fi
+   if [ "$BRCM_KERNEL_CRYPTO_AES" != "" ]; then
+         SEDCMD="$SEDCMD -e 's/# CONFIG_CRYPTO_AES is not set/CONFIG_CRYPTO_AES=y/'"
+   fi
+fi
+
 ############################################################
 #      Bridge Layer filter config generation
 ############################################################
 if [ "$BUILD_EBTABLES" != "" ]; then
 SEDCMD="$SEDCMD -e 's/# CONFIG_BRIDGE_NF_EBTABLES is not set/CONFIG_BRIDGE_NF_EBTABLES=y/'"
 SEDCMD="$SEDCMD -e 's/# CONFIG_BRIDGE_EBT_T_FILTER is not set/CONFIG_BRIDGE_EBT_T_FILTER=y/'"
+SEDCMD="$SEDCMD -e 's/# CONFIG_BRIDGE_EBT_BROUTE is not set/CONFIG_BRIDGE_EBT_BROUTE=y/'"
 SEDCMD="$SEDCMD -e 's/# CONFIG_BRIDGE_EBT_IP is not set/CONFIG_BRIDGE_EBT_IP=y/'"
 SEDCMD="$SEDCMD -e 's/# CONFIG_BRIDGE_EBT_VLAN is not set/CONFIG_BRIDGE_EBT_VLAN=y/'"
 SEDCMD="$SEDCMD -e 's/# CONFIG_BRIDGE_EBT_TIME is not set/CONFIG_BRIDGE_EBT_TIME=y/'"
@@ -308,19 +354,16 @@ fi
 ############################################################
 if [ "$BRCM_KERNEL_NETQOS" != "" ]; then
    SEDCMD="$SEDCMD -e 's/# CONFIG_NET_SCHED is not set/CONFIG_NET_SCHED=y/'"
-   SEDCMD="$SEDCMD -e 's/# CONFIG_NET_QOS is not set/CONFIG_NET_QOS=y/'"
-   SEDCMD="$SEDCMD -e 's/# CONFIG_NET_ESTIMATOR is not set/CONFIG_NET_ESTIMATOR=y/'"
+   SEDCMD="$SEDCMD -e 's/# CONFIG_NET_SCH_CLK_JIFFIES is not set/CONFIG_NET_SCH_CLK_JIFFIES=y/'"
    SEDCMD="$SEDCMD -e 's/# CONFIG_NET_CLS is not set/CONFIG_NET_CLS=y/'"
    SEDCMD="$SEDCMD -e 's/# CONFIG_NET_CLS_POLICE is not set/CONFIG_NET_CLS_POLICE=y/'"
    general_setup CONFIG_NET_SCH_CBQ  $BRCM_KERNEL_NETQOS
    general_setup CONFIG_NET_SCH_HTB  $BRCM_KERNEL_NETQOS
-   general_setup CONFIG_NET_SCH_HFSC $BRCM_KERNEL_NETQOS
    general_setup CONFIG_NET_SCH_PRIO $BRCM_KERNEL_NETQOS
    general_setup CONFIG_NET_SCH_SFQ $BRCM_KERNEL_NETQOS
-   general_setup CONFIG_NET_SCH_DSMARK $BRCM_KERNEL_NETQOS
-   general_setup CONFIG_NET_CLS_TCINDEX $BRCM_KERNEL_NETQOS
    general_setup CONFIG_NET_CLS_FW $BRCM_KERNEL_NETQOS
    general_setup CONFIG_NET_CLS_U32 $BRCM_KERNEL_NETQOS
+   general_setup CONFIG_NET_CLS_POLICE $BRCM_KERNEL_NETQOS
 fi
 
 ############################################################
index 7bbdaec..fb5a18c 100755 (executable)
@@ -405,7 +405,7 @@ endif # KBUILD_EXTMOD
 
 # CONFIG_MIPS_BRCM Begin Broadcom changed code.
 export HPATH   := $(TOPDIR)/include
-brcmdrivers-y  := $(INC_BRCMBOARDPARMS_PATH)/$(BRCM_BOARD)/ $(BRCMDRIVERS_DIR)/
+brcmdrivers-y  := $(INC_BRCMBOARDPARMS_PATH)/$(BRCM_BOARD)/ $(BRCMDRIVERS_DIR)/ $(INC_BRCMSHARED_SRC_PATH)/
 BRCMDRIVERS    := $(brcmdrivers-y)
 # CONFIG_MIPS_BRCM End Broadcom changed code.
 
@@ -653,8 +653,7 @@ $(vmlinux-dirs): prepare-all scripts
 .PHONY: prepare-all prepare prepare0 prepare1 prepare2 preparebrcmdriver
 
 preparebrcmdriver:
-       $(Q)$(MAKE) -C $(BRCMDRIVERS_DIR)/opensource symlinks
-       $(Q)$(MAKE) -C $(BRCMDRIVERS_DIR)/broadcom symlinks
+       $(Q)$(MAKE) -C $(BRCMDRIVERS_DIR) symlinks
 # CONFIG_MIPS_BRCM End Broadcom changed code.
 
 # prepare 2 generate Makefile to be placed in output directory, if
index 4140f98..ab8fb26 100755 (executable)
@@ -61,6 +61,10 @@ config BCM_ENDPOINT
        tristate "Support for VOICE"
        depends on BCM96338 || BCM96345 || BCM96348
 
+config BCM_BCMPROF
+       tristate "Support for profiling"
+       depends on BCM96338 || BCM96345 || BCM96348
+
 config BCM_PROCFS
        tristate "Support for PROCFS"
        depends on BCM96338 || BCM96345 || BCM96348
@@ -117,6 +121,10 @@ config BCM_ENDPOINT_IMPL
        int "Implementation index for VOICE"
        depends on BCM96338 || BCM96345 || BCM96348
 
+config BCM_BCMPROF_IMPL
+       int "Implementation index for PROFILING"
+       depends on BCM96338 || BCM96345 || BCM96348
+
 config BCM_PROCFS_IMPL
        int "Implementation index for PROCFS"
        depends on BCM96338 || BCM96345 || BCM96348
index ddad0ef..ce5ad41 100755 (executable)
@@ -48,8 +48,7 @@ static void irq_dispatch_int(struct pt_regs *regs)
 
     pendingIrqs = PERF->IrqStatus & PERF->IrqMask;
     if (!pendingIrqs) {
-       printk("***no pending IRQ***\n");
-       return;
+        return;
     }
 
     while (1) {
@@ -229,8 +228,6 @@ int request_external_irq(unsigned int irq,
     return( request_irq(irq, handler, irqflags, devname, dev_id) );
 }
 
-/* VxWorks compatibility function(s). */
-
 unsigned int BcmHalMapInterrupt(FN_HANDLER pfunc, unsigned int param,
     unsigned int interruptId)
 {
@@ -251,7 +248,8 @@ unsigned int BcmHalMapInterrupt(FN_HANDLER pfunc, unsigned int param,
     if( interruptId >= INTERNAL_ISR_TABLE_OFFSET )
     {
         nRet = request_irq( interruptId, pfunc, SA_SAMPLE_RANDOM | SA_INTERRUPT,
-            devname, (void *) param );
+                devname, (void *) param );
+            
     }
     else if (interruptId >= INTERRUPT_ID_EXTERNAL_0 && interruptId <= INTERRUPT_ID_EXTERNAL_3)
     {
@@ -262,7 +260,6 @@ unsigned int BcmHalMapInterrupt(FN_HANDLER pfunc, unsigned int param,
     return( nRet );
 }
 
-
 /* Debug function. */
 
 void dump_intr_regs(void)
index c304817..5eca144 100755 (executable)
@@ -168,50 +168,51 @@ static int cardtype_vcc_detect(void)
     int cardtype;
 
     cardtype = MPI_CARDTYPE_NONE;
-    mpi->pcmcia_cntl1 = 0x0000A000; // Turn on the output enables and drive
+    mpi->pcmcia_cntl1 = (CARDBUS_ENABLE|PCMCIA_GPIO_ENABLE); // Turn on the output enables and drive
                                         // the CVS pins to 0.
     data32 = mpi->pcmcia_cntl1;
-    switch (data32 & 0x00000003)  // Test CD1# and CD2#, see if card is plugged in.
+    switch (data32 & (CD2_IN|CD1_IN))  // Test CD1# and CD2#, see if card is plugged in.
     {
-    case 0x00000003:  // No Card is in the slot.
+    case (CD2_IN|CD1_IN):  // No Card is in the slot.
         printk("mpi: No Card is in the PCMCIA slot\n");
         break;
 
-    case 0x00000002:  // Partial insertion, No CD2#.
+    case CD2_IN:  // Partial insertion, No CD2#.
         printk("mpi: Card in the PCMCIA slot partial insertion, no CD2 signal\n");
         break;
 
-    case 0x00000001:  // Partial insertion, No CD1#.
+    case CD1_IN:  // Partial insertion, No CD1#.
         printk("mpi: Card in the PCMCIA slot partial insertion, no CD1 signal\n");
         break;
 
     case 0x00000000:
-        mpi->pcmcia_cntl1 = 0x0000A0C0; // Turn off the CVS output enables and
+        mpi->pcmcia_cntl1 = (CARDBUS_ENABLE|PCMCIA_GPIO_ENABLE|VS2_OEN|VS1_OEN); 
+                                        // Turn off the CVS output enables and
                                         // float the CVS pins.
         mdelay(1);
         data32 = mpi->pcmcia_cntl1;
         // Read the Register.
-        switch (data32 & 0x0000000C)  // See what is on the CVS pins.
+        switch (data32 & (VS2_IN|VS1_IN))  // See what is on the CVS pins.
         {
         case 0x00000000: // CVS1 and CVS2 are tied to ground, only 1 option.
             printk("mpi: Detected 3.3 & x.x 16-bit PCMCIA card\n");
             cardtype = MPI_CARDTYPE_PCMCIA;
             break;
           
-        case 0x00000004: // CVS1 is open or tied to CCD1/CCD2 and CVS2 is tied to ground.
+        case VS1_IN: // CVS1 is open or tied to CCD1/CCD2 and CVS2 is tied to ground.
                          // 2 valid voltage options.
-        switch (data32 & 0x00000003)  // Test the values of CCD1 and CCD2.
+        switch (data32 & (CD2_IN|CD1_IN))  // Test the values of CCD1 and CCD2.
         {
-            case 0x00000003:  // CCD1 and CCD2 are tied to 1 of the CVS pins.
+            case (CD2_IN|CD1_IN):  // CCD1 and CCD2 are tied to 1 of the CVS pins.
                               // This is not a valid combination.
                 printk("mpi: Unknown card plugged into slot\n"); 
                 break;
       
-            case 0x00000002:  // CCD2 is tied to either CVS1 or CVS2. 
-                mpi->pcmcia_cntl1 = 0x0000A080; // Drive CVS1 to a 0.
+            case CD2_IN:  // CCD2 is tied to either CVS1 or CVS2. 
+                mpi->pcmcia_cntl1 = (CARDBUS_ENABLE|PCMCIA_GPIO_ENABLE|VS2_OEN); // Drive CVS1 to a 0.
                 mdelay(1);
                 data32 = mpi->pcmcia_cntl1;
-                if (data32 & 0x00000002) { // CCD2 is tied to CVS2, not valid.
+                if (data32 & CD2_IN) { // CCD2 is tied to CVS2, not valid.
                     printk("mpi: Unknown card plugged into slot\n"); 
                 } else {                   // CCD2 is tied to CVS1.
                     printk("mpi: Detected 3.3, x.x and y.y Cardbus card\n");
@@ -219,7 +220,7 @@ static int cardtype_vcc_detect(void)
                 }
                 break;
                 
-            case 0x00000001: // CCD1 is tied to either CVS1 or CVS2.
+            case CD1_IN: // CCD1 is tied to either CVS1 or CVS2.
                              // This is not a valid combination.
                 printk("mpi: Unknown card plugged into slot\n"); 
                 break;
@@ -231,20 +232,20 @@ static int cardtype_vcc_detect(void)
             }
             break;
           
-        case 0x00000008: // CVS2 is open or tied to CCD1/CCD2 and CVS1 is tied to ground.
+        case VS2_IN: // CVS2 is open or tied to CCD1/CCD2 and CVS1 is tied to ground.
                          // 2 valid voltage options.
-            switch (data32 & 0x00000003)  // Test the values of CCD1 and CCD2.
+            switch (data32 & (CD2_IN|CD1_IN))  // Test the values of CCD1 and CCD2.
             {
-            case 0x00000003:  // CCD1 and CCD2 are tied to 1 of the CVS pins.
+            case (CD2_IN|CD1_IN):  // CCD1 and CCD2 are tied to 1 of the CVS pins.
                               // This is not a valid combination.
                 printk("mpi: Unknown card plugged into slot\n"); 
                 break;
       
-            case 0x00000002:  // CCD2 is tied to either CVS1 or CVS2.
-                mpi->pcmcia_cntl1 = 0x0000A040; // Drive CVS2 to a 0.
+            case CD2_IN:  // CCD2 is tied to either CVS1 or CVS2.
+                mpi->pcmcia_cntl1 = (CARDBUS_ENABLE|PCMCIA_GPIO_ENABLE|VS1_OEN);// Drive CVS2 to a 0.
                 mdelay(1);
                 data32 = mpi->pcmcia_cntl1;
-                if (data32 & 0x00000002) { // CCD2 is tied to CVS1, not valid.
+                if (data32 & CD2_IN) { // CCD2 is tied to CVS1, not valid.
                     printk("mpi: Unknown card plugged into slot\n"); 
                 } else {// CCD2 is tied to CVS2.
                     printk("mpi: Detected 3.3 and x.x Cardbus card\n");
@@ -252,7 +253,7 @@ static int cardtype_vcc_detect(void)
                 }
                 break;
 
-            case 0x00000001: // CCD1 is tied to either CVS1 or CVS2.
+            case CD1_IN: // CCD1 is tied to either CVS1 or CVS2.
                              // This is not a valid combination.
                 printk("mpi: Unknown card plugged into slot\n"); 
                 break;
@@ -264,22 +265,22 @@ static int cardtype_vcc_detect(void)
             }
             break;
           
-        case 0x0000000C:  // CVS1 and CVS2 are open or tied to CCD1/CCD2.
+        case (VS2_IN|VS1_IN):  // CVS1 and CVS2 are open or tied to CCD1/CCD2.
                           // 5 valid voltage options.
       
-            switch (data32 & 0x00000003)  // Test the values of CCD1 and CCD2.
+            switch (data32 & (CD2_IN|CD1_IN))  // Test the values of CCD1 and CCD2.
             {
-            case 0x00000003:  // CCD1 and CCD2 are tied to 1 of the CVS pins.
+            case (CD2_IN|CD1_IN):  // CCD1 and CCD2 are tied to 1 of the CVS pins.
                               // This is not a valid combination.
                 printk("mpi: Unknown card plugged into slot\n"); 
                 break;
       
-            case 0x00000002:  // CCD2 is tied to either CVS1 or CVS2.
+            case CD2_IN:  // CCD2 is tied to either CVS1 or CVS2.
                               // CCD1 is tied to ground.
-                mpi->pcmcia_cntl1 = 0x0000A040; // Drive CVS2 to a 0.
+                mpi->pcmcia_cntl1 = (CARDBUS_ENABLE|PCMCIA_GPIO_ENABLE|VS1_OEN);// Drive CVS2 to a 0.
                 mdelay(1);
                 data32 = mpi->pcmcia_cntl1;
-                if (data32 & 0x00000002) {  // CCD2 is tied to CVS1.
+                if (data32 & CD2_IN) {  // CCD2 is tied to CVS1.
                     printk("mpi: Detected y.y vdc Cardbus card\n");
                 } else {                    // CCD2 is tied to CVS2.
                     printk("mpi: Detected x.x vdc Cardbus card\n");
@@ -287,13 +288,13 @@ static int cardtype_vcc_detect(void)
                 cardtype = MPI_CARDTYPE_CARDBUS;
                 break;
       
-            case 0x00000001: // CCD1 is tied to either CVS1 or CVS2.
+            case CD1_IN: // CCD1 is tied to either CVS1 or CVS2.
                              // CCD2 is tied to ground.
       
-                mpi->pcmcia_cntl1 = 0x0000A040; // Drive CVS2 to a 0.
+                mpi->pcmcia_cntl1 = (CARDBUS_ENABLE|PCMCIA_GPIO_ENABLE|VS1_OEN);// Drive CVS2 to a 0.
                 mdelay(1);
                 data32 = mpi->pcmcia_cntl1;
-                if (data32 & 0x00000001) {// CCD1 is tied to CVS1.
+                if (data32 & CD1_IN) {// CCD1 is tied to CVS1.
                     printk("mpi: Detected 3.3 vdc Cardbus card\n");
                 } else {                    // CCD1 is tied to CVS2.
                     printk("mpi: Detected x.x and y.y Cardbus card\n");
@@ -331,8 +332,7 @@ static int mpi_DetectPcCard(void)
     cardtype = cardtype_vcc_detect();
     switch(cardtype) {
         case MPI_CARDTYPE_PCMCIA:
-            mpi->pcmcia_cntl1 &= ~0x0000e000; // disable enable bits
-            //mpi->pcmcia_cntl1 = (mpi->pcmcia_cntl1 & ~PCCARD_CARD_RESET);
+            mpi->pcmcia_cntl1 &= ~(CARDBUS_ENABLE|PCMCIA_ENABLE|PCMCIA_GPIO_ENABLE); // disable enable bits
             mpi->pcmcia_cntl1 |= (PCMCIA_ENABLE | PCMCIA_GPIO_ENABLE);
             mpi_InitPcmciaSpace();
             mpi_ResetPcCard(cardtype, FALSE);
@@ -418,12 +418,12 @@ static int mpi_init(void)
     mpi_SetLocalPciConfigReg(PCI_BASE_ADDRESS_3, BCM_HOST_MEM_SPACE1);
     mpi->sp0remap = 0x0;
 
-    /* Accesses to the SDRAM from PCI bus will not be "byte swapped" for this region */
+    /* Accesses to the SDRAM from PCI bus will be "byte swapped" for this region */
     mpi_SetLocalPciConfigReg(PCI_BASE_ADDRESS_4, BCM_HOST_MEM_SPACE2);
     mpi->sp1remap = 0x0;
-    mpi->pcimodesel |= (PCI_BAR2_NOSWAP | 0x40);
+    mpi->pcimodesel |= 0x40;
 
-    if ((chipid == 0x6348) && (chiprev == 0xb0)) {
+    if ((chipid == 0x6348) && ((chiprev & 0xF0) != 0xa0)) {
         mpi->sp0range = ~(sdramsize-1);
         mpi->sp1range = ~(sdramsize-1);
     }
@@ -465,7 +465,7 @@ static int __init brcm63xx_setup(void)
 
     board_timer_setup = brcm_timer_setup;
 
-    panic_timeout = 180;
+    panic_timeout = 1;
 
 #if defined(CONFIG_BCM96348) && defined(CONFIG_PCI)
     /* mpi initialization */
index 820c3af..40f825f 100755 (executable)
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1995 - 2000 by Ralf Baechle
- */
-#include <linux/signal.h>
-#include <linux/sched.h>
-#include <linux/interrupt.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/types.h>
-#include <linux/ptrace.h>
-#include <linux/mman.h>
-#include <linux/mm.h>
-#include <linux/smp.h>
-#include <linux/smp_lock.h>
-#include <linux/vt_kern.h>             /* For unblank_screen() */
-#include <linux/module.h>
-
-#include <asm/branch.h>
-#include <asm/hardirq.h>
-#include <asm/mmu_context.h>
-#include <asm/system.h>
-#include <asm/uaccess.h>
-#include <asm/ptrace.h>
-
-/*
- * This routine handles page faults.  It determines the address,
- * and the problem, and then passes it off to one of the appropriate
- * routines.
- */
-asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
-                             unsigned long address)
-{
-       struct vm_area_struct * vma = NULL;
-       struct task_struct *tsk = current;
-       struct mm_struct *mm = tsk->mm;
-       const int field = sizeof(unsigned long) * 2;
-       siginfo_t info;
-
-#if 0
-       printk("Cpu%d[%s:%d:%0*lx:%ld:%0*lx]\n", smp_processor_id(),
-              current->comm, current->pid, field, address, write,
-              field, regs->cp0_epc);
-#endif
-
-       info.si_code = SEGV_MAPERR;
-
-       /*
-        * We fault-in kernel-space virtual memory on-demand. The
-        * 'reference' page table is init_mm.pgd.
-        *
-        * NOTE! We MUST NOT take any locks for this case. We may
-        * be in an interrupt or a critical region, and should
-        * only copy the information from the master page table,
-        * nothing more.
-        */
-       if (unlikely(address >= VMALLOC_START))
-               goto vmalloc_fault;
-
-       /*
-        * If we're in an interrupt or have no user
-        * context, we must not take the fault..
-        */
-       if (in_atomic() || !mm)
-               goto bad_area_nosemaphore;
-
-       down_read(&mm->mmap_sem);
-       vma = find_vma(mm, address);
-       if (!vma)
-               goto bad_area;
-       if (vma->vm_start <= address)
-               goto good_area;
-       if (!(vma->vm_flags & VM_GROWSDOWN))
-               goto bad_area;
-       if (expand_stack(vma, address))
-               goto bad_area;
-/*
- * Ok, we have a good vm_area for this memory access, so
- * we can handle it..
- */
-good_area:
-       info.si_code = SEGV_ACCERR;
-
-       if (write) {
-               if (!(vma->vm_flags & VM_WRITE))
-                       goto bad_area;
-       } else {
-               if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
-                       goto bad_area;
-       }
-
-survive:
-       /*
-        * If for any reason at all we couldn't handle the fault,
-        * make sure we exit gracefully rather than endlessly redo
-        * the fault.
-        */
-       switch (handle_mm_fault(mm, vma, address, write)) {
-       case VM_FAULT_MINOR:
-               tsk->min_flt++;
-               break;
-       case VM_FAULT_MAJOR:
-               tsk->maj_flt++;
-               break;
-       case VM_FAULT_SIGBUS:
-               goto do_sigbus;
-       case VM_FAULT_OOM:
-               goto out_of_memory;
-       default:
-               BUG();
-       }
-
-       up_read(&mm->mmap_sem);
-       return;
-
-/*
- * Something tried to access memory that isn't in our memory map..
- * Fix it, but check if it's kernel or user first..
- */
-bad_area:
-       up_read(&mm->mmap_sem);
-
-bad_area_nosemaphore:
-       /* User mode accesses just cause a SIGSEGV */
-       if (user_mode(regs)) {
-               tsk->thread.cp0_badvaddr = address;
-               tsk->thread.error_code = write;
-#if 0
-               printk("do_page_fault() #2: sending SIGSEGV to %s for "
-                      "invalid %s\n%0*lx (epc == %0*lx, ra == %0*lx)\n",
-                      tsk->comm,
-                      write ? "write access to" : "read access from",
-                      field, address,
-                      field, (unsigned long) regs->cp0_epc,
-                      field, (unsigned long) regs->regs[31]);
-#endif
-               info.si_signo = SIGSEGV;
-               info.si_errno = 0;
-               /* info.si_code has been set above */
-               info.si_addr = (void *) address;
-               force_sig_info(SIGSEGV, &info, tsk);
-               return;
-       }
-
-no_context:
-       /* Are we prepared to handle this kernel fault?  */
-       if (fixup_exception(regs)) {
-               current->thread.cp0_baduaddr = address;
-               return;
-       }
-
-       /*
-        * Oops. The kernel tried to access some bad page. We'll have to
-        * terminate things with extreme prejudice.
-        */
-
-       bust_spinlocks(1);
-
-       printk(KERN_ALERT "CPU %d Unable to handle kernel paging request at "
-              "virtual address %0*lx, epc == %0*lx, ra == %0*lx\n",
-              smp_processor_id(), field, address, field, regs->cp0_epc,
-              field,  regs->regs[31]);
-       die("Oops", regs);
-
-/*
- * We ran out of memory, or some other thing happened to us that made
- * us unable to handle the page fault gracefully.
- */
-out_of_memory:
-       up_read(&mm->mmap_sem);
-       if (tsk->pid == 1) {
-               yield();
-               down_read(&mm->mmap_sem);
-               goto survive;
-       }
-       printk("VM: killing process %s\n", tsk->comm);
-       if (user_mode(regs))
-               do_exit(SIGKILL);
-       goto no_context;
-
-do_sigbus:
-       up_read(&mm->mmap_sem);
-
-       /* Kernel mode? Handle exceptions or die */
-       if (!user_mode(regs))
-               goto no_context;
-
-       /*
-        * Send a sigbus, regardless of whether we were in kernel
-        * or user mode.
-        */
-       tsk->thread.cp0_badvaddr = address;
-       info.si_signo = SIGBUS;
-       info.si_errno = 0;
-       info.si_code = BUS_ADRERR;
-       info.si_addr = (void *) address;
-       force_sig_info(SIGBUS, &info, tsk);
-
-       return;
-
-vmalloc_fault:
-       {
-               /*
-                * Synchronize this task's top level page-table
-                * with the 'reference' page table.
-                *
-                * Do _not_ use "tsk" here. We might be inside
-                * an interrupt in the middle of a task switch..
-                */
-               int offset = __pgd_offset(address);
-               pgd_t *pgd, *pgd_k;
-               pmd_t *pmd, *pmd_k;
-               pte_t *pte_k;
-
-               pgd = (pgd_t *) pgd_current[smp_processor_id()] + offset;
-               pgd_k = init_mm.pgd + offset;
-
-               if (!pgd_present(*pgd_k))
-                       goto no_context;
-               set_pgd(pgd, *pgd_k);
-
-               pmd = pmd_offset(pgd, address);
-               pmd_k = pmd_offset(pgd_k, address);
-               if (!pmd_present(*pmd_k))
-                       goto no_context;
-               set_pmd(pmd, *pmd_k);
-
-               pte_k = pte_offset_kernel(pmd_k, address);
-               if (!pte_present(*pte_k))
-                       goto no_context;
-               return;
-       }
-}
+/*\r
+ * This file is subject to the terms and conditions of the GNU General Public\r
+ * License.  See the file "COPYING" in the main directory of this archive\r
+ * for more details.\r
+ *\r
+ * Copyright (C) 1995 - 2000 by Ralf Baechle\r
+ */\r
+#include <linux/signal.h>\r
+#include <linux/sched.h>\r
+#include <linux/interrupt.h>\r
+#include <linux/kernel.h>\r
+#include <linux/errno.h>\r
+#include <linux/string.h>\r
+#include <linux/types.h>\r
+#include <linux/ptrace.h>\r
+#include <linux/mman.h>\r
+#include <linux/mm.h>\r
+#include <linux/smp.h>\r
+#include <linux/smp_lock.h>\r
+#include <linux/vt_kern.h>             /* For unblank_screen() */\r
+#include <linux/module.h>\r
+\r
+#include <asm/branch.h>\r
+#include <asm/hardirq.h>\r
+#include <asm/mmu_context.h>\r
+#include <asm/system.h>\r
+#include <asm/uaccess.h>\r
+#include <asm/ptrace.h>\r
+\r
+/*\r
+ * This routine handles page faults.  It determines the address,\r
+ * and the problem, and then passes it off to one of the appropriate\r
+ * routines.\r
+ */\r
+asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,\r
+                             unsigned long address)\r
+{\r
+       struct vm_area_struct * vma = NULL;\r
+       struct task_struct *tsk = current;\r
+       struct mm_struct *mm = tsk->mm;\r
+       const int field = sizeof(unsigned long) * 2;\r
+       siginfo_t info;\r
+\r
+#if 0\r
+       printk("Cpu%d[%s:%d:%0*lx:%ld:%0*lx]\n", smp_processor_id(),\r
+              current->comm, current->pid, field, address, write,\r
+              field, regs->cp0_epc);\r
+#endif\r
+\r
+       info.si_code = SEGV_MAPERR;\r
+\r
+       /*\r
+        * We fault-in kernel-space virtual memory on-demand. The\r
+        * 'reference' page table is init_mm.pgd.\r
+        *\r
+        * NOTE! We MUST NOT take any locks for this case. We may\r
+        * be in an interrupt or a critical region, and should\r
+        * only copy the information from the master page table,\r
+        * nothing more.\r
+        */\r
+       if (unlikely(address >= VMALLOC_START))\r
+               goto vmalloc_fault;\r
+\r
+       /*\r
+        * If we're in an interrupt or have no user\r
+        * context, we must not take the fault..\r
+        */\r
+       if (in_atomic() || !mm)\r
+               goto bad_area_nosemaphore;\r
+\r
+       down_read(&mm->mmap_sem);\r
+       vma = find_vma(mm, address);\r
+       if (!vma)\r
+               goto bad_area;\r
+       if (vma->vm_start <= address)\r
+               goto good_area;\r
+       if (!(vma->vm_flags & VM_GROWSDOWN))\r
+               goto bad_area;\r
+       if (expand_stack(vma, address))\r
+               goto bad_area;\r
+/*\r
+ * Ok, we have a good vm_area for this memory access, so\r
+ * we can handle it..\r
+ */\r
+good_area:\r
+       info.si_code = SEGV_ACCERR;\r
+\r
+       if (write) {\r
+               if (!(vma->vm_flags & VM_WRITE))\r
+                       goto bad_area;\r
+       } else {\r
+               if (!(vma->vm_flags & (VM_READ | VM_EXEC)))\r
+                       goto bad_area;\r
+       }\r
+\r
+survive:\r
+       /*\r
+        * If for any reason at all we couldn't handle the fault,\r
+        * make sure we exit gracefully rather than endlessly redo\r
+        * the fault.\r
+        */\r
+       switch (handle_mm_fault(mm, vma, address, write)) {\r
+       case VM_FAULT_MINOR:\r
+               tsk->min_flt++;\r
+               break;\r
+       case VM_FAULT_MAJOR:\r
+               tsk->maj_flt++;\r
+               break;\r
+       case VM_FAULT_SIGBUS:\r
+               goto do_sigbus;\r
+       case VM_FAULT_OOM:\r
+               goto out_of_memory;\r
+       default:\r
+               BUG();\r
+       }\r
+\r
+       up_read(&mm->mmap_sem);\r
+       return;\r
+\r
+/*\r
+ * Something tried to access memory that isn't in our memory map..\r
+ * Fix it, but check if it's kernel or user first..\r
+ */\r
+bad_area:\r
+       up_read(&mm->mmap_sem);\r
+\r
+bad_area_nosemaphore:\r
+       /* User mode accesses just cause a SIGSEGV */\r
+       if (user_mode(regs)) {\r
+               tsk->thread.cp0_badvaddr = address;\r
+               tsk->thread.error_code = write;\r
+#if 1\r
+               printk("do_page_fault() #2: sending SIGSEGV to %s for "\r
+                      "invalid %s\n%0*lx (epc == %0*lx, ra == %0*lx)\n",\r
+                      tsk->comm,\r
+                      write ? "write access to" : "read access from",\r
+                      field, address,\r
+                      field, (unsigned long) regs->cp0_epc,\r
+                      field, (unsigned long) regs->regs[31]);\r
+#endif\r
+               info.si_signo = SIGSEGV;\r
+               info.si_errno = 0;\r
+               /* info.si_code has been set above */\r
+               info.si_addr = (void *) address;\r
+               force_sig_info(SIGSEGV, &info, tsk);\r
+               return;\r
+       }\r
+\r
+no_context:\r
+       /* Are we prepared to handle this kernel fault?  */\r
+       if (fixup_exception(regs)) {\r
+               current->thread.cp0_baduaddr = address;\r
+               return;\r
+       }\r
+\r
+       /*\r
+        * Oops. The kernel tried to access some bad page. We'll have to\r
+        * terminate things with extreme prejudice.\r
+        */\r
+\r
+       bust_spinlocks(1);\r
+\r
+       printk(KERN_ALERT "CPU %d Unable to handle kernel paging request at "\r
+              "virtual address %0*lx, epc == %0*lx, ra == %0*lx\n",\r
+              smp_processor_id(), field, address, field, regs->cp0_epc,\r
+              field,  regs->regs[31]);\r
+       die("Oops", regs);\r
+\r
+/*\r
+ * We ran out of memory, or some other thing happened to us that made\r
+ * us unable to handle the page fault gracefully.\r
+ */\r
+out_of_memory:\r
+       up_read(&mm->mmap_sem);\r
+       if (tsk->pid == 1) {\r
+               yield();\r
+               down_read(&mm->mmap_sem);\r
+               goto survive;\r
+       }\r
+       printk("VM: killing process %s\n", tsk->comm);\r
+       if (user_mode(regs))\r
+               do_exit(SIGKILL);\r
+       goto no_context;\r
+\r
+do_sigbus:\r
+       up_read(&mm->mmap_sem);\r
+\r
+       /* Kernel mode? Handle exceptions or die */\r
+       if (!user_mode(regs))\r
+               goto no_context;\r
+\r
+       /*\r
+        * Send a sigbus, regardless of whether we were in kernel\r
+        * or user mode.\r
+        */\r
+       tsk->thread.cp0_badvaddr = address;\r
+       info.si_signo = SIGBUS;\r
+       info.si_errno = 0;\r
+       info.si_code = BUS_ADRERR;\r
+       info.si_addr = (void *) address;\r
+       force_sig_info(SIGBUS, &info, tsk);\r
+\r
+       return;\r
+\r
+vmalloc_fault:\r
+       {\r
+               /*\r
+                * Synchronize this task's top level page-table\r
+                * with the 'reference' page table.\r
+                *\r
+                * Do _not_ use "tsk" here. We might be inside\r
+                * an interrupt in the middle of a task switch..\r
+                */\r
+               int offset = __pgd_offset(address);\r
+               pgd_t *pgd, *pgd_k;\r
+               pmd_t *pmd, *pmd_k;\r
+               pte_t *pte_k;\r
+\r
+               pgd = (pgd_t *) pgd_current[smp_processor_id()] + offset;\r
+               pgd_k = init_mm.pgd + offset;\r
+\r
+               if (!pgd_present(*pgd_k))\r
+                       goto no_context;\r
+               set_pgd(pgd, *pgd_k);\r
+\r
+               pmd = pmd_offset(pgd, address);\r
+               pmd_k = pmd_offset(pgd_k, address);\r
+               if (!pmd_present(*pmd_k))\r
+                       goto no_context;\r
+               set_pmd(pmd, *pmd_k);\r
+\r
+               pte_k = pte_offset_kernel(pmd_k, address);\r
+               if (!pte_present(*pte_k))\r
+                       goto no_context;\r
+               return;\r
+       }\r
+}\r
index 01c0e79..5995dca 100755 (executable)
@@ -17,6 +17,7 @@
 
 #include <board.h>
 #include <bcmTag.h>
+#include <bcm_map_part.h>
 #define  VERSION       "1.0"
 
 extern PFILE_TAG kerSysImageTagGet(void);
@@ -27,14 +28,26 @@ static map_word brcm_physmap_read16(struct map_info *map, unsigned long ofs)
 {
        map_word val;
        
-       val.x[0] = __raw_readw(map->map_priv_1 + ofs);
+    /* If the requested flash address is in a memory mapped range, use
+     * __raw_readw.  Otherwise, use kerSysReadFromFlash.
+     */
+    if(((map->map_priv_1 & ~0xfff00000) + ofs + sizeof(short)) < map->map_priv_2)
+           val.x[0] = __raw_readw(map->map_priv_1 + ofs);
+    else
+        kerSysReadFromFlash( &val.x[0], map->map_priv_1 + ofs, sizeof(short) );
        
        return val;
 }
 
 static void brcm_physmap_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
 {
-       memcpy_fromio(to, map->map_priv_1 + from, len);
+    /* If the requested flash address is in a memory mapped range, use
+     * memcpy_fromio.  Otherwise, use kerSysReadFromFlash.
+     */
+    if( ((map->map_priv_1 & ~0xfff00000) + from + len) < map->map_priv_2 )
+           memcpy_fromio(to, map->map_priv_1 + from, len);
+    else
+        kerSysReadFromFlash( to, map->map_priv_1 + from, len );
 }
 
 static struct map_info brcm_physmap_map = {
@@ -48,10 +61,8 @@ static int __init init_brcm_physmap(void)
 {
         PFILE_TAG pTag = NULL;
         u_int32_t rootfs_addr, kernel_addr;
-        FLASH_ADDR_INFO info;
 
        printk("bcm963xx_mtd driver v%s\n", VERSION);
-        kerSysFlashAddrInfoGet( &info );
 
         /* Read the flash memory map from flash memory. */
         if (!(pTag = kerSysImageTagGet())) {
@@ -59,12 +70,18 @@ static int __init init_brcm_physmap(void)
                 return -EIO;
         }
 
-        rootfs_addr = (u_int32_t) simple_strtoul(pTag->rootfsAddress, NULL, 10);
-        kernel_addr = (u_int32_t) simple_strtoul(pTag->kernelAddress, NULL, 10);
+        rootfs_addr = (u_int32_t) simple_strtoul(pTag->rootfsAddress, NULL, 10) + BOOT_OFFSET;
+        kernel_addr = (u_int32_t) simple_strtoul(pTag->kernelAddress, NULL, 10) + BOOT_OFFSET;
        
        brcm_physmap_map.size = kernel_addr - rootfs_addr;
        brcm_physmap_map.map_priv_1 = (unsigned long)rootfs_addr;
 
+       /* Set map_priv_2 to the amount of flash memory that is memory mapped to
+        * the flash base address.  On the BCM6338, serial flash parts are only
+        * memory mapped up to 1MB even though the flash part may be bigger.
+        */
+       brcm_physmap_map.map_priv_2 =(unsigned long)kerSysMemoryMappedFlashSizeGet();
+
        if (!brcm_physmap_map.map_priv_1) {
                printk("Wrong rootfs starting address\n");
                return -EIO;
index 3f39365..1193aaa 100755 (executable)
@@ -100,7 +100,7 @@ config MAC_PARTITION
 
 config MSDOS_PARTITION
        bool "PC BIOS (MSDOS partition tables) support" if PARTITION_ADVANCED
-       default y if !PARTITION_ADVANCED && !AMIGA && !ATARI && !MAC && !SGI_IP22 && !ARM && !SGI_IP27
+       default n if !PARTITION_ADVANCED && !AMIGA && !ATARI && !MAC && !SGI_IP22 && !ARM && !SGI_IP27
        help
          Say Y here if you would like to use hard disks under Linux which
          were partitioned on an x86 PC (not necessarily by DOS).
index 5a73e08..0c1cea9 100755 (executable)
 #include <asm/page.h>
 
 /**
- *     seq_open -      initialize sequential file
- *     @file: file we initialize
- *     @op: method table describing the sequence
+ *      seq_open -      initialize sequential file
+ *      @file: file we initialize
+ *      @op: method table describing the sequence
  *
- *     seq_open() sets @file, associating it with a sequence described
- *     by @op.  @op->start() sets the iterator up and returns the first
- *     element of sequence. @op->stop() shuts it down.  @op->next()
- *     returns the next element of sequence.  @op->show() prints element
- *     into the buffer.  In case of error ->start() and ->next() return
- *     ERR_PTR(error).  In the end of sequence they return %NULL. ->show()
- *     returns 0 in case of success and negative number in case of error.
+ *      seq_open() sets @file, associating it with a sequence described
+ *      by @op.  @op->start() sets the iterator up and returns the first
+ *      element of sequence. @op->stop() shuts it down.  @op->next()
+ *      returns the next element of sequence.  @op->show() prints element
+ *      into the buffer.  In case of error ->start() and ->next() return
+ *      ERR_PTR(error).  In the end of sequence they return %NULL. ->show()
+ *      returns 0 in case of success and negative number in case of error.
  */
 int seq_open(struct file *file, struct seq_operations *op)
 {
-       struct seq_file *p = kmalloc(sizeof(*p), GFP_KERNEL);
-       if (!p)
-               return -ENOMEM;
-       memset(p, 0, sizeof(*p));
-       sema_init(&p->sem, 1);
-       p->op = op;
-       file->private_data = p;
+        struct seq_file *p = kmalloc(sizeof(*p), GFP_KERNEL);
+        if (!p)
+                return -ENOMEM;
+        memset(p, 0, sizeof(*p));
+        sema_init(&p->sem, 1);
+        p->op = op;
+        file->private_data = p;
 
-       /* SEQ files support lseek, but not pread/pwrite */
-       file->f_mode &= ~(FMODE_PREAD | FMODE_PWRITE);
-       return 0;
+        /* SEQ files support lseek, but not pread/pwrite */
+        file->f_mode &= ~(FMODE_PREAD | FMODE_PWRITE);
+        return 0;
 }
 EXPORT_SYMBOL(seq_open);
 
 /**
- *     seq_read -      ->read() method for sequential files.
- *     @file, @buf, @size, @ppos: see file_operations method
+ *      seq_read -      ->read() method for sequential files.
+ *      @file, @buf, @size, @ppos: see file_operations method
  *
- *     Ready-made ->f_op->read()
+ *      Ready-made ->f_op->read()
  */
 ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
 {
-       struct seq_file *m = (struct seq_file *)file->private_data;
-       size_t copied = 0;
-       loff_t pos;
-       size_t n;
-       void *p;
-       int err = 0;
+        struct seq_file *m = (struct seq_file *)file->private_data;
+        size_t copied = 0;
+        loff_t pos;
+        size_t n;
+        void *p;
+        int err = 0;
 
-       down(&m->sem);
-       /* grab buffer if we didn't have one */
-       if (!m->buf) {
-               m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL);
-               if (!m->buf)
-                       goto Enomem;
-       }
-       /* if not empty - flush it first */
-       if (m->count) {
-               n = min(m->count, size);
-               err = copy_to_user(buf, m->buf + m->from, n);
-               if (err)
-                       goto Efault;
-               m->count -= n;
-               m->from += n;
-               size -= n;
-               buf += n;
-               copied += n;
-               if (!m->count)
-                       m->index++;
-               if (!size)
-                       goto Done;
-       }
-       /* we need at least one record in buffer */
-       while (1) {
-               pos = m->index;
-               p = m->op->start(m, &pos);
-               err = PTR_ERR(p);
-               if (!p || IS_ERR(p))
-                       break;
-               err = m->op->show(m, p);
-               if (err)
-                       break;
-               if (m->count < m->size)
-                       goto Fill;
-               m->op->stop(m, p);
-               kfree(m->buf);
-               m->buf = kmalloc(m->size <<= 1, GFP_KERNEL);
-               if (!m->buf)
-                       goto Enomem;
-               m->count = 0;
-       }
-       m->op->stop(m, p);
-       m->count = 0;
-       goto Done;
+        down(&m->sem);
+        /* grab buffer if we didn't have one */
+        if (!m->buf) {
+                m->buf = kmalloc(m->size = PAGE_SIZE+1, GFP_KERNEL);
+                if (!m->buf)
+                        goto Enomem;
+        }
+        /* if not empty - flush it first */
+        if (m->count) {
+                n = min(m->count, size);
+                err = copy_to_user(buf, m->buf + m->from, n);
+                if (err)
+                        goto Efault;
+                m->count -= n;
+                m->from += n;
+                size -= n;
+                buf += n;
+                copied += n;
+                if (!m->count)
+                        m->index++;
+                if (!size)
+                        goto Done;
+        }
+        /* we need at least one record in buffer */
+        while (1) {
+                pos = m->index;
+                p = m->op->start(m, &pos);
+                err = PTR_ERR(p);
+                if (!p || IS_ERR(p))
+                        break;
+                err = m->op->show(m, p);
+                if (err)
+                        break;
+                if (m->count < m->size)
+                        goto Fill;
+                m->op->stop(m, p);
+                kfree(m->buf);
+                m->buf = kmalloc(m->size <<= 1, GFP_KERNEL);
+                if (!m->buf)
+                        goto Enomem;
+                m->count = 0;
+        }
+        m->op->stop(m, p);
+        m->count = 0;
+        goto Done;
 Fill:
-       /* they want more? let's try to get some more */
-       while (m->count < size) {
-               size_t offs = m->count;
-               loff_t next = pos;
-               p = m->op->next(m, p, &next);
-               if (!p || IS_ERR(p)) {
-                       err = PTR_ERR(p);
-                       break;
-               }
-               err = m->op->show(m, p);
-               if (err || m->count == m->size) {
-                       m->count = offs;
-                       break;
-               }
-               pos = next;
-       }
-       m->op->stop(m, p);
-       n = min(m->count, size);
-       err = copy_to_user(buf, m->buf, n);
-       if (err)
-               goto Efault;
-       copied += n;
-       m->count -= n;
-       if (m->count)
-               m->from = n;
-       else
-               pos++;
-       m->index = pos;
+        /* they want more? let's try to get some more */
+        while (m->count < size) {
+                size_t offs = m->count;
+                loff_t next = pos;
+                p = m->op->next(m, p, &next);
+                if (!p || IS_ERR(p)) {
+                        err = PTR_ERR(p);
+                        break;
+                }
+                err = m->op->show(m, p);
+//BRCM modification begin
+//              if (err || m->count == m->size) {
+                if (err) { 
+//BRCM modification end
+                        m->count = offs;
+                        break;
+                }
+                pos = next;
+        }
+        m->op->stop(m, p);
+        n = min(m->count, size);
+        err = copy_to_user(buf, m->buf, n);
+        if (err)
+                goto Efault;
+        copied += n;
+        m->count -= n;
+
+        if (m->count)
+                m->from = n;
+        else 
+                pos++;
+        m->index = pos; 
+
 Done:
-       if (!copied)
-               copied = err;
-       else
-               *ppos += copied;
-       up(&m->sem);
-       return copied;
+        if (!copied)
+                copied = err;
+        else
+                *ppos += copied;
+
+        up(&m->sem);
+        return copied;
 Enomem:
-       err = -ENOMEM;
-       goto Done;
+        err = -ENOMEM;
+        goto Done;
 Efault:
-       err = -EFAULT;
-       goto Done;
+        err = -EFAULT;
+        goto Done;
 }
 EXPORT_SYMBOL(seq_read);
 
 static int traverse(struct seq_file *m, loff_t offset)
 {
-       loff_t pos = 0;
-       int error = 0;
-       void *p;
+        loff_t pos = 0;
+        int error = 0;
+        void *p;
 
-       m->index = 0;
-       m->count = m->from = 0;
-       if (!offset)
-               return 0;
-       if (!m->buf) {
-               m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL);
-               if (!m->buf)
-                       return -ENOMEM;
-       }
-       p = m->op->start(m, &m->index);
-       while (p) {
-               error = PTR_ERR(p);
-               if (IS_ERR(p))
-                       break;
-               error = m->op->show(m, p);
-               if (error)
-                       break;
-               if (m->count == m->size)
-                       goto Eoverflow;
-               if (pos + m->count > offset) {
-                       m->from = offset - pos;
-                       m->count -= m->from;
-                       break;
-               }
-               pos += m->count;
-               m->count = 0;
-               if (pos == offset) {
-                       m->index++;
-                       break;
-               }
-               p = m->op->next(m, p, &m->index);
-       }
-       m->op->stop(m, p);
-       return error;
+        m->index = 0;
+        m->count = m->from = 0;
+        if (!offset)
+                return 0;
+        if (!m->buf) {
+                m->buf = kmalloc(m->size = PAGE_SIZE, GFP_KERNEL);
+                if (!m->buf)
+                        return -ENOMEM;
+        }
+        p = m->op->start(m, &m->index);
+        while (p) {
+                error = PTR_ERR(p);
+                if (IS_ERR(p))
+                        break;
+                error = m->op->show(m, p);
+                if (error)
+                        break;
+                if (m->count == m->size)
+                        goto Eoverflow;
+                if (pos + m->count > offset) {
+                        m->from = offset - pos;
+                        m->count -= m->from;
+                        break;
+                }
+                pos += m->count;
+                m->count = 0;
+                if (pos == offset) {
+                        m->index++;
+                        break;
+                }
+                p = m->op->next(m, p, &m->index);
+        }
+        m->op->stop(m, p);
+        return error;
 
 Eoverflow:
-       m->op->stop(m, p);
-       kfree(m->buf);
-       m->buf = kmalloc(m->size <<= 1, GFP_KERNEL);
-       return !m->buf ? -ENOMEM : -EAGAIN;
+        m->op->stop(m, p);
+        kfree(m->buf);
+        m->buf = kmalloc(m->size <<= 1, GFP_KERNEL);
+        return !m->buf ? -ENOMEM : -EAGAIN;
 }
 
 /**
- *     seq_lseek -     ->llseek() method for sequential files.
- *     @file, @offset, @origin: see file_operations method
+ *      seq_lseek -     ->llseek() method for sequential files.
+ *      @file, @offset, @origin: see file_operations method
  *
- *     Ready-made ->f_op->llseek()
+ *      Ready-made ->f_op->llseek()
  */
 loff_t seq_lseek(struct file *file, loff_t offset, int origin)
 {
-       struct seq_file *m = (struct seq_file *)file->private_data;
-       long long retval = -EINVAL;
+        struct seq_file *m = (struct seq_file *)file->private_data;
+        long long retval = -EINVAL;
 
-       down(&m->sem);
-       switch (origin) {
-               case 1:
-                       offset += file->f_pos;
-               case 0:
-                       if (offset < 0)
-                               break;
-                       retval = offset;
-                       if (offset != file->f_pos) {
-                               while ((retval=traverse(m, offset)) == -EAGAIN)
-                                       ;
-                               if (retval) {
-                                       /* with extreme prejudice... */
-                                       file->f_pos = 0;
-                                       m->index = 0;
-                                       m->count = 0;
-                               } else {
-                                       retval = file->f_pos = offset;
-                               }
-                       }
-       }
-       up(&m->sem);
-       return retval;
+        down(&m->sem);
+        switch (origin) {
+                case 1:
+                        offset += file->f_pos;
+                case 0:
+                        if (offset < 0)
+                                break;
+                        retval = offset;
+                        if (offset != file->f_pos) {
+                                while ((retval=traverse(m, offset)) == -EAGAIN)
+                                        ;
+                                if (retval) {
+                                        /* with extreme prejudice... */
+                                        file->f_pos = 0;
+                                        m->index = 0;
+                                        m->count = 0;
+                                } else {
+                                        retval = file->f_pos = offset;
+                                }
+                        }
+        }
+        up(&m->sem);
+        return retval;
 }
 EXPORT_SYMBOL(seq_lseek);
 
 /**
- *     seq_release -   free the structures associated with sequential file.
- *     @file: file in question
- *     @inode: file->f_dentry->d_inode
+ *      seq_release -   free the structures associated with sequential file.
+ *      @file: file in question
+ *      @inode: file->f_dentry->d_inode
  *
- *     Frees the structures associated with sequential file; can be used
- *     as ->f_op->release() if you don't have private data to destroy.
+ *      Frees the structures associated with sequential file; can be used
+ *      as ->f_op->release() if you don't have private data to destroy.
  */
 int seq_release(struct inode *inode, struct file *file)
 {
-       struct seq_file *m = (struct seq_file *)file->private_data;
-       kfree(m->buf);
-       kfree(m);
-       return 0;
+        struct seq_file *m = (struct seq_file *)file->private_data;
+        kfree(m->buf);
+        kfree(m);
+        return 0;
 }
 EXPORT_SYMBOL(seq_release);
 
 /**
- *     seq_escape -    print string into buffer, escaping some characters
- *     @m:     target buffer
- *     @s:     string
- *     @esc:   set of characters that need escaping
+ *      seq_escape -    print string into buffer, escaping some characters
+ *      @m:     target buffer
+ *      @s:     string
+ *      @esc:   set of characters that need escaping
  *
- *     Puts string into buffer, replacing each occurrence of character from
- *     @esc with usual octal escape.  Returns 0 in case of success, -1 - in
- *     case of overflow.
+ *      Puts string into buffer, replacing each occurrence of character from
+ *      @esc with usual octal escape.  Returns 0 in case of success, -1 - in
+ *      case of overflow.
  */
 int seq_escape(struct seq_file *m, const char *s, const char *esc)
 {
-       char *end = m->buf + m->size;
+        char *end = m->buf + m->size;
         char *p;
-       char c;
+        char c;
 
         for (p = m->buf + m->count; (c = *s) != '\0' && p < end; s++) {
-               if (!strchr(esc, c)) {
-                       *p++ = c;
-                       continue;
-               }
-               if (p + 3 < end) {
-                       *p++ = '\\';
-                       *p++ = '0' + ((c & 0300) >> 6);
-                       *p++ = '0' + ((c & 070) >> 3);
-                       *p++ = '0' + (c & 07);
-                       continue;
-               }
-               m->count = m->size;
-               return -1;
+                if (!strchr(esc, c)) {
+                        *p++ = c;
+                        continue;
+                }
+                if (p + 3 < end) {
+                        *p++ = '\\';
+                        *p++ = '0' + ((c & 0300) >> 6);
+                        *p++ = '0' + ((c & 070) >> 3);
+                        *p++ = '0' + (c & 07);
+                        continue;
+                }
+                m->count = m->size;
+                return -1;
         }
-       m->count = p - m->buf;
+        m->count = p - m->buf;
         return 0;
 }
 EXPORT_SYMBOL(seq_escape);
 
 int seq_printf(struct seq_file *m, const char *f, ...)
 {
-       va_list args;
-       int len;
-
-       if (m->count < m->size) {
-               va_start(args, f);
-               len = vsnprintf(m->buf + m->count, m->size - m->count, f, args);
-               va_end(args);
-               if (m->count + len < m->size) {
-                       m->count += len;
-                       return 0;
-               }
-       }
-       m->count = m->size;
-       return -1;
+        va_list args;
+        int len;
+//BRCM modification begin       
+        int count, size, max;
+        count = m->count;
+        size = m->size;
+        max = size - count;
+//BRCM modification end 
+        if (m->count < m->size) {
+                va_start(args, f);
+//BRCM modification begin
+                //              len = vsnprintf(m->buf + m->count, m->size - m->count, f, args);
+                len = vsnprintf(m->buf + m->count, max, f, args);
+//BRCM modification end 
+                va_end(args);
+                if (m->count + len < m->size) {
+                        m->count += len;
+                        return 0;
+                }
+        }
+        m->count = m->size;
+        return -1;
 }
 EXPORT_SYMBOL(seq_printf);
 
 int seq_path(struct seq_file *m,
-            struct vfsmount *mnt, struct dentry *dentry,
-            char *esc)
+             struct vfsmount *mnt, struct dentry *dentry,
+             char *esc)
 {
-       if (m->count < m->size) {
-               char *s = m->buf + m->count;
-               char *p = d_path(dentry, mnt, s, m->size - m->count);
-               if (!IS_ERR(p)) {
-                       while (s <= p) {
-                               char c = *p++;
-                               if (!c) {
-                                       p = m->buf + m->count;
-                                       m->count = s - m->buf;
-                                       return s - p;
-                               } else if (!strchr(esc, c)) {
-                                       *s++ = c;
-                               } else if (s + 4 > p) {
-                                       break;
-                               } else {
-                                       *s++ = '\\';
-                                       *s++ = '0' + ((c & 0300) >> 6);
-                                       *s++ = '0' + ((c & 070) >> 3);
-                                       *s++ = '0' + (c & 07);
-                               }
-                       }
-               }
-       }
-       m->count = m->size;
-       return -1;
+        if (m->count < m->size) {
+                char *s = m->buf + m->count;
+                char *p = d_path(dentry, mnt, s, m->size - m->count);
+                if (!IS_ERR(p)) {
+                        while (s <= p) {
+                                char c = *p++;
+                                if (!c) {
+                                        p = m->buf + m->count;
+                                        m->count = s - m->buf;
+                                        return s - p;
+                                } else if (!strchr(esc, c)) {
+                                        *s++ = c;
+                                } else if (s + 4 > p) {
+                                        break;
+                                } else {
+                                        *s++ = '\\';
+                                        *s++ = '0' + ((c & 0300) >> 6);
+                                        *s++ = '0' + ((c & 070) >> 3);
+                                        *s++ = '0' + (c & 07);
+                                }
+                        }
+                }
+        }
+        m->count = m->size;
+        return -1;
 }
 EXPORT_SYMBOL(seq_path);
 
 static void *single_start(struct seq_file *p, loff_t *pos)
 {
-       return NULL + (*pos == 0);
+        return NULL + (*pos == 0);
 }
 
 static void *single_next(struct seq_file *p, void *v, loff_t *pos)
 {
-       ++*pos;
-       return NULL;
+        ++*pos;
+        return NULL;
 }
 
 static void single_stop(struct seq_file *p, void *v)
@@ -352,64 +366,64 @@ static void single_stop(struct seq_file *p, void *v)
 }
 
 int single_open(struct file *file, int (*show)(struct seq_file *, void *),
-               void *data)
+                void *data)
 {
-       struct seq_operations *op = kmalloc(sizeof(*op), GFP_KERNEL);
-       int res = -ENOMEM;
+        struct seq_operations *op = kmalloc(sizeof(*op), GFP_KERNEL);
+        int res = -ENOMEM;
 
-       if (op) {
-               op->start = single_start;
-               op->next = single_next;
-               op->stop = single_stop;
-               op->show = show;
-               res = seq_open(file, op);
-               if (!res)
-                       ((struct seq_file *)file->private_data)->private = data;
-               else
-                       kfree(op);
-       }
-       return res;
+        if (op) {
+                op->start = single_start;
+                op->next = single_next;
+                op->stop = single_stop;
+                op->show = show;
+                res = seq_open(file, op);
+                if (!res)
+                        ((struct seq_file *)file->private_data)->private = data;
+                else
+                        kfree(op);
+        }
+        return res;
 }
 EXPORT_SYMBOL(single_open);
 
 int single_release(struct inode *inode, struct file *file)
 {
-       struct seq_operations *op = ((struct seq_file *)file->private_data)->op;
-       int res = seq_release(inode, file);
-       kfree(op);
-       return res;
+        struct seq_operations *op = ((struct seq_file *)file->private_data)->op;
+        int res = seq_release(inode, file);
+        kfree(op);
+        return res;
 }
 EXPORT_SYMBOL(single_release);
 
 int seq_release_private(struct inode *inode, struct file *file)
 {
-       struct seq_file *seq = file->private_data;
+        struct seq_file *seq = file->private_data;
 
-       kfree(seq->private);
-       seq->private = NULL;
-       return seq_release(inode, file);
+        kfree(seq->private);
+        seq->private = NULL;
+        return seq_release(inode, file);
 }
 EXPORT_SYMBOL(seq_release_private);
 
 int seq_putc(struct seq_file *m, char c)
 {
-       if (m->count < m->size) {
-               m->buf[m->count++] = c;
-               return 0;
-       }
-       return -1;
+        if (m->count < m->size) {
+                m->buf[m->count++] = c;
+                return 0;
+        }
+        return -1;
 }
 EXPORT_SYMBOL(seq_putc);
 
 int seq_puts(struct seq_file *m, const char *s)
 {
-       int len = strlen(s);
-       if (m->count + len < m->size) {
-               memcpy(m->buf + m->count, s, len);
-               m->count += len;
-               return 0;
-       }
-       m->count = m->size;
-       return -1;
+        int len = strlen(s);
+        if (m->count + len < m->size) {
+                memcpy(m->buf + m->count, s, len);
+                m->count += len;
+                return 0;
+        }
+        m->count = m->size;
+        return -1;
 }
 EXPORT_SYMBOL(seq_puts);
index 51189bd..45d4ad0 100755 (executable)
@@ -8,8 +8,12 @@
 #ifndef __ASM_MACH_GENERIC_PARAM_H
 #define __ASM_MACH_GENERIC_PARAM_H
 
-#if 0 /* defined(CONFIG_MIPS_BRCM) */
-#define HZ             200                     /* Internal kernel timer frequency */
+/* Header file config.h, which defines CONFIG_MIPS_BRCM, is not included by
+ * all files that include this header file.  Therefore, unconditionally
+ * define HZ to 200.
+ */
+#if 1 /* defined(CONFIG_MIPS_BRCM) */
+#define HZ             200                 /* Internal kernel timer frequency */
 #else
 #define HZ             1000            /* Internal kernel timer frequency */
 #endif
index a54628c..b919065 100755 (executable)
 #ifdef __KERNEL__
 
 # include <param.h>                    /* Internal kernel timer frequency */
-#if defined(CONFIG_BCM_ENDPOINT_MODULE)
-# define USER_HZ       HZ              /* .. some user interfaces are in "ticks" */
-#else
+
 # define USER_HZ       100             /* .. some user interfaces are in "ticks" */
-#endif
+
 # define CLOCKS_PER_SEC        (USER_HZ)       /* like times() */
 #endif
 
index e9631f9..89d38cb 100755 (executable)
@@ -81,6 +81,8 @@ struct atm_backend_br2684 {
 #if defined(CONFIG_MIPS_BRCM)
 #define FILTER_PPPOE   1
        int     proto_filter;   /* protocol filter flag, current only PPPoE */
+        unsigned short  vlan_id;        /* vlan id (0-4096) */
+
 #endif
 
 };
index 5155f57..0fbec88 100755 (executable)
@@ -50,25 +50,6 @@ DECLARE_LOCK_EXTERN(ip_pptp_lock);
 
 #define IP_CONNTR_PPTP         PPTP_CONTROL_PORT
 
-union pptp_ctrl_union {
-                void                           *rawreq;
-               struct PptpStartSessionRequest  *sreq;
-               struct PptpStartSessionReply    *srep;
-               struct PptpStopSessionReqest    *streq;
-               struct PptpStopSessionReply     *strep;
-                struct PptpOutCallRequest       *ocreq;
-                struct PptpOutCallReply         *ocack;
-                struct PptpInCallRequest        *icreq;
-                struct PptpInCallReply          *icack;
-                struct PptpInCallConnected      *iccon;
-               struct PptpClearCallRequest     *clrreq;
-                struct PptpCallDisconnectNotify *disc;
-                struct PptpWanErrorNotify       *wanerr;
-                struct PptpSetLinkInfo          *setlink;
-};
-
-
-
 #define PPTP_CONTROL_PORT      1723
 
 #define PPTP_PACKET_CONTROL    1
@@ -309,5 +290,21 @@ struct pptp_priv_data {
        __u16   pcall_id;
 };
 
+union pptp_ctrl_union {
+               struct PptpStartSessionRequest  sreq;
+               struct PptpStartSessionReply    srep;
+               struct PptpStopSessionRequest   streq;
+               struct PptpStopSessionReply     strep;
+                struct PptpOutCallRequest       ocreq;
+                struct PptpOutCallReply         ocack;
+                struct PptpInCallRequest        icreq;
+                struct PptpInCallReply          icack;
+                struct PptpInCallConnected      iccon;
+               struct PptpClearCallRequest     clrreq;
+                struct PptpCallDisconnectNotify disc;
+                struct PptpWanErrorNotify       wanerr;
+                struct PptpSetLinkInfo          setlink;
+};
+
 #endif /* __KERNEL__ */
 #endif /* _CONNTRACK_PPTP_H */
index 56e37ef..072cf3f 100755 (executable)
@@ -62,5 +62,6 @@ extern void ip_conntrack_protocol_unregister(struct ip_conntrack_protocol *proto
 extern struct ip_conntrack_protocol ip_conntrack_protocol_tcp;
 extern struct ip_conntrack_protocol ip_conntrack_protocol_udp;
 extern struct ip_conntrack_protocol ip_conntrack_protocol_icmp;
+extern struct ip_conntrack_protocol ip_conntrack_protocol_esp;
 extern int ip_conntrack_protocol_tcp_init(void);
 #endif /*_IP_CONNTRACK_PROTOCOL_H*/
index 2ba8c2f..5d1734a 100755 (executable)
@@ -247,6 +247,10 @@ struct sk_buff {
        unsigned short          protocol,
                                security;
 
+#if defined(CONFIG_MIPS_BRCM)
+       char                    extif[64];
+#endif
+
        void                    (*destructor)(struct sk_buff *skb);
 #ifdef CONFIG_NETFILTER
         unsigned long          nfmark;
@@ -273,7 +277,7 @@ struct sk_buff {
 
 #endif
 #if defined(CONFIG_MIPS_BRCM)
-#define FROM_WAN               7
+#define FROM_WAN               0x1000
 #define FREE_DATA              0
 #define FREE_SKB               1
        /* Call back function to return the buffer or skb itself back to the free queue
@@ -361,7 +365,7 @@ static inline void skb_hdrinit(unsigned int offset, unsigned int size,
        skb->tail = data + size;
        skb->end  = (unsigned char *) (((unsigned long) data + size + 0x0f) & ~0x0f);
        skb->len = size;
-       skb->rcvfrom = rcvfrom;
+       skb->nfmark |= rcvfrom;
 
        skb->retfreeq_cb = retfreeq_cb;
        skb->retfreeq_context = retfreeq_ctx;
@@ -1167,6 +1171,19 @@ extern void             skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
 extern void           skb_split(struct sk_buff *skb,
                                 struct sk_buff *skb1, const u32 len);
 
+static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
+                                        int len, void *buffer)
+{
+         int hlen = skb_headlen(skb);
+         if (offset + len <= hlen)
+                 return skb->data + offset;
+         if (skb_copy_bits(skb, offset, buffer, len) < 0)
+                 return NULL;
+         return buffer;
+ }
 extern void skb_init(void);
 extern void skb_add_mtu(int mtu);
 
index fadfc6d..8cc2519 100755 (executable)
@@ -438,6 +438,8 @@ asmlinkage long sys_umask(int mask);
 asmlinkage long sys_msgget(key_t key, int msgflg);
 asmlinkage long sys_msgsnd(int msqid, struct msgbuf __user *msgp,
                                size_t msgsz, int msgflg);
+asmlinkage long kernel_sys_msgsnd(int msqid, struct msgbuf __user *msgp,
+                               size_t msgsz, int msgflg);
 asmlinkage long sys_msgrcv(int msqid, struct msgbuf __user *msgp,
                                size_t msgsz, long msgtyp, int msgflg);
 asmlinkage long sys_msgctl(int msqid, int cmd, struct msqid_ds __user *buf);
index bce3aaf..fefa532 100755 (executable)
@@ -101,8 +101,7 @@ struct Qdisc
 
 static inline void *qdisc_priv(struct Qdisc *q)
 {
-       return (char *)q + ((sizeof(struct Qdisc) + QDISC_ALIGN_CONST)
-                             & ~QDISC_ALIGN_CONST);
+       return (unsigned int)((char *)q + (sizeof(struct Qdisc) + QDISC_ALIGN_CONST)) & ~(QDISC_ALIGN_CONST);
 }
 
 struct qdisc_rate_table
index 0b94438..45f86d0 100755 (executable)
@@ -257,6 +257,9 @@ struct sock {
        struct sk_buff          *sk_send_head;
       &nbs