summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2003-09-21 08:47:10 -0700
committerPatrick Mochel <mochel@osdl.org>2003-09-21 08:47:10 -0700
commit525ae82073bf9723386c4aaffcd35e49812c2e05 (patch)
treedaed70969bd8c7cd287296bc72085d04f0ee8068
parent49824db2751e56f8e79ad47ccc91a83f5bc4539b (diff)
parent1c20618e2767bdcbe27e331a118a6f0e58eb64d2 (diff)
Merge osdl.org:/home/mochel/src/kernel/linux-2.5-virgin
into osdl.org:/home/mochel/src/kernel/linux-2.5-power
-rw-r--r--CREDITS2
-rw-r--r--Documentation/Changes4
-rw-r--r--Documentation/DocBook/gadget.tmpl27
-rw-r--r--Documentation/DocBook/writing_usb_driver.tmpl3
-rw-r--r--Documentation/block/biodoc.txt222
-rw-r--r--Documentation/kernel-parameters.txt4
-rw-r--r--Documentation/networking/bonding.txt4
-rw-r--r--Documentation/smp.tex346
-rw-r--r--Documentation/video4linux/Zoran26
-rw-r--r--MAINTAINERS2
-rw-r--r--arch/alpha/Kconfig3
-rw-r--r--arch/arm/Makefile16
-rw-r--r--arch/arm/boot/bootp/init.S96
-rw-r--r--arch/arm/common/sa1111.c1
-rw-r--r--arch/arm/configs/a5k_defconfig (renamed from arch/arm/def-configs/a5k)0
-rw-r--r--arch/arm/configs/adi_evb_defconfig (renamed from arch/arm/def-configs/adi_evb)0
-rw-r--r--arch/arm/configs/adsbitsy_defconfig (renamed from arch/arm/def-configs/adsbitsy)0
-rw-r--r--arch/arm/configs/anakin_defconfig (renamed from arch/arm/def-configs/anakin)0
-rw-r--r--arch/arm/configs/assabet_defconfig (renamed from arch/arm/def-configs/assabet)0
-rw-r--r--arch/arm/configs/badge4_defconfig (renamed from arch/arm/def-configs/badge4)0
-rw-r--r--arch/arm/configs/brutus_defconfig (renamed from arch/arm/def-configs/brutus)0
-rw-r--r--arch/arm/configs/cerfcube_defconfig (renamed from arch/arm/def-configs/cerfcube)0
-rw-r--r--arch/arm/configs/cerfpda_defconfig (renamed from arch/arm/def-configs/cerfpda)0
-rw-r--r--arch/arm/configs/cerfpod_defconfig (renamed from arch/arm/def-configs/cerfpod)0
-rw-r--r--arch/arm/configs/clps7500_defconfig (renamed from arch/arm/def-configs/clps7500)0
-rw-r--r--arch/arm/configs/ebsa110_defconfig (renamed from arch/arm/def-configs/ebsa110)0
-rw-r--r--arch/arm/configs/edb7211_defconfig (renamed from arch/arm/def-configs/edb7211)0
-rw-r--r--arch/arm/configs/empeg_defconfig (renamed from arch/arm/def-configs/empeg)0
-rw-r--r--arch/arm/configs/epxa10db_defconfig (renamed from arch/arm/def-configs/epxa10db)0
-rw-r--r--arch/arm/configs/flexanet_defconfig (renamed from arch/arm/def-configs/flexanet)0
-rw-r--r--arch/arm/configs/footbridge_defconfig (renamed from arch/arm/def-configs/footbridge)0
-rw-r--r--arch/arm/configs/fortunet_defconfig (renamed from arch/arm/def-configs/fortunet)0
-rw-r--r--arch/arm/configs/freebird_defconfig (renamed from arch/arm/def-configs/freebird)0
-rw-r--r--arch/arm/configs/freebird_new_defconfig (renamed from arch/arm/def-configs/freebird_new)0
-rw-r--r--arch/arm/configs/graphicsclient_defconfig (renamed from arch/arm/def-configs/graphicsclient)0
-rw-r--r--arch/arm/configs/graphicsmaster_defconfig (renamed from arch/arm/def-configs/graphicsmaster)0
-rw-r--r--arch/arm/configs/h3600_defconfig (renamed from arch/arm/def-configs/h3600)0
-rw-r--r--arch/arm/configs/hackkit_defconfig (renamed from arch/arm/def-configs/hackkit)0
-rw-r--r--arch/arm/configs/huw_webpanel_defconfig (renamed from arch/arm/def-configs/huw_webpanel)0
-rw-r--r--arch/arm/configs/integrator_defconfig (renamed from arch/arm/def-configs/integrator)0
-rw-r--r--arch/arm/configs/iq80310_defconfig (renamed from arch/arm/def-configs/iq80310)0
-rw-r--r--arch/arm/configs/iq80321_defconfig (renamed from arch/arm/def-configs/iq80321)0
-rw-r--r--arch/arm/configs/jornada720_defconfig (renamed from arch/arm/def-configs/jornada720)0
-rw-r--r--arch/arm/configs/lart_defconfig (renamed from arch/arm/def-configs/lart)0
-rw-r--r--arch/arm/configs/lubbock_defconfig (renamed from arch/arm/def-configs/lubbock)0
-rw-r--r--arch/arm/configs/lusl7200_defconfig (renamed from arch/arm/def-configs/lusl7200)0
-rw-r--r--arch/arm/configs/neponset_defconfig (renamed from arch/arm/def-configs/neponset)0
-rw-r--r--arch/arm/configs/omnimeter_defconfig (renamed from arch/arm/def-configs/omnimeter)0
-rw-r--r--arch/arm/configs/pangolin_defconfig (renamed from arch/arm/def-configs/pangolin)0
-rw-r--r--arch/arm/configs/pfs168_mqtft_defconfig (renamed from arch/arm/def-configs/pfs168_mqtft)0
-rw-r--r--arch/arm/configs/pfs168_mqvga_defconfig (renamed from arch/arm/def-configs/pfs168_mqvga)0
-rw-r--r--arch/arm/configs/pfs168_sastn_defconfig (renamed from arch/arm/def-configs/pfs168_sastn)0
-rw-r--r--arch/arm/configs/pfs168_satft_defconfig (renamed from arch/arm/def-configs/pfs168_satft)0
-rw-r--r--arch/arm/configs/pleb_defconfig (renamed from arch/arm/def-configs/pleb)0
-rw-r--r--arch/arm/configs/rpc_defconfig (renamed from arch/arm/def-configs/rpc)0
-rw-r--r--arch/arm/configs/shannon_defconfig (renamed from arch/arm/def-configs/shannon)0
-rw-r--r--arch/arm/configs/shark_defconfig (renamed from arch/arm/def-configs/shark)0
-rw-r--r--arch/arm/configs/sherman_defconfig (renamed from arch/arm/def-configs/sherman)0
-rw-r--r--arch/arm/configs/stork_defconfig (renamed from arch/arm/def-configs/stork)0
-rw-r--r--arch/arm/configs/system3_defconfig (renamed from arch/arm/def-configs/system3)0
-rw-r--r--arch/arm/configs/trizeps_defconfig (renamed from arch/arm/def-configs/trizeps)0
-rw-r--r--arch/arm/kernel/asm-offsets.c2
-rw-r--r--arch/arm/kernel/ecard.c3
-rw-r--r--arch/arm/kernel/entry-armv.S4
-rw-r--r--arch/arm/kernel/fiq.c1
-rw-r--r--arch/arm/kernel/process.c56
-rw-r--r--arch/arm/kernel/ptrace.c1
-rw-r--r--arch/arm/kernel/semaphore.c1
-rw-r--r--arch/arm/lib/io-readsb.S76
-rw-r--r--arch/arm/lib/io-writesb.S94
-rw-r--r--arch/arm/lib/io-writesl.S25
-rw-r--r--arch/arm/lib/lib1funcs.S1
-rw-r--r--arch/arm/mach-anakin/arch.c2
-rw-r--r--arch/arm/mach-clps711x/mm.c1
-rw-r--r--arch/arm/mach-integrator/core.c1
-rw-r--r--arch/arm/mach-integrator/cpu.c1
-rw-r--r--arch/arm/mach-iop3xx/mm-321.c2
-rw-r--r--arch/arm/mach-l7200/core.c1
-rw-r--r--arch/arm/mach-pxa/generic.c1
-rw-r--r--arch/arm/mach-pxa/leds.c1
-rw-r--r--arch/arm/mach-pxa/pm.c2
-rw-r--r--arch/arm/mach-rpc/riscpc.c1
-rw-r--r--arch/arm/mach-sa1100/h3600.c1
-rw-r--r--arch/arm/mach-sa1100/hackkit.c2
-rw-r--r--arch/arm/mach-sa1100/pfs168.c1
-rw-r--r--arch/arm/mach-sa1100/stork.c2
-rw-r--r--arch/arm/mach-sa1100/trizeps.c1
-rw-r--r--arch/arm/mach-tbox/core.c1
-rw-r--r--arch/arm/mm/cache-v3.S5
-rw-r--r--arch/arm/mm/cache-v4.S5
-rw-r--r--arch/arm/mm/cache-v4wb.S6
-rw-r--r--arch/arm/mm/cache-v4wt.S6
-rw-r--r--arch/arm/mm/consistent.c1
-rw-r--r--arch/arm/mm/copypage-v3.S4
-rw-r--r--arch/arm/mm/copypage-v4mc.S5
-rw-r--r--arch/arm/mm/copypage-v4wb.S5
-rw-r--r--arch/arm/mm/copypage-v4wt.S5
-rw-r--r--arch/arm/mm/copypage-xscale.S4
-rw-r--r--arch/arm/mm/mm-armv.c1
-rw-r--r--arch/arm/mm/proc-arm1020.S54
-rw-r--r--arch/arm/mm/proc-arm1020e.S54
-rw-r--r--arch/arm/mm/proc-arm1022.S54
-rw-r--r--arch/arm/mm/proc-arm1026.S12
-rw-r--r--arch/arm/mm/proc-arm6_7.S35
-rw-r--r--arch/arm/mm/proc-arm720.S17
-rw-r--r--arch/arm/mm/proc-arm920.S41
-rw-r--r--arch/arm/mm/proc-arm922.S41
-rw-r--r--arch/arm/mm/proc-arm926.S47
-rw-r--r--arch/arm/mm/proc-sa110.S22
-rw-r--r--arch/arm/mm/proc-sa1100.S24
-rw-r--r--arch/arm/mm/proc-xscale.S39
-rw-r--r--arch/arm/mm/tlb-v3.S2
-rw-r--r--arch/arm/mm/tlb-v4.S2
-rw-r--r--arch/arm/mm/tlb-v4wb.S2
-rw-r--r--arch/arm/mm/tlb-v4wbi.S2
-rw-r--r--arch/arm/nwfpe/fpa11.c1
-rw-r--r--arch/arm/nwfpe/fpa11.h1
-rw-r--r--arch/arm/nwfpe/fpa11_cpdo.c1
-rw-r--r--arch/arm/nwfpe/fpa11_cpdt.c1
-rw-r--r--arch/arm/nwfpe/fpa11_cprt.c1
-rw-r--r--arch/arm/nwfpe/fpopcode.c1
-rw-r--r--arch/arm/nwfpe/fpopcode.h2
-rw-r--r--arch/arm/nwfpe/softfloat.h2
-rw-r--r--arch/arm/tools/mach-types3
-rw-r--r--arch/h8300/kernel/signal.c2
-rw-r--r--arch/i386/kernel/apm.c2
-rw-r--r--arch/i386/kernel/cpu/cpufreq/powernow-k7.c9
-rw-r--r--arch/i386/kernel/cpu/mtrr/if.c10
-rw-r--r--arch/i386/kernel/i386_ksyms.c3
-rw-r--r--arch/i386/kernel/io_apic.c5
-rw-r--r--arch/i386/kernel/numaq.c8
-rw-r--r--arch/i386/kernel/smpboot.c4
-rw-r--r--arch/i386/kernel/srat.c33
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c24
-rw-r--r--arch/i386/kernel/traps.c5
-rw-r--r--arch/i386/mm/discontig.c11
-rw-r--r--arch/ia64/Kconfig18
-rw-r--r--arch/ia64/hp/common/sba_iommu.c61
-rw-r--r--arch/ia64/ia32/sys_ia32.c11
-rw-r--r--arch/ia64/kernel/Makefile1
-rw-r--r--arch/ia64/kernel/acpi.c2
-rw-r--r--arch/ia64/kernel/efi.c2
-rw-r--r--arch/ia64/kernel/mca.c4
-rw-r--r--arch/ia64/kernel/perfmon.c2
-rw-r--r--arch/ia64/kernel/salinfo.c3
-rw-r--r--arch/ia64/kernel/time.c2
-rw-r--r--arch/ia64/kernel/traps.c8
-rw-r--r--arch/ia64/kernel/unwind.c5
-rw-r--r--arch/ia64/sn/io/machvec/iomv.c2
-rw-r--r--arch/ia64/sn/io/sn2/ml_SN_intr.c1
-rw-r--r--arch/ia64/sn/io/sn2/shub.c4
-rw-r--r--arch/ia64/sn/kernel/irq.c3
-rw-r--r--arch/m68k/kernel/signal.c2
-rw-r--r--arch/m68knommu/kernel/signal.c2
-rw-r--r--arch/mips/jazz/setup.c1
-rw-r--r--arch/mips/kernel/irixelf.c2
-rw-r--r--arch/mips/kernel/irixsig.c2
-rw-r--r--arch/mips/kernel/mips_ksyms.c4
-rw-r--r--arch/mips/kernel/setup.c9
-rw-r--r--arch/mips/kernel/sysirix.c4
-rw-r--r--arch/mips/sgi-ip22/ip22-eisa.c1
-rw-r--r--arch/mips/sni/setup.c1
-rw-r--r--arch/parisc/kernel/irq.c3
-rw-r--r--arch/parisc/kernel/parisc_ksyms.c3
-rw-r--r--arch/parisc/kernel/pci.c1
-rw-r--r--arch/parisc/kernel/setup.c4
-rw-r--r--arch/ppc/kernel/time.c25
-rw-r--r--arch/ppc64/kernel/time.c9
-rw-r--r--arch/sparc/kernel/sun4d_smp.c10
-rw-r--r--arch/sparc/mm/srmmu.c7
-rw-r--r--arch/sparc64/kernel/time.c20
-rw-r--r--arch/sparc64/solaris/misc.c4
-rw-r--r--arch/x86_64/kernel/time.c13
-rw-r--r--drivers/atm/eni.c14
-rw-r--r--drivers/atm/firestream.c2
-rw-r--r--drivers/atm/idt77252.c5
-rw-r--r--drivers/atm/lanai.c5
-rw-r--r--drivers/atm/uPD98402.c17
-rw-r--r--drivers/atm/zatm.c3
-rw-r--r--drivers/block/as-iosched.c23
-rw-r--r--drivers/block/cciss.c24
-rw-r--r--drivers/block/deadline-iosched.c22
-rw-r--r--drivers/block/floppy.c35
-rw-r--r--drivers/block/loop.c2
-rw-r--r--drivers/char/Kconfig4
-rw-r--r--drivers/char/Makefile2
-rw-r--r--drivers/char/agp/backend.c2
-rw-r--r--drivers/char/ftape/lowlevel/ftape-init.c39
-rw-r--r--drivers/char/istallion.c4
-rw-r--r--drivers/char/keyboard.c2
-rw-r--r--drivers/char/mem.c9
-rw-r--r--drivers/char/misc.c3
-rw-r--r--drivers/char/n_tty.c6
-rw-r--r--drivers/char/random.c12
-rw-r--r--drivers/char/rio/rio_linux.c45
-rw-r--r--drivers/char/rocket.c2
-rw-r--r--drivers/char/specialix.c37
-rw-r--r--drivers/char/sx.c24
-rw-r--r--drivers/char/tty_io.c14
-rw-r--r--drivers/eisa/eisa-bus.c5
-rw-r--r--drivers/ieee1394/nodemgr.c3
-rw-r--r--drivers/input/evdev.c12
-rw-r--r--drivers/input/input.c36
-rw-r--r--drivers/input/joystick/Kconfig18
-rw-r--r--drivers/input/joystick/db9.c313
-rw-r--r--drivers/input/joystick/iforce/iforce-packets.c5
-rw-r--r--drivers/input/joystick/iforce/iforce-usb.c6
-rw-r--r--drivers/input/keyboard/Kconfig15
-rw-r--r--drivers/input/keyboard/atkbd.c174
-rw-r--r--drivers/input/mouse/Kconfig26
-rw-r--r--drivers/input/mouse/psmouse-base.c103
-rw-r--r--drivers/input/mouse/psmouse.h22
-rw-r--r--drivers/input/mouse/synaptics.c363
-rw-r--r--drivers/input/mouse/synaptics.h27
-rw-r--r--drivers/input/serio/Kconfig4
-rw-r--r--drivers/input/serio/ambakmi.c14
-rw-r--r--drivers/input/serio/serio.c34
-rw-r--r--drivers/input/touchscreen/Kconfig6
-rw-r--r--drivers/isdn/hardware/eicon/divasmain.c1
-rw-r--r--drivers/isdn/hardware/eicon/i4lididrv.c2
-rw-r--r--drivers/isdn/i4l/isdn_tty.c3
-rw-r--r--drivers/macintosh/adb.c3
-rw-r--r--drivers/macintosh/mediabay.c3
-rw-r--r--drivers/mtd/mtd_blkdevs.c3
-rw-r--r--drivers/net/3c501.c6
-rw-r--r--drivers/net/3c505.c12
-rw-r--r--drivers/net/3c515.c1
-rw-r--r--drivers/net/Space.c4
-rw-r--r--drivers/net/ac3200.c1
-rw-r--r--drivers/net/acenic.c3
-rw-r--r--drivers/net/arm/ether00.c2
-rw-r--r--drivers/net/bonding/bond_alb.c150
-rw-r--r--drivers/net/bonding/bond_alb.h8
-rw-r--r--drivers/net/bonding/bond_main.c1078
-rw-r--r--drivers/net/bonding/bonding.h4
-rw-r--r--drivers/net/cs89x0.c1
-rw-r--r--drivers/net/depca.c942
-rw-r--r--drivers/net/dgrs.c1
-rw-r--r--drivers/net/e1000/e1000_main.c13
-rw-r--r--drivers/net/eepro.c6
-rw-r--r--drivers/net/es3210.c1
-rw-r--r--drivers/net/ewrk3.c5
-rw-r--r--drivers/net/hamradio/baycom_par.c1
-rw-r--r--drivers/net/hamradio/baycom_ser_fdx.c1
-rw-r--r--drivers/net/hamradio/baycom_ser_hdx.c1
-rw-r--r--drivers/net/hamradio/hdlcdrv.c1
-rw-r--r--drivers/net/hamradio/scc.c208
-rw-r--r--drivers/net/hamradio/yam.c1
-rw-r--r--drivers/net/hp100.c1
-rw-r--r--drivers/net/ibmlana.c1
-rw-r--r--drivers/net/irda/Kconfig24
-rw-r--r--drivers/net/irda/Makefile2
-rw-r--r--drivers/net/irda/ali-ircc.c84
-rw-r--r--drivers/net/irda/donauboe.c50
-rw-r--r--drivers/net/irda/irda-usb.c44
-rw-r--r--drivers/net/irda/nsc-ircc.c78
-rw-r--r--drivers/net/irda/sir_kthread.c4
-rw-r--r--drivers/net/irda/smc-ircc.c1258
-rw-r--r--drivers/net/irda/toshoboe.c957
-rw-r--r--drivers/net/irda/via-ircc.c92
-rw-r--r--drivers/net/irda/w83977af_ir.c54
-rw-r--r--drivers/net/lance.c10
-rw-r--r--drivers/net/lne390.c1
-rw-r--r--drivers/net/mace.c1
-rw-r--r--drivers/net/ne2.c1
-rw-r--r--drivers/net/ne3210.c1
-rw-r--r--drivers/net/net_init.c2
-rw-r--r--drivers/net/ni5010.c5
-rw-r--r--drivers/net/ni52.c5
-rw-r--r--drivers/net/ni65.c1
-rw-r--r--drivers/net/ns83820.c10
-rw-r--r--drivers/net/pcmcia/com20020_cs.c41
-rw-r--r--drivers/net/rcpci45.c4
-rw-r--r--drivers/net/rrunner.c17
-rw-r--r--drivers/net/rrunner.h1
-rw-r--r--drivers/net/sb1000.c1
-rw-r--r--drivers/net/sis900.c1
-rw-r--r--drivers/net/sk98lin/h/skdrv1st.h4
-rw-r--r--drivers/net/sk98lin/skge.c1
-rw-r--r--drivers/net/sk_mca.h2
-rw-r--r--drivers/net/skfp/h/targetos.h1
-rw-r--r--drivers/net/smc-ultra32.c1
-rw-r--r--drivers/net/smc9194.c1
-rw-r--r--drivers/net/tlan.c1
-rw-r--r--drivers/net/tokenring/Kconfig5
-rw-r--r--drivers/net/tokenring/lanstreamer.h2
-rw-r--r--drivers/net/tokenring/proteon.c2
-rw-r--r--drivers/net/tokenring/skisa.c2
-rw-r--r--drivers/net/tokenring/smctr.c1
-rw-r--r--drivers/net/tokenring/tms380tr.c1
-rw-r--r--drivers/net/wan/Kconfig24
-rw-r--r--drivers/net/wan/Makefile22
-rw-r--r--drivers/net/wan/comx-hw-comx.c1
-rw-r--r--drivers/net/wan/comx-hw-locomx.c1
-rw-r--r--drivers/net/wan/comx-hw-mixcom.c1
-rw-r--r--drivers/net/wan/comx-hw-munich.c1
-rw-r--r--drivers/net/wan/comx-proto-fr.c1
-rw-r--r--drivers/net/wan/comx-proto-lapb.c1
-rw-r--r--drivers/net/wan/comx-proto-ppp.c1
-rw-r--r--drivers/net/wan/comx.c1
-rw-r--r--drivers/net/wan/cycx_x25.c1
-rw-r--r--drivers/net/wan/dlci.c1
-rw-r--r--drivers/net/wan/dscc4.c1
-rw-r--r--drivers/net/wan/lmc/lmc_ver.h2
-rw-r--r--drivers/net/wan/pc300_drv.c1
-rw-r--r--drivers/net/wan/pc300_tty.c1
-rw-r--r--drivers/net/wan/sbni.c20
-rw-r--r--drivers/net/wan/sdla_chdlc.c5
-rw-r--r--drivers/net/wan/sdla_fr.c31
-rw-r--r--drivers/net/wan/sdla_ft1.c1
-rw-r--r--drivers/net/wan/sdla_ppp.c1
-rw-r--r--drivers/net/wan/sdla_x25.c21
-rw-r--r--drivers/net/wan/sdladrv.c3
-rw-r--r--drivers/net/wan/sdlamain.c101
-rw-r--r--drivers/net/wan/sealevel.c159
-rw-r--r--drivers/net/wan/wanpipe_multppp.c1
-rw-r--r--drivers/net/wan/wanxl.c836
-rw-r--r--drivers/net/wan/wanxl.h152
-rw-r--r--drivers/net/wan/wanxlfw.S895
-rw-r--r--drivers/net/wan/wanxlfw.inc158
-rw-r--r--drivers/net/wd.c5
-rw-r--r--drivers/net/wireless/airo.c11
-rw-r--r--drivers/net/wireless/arlan-proc.c3
-rw-r--r--drivers/net/wireless/arlan.c1
-rw-r--r--drivers/net/wireless/arlan.h1
-rw-r--r--drivers/net/wireless/strip.c1
-rw-r--r--drivers/pcmcia/cs.c117
-rw-r--r--drivers/pcmcia/rsrc_mgr.c22
-rw-r--r--drivers/pcmcia/sa1100_assabet.c1
-rw-r--r--drivers/pcmcia/sa1111_generic.c1
-rw-r--r--drivers/pnp/card.c8
-rw-r--r--drivers/pnp/isapnp/compat.c1
-rw-r--r--drivers/pnp/isapnp/core.c2
-rw-r--r--drivers/pnp/isapnp/proc.c1
-rw-r--r--drivers/pnp/pnpbios/bioscalls.c89
-rw-r--r--drivers/pnp/pnpbios/core.c80
-rw-r--r--drivers/pnp/pnpbios/pnpbios.h40
-rw-r--r--drivers/pnp/pnpbios/proc.c14
-rw-r--r--drivers/pnp/quirks.c24
-rw-r--r--drivers/pnp/resource.c18
-rw-r--r--drivers/sbus/char/bpp.c1
-rw-r--r--drivers/sbus/char/cpwatchdog.c1
-rw-r--r--drivers/sbus/char/display7seg.c1
-rw-r--r--drivers/scsi/NCR5380.c4
-rw-r--r--drivers/usb/Kconfig12
-rw-r--r--drivers/usb/class/usblp.c5
-rw-r--r--drivers/usb/core/config.c546
-rw-r--r--drivers/usb/core/hub.c6
-rw-r--r--drivers/usb/core/usb.c10
-rw-r--r--drivers/usb/gadget/Kconfig34
-rw-r--r--drivers/usb/gadget/inode.c1
-rw-r--r--drivers/usb/input/Kconfig48
-rw-r--r--drivers/usb/input/hiddev.c1
-rw-r--r--drivers/usb/media/Kconfig61
-rw-r--r--drivers/usb/media/dabusb.c5
-rw-r--r--drivers/usb/media/usbvideo.c1
-rw-r--r--drivers/usb/media/vicam.c2
-rw-r--r--drivers/usb/misc/speedtch.c33
-rw-r--r--drivers/usb/misc/usbtest.c2
-rw-r--r--drivers/usb/net/usbnet.c277
-rw-r--r--drivers/usb/serial/Kconfig121
-rw-r--r--drivers/usb/serial/ipaq.c2
-rw-r--r--drivers/usb/serial/usb-serial.c4
-rw-r--r--drivers/usb/storage/Kconfig6
-rw-r--r--drivers/usb/storage/unusual_devs.h2
-rw-r--r--fs/autofs/autofs_i.h2
-rw-r--r--fs/autofs/inode.c4
-rw-r--r--fs/autofs/root.c4
-rw-r--r--fs/autofs4/autofs_i.h2
-rw-r--r--fs/autofs4/inode.c4
-rw-r--r--fs/autofs4/root.c4
-rw-r--r--fs/binfmt_elf.c4
-rw-r--r--fs/bio.c24
-rw-r--r--fs/char_dev.c15
-rw-r--r--fs/coda/upcall.c2
-rw-r--r--fs/devfs/base.c6
-rw-r--r--fs/jbd/transaction.c3
-rw-r--r--fs/jffs/inode-v23.c2
-rw-r--r--fs/jfs/super.c9
-rw-r--r--fs/locks.c26
-rw-r--r--fs/nls/Makefile13
-rw-r--r--fs/nls/nls_base.c5
-rw-r--r--fs/nls/nls_big5.c59
-rw-r--r--fs/nls/nls_cp1250.c18
-rw-r--r--fs/nls/nls_cp1251.c16
-rw-r--r--fs/nls/nls_cp1255.c18
-rw-r--r--fs/nls/nls_cp437.c16
-rw-r--r--fs/nls/nls_cp737.c16
-rw-r--r--fs/nls/nls_cp775.c16
-rw-r--r--fs/nls/nls_cp850.c16
-rw-r--r--fs/nls/nls_cp852.c16
-rw-r--r--fs/nls/nls_cp855.c16
-rw-r--r--fs/nls/nls_cp857.c16
-rw-r--r--fs/nls/nls_cp860.c16
-rw-r--r--fs/nls/nls_cp861.c16
-rw-r--r--fs/nls/nls_cp862.c16
-rw-r--r--fs/nls/nls_cp863.c16
-rw-r--r--fs/nls/nls_cp864.c16
-rw-r--r--fs/nls/nls_cp865.c16
-rw-r--r--fs/nls/nls_cp866.c16
-rw-r--r--fs/nls/nls_cp869.c16
-rw-r--r--fs/nls/nls_cp874.c18
-rw-r--r--fs/nls/nls_cp932.c21
-rw-r--r--fs/nls/nls_cp936.c21
-rw-r--r--fs/nls/nls_cp949.c21
-rw-r--r--fs/nls/nls_cp950.c21
-rw-r--r--fs/nls/nls_euc-jp.c19
-rw-r--r--fs/nls/nls_euc-kr.c59
-rw-r--r--fs/nls/nls_gb2312.c59
-rw-r--r--fs/nls/nls_iso8859-1.c18
-rw-r--r--fs/nls/nls_iso8859-13.c18
-rw-r--r--fs/nls/nls_iso8859-14.c18
-rw-r--r--fs/nls/nls_iso8859-15.c18
-rw-r--r--fs/nls/nls_iso8859-2.c18
-rw-r--r--fs/nls/nls_iso8859-3.c18
-rw-r--r--fs/nls/nls_iso8859-4.c18
-rw-r--r--fs/nls/nls_iso8859-5.c18
-rw-r--r--fs/nls/nls_iso8859-6.c18
-rw-r--r--fs/nls/nls_iso8859-7.c18
-rw-r--r--fs/nls/nls_iso8859-8.c59
-rw-r--r--fs/nls/nls_iso8859-9.c18
-rw-r--r--fs/nls/nls_koi8-r.c18
-rw-r--r--fs/nls/nls_koi8-ru.c18
-rw-r--r--fs/nls/nls_koi8-u.c18
-rw-r--r--fs/nls/nls_sjis.c59
-rw-r--r--fs/nls/nls_tis-620.c59
-rw-r--r--fs/proc/array.c7
-rw-r--r--fs/proc/base.c506
-rw-r--r--fs/reiserfs/file.c6
-rw-r--r--fs/reiserfs/journal.c14
-rw-r--r--fs/reiserfs/super.c13
-rw-r--r--fs/xfs/linux/xfs_sysctl.c20
-rw-r--r--fs/xfs/linux/xfs_sysctl.h6
-rw-r--r--fs/xfs/linux/xfs_vnode.c2
-rw-r--r--fs/xfs/pagebuf/page_buf.c8
-rw-r--r--fs/xfs/pagebuf/page_buf_internal.h6
-rw-r--r--fs/xfs/xfs_da_btree.c4
-rw-r--r--fs/xfs/xfs_dir2_node.c3
-rw-r--r--fs/xfs/xfs_error.c2
-rw-r--r--fs/xfs/xfs_error.h18
-rw-r--r--fs/xfs/xfs_inode.c2
-rw-r--r--include/asm-alpha/processor.h1
-rw-r--r--include/asm-alpha/signal.h2
-rw-r--r--include/asm-arm/arch-iop3xx/iop321-irqs.h1
-rw-r--r--include/asm-arm/arch-iop3xx/irqs.h2
-rw-r--r--include/asm-arm/arch-pxa/hardware.h1
-rw-r--r--include/asm-arm/arch-pxa/ide.h1
-rw-r--r--include/asm-arm/arch-pxa/idp.h1
-rw-r--r--include/asm-arm/arch-pxa/irqs.h2
-rw-r--r--include/asm-arm/arch-pxa/keyboard.h1
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h1
-rw-r--r--include/asm-arm/arch-sa1100/serial.h2
-rw-r--r--include/asm-arm/arch-sa1100/trizeps.h2
-rw-r--r--include/asm-arm/cacheflush.h1
-rw-r--r--include/asm-arm/glue.h2
-rw-r--r--include/asm-arm/mmu.h2
-rw-r--r--include/asm-arm/pgtable.h1
-rw-r--r--include/asm-arm/processor.h1
-rw-r--r--include/asm-arm/signal.h2
-rw-r--r--include/asm-arm26/processor.h1
-rw-r--r--include/asm-arm26/signal.h2
-rw-r--r--include/asm-cris/signal.h2
-rw-r--r--include/asm-generic/cpumask_arith.h7
-rw-r--r--include/asm-generic/cpumask_array.h8
-rw-r--r--include/asm-h8300/processor.h1
-rw-r--r--include/asm-h8300/signal.h2
-rw-r--r--include/asm-i386/genapic.h2
-rw-r--r--include/asm-i386/mach-bigsmp/mach_apic.h2
-rw-r--r--include/asm-i386/mach-default/mach_apic.h2
-rw-r--r--include/asm-i386/mach-generic/mach_apic.h1
-rw-r--r--include/asm-i386/mach-numaq/mach_apic.h2
-rw-r--r--include/asm-i386/mach-summit/mach_apic.h34
-rw-r--r--include/asm-i386/mach-visws/mach_apic.h2
-rw-r--r--include/asm-i386/mmzone.h20
-rw-r--r--include/asm-i386/numaq.h3
-rw-r--r--include/asm-i386/processor.h5
-rw-r--r--include/asm-i386/signal.h2
-rw-r--r--include/asm-i386/srat.h3
-rw-r--r--include/asm-i386/uaccess.h2
-rw-r--r--include/asm-ia64/acpi.h2
-rw-r--r--include/asm-ia64/numa.h2
-rw-r--r--include/asm-ia64/param.h30
-rw-r--r--include/asm-ia64/processor.h1
-rw-r--r--include/asm-ia64/signal.h2
-rw-r--r--include/asm-ia64/sn/ksys/elsc.h3
-rw-r--r--include/asm-ia64/sn/ksys/l1.h35
-rw-r--r--include/asm-ia64/sn/nodepda.h2
-rw-r--r--include/asm-ia64/sn/pci/pcibr_private.h2
-rw-r--r--include/asm-ia64/sn/router.h219
-rw-r--r--include/asm-ia64/sn/sn2/shub.h7
-rw-r--r--include/asm-ia64/sn/sn2/shub_mmr_t.h12556
-rw-r--r--include/asm-ia64/spinlock.h2
-rw-r--r--include/asm-m68k/processor.h1
-rw-r--r--include/asm-m68k/signal.h2
-rw-r--r--include/asm-m68knommu/processor.h1
-rw-r--r--include/asm-m68knommu/signal.h2
-rw-r--r--include/asm-mips/processor.h6
-rw-r--r--include/asm-mips/signal.h2
-rw-r--r--include/asm-parisc/processor.h6
-rw-r--r--include/asm-parisc/signal.h2
-rw-r--r--include/asm-ppc/processor.h1
-rw-r--r--include/asm-ppc/signal.h2
-rw-r--r--include/asm-ppc/time.h8
-rw-r--r--include/asm-ppc64/processor.h2
-rw-r--r--include/asm-ppc64/signal.h2
-rw-r--r--include/asm-s390/signal.h2
-rw-r--r--include/asm-sh/processor.h2
-rw-r--r--include/asm-sh/signal.h2
-rw-r--r--include/asm-sparc/processor.h1
-rw-r--r--include/asm-sparc/signal.h2
-rw-r--r--include/asm-sparc64/processor.h1
-rw-r--r--include/asm-sparc64/signal.h2
-rw-r--r--include/asm-v850/processor.h2
-rw-r--r--include/asm-v850/signal.h2
-rw-r--r--include/asm-x86_64/processor.h1
-rw-r--r--include/asm-x86_64/signal.h2
-rw-r--r--include/linux/bio.h1
-rw-r--r--include/linux/compiler-gcc+.h14
-rw-r--r--include/linux/compiler-gcc.h17
-rw-r--r--include/linux/compiler-gcc2.h23
-rw-r--r--include/linux/compiler-gcc3.h22
-rw-r--r--include/linux/compiler-intel.h24
-rw-r--r--include/linux/compiler.h72
-rw-r--r--include/linux/console.h1
-rw-r--r--include/linux/devfs_fs_kernel.h1
-rw-r--r--include/linux/eisa.h13
-rw-r--r--include/linux/elevator.h1
-rw-r--r--include/linux/ftape.h2
-rw-r--r--include/linux/input.h2
-rw-r--r--include/linux/kernel.h4
-rw-r--r--include/linux/llc.h8
-rw-r--r--include/linux/miscdevice.h2
-rw-r--r--include/linux/netdevice.h6
-rw-r--r--include/linux/netfilter_ipv4/ipt_physdev.h4
-rw-r--r--include/linux/nls.h3
-rw-r--r--include/linux/pnpbios.h8
-rw-r--r--include/linux/random.h1
-rw-r--r--include/linux/sched.h19
-rw-r--r--include/linux/serio.h3
-rw-r--r--include/linux/skbuff.h8
-rw-r--r--include/linux/swap.h1
-rw-r--r--include/linux/tty.h1
-rw-r--r--include/linux/usb.h2
-rw-r--r--include/linux/usb_gadget.h30
-rw-r--r--include/linux/writeback.h1
-rw-r--r--include/net/llc.h91
-rw-r--r--include/net/llc_actn.h49
-rw-r--r--include/net/llc_conn.h25
-rw-r--r--include/net/llc_evnt.h70
-rw-r--r--include/net/llc_if.h49
-rw-r--r--include/net/llc_mac.h61
-rw-r--r--include/net/llc_main.h67
-rw-r--r--include/net/llc_pdu.h206
-rw-r--r--include/net/llc_s_st.h3
-rw-r--r--include/net/llc_sap.h45
-rw-r--r--include/net/llc_stat.h35
-rw-r--r--include/net/syncppp.h7
-rw-r--r--init/main.c20
-rw-r--r--ipc/sem.c4
-rw-r--r--kernel/configs.c46
-rw-r--r--kernel/exit.c24
-rw-r--r--kernel/fork.c17
-rw-r--r--kernel/ksyms.c2
-rw-r--r--kernel/pid.c4
-rw-r--r--kernel/posix-timers.c1
-rw-r--r--kernel/sched.c391
-rw-r--r--kernel/signal.c4
-rw-r--r--kernel/sys.c17
-rw-r--r--mm/memory.c2
-rw-r--r--mm/mlock.c24
-rw-r--r--mm/page-writeback.c10
-rw-r--r--mm/page_alloc.c31
-rw-r--r--mm/slab.c220
-rw-r--r--net/802/p8022.c2
-rw-r--r--net/802/psnap.c3
-rw-r--r--net/Kconfig24
-rw-r--r--net/atm/clip.c8
-rw-r--r--net/bluetooth/bnep/core.c2
-rw-r--r--net/bluetooth/bnep/sock.c1
-rw-r--r--net/bluetooth/rfcomm/core.c2
-rw-r--r--net/core/dev.c12
-rw-r--r--net/core/wireless.c11
-rw-r--r--net/ipv4/igmp.c4
-rw-r--r--net/ipv4/ipconfig.c57
-rw-r--r--net/ipv4/ipvs/ip_vs_app.c125
-rw-r--r--net/ipv4/ipvs/ip_vs_conn.c154
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c447
-rw-r--r--net/ipv4/ipvs/ip_vs_lblc.c57
-rw-r--r--net/ipv4/ipvs/ip_vs_lblcr.c61
-rw-r--r--net/ipv4/ipvs/ip_vs_lc.c8
-rw-r--r--net/ipv4/ipvs/ip_vs_nq.c8
-rw-r--r--net/ipv4/ipvs/ip_vs_proto_tcp.c12
-rw-r--r--net/ipv4/ipvs/ip_vs_proto_udp.c13
-rw-r--r--net/ipv4/ipvs/ip_vs_rr.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_sched.c7
-rw-r--r--net/ipv4/ipvs/ip_vs_sed.c9
-rw-r--r--net/ipv4/ipvs/ip_vs_sync.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_wlc.c9
-rw-r--r--net/ipv4/ipvs/ip_vs_wrr.c20
-rw-r--r--net/ipv4/netfilter/ip_nat_snmp_basic.c2
-rw-r--r--net/ipv4/netfilter/ipt_physdev.c18
-rw-r--r--net/ipv4/tcp_diag.c18
-rw-r--r--net/ipv4/udp.c1
-rw-r--r--net/ipv6/udp.c1
-rw-r--r--net/irda/discovery.c148
-rw-r--r--net/irda/ircomm/ircomm_core.c151
-rw-r--r--net/irda/iriap.c146
-rw-r--r--net/irda/irlap.c233
-rw-r--r--net/irda/irlap_frame.c34
-rw-r--r--net/irda/irlmp.c227
-rw-r--r--net/irda/irproc.c43
-rw-r--r--net/irda/irttp.c171
-rw-r--r--net/llc/Kconfig10
-rw-r--r--net/llc/Makefile14
-rw-r--r--net/llc/af_llc.c48
-rw-r--r--net/llc/llc_actn.c138
-rw-r--r--net/llc/llc_c_ac.c403
-rw-r--r--net/llc/llc_conn.c378
-rw-r--r--net/llc/llc_core.c181
-rw-r--r--net/llc/llc_evnt.c125
-rw-r--r--net/llc/llc_if.c134
-rw-r--r--net/llc/llc_input.c189
-rw-r--r--net/llc/llc_mac.c302
-rw-r--r--net/llc/llc_main.c607
-rw-r--r--net/llc/llc_output.c105
-rw-r--r--net/llc/llc_output.h20
-rw-r--r--net/llc/llc_pdu.c233
-rw-r--r--net/llc/llc_proc.c12
-rw-r--r--net/llc/llc_s_ac.c21
-rw-r--r--net/llc/llc_sap.c174
-rw-r--r--net/llc/llc_stat.c218
-rw-r--r--net/llc/llc_station.c713
-rw-r--r--net/netlink/af_netlink.c6
-rw-r--r--net/netrom/af_netrom.c18
-rw-r--r--net/netrom/nr_loopback.c31
-rw-r--r--net/netrom/nr_timer.c62
-rw-r--r--net/netsyms.c2
-rw-r--r--net/packet/af_packet.c37
-rw-r--r--net/sched/sch_generic.c26
-rw-r--r--net/wanrouter/af_wanpipe.c1
-rw-r--r--net/wanrouter/wanmain.c1
-rwxr-xr-xscripts/mkconfigs12
-rw-r--r--scripts/modpost.c2
-rw-r--r--sound/oss/Kconfig7
-rw-r--r--sound/oss/i810_audio.c11
-rw-r--r--sound/pci/ens1370.c17
646 files changed, 11996 insertions, 23927 deletions
diff --git a/CREDITS b/CREDITS
index 24d51d79b113..78afcb7fff8e 100644
--- a/CREDITS
+++ b/CREDITS
@@ -2796,7 +2796,7 @@ E: gt8134b@prism.gatech.edu
D: Dosemu
N: Duncan Sands
-E: duncan.sands@wanadoo.fr
+E: duncan.sands@free.fr
W: http://topo.math.u-psud.fr/~sands
D: Alcatel SpeedTouch USB driver
S: 69 rue Dunois
diff --git a/Documentation/Changes b/Documentation/Changes
index f26c7c282164..458086bd7f04 100644
--- a/Documentation/Changes
+++ b/Documentation/Changes
@@ -52,7 +52,7 @@ o Gnu C 2.95.3 # gcc --version
o Gnu make 3.78 # make --version
o binutils 2.12 # ld -v
o util-linux 2.10o # fdformat --version
-o module-init-tools 0.9.9 # depmod -V
+o module-init-tools 0.9.10 # depmod -V
o e2fsprogs 1.29 # tune2fs
o jfsutils 1.1.3 # fsck.jfs -V
o reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs
@@ -62,7 +62,7 @@ o quota-tools 3.09 # quota -V
o PPP 2.4.0 # pppd --version
o isdn4k-utils 3.1pre1 # isdnctrl 2>&1|grep version
o nfs-utils 1.0.5 # showmount --version
-o procps 2.0.9 # ps --version
+o procps 3.1.13 # ps --version
o oprofile 0.5.3 # oprofiled --version
Kernel compilation
diff --git a/Documentation/DocBook/gadget.tmpl b/Documentation/DocBook/gadget.tmpl
index e71faffc7429..af92fe5208d7 100644
--- a/Documentation/DocBook/gadget.tmpl
+++ b/Documentation/DocBook/gadget.tmpl
@@ -468,6 +468,15 @@ contact NetChip Technologies for development boards and product
information.
</para>
+<para>For users of Intel's PXA 2xx series processors,
+a <filename>pxa2xx_udc</filename> driver is available.
+</para>
+
+<para>At this writing, there are people at work on drivers in
+this framework for several other USB device controllers,
+with plans to make many of them be widely available.
+</para>
+
<!-- !Edrivers/usb/gadget/net2280.c -->
<para>A partial USB simulator,
@@ -500,7 +509,7 @@ for usb controller hardware), other gadget drivers exist.
<para>There's an <emphasis>ethernet</emphasis> gadget
driver, which implements one of the most useful
-<emphasis>Communications Device Class</emphasis> models.
+<emphasis>Communications Device Class</emphasis> (CDC) models.
One of the standards for cable modem interoperability even
specifies the use of this ethernet model as one of two
mandatory options.
@@ -509,6 +518,11 @@ an Ethernet adapter.
It provides access to a network where the gadget's CPU is one host,
which could easily be bridging, routing, or firewalling
access to other networks.
+Since some hardware can't fully implement the CDC Ethernet
+requirements, this driver also implements a "good parts only"
+subset of CDC Ethernet.
+(That subset doesn't advertise itself as CDC Ethernet,
+to avoid creating problems.)
</para>
<para>There is also support for user mode gadget drivers,
@@ -522,6 +536,17 @@ controller driver is available many applications for it
won't require new kernel mode software.
</para>
+<para>There's a USB Mass Storage class driver, which provides
+a different solution for interoperability with systems such
+as MS-Windows and MacOS.
+That <emphasis>File-backed Storage</emphasis> driver uses a
+file or block device as backing store for a drive,
+like the <filename>loop</filename> driver.
+The USB host uses the BBB, CB, or CBI versions of the mass
+storage class specification, using transparent SCSI commands
+to access the data from the backing store.
+</para>
+
<para>Support for other kinds of gadget is expected to
be developed and contributed
over time, as this driver framework evolves.
diff --git a/Documentation/DocBook/writing_usb_driver.tmpl b/Documentation/DocBook/writing_usb_driver.tmpl
index 42acfcaa788f..5b02c55e56ca 100644
--- a/Documentation/DocBook/writing_usb_driver.tmpl
+++ b/Documentation/DocBook/writing_usb_driver.tmpl
@@ -209,7 +209,7 @@ static int skel_probe(struct usb_interface *interface,
The driver now needs to verify that this device is actually one that it
can accept. If so, it returns 0.
If not, or if any error occurs during initialization, an errorcode
- (such as <literal>-ENOMEM<literal> or <literal>-ENODEV<literal>)
+ (such as <literal>-ENOMEM</literal> or <literal>-ENODEV</literal>)
is returned from the probe function.
</para>
<para>
@@ -327,6 +327,7 @@ if (!retval) {
talk to the device, the release function in the driver is called. In this
function we decrement our private usage count and wait for possible
pending writes:
+ </para>
<programlisting>
/* decrement our usage count for the device */
--skel->open_count;
diff --git a/Documentation/block/biodoc.txt b/Documentation/block/biodoc.txt
index 4be777cf91a9..13691ba9967d 100644
--- a/Documentation/block/biodoc.txt
+++ b/Documentation/block/biodoc.txt
@@ -6,6 +6,8 @@ Notes Written on Jan 15, 2002:
Suparna Bhattacharya <suparna@in.ibm.com>
Last Updated May 2, 2002
+September 2003: Updated I/O Scheduler portions
+ Nick Piggin <piggin@cyberone.com.au>
Introduction:
@@ -220,42 +222,8 @@ i/o scheduling algorithm aspects and details outside of the generic loop.
It also makes it possible to completely hide the implementation details of
the i/o scheduler from block drivers.
-New routines to be used instead of accessing the queue directly:
-
-elv_add_request: Should be called to queue a request
-elv_next_request: Should be called to pull of the next request to be serviced
- of the queue. It takes care of several things like skipping active requests,
- invoking the command pre-builder etc.
-
-Some new plugins:
-e->elevator_next_req_fn
- Plugin called to extract the next request to service from the
- queue
-e->elevator_add_req_fn
- Plugin called to add a new request to the queue
-e->elevator_init_fn
- Plugin called when initializing the queue
-e->elevator_exit_fn
- Plugin called when destrying the queue
-
-Elevator Linus and Elevator noop are the existing combinations that can be
-directly used, but a driver can provide relevant callbacks, in case
-it needs to do something different.
-
-Elevator noop only attempts to merge requests, but doesn't reorder (sort)
-them. Even merging requires a linear scan today (except for the last merged
-hint case discussed later) though, which takes take up some CPU cycles.
-
-[Note: Merging usually helps in general, because there's usually non-trivial
-command overhead associated with setting up and starting a command. Sorting,
-on the other hand, may not be relevant for intelligent devices that reorder
-requests anyway]
-
-Elevator Linus attempts merging as well as sorting of requests on the queue.
-The sorting happens via an insert scan whenever a request comes in.
-Often some sorting still makes sense as the depth which most hardware can
-handle may be less than the queue lengths during i/o loads.
-
+I/O scheduler wrappers are to be used instead of accessing the queue directly.
+See section 4. The I/O scheduler for details.
1.2 Tuning Based on High level code capabilities
@@ -317,32 +285,6 @@ Arjan's proposed request priority scheme allows higher levels some broad
requests. Some bits in the bi_rw flags field in the bio structure are
intended to be used for this priority information.
- Jens has an implementation of a simple deadline i/o scheduler that
- makes a best effort attempt to start requests within a given expiry
- time limit, along with trying to optimize disk seeks as in the current
- elevator. It does this by sorting a request on two lists, one by
- the deadline and one by the sector order. It employs a policy that
- follows sector ordering as long as a deadline is not violated, and
- tries to keep up with deadlines in so far as it can batch up to at
- least a certain minimum number of sector ordered requests to reduce
- arbitrary disk seeks. This implementation is constructed in a way
- that makes it possible to support advanced compound i/o schedulers
- as a combination of several low level schedulers with an overall
- class-independent scheduler layered above.
-
-The current elevator scheme provides a latency bound over how many future
-requests can "pass" (get placed before) a given request, and this bound
-is determined by the request type (read, write). However, it doesn't
-prioritize a new request over existing requests in the queue based on its
-latency requirement. A new request could of course get serviced before
-earlier requests based on the position on disk which it accesses. This is
-due to the sort/merge in the basic elevator scan logic, but irrespective
-of the request's own priority/latency value. Interestingly the elevator
-sequence or the latency bound setting of the new request is unaffected by the
-number of existing requests it has passed, i.e. doesn't depend on where
-it is positioned in the queue, but only on the number of requests that pass
-it in the future.
-
1.3 Direct Access to Low level Device/Driver Capabilities (Bypass mode)
(e.g Diagnostics, Systems Management)
@@ -964,7 +906,74 @@ Aside:
4. The I/O scheduler
-
+I/O schedulers are now per queue. They should be runtime switchable and modular
+but aren't yet. Jens has most bits to do this, but the sysfs implementation is
+missing.
+
+A block layer call to the i/o scheduler follows the convention elv_xxx(). This
+calls elevator_xxx_fn in the elevator switch (drivers/block/elevator.c). Oh,
+xxx and xxx might not match exactly, but use your imagination. If an elevator
+doesn't implement a function, the switch does nothing or some minimal house
+keeping work.
+
+4.1. I/O scheduler API
+
+The functions an elevator may implement are: (* are mandatory)
+elevator_merge_fn called to query requests for merge with a bio
+
+elevator_merge_req_fn " " " with another request
+
+elevator_merged_fn called when a request in the scheduler has been
+ involved in a merge. It is used in the deadline
+ scheduler for example, to reposition the request
+ if its sorting order has changed.
+
+*elevator_next_req_fn returns the next scheduled request, or NULL
+ if there are none (or none are ready).
+
+*elevator_add_req_fn called to add a new request into the scheduler
+
+elevator_queue_empty_fn returns true if the merge queue is empty.
+ Drivers shouldn't use this, but rather check
+ if elv_next_request is NULL (without losing the
+ request if one exists!)
+
+elevator_remove_req_fn This is called when a driver claims ownership of
+ the target request - it now belongs to the
+ driver. It must not be modified or merged.
+ Drivers must not lose the request! A subsequent
+ call of elevator_next_req_fn must return the
+ _next_ request.
+
+elevator_requeue_req_fn called to add a request to the scheduler. This
+ is used when the request has alrnadebeen
+ returned by elv_next_request, but hasn't
+ completed. If this is not implemented then
+ elevator_add_req_fn is called instead.
+
+elevator_former_req_fn
+elevator_latter_req_fn These return the request before or after the
+ one specified in disk sort order. Used by the
+ block layer to find merge possibilities.
+
+elevator_completed_req_fn called when a request is completed. This might
+ come about due to being merged with another or
+ when the device completes the request.
+
+elevator_may_queue_fn returns true if the scheduler wants to allow the
+ current context to queue a new request even if
+ it is over the queue limit. This must be used
+ very carefully!!
+
+elevator_set_req_fn
+elevator_put_req_fn Must be used to allocate and free any elevator
+ specific storate for a request.
+
+elevator_init_fn
+elevator_exit_fn Allocate and free any elevator specific storage
+ for a queue.
+
+4.2 I/O scheduler implementation
The generic i/o scheduler algorithm attempts to sort/merge/batch requests for
optimal disk scan and request servicing performance (based on generic
principles and device capabilities), optimized for:
@@ -974,49 +983,58 @@ iii. better utilization of h/w & CPU time
Characteristics:
-i. Linked list for O(n) insert/merge (linear scan) right now
-
-This is just the same as it was in 2.4.
+i. Binary tree
+AS and deadline i/o schedulers use red black binary trees for disk position
+sorting and searching, and a fifo linked list for time-based searching. This
+gives good scalability and good availablility of information. Requests are
+almost always dispatched in disk sort order, so a cache is kept of the next
+request in sort order to prevent binary tree lookups.
-There is however an added level of abstraction in the operations for adding
-and extracting a request to/from the queue, which makes it possible to
-try out alternative queue structures without changes to the users of the queue.
-Some things like head-active are thus now handled within elv_next_request
-making it possible to mark more than one request to be left alone.
+This arrangement is not a generic block layer characteristic however, so
+elevators may implement queues as they please.
-Aside:
-1. The use of a merge hash was explored to reduce merge times and to make
- elevator_noop close to noop by avoiding the scan for merge. However the
- complexity and locking issues introduced wasn't desirable especially as
- with multi-page bios the incidence of merges is expected to be lower.
-2. The use of binomial/fibonacci heaps was explored to reduce the scan time;
- however the idea was given up due to the complexity and added weight of
- data structures, complications for handling barriers, as well as the
- advantage of O(1) extraction and deletion (performance critical path) with
- the existing list implementation vs heap based implementations.
+ii. Last merge hint
+The last merge hint is part of the generic queue layer. I/O schedulers must do
+some management on it. For the most part, the most important thing is to make
+sure q->last_merge is cleared (set to NULL) when the request on it is no longer
+a candidate for merging (for example if it has been sent to the driver).
-ii. Utilizes max_phys/hw_segments, and max_request_size parameters, to merge
- within the limits that the device can handle (See 3.2.2)
+The last merge performed is cached as a hint for the subsequent request. If
+sequential data is being submitted, the hint is used to perform merges without
+any scanning. This is not sufficient when there are multiple processes doing
+I/O though, so a "merge hash" is used by some schedulers.
-iii. Last merge hint
+iii. Merge hash
+AS and deadline use a hash table indexed by the last sector of a request. This
+enables merging code to quickly look up "back merge" candidates, even when
+multiple I/O streams are being performed at once on one disk.
-In 2.5, information about the last merge is saved as a hint for the subsequent
-request. This way, if sequential data is coming down the pipe, the hint can
-be used to speed up merges without going through a scan.
+"Front merges", a new request being merged at the front of an existing request,
+are far less common than "back merges" due to the nature of most I/O patterns.
+Front merges are handled by the binary trees in AS and deadline schedulers.
iv. Handling barrier cases
-
-As mentioned earlier, barrier support is new to 2.5, and the i/o scheduler
-has been modified accordingly.
-
-When a barrier comes in, then since insert happens in the form of a
-linear scan, starting from the end, it just needs to be ensured that this
-and future scans stops barrier point. This is achieved by skipping the
-entire merge/scan logic for a barrier request, so it gets placed at the
-end of the queue, and specifying a zero latency for the request containing
-the bio so that no future requests can pass it.
-
-v. Plugging the queue to batch requests in anticipation of opportunities for
+A request with flags REQ_HARDBARRIER or REQ_SOFTBARRIER must not be ordered
+around. That is, they must be processed after all older requests, and before
+any newer ones. This includes merges!
+
+In AS and deadline schedulers, barriers have the effect of flushing the reorder
+queue. The performance cost of this will vary from nothing to a lot depending
+on i/o patterns and device characteristics. Obviously they won't improve
+performance, so their use should be kept to a minimum.
+
+v. Handling insertion position directives
+A request may be inserted with a position directive. The directives are one of
+ELEVATOR_INSERT_BACK, ELEVATOR_INSERT_FRONT, ELEVATOR_INSERT_SORT.
+
+ELEVATOR_INSERT_SORT is a general directive for non-barrier requests.
+ELEVATOR_INSERT_BACK is used to insert a barrier to the back of the queue.
+ELEVATOR_INSERT_FRONT is used to insert a barrier to the front of the queue, and
+overrides the ordering requested by any previous barriers. In practice this is
+harmless and required, because it is used for SCSI requeueing. This does not
+require flushing the reorder queue, so does not impose a performance penalty.
+
+vi. Plugging the queue to batch requests in anticipation of opportunities for
merge/sort optimizations
This is just the same as in 2.4 so far, though per-device unplugging
@@ -1051,6 +1069,12 @@ Aside:
blk_kick_queue() to unplug a specific queue (right away ?)
or optionally, all queues, is in the plan.
+4.3 I/O contexts
+I/O contexts provide a dynamically allocated per process data area. They may
+be used in I/O schedulers, and in the block layer (could be used for IO statis,
+priorities for example). See *io_context in drivers/block/ll_rw_blk.c, and
+as-iosched.c for an example of usage in an i/o scheduler.
+
5. Scalability related changes
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index f6121f18c501..3a66d54c51e0 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -788,6 +788,10 @@ running once the system is up.
psmouse_noext [HW,MOUSE] Disable probing for PS2 mouse protocol extensions
+ psmouse_resetafter=
+ [HW,MOUSE] Try to reset Synaptics Touchpad after so many
+ bad packets (0 = never).
+
pss= [HW,OSS] Personal Sound System (ECHO ESC614)
Format: <io>,<mss_io>,<mss_irq>,<mss_dma>,<mpu_io>,<mpu_irq>
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt
index 0687f435ee89..32acbb0020f4 100644
--- a/Documentation/networking/bonding.txt
+++ b/Documentation/networking/bonding.txt
@@ -527,9 +527,9 @@ Verifying Bond Configuration
1) Bonding information files
----------------------------
-The bonding driver information files reside in the /proc/net/bond* directories.
+The bonding driver information files reside in the /proc/net/bonding directory.
-Sample contents of /proc/net/bond0/info after the driver is loaded with
+Sample contents of /proc/net/bonding/bond0 after the driver is loaded with
parameters of mode=0 and miimon=1000 is shown below.
Bonding Mode: load balancing (round-robin)
diff --git a/Documentation/smp.tex b/Documentation/smp.tex
deleted file mode 100644
index 40e73fe6ea43..000000000000
--- a/Documentation/smp.tex
+++ /dev/null
@@ -1,346 +0,0 @@
-From: michael@Physik.Uni-Dortmund.DE (Michael Dirkmann)
-
-thanks for your information. Attached is the tex-code of your
-SMP-documentation :
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-\documentclass[]{article}
-\parindent0.0cm
-\parskip0.2cm
-
-\begin{document}
-
-\begin{center}
-\LARGE \bf
-An Implementation Of Multiprocessor Linux
-\normalsize
-\end{center}
-
-{ \it
-This document describes the implementation of a simple SMP
-Linux kernel extension and how to use this to develop SMP Linux kernels for
-architectures other than the Intel MP v1.1 architecture for Pentium and 486
-processors.}
-
-\hfill Alan Cox, 1995
-
-
-The author wishes to thank Caldera Inc. ( http://www.caldera.com )
-whose donation of an ASUS dual Pentium board made this project possible,
-and Thomas Radke, whose initial work on multiprocessor Linux formed
-the backbone of this project.
-
-\section{Background: The Intel MP specification.}
-Most IBM PC style multiprocessor motherboards combine Intel 486 or Pentium
-processors and glue chipsets with a hardware/software specification. The
-specification places much of the onus for hard work on the chipset and
-hardware rather than the operating system.
-
-The Intel Pentium processors have a wide variety of inbuilt facilities for
-supporting multiprocessing, including hardware cache coherency, built in
-interprocessor interrupt handling and a set of atomic test and set,
-exchange and similar operations. The cache coherency in particular makes the
-operating system's job far easier.
-
-The specification defines a detailed configuration structure in ROM that
-the boot up processor can read to find the full configuration of the
-processors and buses. It also defines a procedure for starting up the
-other processors.
-
-
-\section{Mutual Exclusion Within A Single Processor Linux Kernel}
-For any kernel to function in a sane manner it has to provide internal
-locking and protection of its own tables to prevent two processes updating
-them at once and for example allocating the same memory block. There are
-two strategies for this within current Unix and Unixlike kernels.
-Traditional Unix systems from the earliest of days use a scheme of 'Coarse
-Grained Locking' where the entire kernel is protected by a small number of
-locks only. Some modern systems use fine grained locking. Because fine
-grained locking has more overhead it is normally used only on
-multiprocessor kernels and real time kernels. In a real time kernel the
-fine grained locking reduces the amount of time locks are held and reduces
-the critical (to real time programming at least) latency times.
-
-Within the Linux kernel certain guarantees are made. No process running in
-kernel mode will be pre-empted by another kernel mode process unless it
-voluntarily sleeps. This ensures that blocks of kernel code are
-effectively atomic with respect to other processes and greatly simplifies
-many operations. Secondly interrupts may pre-empt a kernel running process,
-but will always return to that process. A process in kernel mode may
-disable interrupts on the processor and guarantee such an interruption will
-not occur. The final guarantee is that an interrupt will not be pre-empted
-by a kernel task. That is interrupts will run to completion or be
-pre-empted by other interrupts only.
-
-The SMP kernel chooses to continue these basic guarantees in order to make
-initial implementation and deployment easier. A single lock is maintained
-across all processors. This lock is required to access the kernel space.
-Any processor may hold it and once it is held may also re-enter the kernel
-for interrupts and other services whenever it likes until the lock is
-relinquished. This lock ensures that a kernel mode process will not be
-pre-empted and ensures that blocking interrupts in kernel mode behaves
-correctly. This is guaranteed because only the processor holding the lock
-can be in kernel mode, only kernel mode processes can disable interrupts
-and only the processor holding the lock may handle an interrupt.
-
-Such a choice is however poor for performance. In the longer term it is
-necessary to move to finer grained parallelism in order to get the best
-system performance. This can be done hierarchically by gradually refining
-the locks to cover smaller areas. With the current kernel highly CPU bound
-process sets perform well but I/O bound task sets can easily degenerate to
-near single processor performance levels. This refinement will be needed to
-get the best from Linux/SMP.
-
-\subsection{Changes To The Portable Kernel Components}
-The kernel changes are split into generic SMP support changes and
-architecture specific changes necessary to accommodate each different
-processor type Linux is ported to.
-
-
-\subsubsection{Initialisation}
-The first problem with a multiprocessor kernel is starting the other
-processors up. Linux/SMP defines that a single processor enters the normal
-kernel entry point start\_kernel(). Other processors are assumed not to be
-started or to have been captured elsewhere. The first processor begins the
-normal Linux initialisation sequences and sets up paging, interrupts and
-trap handlers. After it has obtained the processor information about the
-boot CPU, the architecture specific function
-
-
-{\tt \bf{void smp\_store\_cpu\_info(int processor\_id) }}
-
-is called to store any information about the processor into a per processor
-array. This includes things like the bogomips speed ratings.
-
-Having completed the kernel initialisation the architecture specific
-function
-
-{\tt \bf void smp\_boot\_cpus(void) }
-
-is called and is expected to start up each other processor and cause it to
-enter start\_kernel() with its paging registers and other control
-information correctly loaded. Each other processor skips the setup except
-for calling the trap and irq initialisation functions that are needed on
-some processors to set each CPU up correctly. These functions will
-probably need to be modified in existing kernels to cope with this.
-
-
-Each additional CPU then calls the architecture specific function
-
-{\tt \bf void smp\_callin(void)}
-
-which does any final setup and then spins the processor while the boot
-up processor forks off enough idle threads for each processor. This is
-necessary because the scheduler assumes there is always something to run.
-Having generated these threads and forked init the architecture specific
-
-{\tt \bf void smp\_commence(void)}
-
-function is invoked. This does any final setup and indicates to the system
-that multiprocessor mode is now active. All the processors spinning in the
-smp\_callin() function are now released to run the idle processes, which
-they will run when they have no real work to process.
-
-
-\subsubsection{Scheduling}
-The kernel scheduler implements a simple but very effective task
-scheduler. The basic structure of this scheduler is unchanged in the
-multiprocessor kernel. A processor field is added to each task, and this
-maintains the number of the processor executing a given task, or a magic
-constant (NO\_PROC\_ID) indicating the job is not allocated to a processor.
-
-Each processor executes the scheduler itself and will select the next task
-to run from all runnable processes not allocated to a different processor.
-The algorithm used by the selection is otherwise unchanged. This is
-actually inadequate for the final system because there are advantages to
-keeping a process on the same CPU, especially on processor boards with per
-processor second level caches.
-
-Throughout the kernel the variable 'current' is used as a global for the
-current process. In Linux/SMP this becomes a macro which expands to
-current\_set[smp\_processor\_id()]. This enables almost the entire kernel to
-be unaware of the array of running processors, but still allows the SMP
-aware kernel modules to see all of the running processes.
-
-The fork system call is modified to generate multiple processes with a
-process id of zero until the SMP kernel starts up properly. This is
-necessary because process number 1 must be init, and it is desirable that
-all the system threads are process 0.
-
-The final area within the scheduling of processes that does cause problems
-is the fact the uniprocessor kernel hard codes tests for the idle threads
-as task[0] and the init process as task[1]. Because there are multiple idle
-threads it is necessary to replace these with tests that the process id is
-0 and a search for process ID 1, respectively.
-
-\subsubsection{Memory Management}
-The memory management core of the existing Linux system functions
-adequately within the multiprocessor framework providing the locking is
-used. Certain processor specific areas do need changing, in particular
-invalidate() must invalidate the TLBs of all processors before it returns.
-
-
-\subsubsection{Miscellaneous Functions}
-The portable SMP code rests on a small set of functions and variables
-that are provided by the processor specification functionality. These are
-
-{\tt \bf int smp\_processor\_id(void) }
-
-which returns the identity of the processor the call is executed upon. This
-call is assumed to be valid at all times. This may mean additional tests
-are needed during initialisation.
-
-
-{\tt \bf int smp\_num\_cpus;}
-
-This is the number of processors in the system. \
-
-{\tt \bf void smp\_message\_pass(int target, int msg, unsigned long data,
- int wait)}
-
-This function passes messages between processors. At the moment it is not
-sufficiently defined to sensibly document and needs cleaning up and further
-work. Refer to the processor specific code documentation for more details.
-
-
-\subsection{Architecture Specific Code For the Intel MP Port}
-The architecture specific code for the Intel port splits fairly cleanly
-into four sections. Firstly the initialisation code used to boot the
-system, secondly the message handling and support code, thirdly the
-interrupt and kernel syscall entry function handling and finally the
-extensions to standard kernel facilities to cope with multiple processors.
-
-\subsubsection{Initialisation}
-The Intel MP architecture captures all the processors except for a single
-processor known as the 'boot processor' in the BIOS at boot time. Thus a
-single processor enters the kernel bootup code. The first processor
-executes the bootstrap code, loads and uncompresses the kernel. Having
-unpacked the kernel it sets up the paging and control registers then enters
-the C kernel startup.
-
-The assembler startup code for the kernel is modified so that it can be
-used by the other processors to do the processor identification and various
-other low level configurations but does not execute those parts of the
-startup code that would damage the running system (such as clearing the BSS
-segment).
-
-In the initialisation done by the first processor the arch/i386/mm/init
-code is modified to scan the low page, top page and BIOS for intel MP
-signature blocks. This is necessary because the MP signature blocks must
-be read and processed before the kernel is allowed to allocate and destroy
-the page at the top of low memory. Having established the number of
-processors it reserves a set of pages to provide a stack come boot up area
-for each processor in the system. These must be allocated at startup to
-ensure they fall below the 1Mb boundary.
-
-Further processors are started up in smp\_boot\_cpus() by programming the
-APIC controller registers and sending an inter-processor interrupt (IPI) to
-the processor. This message causes the target processor to begin executing
-code at the start of any page of memory within the lowest 1Mb, in 16bit
-real mode. The kernel uses the single page it allocated for each processor
-to use as stack. Before booting a given CPU the relocatable code from
-trampoline.S and trampoline32.S is copied to the bottom of its stack page
-and used as the target for the startup.
-
-The trampoline code calculates the desired stack base from the code
-segment (since the code segment on startup is the bottom of the stack),
- enters 32bit mode and jumps to the kernel entry assembler. This as
-described above is modified to only execute the parts necessary for each
-processor, and then to enter start\_kernel(). On entering the kernel the
-processor initialises its trap and interrupt handlers before entering
-smp\_callin(), where it reports its status and sets a flag that causes the
-boot processor to continue and look for further processors. The processor
-then spins until smp\_commence() is invoked.
-
-Having started each processor up the smp\_commence( ) function flips a
-flag. Each processor spinning in smp\_callin() then loads the task register
-with the task state segment (TSS) of its idle thread as is needed for task
-switching.
-
-\subsubsection{Message Handling and Support Code}
-The architecture specific code implements the smp\_processor\_id() function
-by querying the APIC logical identity register. Because the APIC isn't
-mapped into the kernel address space at boot, the initial value returned is
-rigged by setting the APIC base pointer to point at a suitable constant.
-Once the system starts doing the SMP setup (in smp\_boot\_cpus()), the APIC
-is mapped with a vremap() call and the apic pointer is adjusted
-appropriately. From then on the real APIC logical identity register is
-read.
-
-Message passing is accomplished using a pair of IPIs on interrupt 13
-(unused by the 80486 FPUs in SMP mode) and interrupt 16. Two are used in
-order to separate messages that cannot be processed until the receiver
-obtains the kernel spinlock from messages that can be processed
-immediately. In effect IRQ 13 is a fast IRQ handler that does not obtain
-the locks, and cannot cause a reschedule, while IRQ 16 is a slow IRQ that
-must acquire the kernel spinlocks and can cause a reschedule. This
-interrupt is used for passing on slave timer messages from the processor
-that receives the timer interrupt to the rest of the processors, so that
-they can reschedule running tasks.
-
-
-\subsubsection{Entry And Exit Code}
-A single spinlock protects the entire kernel. The interrupt handlers, the
-syscall entry code and the exception handlers all acquire the lock before
-entering the kernel proper. When the processor is trying to acquire the
-spinlock it spins continually on the lock with interrupts disabled. This
-causes a specific deadlock problem. The lock owner may need to send an
-invalidate request to the rest of the processors and wait for these to
-complete before continuing. A processor spinning on the lock would not be
-able to do this. Thus the loop of the spinlock tests and handles invalidate
-requests. If the invalidate bit for the spinning CPU is set the processor
-invalidates its TLB and atomically clears the bit. When the spinlock is
-obtained that processor will take an IPI and in the IPI test the bit and
-skip the invalidate as the bit is clear.
-
-One complexity of the spinlock is that a process running in kernel mode
-can sleep voluntarily and be pre-empted. A switch from such a process to a
-process executing in user space may reduce the lock count. To track this
-the kernel uses a syscall\_count and a per process lock\_depth parameter to
-track the kernel lock state. The switch\_to() function is modified in SMP
-mode to adjust the lock appropriately.
-
-The final problem is the idle thread. In the single processor kernel the
-idle thread executes 'hlt' instructions. This saves power and reduces the
-running temperature of the processors when they are idle. However it means
-the process spends all its time in kernel mode and would thus hold the
-kernel spinlock. The SMP idle thread continually reschedules a new task and
-returns to user mode. This is far from ideal and will be modified to use
-'hlt' instructions and release the spinlock soon. Using 'hlt' is even more
-beneficial on a multiprocessor system as it almost completely takes an idle
-processor off the bus.
-
-Interrupts are distributed by an i82489 APIC. This chip is set up to work
-as an emulation of the traditional PC interrupt controllers when the
-machine boots (so that an Intel MP machine boots one CPU and PC
-compatible). The kernel has all the relevant locks but does not yet
-reprogram the 82489 to deliver interrupts to arbitrary processors as it
-should. This requires further modification of the standard Linux interrupt
-handling code, and is particularly messy as the interrupt handler behaviour
-has to change as soon as the 82489 is switched into SMP mode.
-
-
-\subsubsection{Extensions To Standard Facilities}
-The kernel maintains a set of per processor control information such as
-the speed of the processor for delay loops. These functions on the SMP
-kernel look the values up in a per processor array that is set up from the
-data generated at boot up by the smp\_store\_cpu\_info() function. This
-includes other facts such as whether there is an FPU on the processor. The
-current kernel does not handle floating point correctly, this requires some
-changes to the techniques the single CPU kernel uses to minimise floating
-point processor reloads.
-
-The highly useful atomic bit operations are prefixed with the 'lock'
-prefix in the SMP kernel to maintain their atomic properties when used
-outside of (and by) the spinlock and message code. Amongst other things
-this is needed for the invalidate handler, as all CPU's will invalidate at
-the same time without any locks.
-
-Interrupt 13 floating point error reporting is removed. This facility is
-not usable on a multiprocessor board, nor relevant to the Intel MP
-architecture which does not cover the 80386/80387 processor pair. \
-
-The /proc filesystem support is changed so that the /proc/cpuinfo file
-contains a column for each processor present. This information is extracted
-from the data saved by smp\_store\_cpu\_info().
-
-\end{document}
diff --git a/Documentation/video4linux/Zoran b/Documentation/video4linux/Zoran
index 089143f5c4a1..d8c4d428d627 100644
--- a/Documentation/video4linux/Zoran
+++ b/Documentation/video4linux/Zoran
@@ -28,7 +28,7 @@ Iomega Buz:
* Philips saa7111 TV decoder
* Philips saa7185 TV encoder
Drivers to use: videodev, i2c-core, i2c-algo-bit,
- videocodec, saa7111, saa7185, zr36060, zoran
+ videocodec, saa7111, saa7185, zr36060, zr36067
Inputs/outputs: Composite and S-video
Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
Card number: 7
@@ -39,7 +39,7 @@ Linux Media Labs LML33:
* Brooktree bt819 TV decoder
* Brooktree bt856 TV encoder
Drivers to use: videodev, i2c-core, i2c-algo-bit,
- videocodec, bt819, bt856, zr36060, zoran
+ videocodec, bt819, bt856, zr36060, zr36067
Inputs/outputs: Composite and S-video
Norms: PAL (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
Card number: 5
@@ -50,7 +50,7 @@ Linux Media Labs LML33R10:
* Philips saa7114 TV decoder
* Analog Devices adv7170 TV encoder
Drivers to use: videodev, i2c-core, i2c-algo-bit,
- videocodec, saa7114, adv7170, zr36060, zoran
+ videocodec, saa7114, adv7170, zr36060, zr36067
Inputs/outputs: Composite and S-video
Norms: PAL (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
Card number: 6
@@ -61,7 +61,7 @@ Pinnacle/Miro DC10(new):
* Philips saa7110a TV decoder
* Analog Devices adv7176 TV encoder
Drivers to use: videodev, i2c-core, i2c-algo-bit,
- videocodec, saa7110, adv7175, zr36060, zoran
+ videocodec, saa7110, adv7175, zr36060, zr36067
Inputs/outputs: Composite, S-video and Internal
Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
Card number: 1
@@ -72,7 +72,7 @@ Pinnacle/Miro DC10+:
* Philips saa7110a TV decoder
* Analog Devices adv7176 TV encoder
Drivers to use: videodev, i2c-core, i2c-algo-bit,
- videocodec, sa7110, adv7175, zr36060, zoran
+ videocodec, sa7110, adv7175, zr36060, zr36067
Inputs/outputs: Composite, S-video and Internal
Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
Card number: 2
@@ -84,7 +84,7 @@ Pinnacle/Miro DC10(old): *
* Micronas vpx3220a TV decoder
* mse3000 TV encoder or Analog Devices adv7176 TV encoder *
Drivers to use: videodev, i2c-core, i2c-algo-bit,
- videocodec, vpx3220, mse3000/adv7175, zr36050, zr36016, zoran
+ videocodec, vpx3220, mse3000/adv7175, zr36050, zr36016, zr36067
Inputs/outputs: Composite, S-video and Internal
Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
Card number: 0
@@ -96,7 +96,7 @@ Pinnacle/Miro DC30: *
* Micronas vpx3225d/vpx3220a/vpx3216b TV decoder
* Analog Devices adv7176 TV encoder
Drivers to use: videodev, i2c-core, i2c-algo-bit,
- videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36016, zoran
+ videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36016, zr36067
Inputs/outputs: Composite, S-video and Internal
Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
Card number: 3
@@ -108,7 +108,7 @@ Pinnacle/Miro DC30+: *
* Micronas vpx3225d/vpx3220a/vpx3216b TV decoder
* Analog Devices adv7176 TV encoder
Drivers to use: videodev, i2c-core, i2c-algo-bit,
- videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36015, zoran
+ videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36015, zr36067
Inputs/outputs: Composite, S-video and Internal
Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
Card number: 4
@@ -229,16 +229,16 @@ to generate PAL N, maybe it would work if you use the PAL M settings.
2. How do I get this damn thing to work
-Load zoran.o. If it can't autodetect your card, use the card=X insmod
+Load zr36067.o. If it can't autodetect your card, use the card=X insmod
option with X being the card number as given in the previous section.
To have more than one card, use card=X1[,X2[,X3,[X4[..]]]]
To automate this, add the following to your /etc/modules.conf:
-options zoran card=X1[,X2[,X3[,X4[..]]]]
-alias char-major-81-0 zoran
+options zr36067 card=X1[,X2[,X3[,X4[..]]]]
+alias char-major-81-0 zr36067
-One thing to keep in mind is that this doesn't load zoran.o itself yet. It
+One thing to keep in mind is that this doesn't load zr36067.o itself yet. It
just automates loading. If you start using xawtv, the device won't load on
some systems, since you're trying to load modules as a user, which is not
allowed ("permission denied"). A quick workaround is to add 'Load "v4l"' to
@@ -500,7 +500,7 @@ proven by the Buz.
7. It hangs/crashes/fails/whatevers! Help!
Make sure that the card has its own interrupts (see /proc/interrupts), check
-the output of dmesg at high verbosity (load zoran.o/zr36067.o with debug=2,
+the output of dmesg at high verbosity (load zr36067.o with debug=2,
load all other modules with debug=1). Check that your mainboard is favorable
(see question 2) and if not, test the card in another computer. Also see the
notes given in question 3 and try lowering quality/buffersize/capturesize
diff --git a/MAINTAINERS b/MAINTAINERS
index 05fb7cb92e47..00002a8c3c79 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -212,7 +212,7 @@ S: Maintained
ALCATEL SPEEDTOUCH USB DRIVER
P: Duncan Sands
-M: duncan.sands@wanadoo.fr
+M: duncan.sands@free.fr
L: linux-usb-users@lists.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net
W: http://www.linux-usb.org/SpeedTouch/
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index da6dd08713b7..28b21380b8ea 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -484,6 +484,9 @@ config EISA
Otherwise, say N.
+config EISA_ALWAYS
+ def_bool EISA
+
config SMP
bool "Symmetric multi-processing support"
depends on ALPHA_SABLE || ALPHA_LYNX || ALPHA_RAWHIDE || ALPHA_DP264 || ALPHA_WILDFIRE || ALPHA_TITAN || ALPHA_GENERIC || ALPHA_SHARK || ALPHA_MARVEL
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index c6c817b0f9ef..d28aa17756a6 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -172,22 +172,6 @@ bp:; $(Q)$(MAKE) $(build)=$(boot) $(boot)/bootpImage
i:; $(Q)$(MAKE) $(build)=$(boot) install
zi:; $(Q)$(MAKE) $(build)=$(boot) zinstall
-#
-# Configuration targets. Use these to select a
-# configuration for your architecture
-%_config:
- @( \
- CFG=$(@:_config=); \
- if [ -f arch/arm/def-configs/$$CFG ]; then \
- [ -f .config ] && mv -f .config .config.old; \
- cp arch/arm/def-configs/$$CFG .config; \
- echo "*** Default configuration for $$CFG installed"; \
- echo "*** Next, you may run 'make oldconfig'"; \
- else \
- echo "$$CFG does not exist"; \
- fi; \
- )
-
arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/asm-arm/.arch \
include/config/MARKER
diff --git a/arch/arm/boot/bootp/init.S b/arch/arm/boot/bootp/init.S
index 21c28e25d8f9..192ec8da6944 100644
--- a/arch/arm/boot/bootp/init.S
+++ b/arch/arm/boot/bootp/init.S
@@ -1,86 +1,69 @@
/*
* linux/arch/arm/boot/bootp/init.S
*
- * Copyright (C) 2000-2002 Russell King
+ * Copyright (C) 2000-2003 Russell King.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
- * Header file for splitting kernel + initrd. Note that we pass
+ * "Header" file for splitting kernel + initrd. Note that we pass
* r0 through to r3 straight through.
+ *
+ * This demonstrates how to append code to the start of the kernel
+ * zImage, and boot the kernel without copying it around. This
+ * example would be simpler; if we didn't have an object of unknown
+ * size immediately following the kernel, we could build this into
+ * a binary blob, and concatenate the zImage using the cat command.
*/
.section .start,#alloc,#execinstr
.type _start, #function
.globl _start
-_start: adr r10, initdata
- ldr r11, initdata
- sub r11, r10, r11 @ work out exec offset
- b splitify
- .size _entry,. - _entry
-
- .type initdata, #object
-initdata: .word initdata @ compiled address of this
- .size initdata,. - initdata
-splitify: adr r13, data
- ldmia r13!, {r4-r6} @ move the initrd
- add r4, r4, r11 @ correction
- bl move
+_start: adr r12, kernel_start @ offset of kernel zImage
+ ldr r4, [r12, #0x2c] @ length of zImage
+ adr r13, data
+ add r4, r4, r12 @ end of zImage, start of initrd
+ ldmia r13!, {r5-r6} @ r5 = dest, r6 = length
+ bl move @ move the initrd
/*
- * Setup the initrd parameters to pass to the kernel. This can either be
- * passed in via a param_struct or a tag list. We spot the param_struct
- * method by looking at the first word; this should either indicate a page
- * size of 4K, 16K or 32K.
+ * Setup the initrd parameters to pass to the kernel. This can only be
+ * passed in via the tagged list.
*/
- ldmia r13, {r4-r8} @ get size and addr of initrd
- @ r5 = ATAG_INITRD
- @ r6 = initrd start
- @ r7 = initrd end
- @ r8 = param_struct address
- ldr r9, [r8, #0] @ no param struct?
- teq r9, #0x1000 @ 4K?
- teqne r9, #0x4000 @ 16K?
- teqne r9, #0x8000 @ 32K?
- beq param_struct
-
- ldr r9, [r8, #4] @ get first tag
- teq r9, r4
- bne taglist @ ok, we have a tag list
+ ldmia r13, {r5-r9} @ get size and addr of initrd
+ @ r5 = ATAG_CORE
+ @ r6 = ATAG_INITRD2
+ @ r7 = initrd start
+ @ r8 = initrd end
+ @ r9 = param_struct address
+ ldr r10, [r9, #4] @ get first tag
+ teq r10, r5 @ is it ATAG_CORE?
/*
- * We didn't find a valid tag list - create one.
+ * If we didn't find a valid tag list, create a dummy ATAG_CORE entry.
*/
- str r4, [r8, #4]
- mov r4, #8
- str r4, [r8, #0]
- mov r4, #0
- str r4, [r8, #8]
+ movne r10, #0 @ terminator
+ movne r4, #2 @ Size of this entry (2 words)
+ stmneia r8, {r4, r5, r10} @ Size, ATAG_CORE, terminator
/*
* find the end of the tag list, and then add an INITRD tag on the end.
* If there is already an INITRD tag, then we ignore it; the last INITRD
* tag takes precidence.
*/
-taglist: ldr r9, [r8, #0] @ tag length
- teq r9, #0 @ last tag?
- addne r8, r8, r9
+taglist: ldr r10, [r9, #0] @ tag length
+ teq r10, #0 @ last tag (zero length)?
+ addne r9, r9, r10, lsl #2
bne taglist
- mov r4, #16 @ length of initrd tag
- mov r9, #0 @ end of tag list terminator
- stmia r8, {r4, r5, r6, r7, r9}
- adr r12, kernel_start
+ mov r5, #4 @ Size of initrd tag (4 words)
+ stmia r9, {r5, r6, r7, r8, r10}
mov pc, r12 @ call kernel
/*
- * We found a param struct. Modify the param struct for the initrd
+ * Move the block of memory length r6 from address r4 to address r5
*/
-param_struct: add r8, r8, #16*4
- stmia r8, {r6,r7} @ save in param_struct
- mov pc, r12 @ call kernel
-
move: ldmia r4!, {r7 - r10} @ move 32-bytes at a time
stmia r5!, {r7 - r10}
ldmia r4!, {r7 - r10}
@@ -89,15 +72,18 @@ move: ldmia r4!, {r7 - r10} @ move 32-bytes at a time
bcs move
mov pc, lr
-data: .word initrd_start
- .word initrd_addr
- .word initrd_len
+ .size _start, . - _start
+
+ .type data,#object
+data: .word initrd_addr @ destination initrd address
+ .word initrd_len @ initrd size
.word 0x54410001 @ r4 = ATAG_CORE
- .word 0x54420005 @ r5 = ATAG_INITRD
+ .word 0x54420005 @ r5 = ATAG_INITRD2
.word initrd_addr @ r6
.word initrd_len @ r7
.word params @ r8
+ .size data, . - _data
.type initrd_start,#object
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 7bc6ed87ba2b..d2dd8ae7834f 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -14,6 +14,7 @@
* All initialization functions provided here are intended to be called
* from machine specific code with proper arguments when required.
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
diff --git a/arch/arm/def-configs/a5k b/arch/arm/configs/a5k_defconfig
index f5ae4adad6d4..f5ae4adad6d4 100644
--- a/arch/arm/def-configs/a5k
+++ b/arch/arm/configs/a5k_defconfig
diff --git a/arch/arm/def-configs/adi_evb b/arch/arm/configs/adi_evb_defconfig
index 5a74f3d903dc..5a74f3d903dc 100644
--- a/arch/arm/def-configs/adi_evb
+++ b/arch/arm/configs/adi_evb_defconfig
diff --git a/arch/arm/def-configs/adsbitsy b/arch/arm/configs/adsbitsy_defconfig
index 3f7d8fb99815..3f7d8fb99815 100644
--- a/arch/arm/def-configs/adsbitsy
+++ b/arch/arm/configs/adsbitsy_defconfig
diff --git a/arch/arm/def-configs/anakin b/arch/arm/configs/anakin_defconfig
index a42790c74b33..a42790c74b33 100644
--- a/arch/arm/def-configs/anakin
+++ b/arch/arm/configs/anakin_defconfig
diff --git a/arch/arm/def-configs/assabet b/arch/arm/configs/assabet_defconfig
index e3c86c943c02..e3c86c943c02 100644
--- a/arch/arm/def-configs/assabet
+++ b/arch/arm/configs/assabet_defconfig
diff --git a/arch/arm/def-configs/badge4 b/arch/arm/configs/badge4_defconfig
index b94974b56c1f..b94974b56c1f 100644
--- a/arch/arm/def-configs/badge4
+++ b/arch/arm/configs/badge4_defconfig
diff --git a/arch/arm/def-configs/brutus b/arch/arm/configs/brutus_defconfig
index 67223c0ba1a8..67223c0ba1a8 100644
--- a/arch/arm/def-configs/brutus
+++ b/arch/arm/configs/brutus_defconfig
diff --git a/arch/arm/def-configs/cerfcube b/arch/arm/configs/cerfcube_defconfig
index 2d06764504d9..2d06764504d9 100644
--- a/arch/arm/def-configs/cerfcube
+++ b/arch/arm/configs/cerfcube_defconfig
diff --git a/arch/arm/def-configs/cerfpda b/arch/arm/configs/cerfpda_defconfig
index a6803f8eaeb0..a6803f8eaeb0 100644
--- a/arch/arm/def-configs/cerfpda
+++ b/arch/arm/configs/cerfpda_defconfig
diff --git a/arch/arm/def-configs/cerfpod b/arch/arm/configs/cerfpod_defconfig
index b271e290ba95..b271e290ba95 100644
--- a/arch/arm/def-configs/cerfpod
+++ b/arch/arm/configs/cerfpod_defconfig
diff --git a/arch/arm/def-configs/clps7500 b/arch/arm/configs/clps7500_defconfig
index 9e95d4aca811..9e95d4aca811 100644
--- a/arch/arm/def-configs/clps7500
+++ b/arch/arm/configs/clps7500_defconfig
diff --git a/arch/arm/def-configs/ebsa110 b/arch/arm/configs/ebsa110_defconfig
index c6f8b79e2c4a..c6f8b79e2c4a 100644
--- a/arch/arm/def-configs/ebsa110
+++ b/arch/arm/configs/ebsa110_defconfig
diff --git a/arch/arm/def-configs/edb7211 b/arch/arm/configs/edb7211_defconfig
index b3fad54ad118..b3fad54ad118 100644
--- a/arch/arm/def-configs/edb7211
+++ b/arch/arm/configs/edb7211_defconfig
diff --git a/arch/arm/def-configs/empeg b/arch/arm/configs/empeg_defconfig
index cdd8a29cc7d5..cdd8a29cc7d5 100644
--- a/arch/arm/def-configs/empeg
+++ b/arch/arm/configs/empeg_defconfig
diff --git a/arch/arm/def-configs/epxa10db b/arch/arm/configs/epxa10db_defconfig
index 87e9c7c2d752..87e9c7c2d752 100644
--- a/arch/arm/def-configs/epxa10db
+++ b/arch/arm/configs/epxa10db_defconfig
diff --git a/arch/arm/def-configs/flexanet b/arch/arm/configs/flexanet_defconfig
index bf4964ade713..bf4964ade713 100644
--- a/arch/arm/def-configs/flexanet
+++ b/arch/arm/configs/flexanet_defconfig
diff --git a/arch/arm/def-configs/footbridge b/arch/arm/configs/footbridge_defconfig
index b9caaec44be8..b9caaec44be8 100644
--- a/arch/arm/def-configs/footbridge
+++ b/arch/arm/configs/footbridge_defconfig
diff --git a/arch/arm/def-configs/fortunet b/arch/arm/configs/fortunet_defconfig
index 7ed7fc74fa12..7ed7fc74fa12 100644
--- a/arch/arm/def-configs/fortunet
+++ b/arch/arm/configs/fortunet_defconfig
diff --git a/arch/arm/def-configs/freebird b/arch/arm/configs/freebird_defconfig
index 0a2f65e2b893..0a2f65e2b893 100644
--- a/arch/arm/def-configs/freebird
+++ b/arch/arm/configs/freebird_defconfig
diff --git a/arch/arm/def-configs/freebird_new b/arch/arm/configs/freebird_new_defconfig
index 8879826ce6e2..8879826ce6e2 100644
--- a/arch/arm/def-configs/freebird_new
+++ b/arch/arm/configs/freebird_new_defconfig
diff --git a/arch/arm/def-configs/graphicsclient b/arch/arm/configs/graphicsclient_defconfig
index 11f6a6a17166..11f6a6a17166 100644
--- a/arch/arm/def-configs/graphicsclient
+++ b/arch/arm/configs/graphicsclient_defconfig
diff --git a/arch/arm/def-configs/graphicsmaster b/arch/arm/configs/graphicsmaster_defconfig
index eeed072ba001..eeed072ba001 100644
--- a/arch/arm/def-configs/graphicsmaster
+++ b/arch/arm/configs/graphicsmaster_defconfig
diff --git a/arch/arm/def-configs/h3600 b/arch/arm/configs/h3600_defconfig
index 39ed681fc3a0..39ed681fc3a0 100644
--- a/arch/arm/def-configs/h3600
+++ b/arch/arm/configs/h3600_defconfig
diff --git a/arch/arm/def-configs/hackkit b/arch/arm/configs/hackkit_defconfig
index 8d9dfefab4cf..8d9dfefab4cf 100644
--- a/arch/arm/def-configs/hackkit
+++ b/arch/arm/configs/hackkit_defconfig
diff --git a/arch/arm/def-configs/huw_webpanel b/arch/arm/configs/huw_webpanel_defconfig
index 87f6d7728425..87f6d7728425 100644
--- a/arch/arm/def-configs/huw_webpanel
+++ b/arch/arm/configs/huw_webpanel_defconfig
diff --git a/arch/arm/def-configs/integrator b/arch/arm/configs/integrator_defconfig
index 79d4957dcf5e..79d4957dcf5e 100644
--- a/arch/arm/def-configs/integrator
+++ b/arch/arm/configs/integrator_defconfig
diff --git a/arch/arm/def-configs/iq80310 b/arch/arm/configs/iq80310_defconfig
index e6895ea23082..e6895ea23082 100644
--- a/arch/arm/def-configs/iq80310
+++ b/arch/arm/configs/iq80310_defconfig
diff --git a/arch/arm/def-configs/iq80321 b/arch/arm/configs/iq80321_defconfig
index c84b6b1b8985..c84b6b1b8985 100644
--- a/arch/arm/def-configs/iq80321
+++ b/arch/arm/configs/iq80321_defconfig
diff --git a/arch/arm/def-configs/jornada720 b/arch/arm/configs/jornada720_defconfig
index c2f9f45cad43..c2f9f45cad43 100644
--- a/arch/arm/def-configs/jornada720
+++ b/arch/arm/configs/jornada720_defconfig
diff --git a/arch/arm/def-configs/lart b/arch/arm/configs/lart_defconfig
index f7324764b3ec..f7324764b3ec 100644
--- a/arch/arm/def-configs/lart
+++ b/arch/arm/configs/lart_defconfig
diff --git a/arch/arm/def-configs/lubbock b/arch/arm/configs/lubbock_defconfig
index fa6e9588f427..fa6e9588f427 100644
--- a/arch/arm/def-configs/lubbock
+++ b/arch/arm/configs/lubbock_defconfig
diff --git a/arch/arm/def-configs/lusl7200 b/arch/arm/configs/lusl7200_defconfig
index 9866747cea23..9866747cea23 100644
--- a/arch/arm/def-configs/lusl7200
+++ b/arch/arm/configs/lusl7200_defconfig
diff --git a/arch/arm/def-configs/neponset b/arch/arm/configs/neponset_defconfig
index 82e443d64e79..82e443d64e79 100644
--- a/arch/arm/def-configs/neponset
+++ b/arch/arm/configs/neponset_defconfig
diff --git a/arch/arm/def-configs/omnimeter b/arch/arm/configs/omnimeter_defconfig
index 0e4e3c6fe799..0e4e3c6fe799 100644
--- a/arch/arm/def-configs/omnimeter
+++ b/arch/arm/configs/omnimeter_defconfig
diff --git a/arch/arm/def-configs/pangolin b/arch/arm/configs/pangolin_defconfig
index e75a4d106280..e75a4d106280 100644
--- a/arch/arm/def-configs/pangolin
+++ b/arch/arm/configs/pangolin_defconfig
diff --git a/arch/arm/def-configs/pfs168_mqtft b/arch/arm/configs/pfs168_mqtft_defconfig
index e10016c3f311..e10016c3f311 100644
--- a/arch/arm/def-configs/pfs168_mqtft
+++ b/arch/arm/configs/pfs168_mqtft_defconfig
diff --git a/arch/arm/def-configs/pfs168_mqvga b/arch/arm/configs/pfs168_mqvga_defconfig
index 6e26eabea31d..6e26eabea31d 100644
--- a/arch/arm/def-configs/pfs168_mqvga
+++ b/arch/arm/configs/pfs168_mqvga_defconfig
diff --git a/arch/arm/def-configs/pfs168_sastn b/arch/arm/configs/pfs168_sastn_defconfig
index 914cd2dafc9e..914cd2dafc9e 100644
--- a/arch/arm/def-configs/pfs168_sastn
+++ b/arch/arm/configs/pfs168_sastn_defconfig
diff --git a/arch/arm/def-configs/pfs168_satft b/arch/arm/configs/pfs168_satft_defconfig
index 097fdbb9bd8c..097fdbb9bd8c 100644
--- a/arch/arm/def-configs/pfs168_satft
+++ b/arch/arm/configs/pfs168_satft_defconfig
diff --git a/arch/arm/def-configs/pleb b/arch/arm/configs/pleb_defconfig
index a44d50fdf607..a44d50fdf607 100644
--- a/arch/arm/def-configs/pleb
+++ b/arch/arm/configs/pleb_defconfig
diff --git a/arch/arm/def-configs/rpc b/arch/arm/configs/rpc_defconfig
index b0f201eb51a1..b0f201eb51a1 100644
--- a/arch/arm/def-configs/rpc
+++ b/arch/arm/configs/rpc_defconfig
diff --git a/arch/arm/def-configs/shannon b/arch/arm/configs/shannon_defconfig
index ff721cb3783b..ff721cb3783b 100644
--- a/arch/arm/def-configs/shannon
+++ b/arch/arm/configs/shannon_defconfig
diff --git a/arch/arm/def-configs/shark b/arch/arm/configs/shark_defconfig
index cd5fc9c90129..cd5fc9c90129 100644
--- a/arch/arm/def-configs/shark
+++ b/arch/arm/configs/shark_defconfig
diff --git a/arch/arm/def-configs/sherman b/arch/arm/configs/sherman_defconfig
index b5b2c5af3079..b5b2c5af3079 100644
--- a/arch/arm/def-configs/sherman
+++ b/arch/arm/configs/sherman_defconfig
diff --git a/arch/arm/def-configs/stork b/arch/arm/configs/stork_defconfig
index 57f78b1583fb..57f78b1583fb 100644
--- a/arch/arm/def-configs/stork
+++ b/arch/arm/configs/stork_defconfig
diff --git a/arch/arm/def-configs/system3 b/arch/arm/configs/system3_defconfig
index 9b112a6511e9..9b112a6511e9 100644
--- a/arch/arm/def-configs/system3
+++ b/arch/arm/configs/system3_defconfig
diff --git a/arch/arm/def-configs/trizeps b/arch/arm/configs/trizeps_defconfig
index 8b00f2903ed6..8b00f2903ed6 100644
--- a/arch/arm/def-configs/trizeps
+++ b/arch/arm/configs/trizeps_defconfig
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index fdd6bcdd951d..49562ecdf365 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -10,8 +10,6 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
-
-#include <linux/config.h>
#include <linux/sched.h>
#include <linux/mm.h>
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 9588b86f78a6..0a021712b827 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -329,8 +329,7 @@ ecard_call(struct ecard_request *req)
BUG();
if (ecard_pid <= 0)
- ecard_pid = kernel_thread(ecard_task, NULL,
- CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ ecard_pid = kernel_thread(ecard_task, NULL, CLONE_KERNEL);
ecard_req = req;
wake_up(&ecard_wait);
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index f6f64875dfd4..b05db036ac83 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -729,7 +729,7 @@ __dabt_svc: sub sp, sp, #S_FRAME_SIZE
* This routine must not corrupt r9
*/
#ifdef MULTI_ABORT
- ldr r4, .LCprocfns @ pass r0, r3 to
+ ldr r4, .LCprocfns @ pass r2, r3 to
mov lr, pc @ processor code
ldr pc, [r4] @ call processor specific code
#else
@@ -871,7 +871,7 @@ __dabt_usr: sub sp, sp, #S_FRAME_SIZE @ Allocate frame size in one go
alignment_trap r7, r7, __temp_abt
zero_fp
#ifdef MULTI_ABORT
- ldr r4, .LCprocfns @ pass r0, r3 to
+ ldr r4, .LCprocfns @ pass r2, r3 to
mov lr, pc @ processor code
ldr pc, [r4] @ call processor specific code
#else
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
index cadc229f8553..6241a43df292 100644
--- a/arch/arm/kernel/fiq.c
+++ b/arch/arm/kernel/fiq.c
@@ -35,7 +35,6 @@
* - enables FIQ.
* 6. Goto 3
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/mm.h>
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 8cded6988447..4a4532e91896 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -312,8 +312,8 @@ void release_thread(struct task_struct *dead_task)
asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
int
-copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
- unsigned long unused, struct task_struct *p, struct pt_regs *regs)
+copy_thread(int nr, unsigned long clone_flags, unsigned long stack_start,
+ unsigned long stk_sz, struct task_struct *p, struct pt_regs *regs)
{
struct thread_info *thread = p->thread_info;
struct pt_regs *childregs;
@@ -321,7 +321,7 @@ copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
childregs = ((struct pt_regs *)((unsigned long)thread + THREAD_SIZE - 8)) - 1;
*childregs = *regs;
childregs->ARM_r0 = 0;
- childregs->ARM_sp = esp;
+ childregs->ARM_sp = stack_start;
memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
thread->cpu_context.sp = (unsigned long)childregs;
@@ -373,33 +373,35 @@ void dump_thread(struct pt_regs * regs, struct user * dump)
}
/*
- * This is the mechanism for creating a new kernel thread.
- *
- * NOTE! Only a kernel-only process(ie the swapper or direct descendants
- * who haven't done an "execve()") should use this: it will work within
- * a system call from a "real" process, but the process memory space will
- * not be free'd until both the parent and the child have exited.
+ * Shuffle the argument into the correct register before calling the
+ * thread function. r1 is the thread argument, r2 is the pointer to
+ * the thread function, and r3 points to the exit function.
+ */
+extern void kernel_thread_helper(void);
+asm( ".align\n"
+" .type kernel_thread_helper, #function\n"
+"kernel_thread_helper:\n"
+" mov r0, r1\n"
+" mov lr, r3\n"
+" mov pc, r2\n"
+" .size kernel_thread_helper, . - kernel_thread_helper");
+
+/*
+ * Create a kernel thread.
*/
pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
{
- register unsigned int r0 asm("r0") = flags | CLONE_VM | CLONE_UNTRACED;
- register unsigned int r1 asm("r1") = 0;
- register pid_t __ret asm("r0");
-
- __asm__ __volatile__(
- __syscall(clone)" @ kernel_thread sys_clone \n\
- movs %0, r0 @ if we are the child \n\
- bne 1f \n\
- mov fp, #0 @ ensure that fp is zero \n\
- mov r0, %4 \n\
- mov lr, pc \n\
- mov pc, %3 \n\
- b sys_exit \n\
-1: "
- : "=r" (__ret)
- : "0" (r0), "r" (r1), "r" (fn), "r" (arg)
- : "lr");
- return __ret;
+ struct pt_regs regs;
+
+ memset(&regs, 0, sizeof(regs));
+
+ regs.ARM_r1 = (unsigned long)arg;
+ regs.ARM_r2 = (unsigned long)fn;
+ regs.ARM_r3 = (unsigned long)do_exit;
+ regs.ARM_pc = (unsigned long)kernel_thread_helper;
+ regs.ARM_cpsr = SVC_MODE;
+
+ return do_fork(flags|CLONE_VM|CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
}
/*
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index e146dab63778..3fafcf7e9e40 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -9,7 +9,6 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
-#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
diff --git a/arch/arm/kernel/semaphore.c b/arch/arm/kernel/semaphore.c
index 5d83d3ba2e65..a50902e8bec7 100644
--- a/arch/arm/kernel/semaphore.c
+++ b/arch/arm/kernel/semaphore.c
@@ -11,7 +11,6 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
-#include <linux/config.h>
#include <linux/sched.h>
#include <linux/errno.h>
diff --git a/arch/arm/lib/io-readsb.S b/arch/arm/lib/io-readsb.S
index 854138c417d2..2b4f89834998 100644
--- a/arch/arm/lib/io-readsb.S
+++ b/arch/arm/lib/io-readsb.S
@@ -9,7 +9,6 @@
*/
#include <linux/linkage.h>
#include <asm/assembler.h>
-#include <asm/hardware.h>
.insb_align: rsb ip, ip, #4
cmp ip, r2
@@ -37,32 +36,36 @@ ENTRY(__raw_readsb)
.insb_16_lp: ldrb r3, [r0]
ldrb r4, [r0]
- orr r3, r3, r4, lsl #8
- ldrb r4, [r0]
- orr r3, r3, r4, lsl #16
- ldrb r4, [r0]
- orr r3, r3, r4, lsl #24
- ldrb r4, [r0]
- ldrb r5, [r0]
- orr r4, r4, r5, lsl #8
- ldrb r5, [r0]
- orr r4, r4, r5, lsl #16
- ldrb r5, [r0]
- orr r4, r4, r5, lsl #24
ldrb r5, [r0]
+ mov r3, r3, lsl #byte(0)
ldrb r6, [r0]
- orr r5, r5, r6, lsl #8
- ldrb r6, [r0]
- orr r5, r5, r6, lsl #16
+ orr r3, r3, r4, lsl #byte(1)
+ ldrb r4, [r0]
+ orr r3, r3, r5, lsl #byte(2)
+ ldrb r5, [r0]
+ orr r3, r3, r6, lsl #byte(3)
ldrb r6, [r0]
- orr r5, r5, r6, lsl #24
+ mov r4, r4, lsl #byte(0)
+ ldrb ip, [r0]
+ orr r4, r4, r5, lsl #byte(1)
+ ldrb r5, [r0]
+ orr r4, r4, r6, lsl #byte(2)
ldrb r6, [r0]
+ orr r4, r4, ip, lsl #byte(3)
ldrb ip, [r0]
- orr r6, r6, ip, lsl #8
+ mov r5, r5, lsl #byte(0)
+ ldrb lr, [r0]
+ orr r5, r5, r6, lsl #byte(1)
+ ldrb r6, [r0]
+ orr r5, r5, ip, lsl #byte(2)
ldrb ip, [r0]
- orr r6, r6, ip, lsl #16
+ orr r5, r5, lr, lsl #byte(3)
+ ldrb lr, [r0]
+ mov r6, r6, lsl #byte(0)
+ orr r6, r6, ip, lsl #byte(1)
ldrb ip, [r0]
- orr r6, r6, ip, lsl #24
+ orr r6, r6, lr, lsl #byte(2)
+ orr r6, r6, ip, lsl #byte(3)
stmia r1!, {r3 - r6}
subs r2, r2, #16
@@ -76,18 +79,20 @@ ENTRY(__raw_readsb)
ldrb r3, [r0]
ldrb r4, [r0]
- orr r3, r3, r4, lsl #8
- ldrb r4, [r0]
- orr r3, r3, r4, lsl #16
- ldrb r4, [r0]
- orr r3, r3, r4, lsl #24
- ldrb r4, [r0]
ldrb r5, [r0]
- orr r4, r4, r5, lsl #8
- ldrb r5, [r0]
- orr r4, r4, r5, lsl #16
+ mov r3, r3, lsl #byte(0)
+ ldrb r6, [r0]
+ orr r3, r3, r4, lsl #byte(1)
+ ldrb r4, [r0]
+ orr r3, r3, r5, lsl #byte(2)
ldrb r5, [r0]
- orr r4, r4, r5, lsl #24
+ orr r3, r3, r6, lsl #byte(3)
+ ldrb r6, [r0]
+ mov r4, r4, lsl #byte(0)
+ ldrb ip, [r0]
+ orr r4, r4, r5, lsl #byte(1)
+ orr r4, r4, r6, lsl #byte(2)
+ orr r4, r4, ip, lsl #byte(3)
stmia r1!, {r3, r4}
.insb_no_8: tst r2, #4
@@ -95,11 +100,12 @@ ENTRY(__raw_readsb)
ldrb r3, [r0]
ldrb r4, [r0]
- orr r3, r3, r4, lsl #8
- ldrb r4, [r0]
- orr r3, r3, r4, lsl #16
- ldrb r4, [r0]
- orr r3, r3, r4, lsl #24
+ ldrb r5, [r0]
+ ldrb r6, [r0]
+ mov r3, r3, lsl #byte(0)
+ orr r3, r3, r4, lsl #byte(1)
+ orr r3, r3, r5, lsl #byte(2)
+ orr r3, r3, r6, lsl #byte(3)
str r3, [r1], #4
.insb_no_4: ands r2, r2, #3
diff --git a/arch/arm/lib/io-writesb.S b/arch/arm/lib/io-writesb.S
index 873b3697a899..70b2561bdb09 100644
--- a/arch/arm/lib/io-writesb.S
+++ b/arch/arm/lib/io-writesb.S
@@ -9,7 +9,26 @@
*/
#include <linux/linkage.h>
#include <asm/assembler.h>
-#include <asm/hardware.h>
+
+ .macro outword, rd
+#ifndef __ARMEB__
+ strb \rd, [r0]
+ mov \rd, \rd, lsr #8
+ strb \rd, [r0]
+ mov \rd, \rd, lsr #8
+ strb \rd, [r0]
+ mov \rd, \rd, lsr #8
+ strb \rd, [r0]
+#else
+ mov lr, \rd, lsr #24
+ strb lr, [r0]
+ mov lr, \rd, lsr #16
+ strb lr, [r0]
+ mov lr, \rd, lsr #8
+ strb lr, [r0]
+ strb \rd, [r0]
+#endif
+ .endm
.outsb_align: rsb ip, ip, #4
cmp ip, r2
@@ -30,86 +49,37 @@ ENTRY(__raw_writesb)
ands ip, r1, #3
bne .outsb_align
-.outsb_aligned: stmfd sp!, {r4 - r6, lr}
+.outsb_aligned: stmfd sp!, {r4, r5, lr}
subs r2, r2, #16
bmi .outsb_no_16
-.outsb_16_lp: ldmia r1!, {r3 - r6}
-
- strb r3, [r0]
- mov r3, r3, lsr #8
- strb r3, [r0]
- mov r3, r3, lsr #8
- strb r3, [r0]
- mov r3, r3, lsr #8
- strb r3, [r0]
-
- strb r4, [r0]
- mov r4, r4, lsr #8
- strb r4, [r0]
- mov r4, r4, lsr #8
- strb r4, [r0]
- mov r4, r4, lsr #8
- strb r4, [r0]
-
- strb r5, [r0]
- mov r5, r5, lsr #8
- strb r5, [r0]
- mov r5, r5, lsr #8
- strb r5, [r0]
- mov r5, r5, lsr #8
- strb r5, [r0]
-
- strb r6, [r0]
- mov r6, r6, lsr #8
- strb r6, [r0]
- mov r6, r6, lsr #8
- strb r6, [r0]
- mov r6, r6, lsr #8
- strb r6, [r0]
-
+.outsb_16_lp: ldmia r1!, {r3, r4, r5, ip}
+ outword r3
+ outword r4
+ outword r5
+ outword ip
subs r2, r2, #16
bpl .outsb_16_lp
tst r2, #15
- LOADREGS(eqfd, sp!, {r4 - r6, pc})
+ LOADREGS(eqfd, sp!, {r4, r5, pc})
.outsb_no_16: tst r2, #8
beq .outsb_no_8
ldmia r1!, {r3, r4}
-
- strb r3, [r0]
- mov r3, r3, lsr #8
- strb r3, [r0]
- mov r3, r3, lsr #8
- strb r3, [r0]
- mov r3, r3, lsr #8
- strb r3, [r0]
-
- strb r4, [r0]
- mov r4, r4, lsr #8
- strb r4, [r0]
- mov r4, r4, lsr #8
- strb r4, [r0]
- mov r4, r4, lsr #8
- strb r4, [r0]
+ outword r3
+ outword r4
.outsb_no_8: tst r2, #4
beq .outsb_no_4
ldr r3, [r1], #4
- strb r3, [r0]
- mov r3, r3, lsr #8
- strb r3, [r0]
- mov r3, r3, lsr #8
- strb r3, [r0]
- mov r3, r3, lsr #8
- strb r3, [r0]
+ outword r3
.outsb_no_4: ands r2, r2, #3
- LOADREGS(eqfd, sp!, {r4 - r6, pc})
+ LOADREGS(eqfd, sp!, {r4, r5, pc})
cmp r2, #2
ldrb r3, [r1], #1
@@ -119,4 +89,4 @@ ENTRY(__raw_writesb)
ldrgtb r3, [r1]
strgtb r3, [r0]
- LOADREGS(fd, sp!, {r4 - r6, pc})
+ LOADREGS(fd, sp!, {r4, r5, pc})
diff --git a/arch/arm/lib/io-writesl.S b/arch/arm/lib/io-writesl.S
index 12092e2562f2..20b3ee2ef5db 100644
--- a/arch/arm/lib/io-writesl.S
+++ b/arch/arm/lib/io-writesl.S
@@ -17,10 +17,15 @@ ENTRY(__raw_writesl)
ands ip, r1, #3
bne 2f
-1: ldr r3, [r1], #4
- str r3, [r0]
- subs r2, r2, #1
- bne 1b
+ tst r2, #1
+ ldrne r3, [r1], #4
+ strne r3, [r0, #0]
+1: subs r2, r2, #2
+ ldrcs r3, [r1], #4
+ ldrcs ip, [r1], #4
+ strcs r3, [r0, #0]
+ strcs ip, [r0, #0]
+ bcs 1b
mov pc, lr
2: bic r1, r1, #3
@@ -31,25 +36,25 @@ ENTRY(__raw_writesl)
3: mov ip, r3, lsr #16
ldr r3, [r1], #4
- orr ip, ip, r3, lsl #16
- str ip, [r0]
subs r2, r2, #1
+ orr ip, ip, r3, lsl #16
+ str ip, [r0, #0]
bne 3b
mov pc, lr
4: mov ip, r3, lsr #24
ldr r3, [r1], #4
- orr ip, ip, r3, lsl #8
- str ip, [r0]
subs r2, r2, #1
+ orr ip, ip, r3, lsl #8
+ str ip, [r0, #0]
bne 4b
mov pc, lr
5: mov ip, r3, lsr #8
ldr r3, [r1], #4
- orr ip, ip, r3, lsl #24
- str ip, [r0]
subs r2, r2, #1
+ orr ip, ip, r3, lsl #24
+ str ip, [r0, #0]
bne 5b
mov pc, lr
diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S
index e6aab5ceec14..e87f06143311 100644
--- a/arch/arm/lib/lib1funcs.S
+++ b/arch/arm/lib/lib1funcs.S
@@ -41,7 +41,6 @@ Boston, MA 02111-1307, USA. */
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/hardware.h>
-#include <linux/config.h>
#define RET mov
#define RETc(x) mov##x
diff --git a/arch/arm/mach-anakin/arch.c b/arch/arm/mach-anakin/arch.c
index 4adb9cf2e777..8041b7d99647 100644
--- a/arch/arm/mach-anakin/arch.c
+++ b/arch/arm/mach-anakin/arch.c
@@ -10,8 +10,6 @@
* Changelog:
* 09-Apr-2001 W/TTC Created
*/
-
-#include <linux/config.h>
#include <linux/tty.h>
#include <linux/init.h>
diff --git a/arch/arm/mach-clps711x/mm.c b/arch/arm/mach-clps711x/mm.c
index 8c7d11e0be78..120b7cac84b5 100644
--- a/arch/arm/mach-clps711x/mm.c
+++ b/arch/arm/mach-clps711x/mm.c
@@ -22,7 +22,6 @@
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/init.h>
-#include <linux/config.h>
#include <linux/bootmem.h>
#include <asm/hardware.h>
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index 67d0fc309304..f4e83882eb24 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -17,7 +17,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/init.h>
diff --git a/arch/arm/mach-integrator/cpu.c b/arch/arm/mach-integrator/cpu.c
index 50eab0a09c11..69456d0f095d 100644
--- a/arch/arm/mach-integrator/cpu.c
+++ b/arch/arm/mach-integrator/cpu.c
@@ -11,7 +11,6 @@
*
* CPU support functions
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
diff --git a/arch/arm/mach-iop3xx/mm-321.c b/arch/arm/mach-iop3xx/mm-321.c
index 334811f12358..b24a1403d7c8 100644
--- a/arch/arm/mach-iop3xx/mm-321.c
+++ b/arch/arm/mach-iop3xx/mm-321.c
@@ -12,7 +12,7 @@
* option) any later version.
*
*/
-
+#include <linux/config.h>
#include <linux/mm.h>
#include <linux/init.h>
diff --git a/arch/arm/mach-l7200/core.c b/arch/arm/mach-l7200/core.c
index 2570c1f0943f..606ca95f8217 100644
--- a/arch/arm/mach-l7200/core.c
+++ b/arch/arm/mach-l7200/core.c
@@ -5,7 +5,6 @@
*
* Extra MM routines for L7200 architecture
*/
-#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 4ec644f3defe..a7eff6ea1264 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -16,7 +16,6 @@
* initialization stuff for PXA machines which can be overridden later if
* need be.
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
diff --git a/arch/arm/mach-pxa/leds.c b/arch/arm/mach-pxa/leds.c
index 8b27a2400437..b897be63889a 100644
--- a/arch/arm/mach-pxa/leds.c
+++ b/arch/arm/mach-pxa/leds.c
@@ -7,7 +7,6 @@
*
* Copyright (c) 2001 Jeff Sutherland, Accelent Systems Inc.
*/
-#include <linux/config.h>
#include <linux/init.h>
#include <asm/leds.h>
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index c8183c873e1a..fe1a5b55c49a 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -10,7 +10,7 @@
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License.
*/
-
+#include <linux/config.h>
#include <linux/errno.h>
#include <linux/time.h>
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index e705c3cc5b8f..f45e28116609 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -17,7 +17,6 @@
#include <asm/elf.h>
#include <asm/io.h>
-#include <asm/setup.h>
#include <asm/mach-types.h>
#include <asm/hardware.h>
#include <asm/page.h>
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index e4e8e9bf8cae..c3f5e79235f1 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -19,6 +19,7 @@
* and abstracted EGPIO interface.
*
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index aa87418b1eac..e79bb441c8fe 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -11,8 +11,6 @@
* published by the Free Software Foundation.
*
*/
-
-#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
diff --git a/arch/arm/mach-sa1100/pfs168.c b/arch/arm/mach-sa1100/pfs168.c
index a5f86cb723b4..65a29e7e2ddc 100644
--- a/arch/arm/mach-sa1100/pfs168.c
+++ b/arch/arm/mach-sa1100/pfs168.c
@@ -1,7 +1,6 @@
/*
* linux/arch/arm/mach-sa1100/pfs168.c
*/
-#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/tty.h>
diff --git a/arch/arm/mach-sa1100/stork.c b/arch/arm/mach-sa1100/stork.c
index 9ac3a0a10c7d..5aeb087c45d0 100644
--- a/arch/arm/mach-sa1100/stork.c
+++ b/arch/arm/mach-sa1100/stork.c
@@ -8,8 +8,6 @@
* published by the Free Software Foundation.
*
*/
-
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
diff --git a/arch/arm/mach-sa1100/trizeps.c b/arch/arm/mach-sa1100/trizeps.c
index a41090012ffe..199d9cfc5024 100644
--- a/arch/arm/mach-sa1100/trizeps.c
+++ b/arch/arm/mach-sa1100/trizeps.c
@@ -12,7 +12,6 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
-#include <linux/config.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
diff --git a/arch/arm/mach-tbox/core.c b/arch/arm/mach-tbox/core.c
index e9099444b2c2..db9ac783cfce 100644
--- a/arch/arm/mach-tbox/core.c
+++ b/arch/arm/mach-tbox/core.c
@@ -16,7 +16,6 @@
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/page.h>
-#include <asm/io.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
diff --git a/arch/arm/mm/cache-v3.S b/arch/arm/mm/cache-v3.S
index a222e78af7e6..45aa716312b7 100644
--- a/arch/arm/mm/cache-v3.S
+++ b/arch/arm/mm/cache-v3.S
@@ -8,6 +8,7 @@
* published by the Free Software Foundation.
*/
#include <linux/linkage.h>
+#include <linux/init.h>
#include <asm/hardware.h>
#include <asm/page.h>
#include "proc-macros.S"
@@ -107,6 +108,9 @@ ENTRY(v3_dma_flush_range)
ENTRY(v3_dma_clean_range)
mov pc, lr
+ __INITDATA
+
+ .type v3_cache_fns, #object
ENTRY(v3_cache_fns)
.long v3_flush_kern_cache_all
.long v3_flush_user_cache_all
@@ -116,3 +120,4 @@ ENTRY(v3_cache_fns)
.long v3_dma_inv_range
.long v3_dma_clean_range
.long v3_dma_flush_range
+ .size v3_cache_fns, . - v3_cache_fns
diff --git a/arch/arm/mm/cache-v4.S b/arch/arm/mm/cache-v4.S
index e3dbea3a3e01..f948859fc087 100644
--- a/arch/arm/mm/cache-v4.S
+++ b/arch/arm/mm/cache-v4.S
@@ -8,6 +8,7 @@
* published by the Free Software Foundation.
*/
#include <linux/linkage.h>
+#include <linux/init.h>
#include <asm/hardware.h>
#include <asm/page.h>
#include "proc-macros.S"
@@ -109,6 +110,9 @@ ENTRY(v4_dma_flush_range)
ENTRY(v4_dma_clean_range)
mov pc, lr
+ __INITDATA
+
+ .type v4_cache_fns, #object
ENTRY(v4_cache_fns)
.long v4_flush_kern_cache_all
.long v4_flush_user_cache_all
@@ -118,3 +122,4 @@ ENTRY(v4_cache_fns)
.long v4_dma_inv_range
.long v4_dma_clean_range
.long v4_dma_flush_range
+ .size v4_cache_fns, . - v4_cache_fns
diff --git a/arch/arm/mm/cache-v4wb.S b/arch/arm/mm/cache-v4wb.S
index 883c377cbb87..b6422ef0d6db 100644
--- a/arch/arm/mm/cache-v4wb.S
+++ b/arch/arm/mm/cache-v4wb.S
@@ -7,7 +7,9 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
+#include <linux/config.h>
#include <linux/linkage.h>
+#include <linux/init.h>
#include <asm/hardware.h>
#include <asm/page.h>
#include "proc-macros.S"
@@ -185,6 +187,9 @@ ENTRY(v4wb_dma_clean_range)
.globl v4wb_dma_flush_range
.set v4wb_dma_flush_range, v4wb_coherent_kern_range
+ __INITDATA
+
+ .type v4wb_cache_fns, #object
ENTRY(v4wb_cache_fns)
.long v4wb_flush_kern_cache_all
.long v4wb_flush_user_cache_all
@@ -194,3 +199,4 @@ ENTRY(v4wb_cache_fns)
.long v4wb_dma_inv_range
.long v4wb_dma_clean_range
.long v4wb_dma_flush_range
+ .size v4wb_cache_fns, . - v4wb_cache_fns
diff --git a/arch/arm/mm/cache-v4wt.S b/arch/arm/mm/cache-v4wt.S
index f1a76d632900..63db6231e65e 100644
--- a/arch/arm/mm/cache-v4wt.S
+++ b/arch/arm/mm/cache-v4wt.S
@@ -12,6 +12,7 @@
* We assume that the write buffer is not enabled.
*/
#include <linux/linkage.h>
+#include <linux/init.h>
#include <asm/hardware.h>
#include <asm/page.h>
#include "proc-macros.S"
@@ -158,6 +159,9 @@ ENTRY(v4wt_dma_clean_range)
.globl v4wt_dma_flush_range
.equ v4wt_dma_flush_range, v4wt_dma_inv_range
+ __INITDATA
+
+ .type v4wt_cache_fns, #object
ENTRY(v4wt_cache_fns)
.long v4wt_flush_kern_cache_all
.long v4wt_flush_user_cache_all
@@ -167,4 +171,4 @@ ENTRY(v4wt_cache_fns)
.long v4wt_dma_inv_range
.long v4wt_dma_clean_range
.long v4wt_dma_flush_range
-
+ .size v4wt_cache_fns, . - v4wt_cache_fns
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c
index 7c572275f4fd..2db4fb564f36 100644
--- a/arch/arm/mm/consistent.c
+++ b/arch/arm/mm/consistent.c
@@ -9,7 +9,6 @@
*
* DMA uncached mapping support.
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/slab.h>
diff --git a/arch/arm/mm/copypage-v3.S b/arch/arm/mm/copypage-v3.S
index dc03aaa11e8c..4940f1908316 100644
--- a/arch/arm/mm/copypage-v3.S
+++ b/arch/arm/mm/copypage-v3.S
@@ -58,8 +58,10 @@ ENTRY(v3_clear_user_page)
bne 1b @ 1
ldr pc, [sp], #4
- __INIT
+ __INITDATA
+ .type v3_user_fns, #object
ENTRY(v3_user_fns)
.long v3_clear_user_page
.long v3_copy_user_page
+ .size v3_user_fns, . - v3_user_fns
diff --git a/arch/arm/mm/copypage-v4mc.S b/arch/arm/mm/copypage-v4mc.S
index f16bfc4cf81d..305af3dab3d8 100644
--- a/arch/arm/mm/copypage-v4mc.S
+++ b/arch/arm/mm/copypage-v4mc.S
@@ -71,9 +71,10 @@ ENTRY(v4_mc_clear_user_page)
bne 1b @ 1
ldr pc, [sp], #4
- __INIT
+ __INITDATA
+ .type v4_mc_user_fns, #object
ENTRY(v4_mc_user_fns)
.long v4_mc_clear_user_page
.long v4_mc_copy_user_page
-
+ .size v4_mc_user_fns, . - v4_mc_user_fns
diff --git a/arch/arm/mm/copypage-v4wb.S b/arch/arm/mm/copypage-v4wb.S
index cff3c7a4bac6..b94c345ceb94 100644
--- a/arch/arm/mm/copypage-v4wb.S
+++ b/arch/arm/mm/copypage-v4wb.S
@@ -70,9 +70,10 @@ ENTRY(v4wb_clear_user_page)
mcr p15, 0, r1, c7, c10, 4 @ 1 drain WB
ldr pc, [sp], #4
- __INIT
+ __INITDATA
+ .type v4wb_user_fns, #object
ENTRY(v4wb_user_fns)
.long v4wb_clear_user_page
.long v4wb_copy_user_page
-
+ .size v4wb_user_fns, . - v4wb_user_fns
diff --git a/arch/arm/mm/copypage-v4wt.S b/arch/arm/mm/copypage-v4wt.S
index 24ee706d7bf2..976793937a93 100644
--- a/arch/arm/mm/copypage-v4wt.S
+++ b/arch/arm/mm/copypage-v4wt.S
@@ -64,9 +64,10 @@ ENTRY(v4wt_clear_user_page)
mcr p15, 0, r2, c7, c7, 0 @ flush ID cache
ldr pc, [sp], #4
- __INIT
+ __INITDATA
+ .type v4wt_user_fns, #object
ENTRY(v4wt_user_fns)
.long v4wt_clear_user_page
.long v4wt_copy_user_page
-
+ .size v4wt_user_fns, . - v4wt_user_fns
diff --git a/arch/arm/mm/copypage-xscale.S b/arch/arm/mm/copypage-xscale.S
index 76ff846d85c8..bb277316ef52 100644
--- a/arch/arm/mm/copypage-xscale.S
+++ b/arch/arm/mm/copypage-xscale.S
@@ -104,8 +104,10 @@ ENTRY(xscale_mc_clear_user_page)
bne 1b
mov pc, lr
- __INIT
+ __INITDATA
+ .type xscale_mc_user_fns, #object
ENTRY(xscale_mc_user_fns)
.long xscale_mc_clear_user_page
.long xscale_mc_copy_user_page
+ .size xscale_mc_user_fns, . - xscale_mc_user_fns
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index 273b1b42c2b5..a50e83d7092a 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -9,6 +9,7 @@
*
* Page table sludge for ARM v3 and v4 processor architectures.
*/
+#include <linux/config.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/bootmem.h>
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
index 0c14a18fe894..7fe21a95d0bd 100644
--- a/arch/arm/mm/proc-arm1020.S
+++ b/arch/arm/mm/proc-arm1020.S
@@ -409,31 +409,9 @@ ENTRY(cpu_arm1020_set_pte)
mcr p15, 0, r0, c7, c10, 4 @ drain WB
mov pc, lr
-
-ENTRY(cpu_arm1020_name)
- .ascii "ARM1020"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
- .ascii "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
- .ascii "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
- .ascii "(wt)"
-#else
- .ascii "(wb)"
-#endif
-#endif
-#ifndef CONFIG_CPU_BPREDICT_DISABLE
- .ascii "B"
-#endif
-#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
- .ascii "RR"
-#endif
- .ascii "\0"
- .align
-
__INIT
+ .type __arm1020_setup, #function
__arm1020_setup:
mov r0, #0
mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
@@ -467,8 +445,9 @@ __arm1020_setup:
orr r0, r0, #0x1000 @ I Cache on
#endif
mov pc, lr
+ .size __arm1020_setup, . - __arm1020_setup
- .text
+ __INITDATA
/*
* Purpose : Function pointers used to access above functions - all calls
@@ -484,9 +463,10 @@ arm1020_processor_functions:
.word cpu_arm1020_dcache_clean_area
.word cpu_arm1020_switch_mm
.word cpu_arm1020_set_pte
-
.size arm1020_processor_functions, . - arm1020_processor_functions
+ .section ".rodata"
+
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv5t"
@@ -496,6 +476,30 @@ cpu_arch_name:
cpu_elf_name:
.asciz "v5"
.size cpu_elf_name, . - cpu_elf_name
+
+ .type cpu_arm1020_name, #object
+cpu_arm1020_name:
+ .ascii "ARM1020"
+#ifndef CONFIG_CPU_ICACHE_DISABLE
+ .ascii "i"
+#endif
+#ifndef CONFIG_CPU_DCACHE_DISABLE
+ .ascii "d"
+#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
+ .ascii "(wt)"
+#else
+ .ascii "(wb)"
+#endif
+#endif
+#ifndef CONFIG_CPU_BPREDICT_DISABLE
+ .ascii "B"
+#endif
+#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
+ .ascii "RR"
+#endif
+ .ascii "\0"
+ .size cpu_arm1020_name, . - cpu_arm1020_name
+
.align
.section ".proc.info", #alloc, #execinstr
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
index ee36ec03a57d..0332c3e694c8 100644
--- a/arch/arm/mm/proc-arm1020e.S
+++ b/arch/arm/mm/proc-arm1020e.S
@@ -392,31 +392,9 @@ ENTRY(cpu_arm1020e_set_pte)
#endif
mov pc, lr
-
-ENTRY(cpu_arm1020e_name)
- .ascii "ARM1020E"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
- .ascii "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
- .ascii "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
- .ascii "(wt)"
-#else
- .ascii "(wb)"
-#endif
-#endif
-#ifndef CONFIG_CPU_BPREDICT_DISABLE
- .ascii "B"
-#endif
-#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
- .ascii "RR"
-#endif
- .ascii "\0"
- .align
-
__INIT
+ .type __arm1020e_setup, #function
__arm1020e_setup:
mov r0, #0
mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
@@ -450,8 +428,9 @@ __arm1020e_setup:
orr r0, r0, #0x1000 @ I Cache on
#endif
mov pc, lr
+ .size __arm1020e_setup, . - __arm1020e_setup
- .text
+ __INITDATA
/*
* Purpose : Function pointers used to access above functions - all calls
@@ -467,9 +446,10 @@ arm1020e_processor_functions:
.word cpu_arm1020e_dcache_clean_area
.word cpu_arm1020e_switch_mm
.word cpu_arm1020e_set_pte
-
.size arm1020e_processor_functions, . - arm1020e_processor_functions
+ .section ".rodata"
+
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv5te"
@@ -479,6 +459,30 @@ cpu_arch_name:
cpu_elf_name:
.asciz "v5"
.size cpu_elf_name, . - cpu_elf_name
+
+ .type cpu_arm1020e_name, #object
+cpu_arm1020e_name:
+ .ascii "ARM1020E"
+#ifndef CONFIG_CPU_ICACHE_DISABLE
+ .ascii "i"
+#endif
+#ifndef CONFIG_CPU_DCACHE_DISABLE
+ .ascii "d"
+#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
+ .ascii "(wt)"
+#else
+ .ascii "(wb)"
+#endif
+#endif
+#ifndef CONFIG_CPU_BPREDICT_DISABLE
+ .ascii "B"
+#endif
+#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
+ .ascii "RR"
+#endif
+ .ascii "\0"
+ .size cpu_arm1020e_name, . - cpu_arm1020e_name
+
.align
.section ".proc.info", #alloc, #execinstr
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S
index f710cb8cc00e..35a5c2f00233 100644
--- a/arch/arm/mm/proc-arm1022.S
+++ b/arch/arm/mm/proc-arm1022.S
@@ -372,31 +372,9 @@ ENTRY(cpu_arm1022_set_pte)
#endif
mov pc, lr
-
-ENTRY(cpu_arm1022_name)
- .ascii "arm1022"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
- .ascii "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
- .ascii "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
- .ascii "(wt)"
-#else
- .ascii "(wb)"
-#endif
-#endif
-#ifndef CONFIG_CPU_BPREDICT_DISABLE
- .ascii "B"
-#endif
-#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
- .ascii "RR"
-#endif
- .ascii "\0"
- .align
-
__INIT
+ .type __arm1022_setup, #function
__arm1022_setup:
mov r0, #0
mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
@@ -430,8 +408,9 @@ __arm1022_setup:
orr r0, r0, #0x1000 @ ...I............
#endif
mov pc, lr
+ .size __arm1022_setup, . - __arm1022_setup
- .text
+ __INITDATA
/*
* Purpose : Function pointers used to access above functions - all calls
@@ -447,9 +426,10 @@ arm1022_processor_functions:
.word cpu_arm1022_dcache_clean_area
.word cpu_arm1022_switch_mm
.word cpu_arm1022_set_pte
-
.size arm1022_processor_functions, . - arm1022_processor_functions
+ .section ".rodata"
+
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv5te"
@@ -459,6 +439,30 @@ cpu_arch_name:
cpu_elf_name:
.asciz "v5"
.size cpu_elf_name, . - cpu_elf_name
+
+ .type cpu_arm1022_name, #object
+cpu_arm1022_name:
+ .ascii "arm1022"
+#ifndef CONFIG_CPU_ICACHE_DISABLE
+ .ascii "i"
+#endif
+#ifndef CONFIG_CPU_DCACHE_DISABLE
+ .ascii "d"
+#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
+ .ascii "(wt)"
+#else
+ .ascii "(wb)"
+#endif
+#endif
+#ifndef CONFIG_CPU_BPREDICT_DISABLE
+ .ascii "B"
+#endif
+#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
+ .ascii "RR"
+#endif
+ .ascii "\0"
+ .size cpu_arm1022_name, . - cpu_arm1022_name
+
.align
.section ".proc.info", #alloc, #execinstr
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S
index 1913585078e8..0009f2d2779d 100644
--- a/arch/arm/mm/proc-arm1026.S
+++ b/arch/arm/mm/proc-arm1026.S
@@ -365,6 +365,7 @@ ENTRY(cpu_arm1026_set_pte)
__INIT
+ .type __arm1026_setup, #function
__arm1026_setup:
mov r0, #0
mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
@@ -402,6 +403,9 @@ __arm1026_setup:
orr r0, r0, #0x1000 @ ...I............
#endif
mov pc, lr
+ .size __arm1026_setup, . - __arm1026_setup
+
+ __INITDATA
/*
* Purpose : Function pointers used to access above functions - all calls
@@ -409,7 +413,7 @@ __arm1026_setup:
*/
.type arm1026_processor_functions, #object
arm1026_processor_functions:
- .word ev5t_early_abort
+ .word v5t_early_abort
.word cpu_arm1026_proc_init
.word cpu_arm1026_proc_fin
.word cpu_arm1026_reset
@@ -417,7 +421,6 @@ arm1026_processor_functions:
.word cpu_arm1026_dcache_clean_area
.word cpu_arm1026_switch_mm
.word cpu_arm1026_set_pte
-
.size arm1026_processor_functions, . - arm1026_processor_functions
.section .rodata
@@ -434,7 +437,7 @@ cpu_elf_name:
.align
.type cpu_arm1026_name, #object
-ENTRY(cpu_arm1026_name)
+cpu_arm1026_name:
.ascii "ARM1026EJ-S"
#ifndef CONFIG_CPU_ICACHE_DISABLE
.ascii "i"
@@ -454,9 +457,10 @@ ENTRY(cpu_arm1026_name)
.ascii "RR"
#endif
.ascii "\0"
- .align
.size cpu_arm1026_name, . - cpu_arm1026_name
+ .align
+
.section ".proc.info", #alloc, #execinstr
.type __arm1026_proc_info,#object
diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S
index b3e21a92f928..1fdb39451740 100644
--- a/arch/arm/mm/proc-arm6_7.S
+++ b/arch/arm/mm/proc-arm6_7.S
@@ -247,16 +247,9 @@ ENTRY(cpu_arm7_reset)
mcr p15, 0, r1, c1, c0, 0 @ turn off MMU etc
mov pc, r0
-cpu_arm6_name: .asciz "ARM6"
-cpu_arm610_name:
- .asciz "ARM610"
-cpu_arm7_name: .asciz "ARM7"
-cpu_arm710_name:
- .asciz "ARM710"
- .align
-
__INIT
+ .type __arm6_setup, #function
__arm6_setup: mov r0, #0
mcr p15, 0, r0, c7, c0 @ flush caches on v3
mcr p15, 0, r0, c5, c0 @ flush TLBs on v3
@@ -266,7 +259,9 @@ __arm6_setup: mov r0, #0
mov r0, #0x3d @ . ..RS BLDP WCAM
orr r0, r0, #0x100 @ . ..01 0011 1101
mov pc, lr
+ .size __arm6_setup, . - __arm6_setup
+ .type __arm7_setup, #function
__arm7_setup: mov r0, #0
mcr p15, 0, r0, c7, c0 @ flush caches on v3
mcr p15, 0, r0, c5, c0 @ flush TLBs on v3
@@ -276,6 +271,9 @@ __arm7_setup: mov r0, #0
mov r0, #0x7d @ . ..RS BLDP WCAM
orr r0, r0, #0x100 @ . ..01 0111 1101
mov pc, lr
+ .size __arm7_setup, . - __arm7_setup
+
+ __INITDATA
/*
* Purpose : Function pointers used to access above functions - all calls
@@ -309,6 +307,8 @@ ENTRY(arm7_processor_functions)
.word cpu_arm7_set_pte
.size arm7_processor_functions, . - arm7_processor_functions
+ .section ".rodata"
+
.type cpu_arch_name, #object
cpu_arch_name: .asciz "armv3"
.size cpu_arch_name, . - cpu_arch_name
@@ -316,6 +316,25 @@ cpu_arch_name: .asciz "armv3"
.type cpu_elf_name, #object
cpu_elf_name: .asciz "v3"
.size cpu_elf_name, . - cpu_elf_name
+
+ .type cpu_arm6_name, #object
+cpu_arm6_name: .asciz "ARM6"
+ .size cpu_arm6_name, . - cpu_arm6_name
+
+ .type cpu_arm610_name, #object
+cpu_arm610_name:
+ .asciz "ARM610"
+ .size cpu_arm610_name, . - cpu_arm610_name
+
+ .type cpu_arm7_name, #object
+cpu_arm7_name: .asciz "ARM7"
+ .size cpu_arm7_name, . - cpu_arm7_name
+
+ .type cpu_arm710_name, #object
+cpu_arm710_name:
+ .asciz "ARM710"
+ .size cpu_arm710_name, . - cpu_arm710_name
+
.align
.section ".proc.info", #alloc, #execinstr
diff --git a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S
index 01beb2bc4b1f..19e80287f727 100644
--- a/arch/arm/mm/proc-arm720.S
+++ b/arch/arm/mm/proc-arm720.S
@@ -124,13 +124,9 @@ ENTRY(cpu_arm720_reset)
mcr p15, 0, ip, c1, c0, 0 @ ctrl register
mov pc, r0
-
-cpu_arm720_name:
- .asciz "ARM720T"
- .align
-
__INIT
+ .type __arm720_setup, #function
__arm720_setup: mov r0, #0
mcr p15, 0, r0, c7, c7, 0 @ invalidate caches
mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4)
@@ -143,6 +139,9 @@ __arm720_setup: mov r0, #0
orr r0, r0, #0x2100 @ .... .... .111 .... (old)
orr r0, r0, #0x003d @ ..1. ..01 ..11 1101 (new)
mov pc, lr @ __ret (head-armv.S)
+ .size __arm720_setup, . - __arm720_setup
+
+ __INITDATA
/*
* Purpose : Function pointers used to access above functions - all calls
@@ -160,6 +159,8 @@ ENTRY(arm720_processor_functions)
.word cpu_arm720_set_pte
.size arm720_processor_functions, . - arm720_processor_functions
+ .section ".rodata"
+
.type cpu_arch_name, #object
cpu_arch_name: .asciz "armv4t"
.size cpu_arch_name, . - cpu_arch_name
@@ -167,6 +168,12 @@ cpu_arch_name: .asciz "armv4t"
.type cpu_elf_name, #object
cpu_elf_name: .asciz "v4"
.size cpu_elf_name, . - cpu_elf_name
+
+ .type cpu_arm720_name, #object
+cpu_arm720_name:
+ .asciz "ARM720T"
+ .size cpu_arm720_name, . - cpu_arm720_name
+
.align
/*
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
index 439aef9fe24a..3922a8213d20 100644
--- a/arch/arm/mm/proc-arm920.S
+++ b/arch/arm/mm/proc-arm920.S
@@ -360,25 +360,9 @@ ENTRY(cpu_arm920_set_pte)
mcr p15, 0, r0, c7, c10, 4 @ drain WB
mov pc, lr
-
-ENTRY(cpu_arm920_name)
- .ascii "ARM920T"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
- .ascii "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
- .ascii "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
- .ascii "(wt)"
-#else
- .ascii "(wb)"
-#endif
-#endif
- .ascii "\0"
- .align
-
__INIT
+ .type __arm920_setup, #function
__arm920_setup:
mov r0, #0
mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
@@ -409,8 +393,9 @@ __arm920_setup:
orr r0, r0, #0x1000 @ ...1 .... .... ....
#endif
mov pc, lr
+ .size __arm920_setup, . - __arm920_setup
- .text
+ __INITDATA
/*
* Purpose : Function pointers used to access above functions - all calls
@@ -428,6 +413,8 @@ arm920_processor_functions:
.word cpu_arm920_set_pte
.size arm920_processor_functions, . - arm920_processor_functions
+ .section ".rodata"
+
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv4t"
@@ -437,6 +424,24 @@ cpu_arch_name:
cpu_elf_name:
.asciz "v4"
.size cpu_elf_name, . - cpu_elf_name
+
+ .type cpu_arm920_name, #object
+cpu_arm920_name:
+ .ascii "ARM920T"
+#ifndef CONFIG_CPU_ICACHE_DISABLE
+ .ascii "i"
+#endif
+#ifndef CONFIG_CPU_DCACHE_DISABLE
+ .ascii "d"
+#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
+ .ascii "(wt)"
+#else
+ .ascii "(wb)"
+#endif
+#endif
+ .ascii "\0"
+ .size cpu_arm920_name, . - cpu_arm920_name
+
.align
.section ".proc.info", #alloc, #execinstr
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S
index d768b5c7b362..86065117c875 100644
--- a/arch/arm/mm/proc-arm922.S
+++ b/arch/arm/mm/proc-arm922.S
@@ -364,25 +364,9 @@ ENTRY(cpu_arm922_set_pte)
mcr p15, 0, r0, c7, c10, 4 @ drain WB
mov pc, lr
-
-ENTRY(cpu_arm922_name)
- .ascii "ARM922T"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
- .ascii "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
- .ascii "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
- .ascii "(wt)"
-#else
- .ascii "(wb)"
-#endif
-#endif
- .ascii "\0"
- .align
-
__INIT
+ .type __arm922_setup, #function
__arm922_setup:
mov r0, #0
mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
@@ -413,8 +397,9 @@ __arm922_setup:
orr r0, r0, #0x1000 @ ...1 .... .... ....
#endif
mov pc, lr
+ .size __arm922_setup, . - __arm922_setup
- .text
+ __INITDATA
/*
* Purpose : Function pointers used to access above functions - all calls
@@ -432,6 +417,8 @@ arm922_processor_functions:
.word cpu_arm922_set_pte
.size arm922_processor_functions, . - arm922_processor_functions
+ .section ".rodata"
+
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv4t"
@@ -441,6 +428,24 @@ cpu_arch_name:
cpu_elf_name:
.asciz "v4"
.size cpu_elf_name, . - cpu_elf_name
+
+ .type cpu_arm922_name, #object
+cpu_arm922_name:
+ .ascii "ARM922T"
+#ifndef CONFIG_CPU_ICACHE_DISABLE
+ .ascii "i"
+#endif
+#ifndef CONFIG_CPU_DCACHE_DISABLE
+ .ascii "d"
+#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
+ .ascii "(wt)"
+#else
+ .ascii "(wb)"
+#endif
+#endif
+ .ascii "\0"
+ .size cpu_arm922_name, . - cpu_arm922_name
+
.align
.section ".proc.info", #alloc, #execinstr
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
index 3709db989c1b..9b098e05c644 100644
--- a/arch/arm/mm/proc-arm926.S
+++ b/arch/arm/mm/proc-arm926.S
@@ -366,28 +366,9 @@ ENTRY(cpu_arm926_set_pte)
mcr p15, 0, r0, c7, c10, 4 @ drain WB
mov pc, lr
-
-ENTRY(cpu_arm926_name)
- .ascii "ARM926EJ-S"
-#ifndef CONFIG_CPU_ICACHE_DISABLE
- .ascii "i"
-#endif
-#ifndef CONFIG_CPU_DCACHE_DISABLE
- .ascii "d"
-#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
- .ascii "(wt)"
-#else
- .ascii "(wb)"
-#endif
-#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
- .ascii "RR"
-#endif
-#endif
- .ascii "\0"
- .align
-
__INIT
+ .type __arm926_setup, #function
__arm926_setup:
mov r0, #0
mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4
@@ -428,8 +409,9 @@ __arm926_setup:
orr r0, r0, #0x1000 @ ...1 .... .... ....
#endif
mov pc, lr
+ .size __arm926_setup, . - __arm926_setup
- .text
+ __INITDATA
/*
* Purpose : Function pointers used to access above functions - all calls
@@ -447,6 +429,8 @@ arm926_processor_functions:
.word cpu_arm926_set_pte
.size arm926_processor_functions, . - arm926_processor_functions
+ .section ".rodata"
+
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv5tej"
@@ -456,6 +440,27 @@ cpu_arch_name:
cpu_elf_name:
.asciz "v5"
.size cpu_elf_name, . - cpu_elf_name
+
+ .type cpu_arm926_name, #object
+cpu_arm926_name:
+ .ascii "ARM926EJ-S"
+#ifndef CONFIG_CPU_ICACHE_DISABLE
+ .ascii "i"
+#endif
+#ifndef CONFIG_CPU_DCACHE_DISABLE
+ .ascii "d"
+#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
+ .ascii "(wt)"
+#else
+ .ascii "(wb)"
+#endif
+#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
+ .ascii "RR"
+#endif
+#endif
+ .ascii "\0"
+ .size cpu_arm926_name, . - cpu_arm926_name
+
.align
.section ".proc.info", #alloc, #execinstr
diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S
index 2743d98ef8bb..d58fce5cc85d 100644
--- a/arch/arm/mm/proc-sa110.S
+++ b/arch/arm/mm/proc-sa110.S
@@ -182,13 +182,9 @@ ENTRY(cpu_sa110_set_pte)
mcr p15, 0, r0, c7, c10, 4 @ drain WB
mov pc, lr
-
-cpu_sa110_name:
- .asciz "StrongARM-110"
- .align
-
__INIT
+ .type __sa110_setup, #function
__sa110_setup:
mrc p15, 0, r0, c1, c0 @ get control register v4
bic r0, r0, #0x2e00 @ ..VI ZFRS BLDP WCAM
@@ -203,8 +199,9 @@ __sa110_setup:
mov r10, #0x1f @ Domains 0, 1 = client
mcr p15, 0, r10, c3, c0 @ load domain access register
mov pc, lr
+ .size __sa110_setup, . - __sa110_setup
- .text
+ __INITDATA
/*
* Purpose : Function pointers used to access above functions - all calls
@@ -218,16 +215,13 @@ ENTRY(sa110_processor_functions)
.word cpu_sa110_proc_fin
.word cpu_sa110_reset
.word cpu_sa110_do_idle
-
- /* dcache */
.word cpu_sa110_dcache_clean_area
-
- /* pgtable */
.word cpu_sa110_switch_mm
.word cpu_sa110_set_pte
-
.size sa110_processor_functions, . - sa110_processor_functions
+ .section ".rodata"
+
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv4"
@@ -237,6 +231,12 @@ cpu_arch_name:
cpu_elf_name:
.asciz "v4"
.size cpu_elf_name, . - cpu_elf_name
+
+ .type cpu_sa110_name, #object
+cpu_sa110_name:
+ .asciz "StrongARM-110"
+ .size cpu_sa110_name, . - cpu_sa110_name
+
.align
.section ".proc.info", #alloc, #execinstr
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S
index f5b44f142991..586f7d16ebf6 100644
--- a/arch/arm/mm/proc-sa1100.S
+++ b/arch/arm/mm/proc-sa1100.S
@@ -206,15 +206,9 @@ ENTRY(cpu_sa1100_set_pte)
mcr p15, 0, r0, c7, c10, 4 @ drain WB
mov pc, lr
-
-cpu_sa1100_name:
- .asciz "StrongARM-1100"
-cpu_sa1110_name:
- .asciz "StrongARM-1110"
- .align
-
__INIT
+ .type __sa1100_setup, #function
__sa1100_setup:
mov r10, #0
mcr p15, 0, r10, c7, c7 @ invalidate I,D caches on v4
@@ -229,8 +223,9 @@ __sa1100_setup:
orr r0, r0, #0x003d
orr r0, r0, #0x3100 @ ..11 ...1 ..11 11.1
mov pc, lr
+ .size __sa1100_setup, . - __sa1100_setup
- .text
+ __INITDATA
/*
* Purpose : Function pointers used to access above functions - all calls
@@ -252,6 +247,8 @@ ENTRY(sa1100_processor_functions)
.word cpu_sa1100_set_pte
.size sa1100_processor_functions, . - sa1100_processor_functions
+ .section ".rodata"
+
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv4"
@@ -261,6 +258,17 @@ cpu_arch_name:
cpu_elf_name:
.asciz "v4"
.size cpu_elf_name, . - cpu_elf_name
+
+ .type cpu_sa1100_name, #object
+cpu_sa1100_name:
+ .asciz "StrongARM-1100"
+ .size cpu_sa1100_name, . - cpu_sa1100_name
+
+ .type cpu_sa1110_name, #object
+cpu_sa1110_name:
+ .asciz "StrongARM-1110"
+ .size cpu_sa1110_name, . - cpu_sa1110_name
+
.align
.section ".proc.info", #alloc, #execinstr
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 45449460e362..9e7f3f0a0224 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -571,22 +571,11 @@ ENTRY(cpu_xscale_set_pte)
.ltorg
-cpu_80200_name:
- .asciz "XScale-80200"
-
-cpu_80321_name:
- .asciz "XScale-IOP80321"
-
-cpu_pxa250_name:
- .asciz "XScale-PXA250"
-
-cpu_pxa210_name:
- .asciz "XScale-PXA210"
-
.align
__INIT
+ .type __xscale_setup, #function
__xscale_setup:
mov r0, #PSR_F_BIT|PSR_I_BIT|SVC_MODE
msr cpsr_c, r0
@@ -605,8 +594,9 @@ __xscale_setup:
orr r0, r0, #0x0005 @ .... .... .... .C.M
orr r0, r0, #0x3900 @ ..VI Z..S .... ....
mov pc, lr
+ .size __xscale_setup, . - __xscale_setup
- .text
+ __INITDATA
/*
* Purpose : Function pointers used to access above functions - all calls
@@ -625,6 +615,8 @@ ENTRY(xscale_processor_functions)
.word cpu_xscale_set_pte
.size xscale_processor_functions, . - xscale_processor_functions
+ .section ".rodata"
+
.type cpu_arch_name, #object
cpu_arch_name:
.asciz "armv5te"
@@ -634,6 +626,27 @@ cpu_arch_name:
cpu_elf_name:
.asciz "v5"
.size cpu_elf_name, . - cpu_elf_name
+
+ .type cpu_80200_name, #object
+cpu_80200_name:
+ .asciz "XScale-80200"
+ .size cpu_80200_name, . - cpu_80200_name
+
+ .type cpu_80321_name, #object
+cpu_80321_name:
+ .asciz "XScale-IOP80321"
+ .size cpu_80321_name, . - cpu_80321_name
+
+ .type cpu_pxa250_name, #object
+cpu_pxa250_name:
+ .asciz "XScale-PXA250"
+ .size cpu_pxa250_name, . - cpu_pxa250_name
+
+ .type cpu_pxa210_name, #object
+cpu_pxa210_name:
+ .asciz "XScale-PXA210"
+ .size cpu_pxa210_name, . - cpu_pxa210_name
+
.align
.section ".proc.info", #alloc, #execinstr
diff --git a/arch/arm/mm/tlb-v3.S b/arch/arm/mm/tlb-v3.S
index 8b2019203f02..44b0daeaff9b 100644
--- a/arch/arm/mm/tlb-v3.S
+++ b/arch/arm/mm/tlb-v3.S
@@ -42,7 +42,7 @@ ENTRY(v3_flush_kern_tlb_range)
blo 1b
mov pc, lr
- __INIT
+ __INITDATA
.type v3_tlb_fns, #object
ENTRY(v3_tlb_fns)
diff --git a/arch/arm/mm/tlb-v4.S b/arch/arm/mm/tlb-v4.S
index 23771c38b3f2..0c7329f9c38a 100644
--- a/arch/arm/mm/tlb-v4.S
+++ b/arch/arm/mm/tlb-v4.S
@@ -55,7 +55,7 @@ ENTRY(v4_flush_user_tlb_range)
.globl v4_flush_kern_tlb_range
.equ v4_flush_kern_tlb_range, .v4_flush_kern_tlb_range
- __INIT
+ __INITDATA
.type v4_tlb_fns, #object
ENTRY(v4_tlb_fns)
diff --git a/arch/arm/mm/tlb-v4wb.S b/arch/arm/mm/tlb-v4wb.S
index 3444855fb646..15dc83d10397 100644
--- a/arch/arm/mm/tlb-v4wb.S
+++ b/arch/arm/mm/tlb-v4wb.S
@@ -67,7 +67,7 @@ ENTRY(v4wb_flush_kern_tlb_range)
blo 1b
mov pc, lr
- __INIT
+ __INITDATA
.type v4wb_tlb_fns, #object
ENTRY(v4wb_tlb_fns)
diff --git a/arch/arm/mm/tlb-v4wbi.S b/arch/arm/mm/tlb-v4wbi.S
index ecbdcd0b981a..4675a426de21 100644
--- a/arch/arm/mm/tlb-v4wbi.S
+++ b/arch/arm/mm/tlb-v4wbi.S
@@ -58,7 +58,7 @@ ENTRY(v4wbi_flush_kern_tlb_range)
blo 1b
mov pc, lr
- __INIT
+ __INITDATA
.type v4wbi_tlb_fns, #object
ENTRY(v4wbi_tlb_fns)
diff --git a/arch/arm/nwfpe/fpa11.c b/arch/arm/nwfpe/fpa11.c
index 2fa0608152c5..bf61696865ec 100644
--- a/arch/arm/nwfpe/fpa11.c
+++ b/arch/arm/nwfpe/fpa11.c
@@ -26,6 +26,7 @@
#include "fpmodule.h"
#include "fpmodule.inl"
+#include <linux/config.h>
#include <linux/compiler.h>
#include <linux/string.h>
#include <asm/system.h>
diff --git a/arch/arm/nwfpe/fpa11.h b/arch/arm/nwfpe/fpa11.h
index 1b58bfdde481..c3f14c7aa9c9 100644
--- a/arch/arm/nwfpe/fpa11.h
+++ b/arch/arm/nwfpe/fpa11.h
@@ -33,6 +33,7 @@ register unsigned int *user_registers asm("sl");
#define GET_USERREG() (user_registers)
+#include <linux/config.h>
#include <linux/thread_info.h>
/* includes */
diff --git a/arch/arm/nwfpe/fpa11_cpdo.c b/arch/arm/nwfpe/fpa11_cpdo.c
index 02601af35012..1bea67437b6f 100644
--- a/arch/arm/nwfpe/fpa11_cpdo.c
+++ b/arch/arm/nwfpe/fpa11_cpdo.c
@@ -20,6 +20,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <linux/config.h>
#include "fpa11.h"
#include "fpopcode.h"
diff --git a/arch/arm/nwfpe/fpa11_cpdt.c b/arch/arm/nwfpe/fpa11_cpdt.c
index 384528b85cc8..59e3197d6d54 100644
--- a/arch/arm/nwfpe/fpa11_cpdt.c
+++ b/arch/arm/nwfpe/fpa11_cpdt.c
@@ -20,6 +20,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <linux/config.h>
#include "fpa11.h"
#include "softfloat.h"
#include "fpopcode.h"
diff --git a/arch/arm/nwfpe/fpa11_cprt.c b/arch/arm/nwfpe/fpa11_cprt.c
index a656ed488fe5..db01fbc97216 100644
--- a/arch/arm/nwfpe/fpa11_cprt.c
+++ b/arch/arm/nwfpe/fpa11_cprt.c
@@ -20,6 +20,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <linux/config.h>
#include "fpa11.h"
#include "fpopcode.h"
#include "fpa11.inl"
diff --git a/arch/arm/nwfpe/fpopcode.c b/arch/arm/nwfpe/fpopcode.c
index 1d4e89b63165..4c9f5703148c 100644
--- a/arch/arm/nwfpe/fpopcode.c
+++ b/arch/arm/nwfpe/fpopcode.c
@@ -19,6 +19,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <linux/config.h>
#include "fpa11.h"
#include "softfloat.h"
#include "fpopcode.h"
diff --git a/arch/arm/nwfpe/fpopcode.h b/arch/arm/nwfpe/fpopcode.h
index 6fa6d54be2ed..8035f4faafbf 100644
--- a/arch/arm/nwfpe/fpopcode.h
+++ b/arch/arm/nwfpe/fpopcode.h
@@ -23,6 +23,8 @@
#ifndef __FPOPCODE_H__
#define __FPOPCODE_H__
+#include <linux/config.h>
+
/*
ARM Floating Point Instruction Classes
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
diff --git a/arch/arm/nwfpe/softfloat.h b/arch/arm/nwfpe/softfloat.h
index 6678c382a4d7..1e1743173899 100644
--- a/arch/arm/nwfpe/softfloat.h
+++ b/arch/arm/nwfpe/softfloat.h
@@ -32,6 +32,8 @@ this code that are retained.
#ifndef __SOFTFLOAT_H__
#define __SOFTFLOAT_H__
+#include <linux/config.h>
+
/*
-------------------------------------------------------------------------------
The macro `FLOATX80' must be defined to enable the extended double-precision
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index ed9f9e4c2506..37df1bd8456d 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -6,7 +6,7 @@
# To add an entry into this database, please see Documentation/arm/README,
# or contact rmk@arm.linux.org.uk
#
-# Last update: Sat Sep 13 00:22:34 2003
+# Last update: Thu Sep 18 17:15:55 2003
#
# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
#
@@ -384,3 +384,4 @@ prayoglite ARCH_PRAYOGLITE PRAYOGLITE 372
gumstik ARCH_GUMSTIK GUMSTIK 373
rcube ARCH_RCUBE RCUBE 374
rea_olv ARCH_REA_OLV REA_OLV 375
+pxa_iphone ARCH_PXA_IPHONE PXA_IPHONE 376
diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c
index 8db25723b077..727b420fadca 100644
--- a/arch/h8300/kernel/signal.c
+++ b/arch/h8300/kernel/signal.c
@@ -593,7 +593,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
continue;
case SIGTSTP: case SIGTTIN: case SIGTTOU:
- if (is_orphaned_pgrp(current->pgrp))
+ if (is_orphaned_pgrp(process_group(current)))
continue;
/* FALLTHRU */
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 6651e1941eaa..036a2a4d73a1 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -2008,7 +2008,7 @@ static int __init apm_init(void)
if (apm_proc)
apm_proc->owner = THIS_MODULE;
- kernel_thread(apm, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND | SIGCHLD);
+ kernel_thread(apm, NULL, CLONE_KERNEL | SIGCHLD);
if (num_online_cpus() > 1 && !smp ) {
printk(KERN_NOTICE
diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
index 55b1c3378cd8..e3632cbf0da8 100644
--- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/i386/kernel/cpu/cpufreq/powernow-k7.c
@@ -196,6 +196,7 @@ static void change_FID(int fid)
if (fidvidctl.bits.FID != fid) {
fidvidctl.bits.SGTC = latency;
fidvidctl.bits.FID = fid;
+ fidvidctl.bits.VIDC = 0;
fidvidctl.bits.FIDC = 1;
wrmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val);
}
@@ -208,7 +209,9 @@ static void change_VID(int vid)
rdmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val);
if (fidvidctl.bits.VID != vid) {
+ fidvidctl.bits.SGTC = latency;
fidvidctl.bits.VID = vid;
+ fidvidctl.bits.FIDC = 0;
fidvidctl.bits.VIDC = 1;
wrmsrl (MSR_K7_FID_VID_CTL, fidvidctl.val);
}
@@ -298,8 +301,14 @@ static int powernow_decode_bios (int maxfid, int startvid)
dprintk (" voltage regulator)\n");
latency = psb->settlingtime;
+ if (latency < 100) {
+ printk (KERN_INFO PFX "BIOS set settling time to %d microseconds."
+ "Should be at least 100. Correcting.\n", latency);
+ latency = 100;
+ }
dprintk (KERN_INFO PFX "Settling Time: %d microseconds.\n", psb->settlingtime);
dprintk (KERN_INFO PFX "Has %d PST tables. (Only dumping ones relevant to this CPU).\n", psb->numpst);
+ latency *= 100; /* SGTC needs to be in units of 10ns */
p += sizeof (struct psb_s);
diff --git a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c
index 3f0ff9887da5..b5ae16027f55 100644
--- a/arch/i386/kernel/cpu/mtrr/if.c
+++ b/arch/i386/kernel/cpu/mtrr/if.c
@@ -13,7 +13,6 @@
/* RED-PEN: this is accessed without any locking */
extern unsigned int *usage_table;
-static int mtrr_seq_show(struct seq_file *seq, void *offset);
#define FILE_FCOUNT(f) (((struct seq_file *)((f)->private_data))->private)
@@ -33,6 +32,8 @@ char *mtrr_attrib_to_str(int x)
return (x <= 6) ? mtrr_strings[x] : "?";
}
+#ifdef CONFIG_PROC_FS
+
static int
mtrr_file_add(unsigned long base, unsigned long size,
unsigned int type, char increment, struct file *file, int page)
@@ -291,6 +292,8 @@ mtrr_close(struct inode *ino, struct file *file)
return single_release(ino, file);
}
+static int mtrr_seq_show(struct seq_file *seq, void *offset);
+
static int mtrr_open(struct inode *inode, struct file *file)
{
if (!mtrr_if)
@@ -310,11 +313,9 @@ static struct file_operations mtrr_fops = {
.release = mtrr_close,
};
-# ifdef CONFIG_PROC_FS
static struct proc_dir_entry *proc_root_mtrr;
-# endif /* CONFIG_PROC_FS */
static int mtrr_seq_show(struct seq_file *seq, void *offset)
{
@@ -351,15 +352,14 @@ static int mtrr_seq_show(struct seq_file *seq, void *offset)
static int __init mtrr_if_init(void)
{
-#ifdef CONFIG_PROC_FS
proc_root_mtrr =
create_proc_entry("mtrr", S_IWUSR | S_IRUGO, &proc_root);
if (proc_root_mtrr) {
proc_root_mtrr->owner = THIS_MODULE;
proc_root_mtrr->proc_fops = &mtrr_fops;
}
-#endif
return 0;
}
arch_initcall(mtrr_if_init);
+#endif /* CONFIG_PROC_FS */
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
index 38b72b42f877..4b770c5dfe8b 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/i386/kernel/i386_ksyms.c
@@ -63,9 +63,6 @@ extern unsigned long get_cmos_time(void);
/* platform dependent support */
EXPORT_SYMBOL(boot_cpu_data);
-#ifdef CONFIG_EISA
-EXPORT_SYMBOL(EISA_bus);
-#endif
EXPORT_SYMBOL(MCA_bus);
#ifdef CONFIG_DISCONTIGMEM
EXPORT_SYMBOL(node_data);
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 9426f8d59a2b..e33a9d439acf 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -1143,6 +1143,7 @@ int irq_vector[NR_IRQS] = { FIRST_DEVICE_VECTOR , 0 };
static int __init assign_irq_vector(int irq)
{
static int current_vector = FIRST_DEVICE_VECTOR, offset = 0;
+ BUG_ON(irq >= NR_IRQS);
if (IO_APIC_VECTOR(irq) > 0)
return IO_APIC_VECTOR(irq);
next:
@@ -1652,6 +1653,10 @@ static void __init setup_ioapic_ids_from_mpc(void)
mp_ioapics[apic].mpc_apicid = reg_00.bits.ID;
}
+ /* Don't check I/O APIC IDs for some xAPIC systems. They have
+ * no meaning without the serial APIC bus. */
+ if (NO_IOAPIC_CHECK)
+ continue;
/*
* Sanity check, is the ID really free? Every APIC in a
* system must have a unique ID or we get lots of nice
diff --git a/arch/i386/kernel/numaq.c b/arch/i386/kernel/numaq.c
index 032e9a8d8768..a3e650b71f09 100644
--- a/arch/i386/kernel/numaq.c
+++ b/arch/i386/kernel/numaq.c
@@ -99,8 +99,14 @@ static void __init initialize_physnode_map(void)
}
}
-void __init get_memcfg_numaq(void)
+/*
+ * Unlike Summit, we don't really care to let the NUMA-Q
+ * fall back to flat mode. Don't compile for NUMA-Q
+ * unless you really need it!
+ */
+int __init get_memcfg_numaq(void)
{
smp_dump_qct();
initialize_physnode_map();
+ return 1;
}
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index a78d1cc88a1f..2d034f0374cc 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -915,13 +915,13 @@ static void smp_tune_scheduling (void)
cacheflush_time = (cpu_khz>>10) * (cachesize<<10) / bandwidth;
}
- cache_decay_ticks = (long)cacheflush_time/cpu_khz * HZ / 1000;
+ cache_decay_ticks = (long)cacheflush_time/cpu_khz + 1;
printk("per-CPU timeslice cutoff: %ld.%02ld usecs.\n",
(long)cacheflush_time/(cpu_khz/1000),
((long)cacheflush_time*100/(cpu_khz/1000)) % 100);
printk("task migration cache decay timeout: %ld msecs.\n",
- (cache_decay_ticks + 1) * 1000 / HZ);
+ cache_decay_ticks);
}
/*
diff --git a/arch/i386/kernel/srat.c b/arch/i386/kernel/srat.c
index 10906732862b..8c0bd561f4d6 100644
--- a/arch/i386/kernel/srat.c
+++ b/arch/i386/kernel/srat.c
@@ -239,6 +239,11 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp)
}
}
+ if (num_memory_chunks == 0) {
+ printk("could not finy any ACPI SRAT memory areas.\n");
+ goto out_fail;
+ }
+
/* Calculate total number of nodes in system from PXM bitmap and create
* a set of sequential node IDs starting at zero. (ACPI doesn't seem
* to specify the range of _PXM values.)
@@ -295,10 +300,12 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp)
}
}
}
+ return 1;
+out_fail:
return 0;
}
-void __init get_memcfg_from_srat(void)
+int __init get_memcfg_from_srat(void)
{
struct acpi_table_header *header = NULL;
struct acpi_table_rsdp *rsdp = NULL;
@@ -316,11 +323,11 @@ void __init get_memcfg_from_srat(void)
(u32)rsdp_address->pointer.physical;
} else {
printk("%s: rsdp_address is not a physical pointer\n", __FUNCTION__);
- return;
+ goto out_err;
}
if (!rsdp) {
printk("%s: Didn't find ACPI root!\n", __FUNCTION__);
- return;
+ goto out_err;
}
printk(KERN_INFO "%.8s v%d [%.6s]\n", rsdp->signature, rsdp->revision,
@@ -328,7 +335,7 @@ void __init get_memcfg_from_srat(void)
if (strncmp(rsdp->signature, RSDP_SIG,strlen(RSDP_SIG))) {
printk(KERN_WARNING "%s: RSDP table signature incorrect\n", __FUNCTION__);
- return;
+ goto out_err;
}
rsdt = (struct acpi_table_rsdt *)
@@ -338,14 +345,14 @@ void __init get_memcfg_from_srat(void)
printk(KERN_WARNING
"%s: ACPI: Invalid root system description tables (RSDT)\n",
__FUNCTION__);
- return;
+ goto out_err;
}
header = & rsdt->header;
if (strncmp(header->signature, RSDT_SIG, strlen(RSDT_SIG))) {
printk(KERN_WARNING "ACPI: RSDT signature incorrect\n");
- return;
+ goto out_err;
}
/*
@@ -356,15 +363,18 @@ void __init get_memcfg_from_srat(void)
*/
tables = (header->length - sizeof(struct acpi_table_header)) / 4;
+ if (!tables)
+ goto out_err;
+
memcpy(&saved_rsdt, rsdt, sizeof(saved_rsdt));
if (saved_rsdt.header.length > sizeof(saved_rsdt)) {
printk(KERN_WARNING "ACPI: Too big length in RSDT: %d\n",
saved_rsdt.header.length);
- return;
+ goto out_err;
}
-printk("Begin table scan....\n");
+ printk("Begin SRAT table scan....\n");
for (i = 0; i < tables; i++) {
/* Map in header, then map in full table length. */
@@ -379,10 +389,13 @@ printk("Begin table scan....\n");
if (strncmp((char *) &header->signature, "SRAT", 4))
continue;
- acpi20_parse_srat((struct acpi_table_srat *)header);
+
/* we've found the srat table. don't need to look at any more tables */
- break;
+ return acpi20_parse_srat((struct acpi_table_srat *)header);
}
+out_err:
+ printk("failed to get NUMA memory information from SRAT table\n");
+ return 0;
}
/* For each node run the memory list to determine whether there are
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index af912f4d2cf1..f8b3c918a955 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -127,6 +127,30 @@ static unsigned long long monotonic_clock_tsc(void)
return base + cycles_2_ns(this_offset - last_offset);
}
+/*
+ * Scheduler clock - returns current time in nanosec units.
+ */
+unsigned long long sched_clock(void)
+{
+ unsigned long long this_offset;
+
+ /*
+ * In the NUMA case we dont use the TSC as they are not
+ * synchronized across all CPUs.
+ */
+#ifndef CONFIG_NUMA
+ if (unlikely(!cpu_has_tsc))
+#endif
+ return (unsigned long long)jiffies * (1000000000 / HZ);
+
+ /* Read the Time Stamp Counter */
+ rdtscll(this_offset);
+
+ /* return the value in ns */
+ return cycles_2_ns(this_offset);
+}
+
+
static void mark_offset_tsc(void)
{
unsigned long lost,delay;
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index a22eb78ae0b0..fa0935e3510f 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -28,6 +28,7 @@
#ifdef CONFIG_EISA
#include <linux/ioport.h>
+#include <linux/eisa.h>
#endif
#ifdef CONFIG_MCA
@@ -832,10 +833,6 @@ static void __init set_task_gate(unsigned int n, unsigned int gdt_entry)
}
-#ifdef CONFIG_EISA
-int EISA_bus;
-#endif
-
void __init trap_init(void)
{
#ifdef CONFIG_EISA
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c
index aadfcb53b6d0..e613ef8e7014 100644
--- a/arch/i386/mm/discontig.c
+++ b/arch/i386/mm/discontig.c
@@ -30,6 +30,7 @@
#include <linux/initrd.h>
#include <asm/e820.h>
#include <asm/setup.h>
+#include <asm/mmzone.h>
struct pglist_data *node_data[MAX_NUMNODES];
bootmem_data_t node0_bdata;
@@ -84,7 +85,7 @@ void set_pmd_pfn(unsigned long vaddr, unsigned long pfn, pgprot_t flags);
* a single node with all available processors in it with a flat
* memory map.
*/
-void __init get_memcfg_numa_flat(void)
+int __init get_memcfg_numa_flat(void)
{
int pfn;
@@ -107,6 +108,7 @@ void __init get_memcfg_numa_flat(void)
/* Indicate there is one node available. */
node_set_online(0);
numnodes = 1;
+ return 1;
}
/*
@@ -355,17 +357,20 @@ void __init zone_sizes_init(void)
unsigned long low = max_low_pfn;
unsigned long start = node_start_pfn[nid];
unsigned long high = node_end_pfn[nid];
-
+
max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
if (start > low) {
#ifdef CONFIG_HIGHMEM
- zones_size[ZONE_HIGHMEM] = high - start;
+ BUG_ON(start > high);
+ zones_size[ZONE_HIGHMEM] = high - start;
#endif
} else {
if (low < max_dma)
zones_size[ZONE_DMA] = low;
else {
+ BUG_ON(max_dma > low);
+ BUG_ON(low > high);
zones_size[ZONE_DMA] = max_dma;
zones_size[ZONE_NORMAL] = low - max_dma;
#ifdef CONFIG_HIGHMEM
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index a34c4788b99e..ffef70740670 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -413,6 +413,16 @@ config IA64_PALINFO
To use this option, you have to ensure that the "/proc file system
support" (CONFIG_PROC_FS) is enabled, too.
+config IA64_SALINFO
+ tristate "/proc/sal support"
+ help
+ The /proc/sal directory exports the SAL (system abstraction layer)
+ feature bits, like whether the platform is subject to ITC drift. It
+ is intended to be used by user programs that care about such things.
+
+ To use this option, you have to ensure that the "/proc file system
+ support" (CONFIG_PROC_FS) is enabled, too.
+
config EFI_VARS
tristate "/proc/efi/vars support"
help
@@ -424,9 +434,15 @@ config EFI_VARS
support" (CONFIG_PROC_FS) is enabled, too.
config NR_CPUS
- int "Maximum number of CPUs (2-64)"
+ int "Maximum number of CPUs"
depends on SMP
default "64"
+ help
+ You should set this to the number of CPUs in your system, but
+ keep in mind that a kernel compiled for, e.g., 2 CPUs will boot but
+ only use 2 CPUs on a >2 CPU system. Setting this to a value larger
+ than 64 will cause the use of a CPU mask array, causing a small
+ performance hit.
source "fs/Kconfig.binfmt"
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index 59220cccf9b3..fe8278fc8c31 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -54,6 +54,11 @@
*/
#define ALLOW_IOV_BYPASS
+#ifdef CONFIG_PROC_FS
+ /* turn it off for now; without per-CPU counters, it's too much of a scalability bottleneck: */
+# define SBA_PROC_FS 0
+#endif
+
/*
** If a device prefetches beyond the end of a valid pdir entry, it will cause
** a hard failure, ie. MCA. Version 3.0 and later of the zx1 LBA should
@@ -193,7 +198,7 @@ struct ioc {
} saved[DELAYED_RESOURCE_CNT];
#endif
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
#define SBA_SEARCH_SAMPLE 0x100
unsigned long avg_search[SBA_SEARCH_SAMPLE];
unsigned long avg_idx; /* current index into avg_search */
@@ -517,7 +522,7 @@ static int
sba_alloc_range(struct ioc *ioc, size_t size)
{
unsigned int pages_needed = size >> IOVP_SHIFT;
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
unsigned long itc_start = ia64_get_itc();
#endif
unsigned long pide;
@@ -551,7 +556,7 @@ sba_alloc_range(struct ioc *ioc, size_t size)
(uint) ((unsigned long) ioc->res_hint - (unsigned long) ioc->res_map),
ioc->res_bitshift );
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
{
unsigned long itc_end = ia64_get_itc();
unsigned long tmp = itc_end - itc_start;
@@ -593,7 +598,7 @@ sba_free_range(struct ioc *ioc, dma_addr_t iova, size_t size)
__FUNCTION__, (uint) iova, size,
bits_not_wanted, m, pide, res_ptr, *res_ptr);
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
ioc->used_pages -= bits_not_wanted;
#endif
@@ -785,7 +790,7 @@ sba_map_single(struct device *dev, void *addr, size_t size, int dir)
** Device is bit capable of DMA'ing to the buffer...
** just return the PCI address of ptr
*/
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
spin_lock_irqsave(&ioc->res_lock, flags);
ioc->msingle_bypass++;
spin_unlock_irqrestore(&ioc->res_lock, flags);
@@ -811,7 +816,7 @@ sba_map_single(struct device *dev, void *addr, size_t size, int dir)
panic("Sanity check failed");
#endif
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
ioc->msingle_calls++;
ioc->msingle_pages += size >> IOVP_SHIFT;
#endif
@@ -870,7 +875,7 @@ void sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size, int dir)
/*
** Address does not fall w/in IOVA, must be bypassing
*/
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
spin_lock_irqsave(&ioc->res_lock, flags);
ioc->usingle_bypass++;
spin_unlock_irqrestore(&ioc->res_lock, flags);
@@ -895,7 +900,7 @@ void sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size, int dir)
size = ROUNDUP(size, IOVP_SIZE);
spin_lock_irqsave(&ioc->res_lock, flags);
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
ioc->usingle_calls++;
ioc->usingle_pages += size >> IOVP_SHIFT;
#endif
@@ -957,20 +962,20 @@ void sba_unmap_single(struct device *dev, dma_addr_t iova, size_t size, int dir)
/**
- * sba_alloc_consistent - allocate/map shared mem for DMA
- * @hwdev: instance of PCI owned by the driver that's asking.
+ * sba_alloc_coherent - allocate/map shared mem for DMA
+ * @dev: instance of PCI owned by the driver that's asking.
* @size: number of bytes mapped in driver buffer.
* @dma_handle: IOVA of new buffer.
*
* See Documentation/DMA-mapping.txt
*/
void *
-sba_alloc_coherent (struct device *hwdev, size_t size, dma_addr_t *dma_handle, int flags)
+sba_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, int flags)
{
struct ioc *ioc;
void *addr;
- addr = (void *) __get_free_pages(flags, get_order(size));
+ addr = (void *) __get_free_pages(flags, get_order(size));
if (!addr)
return NULL;
@@ -978,7 +983,7 @@ sba_alloc_coherent (struct device *hwdev, size_t size, dma_addr_t *dma_handle, i
* REVISIT: if sba_map_single starts needing more than dma_mask from the
* device, this needs to be updated.
*/
- ioc = GET_IOC(hwdev);
+ ioc = GET_IOC(dev);
ASSERT(ioc);
*dma_handle = sba_map_single(&ioc->sac_only_dev->dev, addr, size, 0);
@@ -988,17 +993,17 @@ sba_alloc_coherent (struct device *hwdev, size_t size, dma_addr_t *dma_handle, i
/**
- * sba_free_consistent - free/unmap shared mem for DMA
- * @hwdev: instance of PCI owned by the driver that's asking.
+ * sba_free_coherent - free/unmap shared mem for DMA
+ * @dev: instance of PCI owned by the driver that's asking.
* @size: number of bytes mapped in driver buffer.
* @vaddr: virtual address IOVA of "consistent" buffer.
* @dma_handler: IO virtual address of "consistent" buffer.
*
* See Documentation/DMA-mapping.txt
*/
-void sba_free_coherent (struct device *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle)
+void sba_free_coherent (struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle)
{
- sba_unmap_single(hwdev, dma_handle, size, 0);
+ sba_unmap_single(dev, dma_handle, size, 0);
free_pages((unsigned long) vaddr, get_order(size));
}
@@ -1078,7 +1083,7 @@ sba_fill_pdir(
cnt += dma_offset;
dma_offset=0; /* only want offset on first chunk */
cnt = ROUNDUP(cnt, IOVP_SIZE);
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
ioc->msg_pages += cnt >> IOVP_SHIFT;
#endif
do {
@@ -1268,7 +1273,7 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di
sg->dma_length = sg->length;
sg->dma_address = virt_to_phys(sba_sg_address(sg));
}
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
spin_lock_irqsave(&ioc->res_lock, flags);
ioc->msg_bypass++;
spin_unlock_irqrestore(&ioc->res_lock, flags);
@@ -1281,7 +1286,7 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di
sglist->dma_length = sglist->length;
sglist->dma_address = sba_map_single(dev, sba_sg_address(sglist), sglist->length,
dir);
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
/*
** Should probably do some stats counting, but trying to
** be precise quickly starts wasting CPU time.
@@ -1300,7 +1305,7 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di
}
#endif
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
ioc->msg_calls++;
#endif
@@ -1363,7 +1368,7 @@ void sba_unmap_sg (struct device *dev, struct scatterlist *sglist, int nents, in
ioc = GET_IOC(dev);
ASSERT(ioc);
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
ioc->usg_calls++;
#endif
@@ -1376,7 +1381,7 @@ void sba_unmap_sg (struct device *dev, struct scatterlist *sglist, int nents, in
while (nents && sglist->dma_length) {
sba_unmap_single(dev, sglist->dma_address, sglist->dma_length, dir);
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
/*
** This leaves inconsistent data in the stats, but we can't
** tell which sg lists were mapped by map_single and which
@@ -1704,7 +1709,7 @@ ioc_init(u64 hpa, void *handle)
**
**************************************************************************/
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
static void *
ioc_start(struct seq_file *s, loff_t *pos)
{
@@ -1758,7 +1763,7 @@ ioc_show(struct seq_file *s, void *v)
if (ioc->avg_search[i] > max) max = ioc->avg_search[i];
if (ioc->avg_search[i] < min) min = ioc->avg_search[i];
}
- avg /= SBA_SEARCH_SAMPLE;
+ avg /= SBA_SEARCH_SAMPLE;
seq_printf(s, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n", min, avg, max);
seq_printf(s, "pci_map_single(): %12ld calls %12ld pages (avg %d/1000)\n",
@@ -1859,7 +1864,7 @@ ioc_proc_init(void)
}
#endif
-void
+static void
sba_connect_bus(struct pci_bus *bus)
{
acpi_handle handle, parent;
@@ -1867,7 +1872,7 @@ sba_connect_bus(struct pci_bus *bus)
struct ioc *ioc;
if (!PCI_CONTROLLER(bus))
- panic(PFX "no sysdata on bus %d!\n",bus->number);
+ panic(PFX "no sysdata on bus %d!\n", bus->number);
if (PCI_CONTROLLER(bus)->iommu)
return;
@@ -1950,7 +1955,7 @@ sba_init(void)
}
#endif
-#ifdef CONFIG_PROC_FS
+#if SBA_PROC_FS
ioc_proc_init();
#endif
return 0;
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index fcd6d712757e..d4931dc98dbd 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -76,6 +76,7 @@
#define OFFSET4K(a) ((a) & 0xfff)
#define PAGE_START(addr) ((addr) & PAGE_MASK)
+#define MINSIGSTKSZ_IA32 2048
#define high2lowuid(uid) ((uid) > 65535 ? 65534 : (uid))
#define high2lowgid(gid) ((gid) > 65535 ? 65534 : (gid))
@@ -2262,10 +2263,18 @@ sys32_sigaltstack (ia32_stack_t *uss32, ia32_stack_t *uoss32,
return -EFAULT;
uss.ss_sp = (void *) (long) buf32.ss_sp;
uss.ss_flags = buf32.ss_flags;
- uss.ss_size = buf32.ss_size;
+ /* MINSIGSTKSZ is different for ia32 vs ia64. We lie here to pass the
+ check and set it to the user requested value later */
+ if (buf32.ss_size < MINSIGSTKSZ_IA32) {
+ ret = -ENOMEM;
+ goto out;
+ }
+ uss.ss_size = MINSIGSTKSZ;
set_fs(KERNEL_DS);
ret = do_sigaltstack(uss32 ? &uss : NULL, &uoss, pt->r12);
+ current->sas_ss_size = buf32.ss_size;
set_fs(old_fs);
+out:
if (ret < 0)
return(ret);
if (uoss32) {
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index c865b48e2b16..5c0ea19a28ac 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_IA64_GENERIC) += acpi-ext.o
obj-$(CONFIG_IA64_HP_ZX1) += acpi-ext.o
obj-$(CONFIG_IA64_MCA) += mca.o mca_asm.o
obj-$(CONFIG_IA64_PALINFO) += palinfo.o
+obj-$(CONFIG_IA64_SALINFO) += salinfo.o
obj-$(CONFIG_IOSAPIC) += iosapic.o
obj-$(CONFIG_MODULES) += module.o
obj-$(CONFIG_SMP) += smp.o smpboot.o
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 6ee74e2ef0b9..d446f47a0ec4 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -331,7 +331,7 @@ acpi_parse_madt (unsigned long phys_addr, unsigned long size)
#ifdef CONFIG_ACPI_NUMA
-#define SLIT_DEBUG
+#undef SLIT_DEBUG
#define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32)
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 8941b976474d..f942f077cf41 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -446,10 +446,12 @@ efi_map_pal_code (void)
panic("Woah! PAL code size bigger than a granule!");
mask = ~((1 << IA64_GRANULE_SHIFT) - 1);
+#if EFI_DEBUG
printk(KERN_INFO "CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n",
smp_processor_id(), md->phys_addr,
md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT),
vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE);
+#endif
/*
* Cannot write to CRx with PSR.ic=1
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index ad80148825ed..b98ff5045104 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -1193,7 +1193,7 @@ static void
ia64_mca_cmc_poll (unsigned long dummy)
{
/* Trigger a CMC interrupt cascade */
- platform_send_ipi(__ffs(cpu_online_map), IA64_CMCP_VECTOR, IA64_IPI_DM_INT, 0);
+ platform_send_ipi(first_cpu(cpu_online_map), IA64_CMCP_VECTOR, IA64_IPI_DM_INT, 0);
}
/*
@@ -1260,7 +1260,7 @@ static void
ia64_mca_cpe_poll (unsigned long dummy)
{
/* Trigger a CPE interrupt cascade */
- platform_send_ipi(__ffs(cpu_online_map), IA64_CPEP_VECTOR, IA64_IPI_DM_INT, 0);
+ platform_send_ipi(first_cpu(cpu_online_map), IA64_CPEP_VECTOR, IA64_IPI_DM_INT, 0);
}
/*
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 274f7afeb907..c5d8dcb5ddf9 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2905,7 +2905,7 @@ pfm_write_pmcs(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
* - system-wide session: PMCx.pm=1 (privileged monitor)
* - per-task : PMCx.pm=0 (user monitor)
*/
- if ((is_monitor || is_counting) && value != PMC_DFL_VAL(i) && PFM_CHECK_PMC_PM(ctx, cnum, value)) {
+ if ((is_monitor || is_counting) && value != PMC_DFL_VAL(cnum) && PFM_CHECK_PMC_PM(ctx, cnum, value)) {
DPRINT(("pmc%u pmc_pm=%ld fl_system=%d\n",
cnum,
PMC_PM(cnum, value),
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index 04f8740c69ab..6e1707866c50 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -5,6 +5,7 @@
*
* Copyright (c) 2001 Silicon Graphics, Inc. All rights reserved.
*
+ * 09/11/2003 jbarnes@sgi.com updated for 2.6
* 10/30/2001 jbarnes@sgi.com copied much of Stephane's palinfo
* code to create this file
*/
@@ -59,7 +60,7 @@ salinfo_init(void)
*sdir = create_proc_read_entry (salinfo_entries[i].name, 0, salinfo_dir,
salinfo_read, (void *)salinfo_entries[i].feature);
if (*sdir)
- *sdir->owner = THIS_MODULE;
+ (*sdir)->owner = THIS_MODULE;
sdir++;
}
*sdir++ = salinfo_dir;
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 156401c955f5..3c060585d455 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -187,7 +187,7 @@ static inline void
ia64_do_profile (struct pt_regs * regs)
{
unsigned long ip, slot;
- extern unsigned long prof_cpu_mask;
+ extern cpumask_t prof_cpu_mask;
profile_hook(regs);
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index 2e6cd77d0350..522d5b3a4bf7 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -568,10 +568,10 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
}
siginfo.si_signo = SIGTRAP;
siginfo.si_errno = 0;
- siginfo.si_flags = 0;
- siginfo.si_isr = 0;
- siginfo.si_addr = (void *) ifa;
- siginfo.si_imm = 0;
+ siginfo.si_addr = (void *) ifa;
+ siginfo.si_imm = 0;
+ siginfo.si_flags = __ISR_VALID;
+ siginfo.si_isr = isr;
force_sig_info(SIGTRAP, &siginfo, current);
return;
diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c
index 96180f87640c..5695b14fd468 100644
--- a/arch/ia64/kernel/unwind.c
+++ b/arch/ia64/kernel/unwind.c
@@ -1171,9 +1171,10 @@ desc_spill_sprel_p (unsigned char qp, unw_word t, unsigned char abreg, unw_word
static inline unw_hash_index_t
hash (unsigned long ip)
{
-# define magic 0x9e3779b97f4a7c16 /* based on (sqrt(5)/2-1)*2^64 */
+# define hashmagic 0x9e3779b97f4a7c16 /* based on (sqrt(5)/2-1)*2^64 */
- return (ip >> 4)*magic >> (64 - UNW_LOG_HASH_SIZE);
+ return (ip >> 4)*hashmagic >> (64 - UNW_LOG_HASH_SIZE);
+#undef hashmagic
}
static inline long
diff --git a/arch/ia64/sn/io/machvec/iomv.c b/arch/ia64/sn/io/machvec/iomv.c
index 32a35601770b..df17cc049541 100644
--- a/arch/ia64/sn/io/machvec/iomv.c
+++ b/arch/ia64/sn/io/machvec/iomv.c
@@ -6,13 +6,13 @@
* Copyright (C) 2000-2003 Silicon Graphics, Inc. All rights reserved.
*/
-#include <linux/pci.h>
#include <linux/module.h>
#include <asm/io.h>
#include <asm/delay.h>
#include <asm/sn/simulator.h>
#include <asm/sn/pda.h>
#include <asm/sn/sn_cpuid.h>
+#include <asm/sn/sn2/shub_mmr.h>
/**
* sn_io_addr - convert an in/out port to an i/o address
diff --git a/arch/ia64/sn/io/sn2/ml_SN_intr.c b/arch/ia64/sn/io/sn2/ml_SN_intr.c
index e569b0f107fb..b6adaaf267e0 100644
--- a/arch/ia64/sn/io/sn2/ml_SN_intr.c
+++ b/arch/ia64/sn/io/sn2/ml_SN_intr.c
@@ -39,6 +39,7 @@
#include <asm/sn/sn2/shubio.h>
#include <asm/sal.h>
#include <asm/sn/sn_sal.h>
+#include <asm/sn/sn2/shub_mmr.h>
extern irqpda_t *irqpdaindr;
extern cnodeid_t master_node_get(vertex_hdl_t vhdl);
diff --git a/arch/ia64/sn/io/sn2/shub.c b/arch/ia64/sn/io/sn2/shub.c
index b1ce748c6dcf..b7af0bdd0ff4 100644
--- a/arch/ia64/sn/io/sn2/shub.c
+++ b/arch/ia64/sn/io/sn2/shub.c
@@ -34,6 +34,8 @@
#include <asm/sal.h>
#include <asm/sn/sn_sal.h>
#include <asm/sn/sndrv.h>
+#include <asm/sn/sn2/shubio.h>
+#include <asm/sn/sn2/shub_mmr.h>
/*
* Shub WAR for Xbridge Little Endian problem:
@@ -491,7 +493,7 @@ linkstatd_init(void)
spin_lock_init(&sn_linkstats_lock);
sn_linkstats = kmalloc(numnodes * sizeof(struct s_linkstats), GFP_KERNEL);
sn_linkstats_reset(60000UL); /* default 60 second update interval */
- kernel_thread(linkstatd_thread, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ kernel_thread(linkstatd_thread, NULL, CLONE_KERNEL);
return 0;
}
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 3f5553ba36f8..fc227798ec53 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -35,7 +35,6 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/vmalloc.h>
-#include <asm/current.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
@@ -44,7 +43,6 @@
#include <asm/sn/sgi.h>
#include <asm/sn/iograph.h>
#include <asm/sn/invent.h>
-#include <linux/devfs_fs_kernel.h>
#include <asm/sn/hcl.h>
#include <asm/sn/types.h>
#include <asm/sn/pci/bridge.h>
@@ -62,6 +60,7 @@
#include <asm/processor.h>
#include <asm/system.h>
#include <asm/bitops.h>
+#include <asm/sn/sn2/shub_mmr.h>
int irq_to_bit_pos(int irq);
static void force_interrupt(int irq);
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index 54951a69f4cc..92c280c7016d 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -1082,7 +1082,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
continue;
case SIGTSTP: case SIGTTIN: case SIGTTOU:
- if (is_orphaned_pgrp(current->pgrp))
+ if (is_orphaned_pgrp(process_group(current)))
continue;
/* FALLTHRU */
diff --git a/arch/m68knommu/kernel/signal.c b/arch/m68knommu/kernel/signal.c
index 4271a229b62c..d24df6f29517 100644
--- a/arch/m68knommu/kernel/signal.c
+++ b/arch/m68knommu/kernel/signal.c
@@ -841,7 +841,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs)
continue;
case SIGTSTP: case SIGTTIN: case SIGTTOU:
- if (is_orphaned_pgrp(current->pgrp))
+ if (is_orphaned_pgrp(process_group(current)))
continue;
/* FALLTHRU */
diff --git a/arch/mips/jazz/setup.c b/arch/mips/jazz/setup.c
index aadaa904b0da..6af2f79944a9 100644
--- a/arch/mips/jazz/setup.c
+++ b/arch/mips/jazz/setup.c
@@ -9,6 +9,7 @@
* Copyright (C) 2001 MIPS Technologies, Inc.
*/
#include <linux/config.h>
+#include <linux/eisa.h>
#include <linux/hdreg.h>
#include <linux/init.h>
#include <linux/ioport.h>
diff --git a/arch/mips/kernel/irixelf.c b/arch/mips/kernel/irixelf.c
index 31fbd57c7021..f925c6514aad 100644
--- a/arch/mips/kernel/irixelf.c
+++ b/arch/mips/kernel/irixelf.c
@@ -1130,7 +1130,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
prstatus.pr_sighold = current->blocked.sig[0];
psinfo.pr_pid = prstatus.pr_pid = current->pid;
psinfo.pr_ppid = prstatus.pr_ppid = current->parent->pid;
- psinfo.pr_pgrp = prstatus.pr_pgrp = current->pgrp;
+ psinfo.pr_pgrp = prstatus.pr_pgrp = process_group(current);
psinfo.pr_sid = prstatus.pr_sid = current->session;
prstatus.pr_utime.tv_sec = CT_TO_SECS(current->utime);
prstatus.pr_utime.tv_usec = CT_TO_USECS(current->utime);
diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
index 85cc88d32b7d..9ed7b1e75a39 100644
--- a/arch/mips/kernel/irixsig.c
+++ b/arch/mips/kernel/irixsig.c
@@ -582,7 +582,7 @@ repeat:
p = list_entry(_p,struct task_struct,sibling);
if ((type == P_PID) && p->pid != pid)
continue;
- if ((type == P_PGID) && p->pgrp != pid)
+ if ((type == P_PGID) && process_group(p) != pid)
continue;
if ((p->exit_signal != SIGCHLD))
continue;
diff --git a/arch/mips/kernel/mips_ksyms.c b/arch/mips/kernel/mips_ksyms.c
index baf44da69264..6bdf758af0e8 100644
--- a/arch/mips/kernel/mips_ksyms.c
+++ b/arch/mips/kernel/mips_ksyms.c
@@ -43,10 +43,6 @@ extern long __strnlen_user_asm(const char *s);
EXPORT_SYMBOL(mips_machtype);
-#ifdef CONFIG_EISA
-EXPORT_SYMBOL(EISA_bus);
-#endif
-
/*
* String functions
*/
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index cdbaf4dd8c1f..0960259c6062 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -44,15 +44,6 @@ struct cpuinfo_mips cpu_data[NR_CPUS];
struct screen_info screen_info;
#endif
-/*
- * Set if box has EISA slots.
- */
-#ifdef CONFIG_EISA
-int EISA_bus;
-
-EXPORT_SYMBOL(EISA_bus);
-#endif
-
#if defined(CONFIG_BLK_DEV_FD) || defined(CONFIG_BLK_DEV_FD_MODULE)
extern struct fd_ops no_fd_ops;
struct fd_ops *fd_ops;
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c
index 022aa036efef..cadafba927ac 100644
--- a/arch/mips/kernel/sysirix.c
+++ b/arch/mips/kernel/sysirix.c
@@ -803,11 +803,11 @@ asmlinkage int irix_setpgrp(int flags)
printk("[%s:%d] setpgrp(%d) ", current->comm, current->pid, flags);
#endif
if(!flags)
- error = current->pgrp;
+ error = process_group(current);
else
error = sys_setsid();
#ifdef DEBUG_PROCGRPS
- printk("returning %d\n", current->pgrp);
+ printk("returning %d\n", process_group(current));
#endif
return error;
diff --git a/arch/mips/sgi-ip22/ip22-eisa.c b/arch/mips/sgi-ip22/ip22-eisa.c
index 68ccb2f64bfd..0ab4abf65d58 100644
--- a/arch/mips/sgi-ip22/ip22-eisa.c
+++ b/arch/mips/sgi-ip22/ip22-eisa.c
@@ -20,6 +20,7 @@
*/
#include <linux/config.h>
+#include <linux/eisa.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/irq.h>
diff --git a/arch/mips/sni/setup.c b/arch/mips/sni/setup.c
index 4acde68fe94b..2f96ca61c1ed 100644
--- a/arch/mips/sni/setup.c
+++ b/arch/mips/sni/setup.c
@@ -8,6 +8,7 @@
* Copyright (C) 1996, 1997, 1998, 2000, 2003 by Ralf Baechle
*/
#include <linux/config.h>
+#include <linux/eisa.h>
#include <linux/hdreg.h>
#include <linux/ioport.h>
#include <linux/sched.h>
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index 9d3a97a5b0bb..eafb849da3a0 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -22,7 +22,7 @@
*/
#include <linux/bitops.h>
#include <linux/config.h>
-#include <asm/pdc.h>
+#include <linux/eisa.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/signal.h>
@@ -39,6 +39,7 @@
#include <linux/spinlock.h>
#include <asm/cache.h>
+#include <asm/pdc.h>
#undef DEBUG_IRQ
#undef PARISC_IRQ_CR16_COUNTS
diff --git a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c
index 4a16af09be6d..f6d87e4d7575 100644
--- a/arch/parisc/kernel/parisc_ksyms.c
+++ b/arch/parisc/kernel/parisc_ksyms.c
@@ -42,9 +42,6 @@ EXPORT_SYMBOL(probe_irq_mask);
#include <asm/processor.h>
EXPORT_SYMBOL(kernel_thread);
EXPORT_SYMBOL(boot_cpu_data);
-#ifdef CONFIG_EISA
-EXPORT_SYMBOL(EISA_bus);
-#endif
#include <linux/pm.h>
EXPORT_SYMBOL(pm_power_off);
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index 1e299167edfc..189a6ae02bb9 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -10,6 +10,7 @@
* Copyright (C) 1999-2001 Grant Grundler
*/
#include <linux/config.h>
+#include <linux/eisa.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
index 5dde472c50fc..42f74c99072b 100644
--- a/arch/parisc/kernel/setup.c
+++ b/arch/parisc/kernel/setup.c
@@ -52,10 +52,6 @@ char command_line[COMMAND_LINE_SIZE];
struct proc_dir_entry * proc_runway_root = NULL;
struct proc_dir_entry * proc_gsc_root = NULL;
-#ifdef CONFIG_EISA
-int EISA_bus; /* This has to go somewhere in architecture specific code. */
-#endif
-
void __init setup_cmdline(char **cmdline_p)
{
extern unsigned int boot_args[];
diff --git a/arch/ppc/kernel/time.c b/arch/ppc/kernel/time.c
index b571bce80370..ee5072f60091 100644
--- a/arch/ppc/kernel/time.c
+++ b/arch/ppc/kernel/time.c
@@ -83,6 +83,7 @@ time_t last_rtc_update;
unsigned tb_ticks_per_jiffy;
unsigned tb_to_us;
unsigned tb_last_stamp;
+unsigned long tb_to_ns_scale;
extern unsigned long wall_jiffies;
@@ -309,6 +310,7 @@ void __init time_init(void)
tb_to_us = 0x418937;
} else {
ppc_md.calibrate_decr();
+ tb_to_ns_scale = mulhwu(tb_to_us, 1000 << 10);
}
/* Now that the decrementer is calibrated, it can be used in case the
@@ -432,3 +434,26 @@ unsigned mulhwu_scale_factor(unsigned inscale, unsigned outscale) {
return mlt;
}
+unsigned long long sched_clock(void)
+{
+ unsigned long lo, hi, hi2;
+ unsigned long long tb;
+
+ if (!__USE_RTC()) {
+ do {
+ hi = get_tbu();
+ lo = get_tbl();
+ hi2 = get_tbu();
+ } while (hi2 != hi);
+ tb = ((unsigned long long) hi << 32) | lo;
+ tb = (tb * tb_to_ns_scale) >> 10;
+ } else {
+ do {
+ hi = get_rtcu();
+ lo = get_rtcl();
+ hi2 = get_rtcu();
+ } while (hi2 != hi);
+ tb = ((unsigned long long) hi) * 1000000000 + lo;
+ }
+ return tb;
+}
diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c
index 6657873853b3..2f5366cb9848 100644
--- a/arch/ppc64/kernel/time.c
+++ b/arch/ppc64/kernel/time.c
@@ -307,6 +307,15 @@ int timer_interrupt(struct pt_regs * regs)
return 1;
}
+/*
+ * Scheduler clock - returns current time in nanosec units.
+ *
+ * This is wrong, but my CPUs run at 1GHz, so nyer nyer.
+ */
+unsigned long long sched_clock(void)
+{
+ return get_tb();
+}
/*
* This version of gettimeofday has microsecond resolution.
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index 9810917d2bff..7b4170081f5c 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -343,11 +343,11 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
unsigned long a3 asm("i3") = arg3;
unsigned long a4 asm("i4") = arg4;
unsigned long a5 asm("i5") = arg5;
-
- __asm__ __volatile__("
- std %0, [%6]
- std %2, [%6 + 8]
- std %4, [%6 + 16]" : :
+
+ __asm__ __volatile__(
+ "std %0, [%6]\n\t"
+ "std %2, [%6 + 8]\n\t"
+ "std %4, [%6 + 16]\n\t" : :
"r"(f), "r"(a1), "r"(a2), "r"(a3), "r"(a4), "r"(a5),
"r" (&ccall_info.func));
}
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index fe0584e049db..d86c40fba8db 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -330,9 +330,6 @@ static unsigned long __srmmu_get_nocache(int size, int align)
offset = bit_map_string_get(&srmmu_nocache_map,
size >> SRMMU_NOCACHE_BITMAP_SHIFT,
align >> SRMMU_NOCACHE_BITMAP_SHIFT);
-/* P3 */ /* printk("srmmu: get size %d align %d, got %d (0x%x)\n",
- size >> SRMMU_NOCACHE_BITMAP_SHIFT, align >> SRMMU_NOCACHE_BITMAP_SHIFT,
- offset, offset); */
if (offset == -1) {
printk("srmmu: out of nocache %d: %d/%d\n",
size, (int) srmmu_nocache_size,
@@ -385,7 +382,6 @@ void srmmu_free_nocache(unsigned long vaddr, int size)
offset = (vaddr - SRMMU_NOCACHE_VADDR) >> SRMMU_NOCACHE_BITMAP_SHIFT;
size = size >> SRMMU_NOCACHE_BITMAP_SHIFT;
-/* P3 */ /* printk("srmmu: free off %d (0x%x) size %d\n", offset, offset, size); */
bit_map_clear(&srmmu_nocache_map, offset, size);
}
@@ -447,9 +443,6 @@ void srmmu_nocache_init(void)
paddr = __pa((unsigned long)srmmu_nocache_pool);
vaddr = SRMMU_NOCACHE_VADDR;
-/* P3 */ printk("srmmu: pool 0x%x vaddr 0x%x bitmap 0x%x bits %d (0x%x)\n",
- (int)srmmu_nocache_pool, vaddr, srmmu_nocache_bitmap, bitmap_bits, bitmap_bits);
-
while (vaddr < srmmu_nocache_end) {
pgd = pgd_offset_k(vaddr);
pmd = srmmu_pmd_offset(__nocache_fix(pgd), vaddr);
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index 2572fdcd9908..2039cf715782 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -416,6 +416,7 @@ unsigned long timer_tick_offset;
unsigned long timer_tick_compare;
static unsigned long timer_ticks_per_usec_quotient;
+static unsigned long timer_ticks_per_nsec_quotient;
#define TICK_SIZE (tick_nsec / 1000)
@@ -1051,12 +1052,18 @@ static struct notifier_block sparc64_cpufreq_notifier_block = {
#endif
/* The quotient formula is taken from the IA64 port. */
+#define SPARC64_USEC_PER_CYC_SHIFT 30UL
+#define SPARC64_NSEC_PER_CYC_SHIFT 30UL
void __init time_init(void)
{
unsigned long clock = sparc64_init_timers(timer_interrupt);
timer_ticks_per_usec_quotient =
- (((1000000UL << 30) +
+ (((1000000UL << SPARC64_USEC_PER_CYC_SHIFT) +
+ (clock / 2)) / clock);
+
+ timer_ticks_per_nsec_quotient =
+ (((NSEC_PER_SEC << SPARC64_NSEC_PER_CYC_SHIFT) +
(clock / 2)) / clock);
#ifdef CONFIG_CPU_FREQ
@@ -1072,7 +1079,16 @@ static __inline__ unsigned long do_gettimeoffset(void)
ticks += timer_tick_offset;
ticks -= timer_tick_compare;
- return (ticks * timer_ticks_per_usec_quotient) >> 30UL;
+ return (ticks * timer_ticks_per_usec_quotient)
+ >> SPARC64_USEC_PER_CYC_SHIFT;
+}
+
+unsigned long long sched_clock(void)
+{
+ unsigned long ticks = tick_ops->get_tick();
+
+ return (ticks * timer_ticks_per_nsec_quotient)
+ >> SPARC64_NSEC_PER_CYC_SHIFT;
}
int do_settimeofday(struct timespec *tv)
diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c
index 024b74c9d8b5..ea7b2c439653 100644
--- a/arch/sparc64/solaris/misc.c
+++ b/arch/sparc64/solaris/misc.c
@@ -392,7 +392,7 @@ asmlinkage int solaris_procids(int cmd, s32 pid, s32 pgid)
switch (cmd) {
case 0: /* getpgrp */
- return current->pgrp;
+ return process_group(current);
case 1: /* setpgrp */
{
int (*sys_setpgid)(pid_t,pid_t) =
@@ -403,7 +403,7 @@ asmlinkage int solaris_procids(int cmd, s32 pid, s32 pgid)
ret = sys_setpgid(0, 0);
if (ret) return ret;
current->tty = NULL;
- return current->pgrp;
+ return process_group(current);
}
case 2: /* getsid */
{
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 92b8ffe633f6..315940661179 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -370,6 +370,19 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
return IRQ_HANDLED;
}
+/* RED-PEN: calculation is done in 32bits with multiply for performance
+ and could overflow, it may be better (but slower)to use an 64bit division. */
+unsigned long long sched_clock(void)
+{
+ unsigned long a;
+
+ if (__vxtime.mode == VXTIME_HPET)
+ return (hpet_readl(HPET_COUNTER) * vxtime.quot) >> 32;
+
+ rdtscll(a);
+ return (a * vxtime.tsc_quot) >> 32;
+}
+
unsigned long get_cmos_time(void)
{
unsigned int timeout, year, mon, day, hour, min, sec;
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index 371a4b7b19fb..45e3f57fbdff 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -2272,8 +2272,6 @@ static int __devinit eni_init_one(struct pci_dev *pci_dev,
DPRINTK("eni_init_one\n");
- MOD_INC_USE_COUNT; /* @@@ we don't support unloading yet */
-
if (pci_enable_device(pci_dev)) {
error = -EIO;
goto out0;
@@ -2307,7 +2305,6 @@ out2:
out1:
kfree(eni_dev);
out0:
- MOD_DEC_USE_COUNT; /* @@@ we don't support unloading yet */
return error;
}
@@ -2351,16 +2348,7 @@ static int __init eni_init(void)
}
-static void __exit eni_cleanup(void)
-{
- /*
- * Well, there's no way to get rid of the driver yet, so we don't
- * have to clean up, right ? :-)
- */
-}
-
-
module_init(eni_init);
-module_exit(eni_cleanup);
+/* @@@ since exit routine not defined, this module can not be unloaded */
MODULE_LICENSE("GPL");
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index feec45ba59ca..98cb2fce6bfe 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1282,9 +1282,7 @@ static const struct atmdev_ops ops = {
.open = fs_open,
.close = fs_close,
.send = fs_send,
-#if 0
.owner = THIS_MODULE,
-#endif
/* ioctl: fs_ioctl, */
/* getsockopt: fs_getsockopt, */
/* setsockopt: fs_setsockopt, */
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index ea503304329e..86ff59491a9a 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -147,7 +147,8 @@ static struct atmdev_ops idt77252_ops =
.phy_put = idt77252_phy_put,
.phy_get = idt77252_phy_get,
.change_qos = idt77252_change_qos,
- .proc_read = idt77252_proc_read
+ .proc_read = idt77252_proc_read,
+ .owner = THIS_MODULE
};
static struct idt77252_dev *idt77252_chain = NULL;
@@ -2544,7 +2545,6 @@ idt77252_open(struct atm_vcc *vcc, short vpi, int vci)
}
set_bit(ATM_VF_READY, &vcc->flags);
- MOD_INC_USE_COUNT;
up(&card->mutex);
return 0;
@@ -2631,7 +2631,6 @@ done:
free_scq(card, vc->scq);
}
- MOD_DEC_USE_COUNT;
up(&card->mutex);
}
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index 2fdb6f766e44..101a71c4831d 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -2242,7 +2242,6 @@ static int __init lanai_dev_open(struct atm_dev *atmdev)
printk(KERN_ERR DEV_LABEL ": can't allocate interrupt\n");
goto error_vcctable;
}
- MOD_INC_USE_COUNT; /* At this point we can't fail */
mb(); /* Make sure that all that made it */
intr_enable(lanai, INT_ALL & ~(INT_PING | INT_WAKE));
/* 3.11: initialize loop mode (i.e. turn looping off) */
@@ -2312,7 +2311,6 @@ static void lanai_dev_close(struct atm_dev *atmdev)
service_buffer_deallocate(lanai);
iounmap((void *) lanai->base);
kfree(lanai);
- MOD_DEC_USE_COUNT;
}
/* close a vcc */
@@ -2686,7 +2684,8 @@ static const struct atmdev_ops ops = {
.phy_put = NULL,
.phy_get = NULL,
.change_qos = lanai_change_qos,
- .proc_read = lanai_proc_read
+ .proc_read = lanai_proc_read,
+ .owner = THIS_MODULE
};
/* initialize one probed card */
diff --git a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c
index d85b77b57c08..dd3b29bed8e4 100644
--- a/drivers/atm/uPD98402.c
+++ b/drivers/atm/uPD98402.c
@@ -246,7 +246,7 @@ static const struct atmphy_ops uPD98402_ops = {
};
-int __init uPD98402_init(struct atm_dev *dev)
+int uPD98402_init(struct atm_dev *dev)
{
DPRINTK("phy_init\n");
dev->phy = &uPD98402_ops;
@@ -254,22 +254,13 @@ DPRINTK("phy_init\n");
}
-#ifdef MODULE
MODULE_LICENSE("GPL");
EXPORT_SYMBOL(uPD98402_init);
-
-int init_module(void)
+static __init int uPD98402_module_init(void)
{
- MOD_INC_USE_COUNT;
return 0;
}
-
-
-void cleanup_module(void)
-{
- /* Nay */
-}
-
-#endif
+module_init(uPD98402_module_init);
+/* module_exit not defined so not unloadable */
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index 8ea8b49cc784..de4e075a5eee 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -1619,11 +1619,10 @@ static int __init zatm_module_init(void)
out:
kfree(zatm_dev);
- /* XXX: currently the driver is not unloadable.. */
- MOD_INC_USE_COUNT;
return 0;
}
MODULE_LICENSE("GPL");
module_init(zatm_module_init);
+/* module_exit not defined so not unloadable */
diff --git a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c
index a54f8e9a358e..6ef1db60da84 100644
--- a/drivers/block/as-iosched.c
+++ b/drivers/block/as-iosched.c
@@ -1303,7 +1303,7 @@ static struct request *as_next_request(request_queue_t *q)
* Add arq to a list behind alias
*/
static inline void
-as_add_aliased_request(struct as_rq *arq, struct as_rq *alias)
+as_add_aliased_request(struct as_data *ad, struct as_rq *arq, struct as_rq *alias)
{
/*
* Another request with the same start sector on the rbtree.
@@ -1312,6 +1312,11 @@ as_add_aliased_request(struct as_rq *arq, struct as_rq *alias)
*/
list_add_tail(&arq->request->queuelist, &alias->request->queuelist);
+ /*
+ * Don't want to have to handle merges.
+ */
+ as_remove_merge_hints(ad->q, arq);
+
}
/*
@@ -1353,7 +1358,7 @@ static void as_add_request(struct as_data *ad, struct as_rq *arq)
as_update_arq(ad, arq); /* keep state machine up to date */
} else {
- as_add_aliased_request(arq, alias);
+ as_add_aliased_request(ad, arq, alias);
/*
* have we been anticipating this request?
* or does it come from the same process as the one we are
@@ -1553,8 +1558,10 @@ static void as_merged_request(request_queue_t *q, struct request *req)
* currently don't bother. Ditto the next function.
*/
as_del_arq_rb(ad, arq);
- if ((alias = as_add_arq_rb(ad, arq)) )
- as_add_aliased_request(arq, alias);
+ if ((alias = as_add_arq_rb(ad, arq)) ) {
+ list_del_init(&arq->fifo);
+ as_add_aliased_request(ad, arq, alias);
+ }
/*
* Note! At this stage of this and the next function, our next
* request may not be optimal - eg the request may have "grown"
@@ -1586,8 +1593,10 @@ as_merged_requests(request_queue_t *q, struct request *req,
if (rq_rb_key(req) != arq->rb_key) {
struct as_rq *alias;
as_del_arq_rb(ad, arq);
- if ((alias = as_add_arq_rb(ad, arq)) )
- as_add_aliased_request(arq, alias);
+ if ((alias = as_add_arq_rb(ad, arq)) ) {
+ list_del_init(&arq->fifo);
+ as_add_aliased_request(ad, arq, alias);
+ }
}
/*
@@ -1926,7 +1935,7 @@ elevator_t iosched_as = {
.elevator_exit_fn = as_exit,
.elevator_ktype = &as_ktype,
- .elevator_name = "anticipatory scheduling",
+ .elevator_name = "anticipatory",
};
EXPORT_SYMBOL(iosched_as);
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 657dc16d5438..3d7fc3bfa6c9 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -754,16 +754,24 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
status = -ENOMEM;
goto cleanup1;
}
- if (copy_from_user(ioc, (void *) arg, sizeof(*ioc)))
- return -EFAULT;
+ if (copy_from_user(ioc, (void *) arg, sizeof(*ioc))) {
+ status = -EFAULT;
+ goto cleanup1;
+ }
if ((ioc->buf_size < 1) &&
- (ioc->Request.Type.Direction != XFER_NONE))
- return -EINVAL;
+ (ioc->Request.Type.Direction != XFER_NONE)) {
+ status = -EINVAL;
+ goto cleanup1;
+ }
/* Check kmalloc limits using all SGs */
- if (ioc->malloc_size > MAX_KMALLOC_SIZE)
- return -EINVAL;
- if (ioc->buf_size > ioc->malloc_size * MAXSGENTRIES)
- return -EINVAL;
+ if (ioc->malloc_size > MAX_KMALLOC_SIZE) {
+ status = -EINVAL;
+ goto cleanup1;
+ }
+ if (ioc->buf_size > ioc->malloc_size * MAXSGENTRIES) {
+ status = -EINVAL;
+ goto cleanup1;
+ }
buff = (unsigned char **) kmalloc(MAXSGENTRIES *
sizeof(char *), GFP_KERNEL);
if (!buff) {
diff --git a/drivers/block/deadline-iosched.c b/drivers/block/deadline-iosched.c
index ecc2a9997007..1c8ca884396f 100644
--- a/drivers/block/deadline-iosched.c
+++ b/drivers/block/deadline-iosched.c
@@ -287,8 +287,11 @@ deadline_find_first_drq(struct deadline_data *dd, int data_dir)
* add drq to rbtree and fifo
*/
static inline void
-deadline_add_request(struct deadline_data *dd, struct deadline_rq *drq)
+deadline_add_request(struct request_queue *q, struct request *rq)
{
+ struct deadline_data *dd = q->elevator.elevator_data;
+ struct deadline_rq *drq = RQ_DATA(rq);
+
const int data_dir = rq_data_dir(drq->request);
deadline_add_drq_rb(dd, drq);
@@ -297,6 +300,13 @@ deadline_add_request(struct deadline_data *dd, struct deadline_rq *drq)
*/
drq->expires = jiffies + dd->fifo_expire[data_dir];
list_add_tail(&drq->fifo, &dd->fifo_list[data_dir]);
+
+ if (rq_mergeable(rq)) {
+ deadline_add_drq_hash(dd, drq);
+
+ if (!q->last_merge)
+ q->last_merge = rq;
+ }
}
/*
@@ -616,7 +626,6 @@ static void
deadline_insert_request(request_queue_t *q, struct request *rq, int where)
{
struct deadline_data *dd = q->elevator.elevator_data;
- struct deadline_rq *drq = RQ_DATA(rq);
/* barriers must flush the reorder queue */
if (unlikely(rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)
@@ -634,19 +643,12 @@ deadline_insert_request(request_queue_t *q, struct request *rq, int where)
break;
case ELEVATOR_INSERT_SORT:
BUG_ON(!blk_fs_request(rq));
- deadline_add_request(dd, drq);
+ deadline_add_request(q, rq);
break;
default:
printk("%s: bad insert point %d\n", __FUNCTION__,where);
return;
}
-
- if (rq_mergeable(rq)) {
- deadline_add_drq_hash(dd, drq);
-
- if (!q->last_merge)
- q->last_merge = rq;
- }
}
static int deadline_queue_empty(request_queue_t *q)
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index b25acb42542e..efc52196d36b 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -219,6 +219,7 @@ static int use_virtual_dma;
*/
static spinlock_t floppy_lock = SPIN_LOCK_UNLOCKED;
+static struct completion device_release;
static unsigned short virtual_dma_port=0x3f0;
irqreturn_t floppy_interrupt(int irq, void *dev_id, struct pt_regs * regs);
@@ -2152,18 +2153,20 @@ static int next_valid_format(void)
static void bad_flp_intr(void)
{
+ int err_count;
+
if (probing){
DRS->probed_format++;
if (!next_valid_format())
return;
}
- (*errors)++;
- INFBOUND(DRWE->badness, *errors);
- if (*errors > DP->max_errors.abort)
+ err_count = ++(*errors);
+ INFBOUND(DRWE->badness, err_count);
+ if (err_count > DP->max_errors.abort)
cont->done(0);
- if (*errors > DP->max_errors.reset)
+ if (err_count > DP->max_errors.reset)
FDCS->reset = 1;
- else if (*errors > DP->max_errors.recal)
+ else if (err_count > DP->max_errors.recal)
DRS->track = NEED_2_RECAL;
}
@@ -4203,9 +4206,17 @@ static int __init floppy_setup(char *str)
static int have_no_fdc= -ENODEV;
+static void floppy_device_release(struct device *dev)
+{
+ complete(&device_release);
+}
+
static struct platform_device floppy_device = {
.name = "floppy",
.id = 0,
+ .dev = {
+ .release = floppy_device_release,
+ }
};
static struct kobject *floppy_find(dev_t dev, int *part, void *data)
@@ -4576,11 +4587,15 @@ int init_module(void)
void cleanup_module(void)
{
int drive;
-
+
+ init_completion(&device_release);
platform_device_unregister(&floppy_device);
blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256);
unregister_blkdev(FLOPPY_MAJOR, "fd");
+
for (drive = 0; drive < N_DRIVE; drive++) {
+ del_timer_sync(&motor_off_timer[drive]);
+
if ((allowed_drive_mask & (1 << drive)) &&
fdc_state[FDC(drive)].version != FDC_NONE) {
del_gendisk(disks[drive]);
@@ -4590,9 +4605,17 @@ void cleanup_module(void)
}
devfs_remove("floppy");
+ del_timer_sync(&fd_timeout);
+ del_timer_sync(&fd_timer);
blk_cleanup_queue(floppy_queue);
+
+ if (usage_count)
+ floppy_release_irq_and_dma();
+
/* eject disk, if any */
fd_eject(0);
+
+ wait_for_completion(&device_release);
}
MODULE_PARM(floppy,"s");
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a5c2ce9cf189..eda9681d1253 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -757,7 +757,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
blk_queue_merge_bvec(lo->lo_queue, q->merge_bvec_fn);
}
- kernel_thread(loop_thread, lo, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ kernel_thread(loop_thread, lo, CLONE_KERNEL);
down(&lo->lo_sem);
fput(file);
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 793712f993ef..fc416a29f75c 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -352,7 +352,7 @@ config STALLION
config ISTALLION
tristate "Stallion EC8/64, ONboard, Brumby support"
- depends on STALDRV && BROKEN
+ depends on STALDRV && BROKEN_ON_SMP
help
If you have an EasyConnection 8/64, ONboard, Brumby or Stallion
serial multiport card, say Y here. Make sure to read
@@ -959,6 +959,7 @@ source "drivers/char/pcmcia/Kconfig"
config MWAVE
tristate "ACP Modem (Mwave) support"
depends on X86
+ select SERIAL_8250
---help---
The ACP modem (Mwave) for Linux is a WinModem. It is composed of a
kernel driver and a user level application. Together these components
@@ -1001,6 +1002,7 @@ config RAW_DRIVER
config HANGCHECK_TIMER
tristate "Hangcheck timer"
+ depends on X86_64 || X86
help
The hangcheck-timer module detects when the system has gone
out to lunch past a certain margin. It can reboot the system
diff --git a/drivers/char/Makefile b/drivers/char/Makefile
index aeac2fb7d641..b53d91f5c10d 100644
--- a/drivers/char/Makefile
+++ b/drivers/char/Makefile
@@ -7,7 +7,7 @@
#
FONTMAPFILE = cp437.uni
-obj-y += mem.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o random.o
+obj-y += mem.o random.o tty_io.o n_tty.o tty_ioctl.o pty.o misc.o
obj-$(CONFIG_VT) += vt_ioctl.o vc_screen.o consolemap.o consolemap_deftbl.o selection.o keyboard.o
obj-$(CONFIG_HW_CONSOLE) += vt.o defkeymap.o
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index f0f54e3b8450..cff44cad625c 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -318,6 +318,7 @@ void __exit agp_exit(void)
{
}
+#ifdef MODULE
static __init int agp_setup(char *s)
{
if (!strcmp(s,"off"))
@@ -327,6 +328,7 @@ static __init int agp_setup(char *s)
return 1;
}
__setup("agp=", agp_setup);
+#endif
MODULE_AUTHOR("Dave Jones <davej@codemonkey.org.uk>");
MODULE_DESCRIPTION("AGP GART driver");
diff --git a/drivers/char/ftape/lowlevel/ftape-init.c b/drivers/char/ftape/lowlevel/ftape-init.c
index 9ffe3de655c0..8d5368a662dd 100644
--- a/drivers/char/ftape/lowlevel/ftape-init.c
+++ b/drivers/char/ftape/lowlevel/ftape-init.c
@@ -55,14 +55,24 @@ char ft_rev[] __initdata = "$Revision: 1.8 $";
char ft_dat[] __initdata = "$Date: 1997/11/06 00:38:08 $";
+#ifndef CONFIG_FT_NO_TRACE_AT_ALL
+static int ft_tracing = -1;
+#endif
+
+
/* Called by modules package when installing the driver
* or by kernel during the initialization phase
*/
-int __init ftape_init(void)
+static int __init ftape_init(void)
{
TRACE_FUN(ft_t_flow);
#ifdef MODULE
+#ifndef CONFIG_FT_NO_TRACE_AT_ALL
+ if (ft_tracing != -1) {
+ ftape_tracing = ft_tracing;
+ }
+#endif
printk(KERN_INFO FTAPE_VERSION "\n");
if (TRACE_LEVEL >= ft_t_info) {
printk(
@@ -112,13 +122,6 @@ KERN_INFO "Compiled for Linux version %s\n", UTS_RELEASE);
#endif
TRACE_EXIT 0;
}
-
-#ifdef MODULE
-
-#ifndef CONFIG_FT_NO_TRACE_AT_ALL
-static int ft_tracing = -1;
-#endif
-
#define FT_MOD_PARM(var,type,desc) \
MODULE_PARM(var,type); MODULE_PARM_DESC(var,desc)
@@ -141,21 +144,7 @@ MODULE_DESCRIPTION(
"QIC-117 driver for QIC-40/80/3010/3020 floppy tape drives.");
MODULE_LICENSE("GPL");
-/* Called by modules package when installing the driver
- */
-int init_module(void)
-{
-#ifndef CONFIG_FT_NO_TRACE_AT_ALL
- if (ft_tracing != -1) {
- ftape_tracing = ft_tracing;
- }
-#endif
- return ftape_init();
-}
-
-/* Called by modules package when removing the driver
- */
-void cleanup_module(void)
+static void __exit ftape_exit(void)
{
TRACE_FUN(ft_t_flow);
@@ -166,4 +155,6 @@ void cleanup_module(void)
printk(KERN_INFO "ftape: unloaded.\n");
TRACE_EXIT;
}
-#endif /* MODULE */
+
+module_init(ftape_init);
+module_exit(ftape_exit);
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index ff543516731d..f26a6e1dd76e 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -2303,7 +2303,7 @@ static void stli_dohangup(void *arg)
/*
* FIXME: There's a module removal race here: tty_hangup
- * calls schedule_task which will call into this
+ * calls schedule_work which will call into this
* driver later.
*/
portp = (stliport_t *) arg;
@@ -2944,7 +2944,7 @@ static inline int stli_hostcmd(stlibrd_t *brdp, stliport_t *portp)
((portp->sigs & TIOCM_CD) == 0)) {
if (portp->flags & ASYNC_CHECK_CD) {
if (tty)
- schedule_task(&portp->tqhangup);
+ schedule_work(&portp->tqhangup);
}
}
}
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 26c5df39f937..32347f8c9369 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -205,7 +205,7 @@ int setkeycode(unsigned int scancode, unsigned int keycode)
INPUT_KEYCODE(dev, scancode) = keycode;
for (i = 0; i < dev->keycodemax; i++)
- if(INPUT_KEYCODE(dev, scancode) == oldkey)
+ if(keycode == oldkey)
break;
if (i == dev->keycodemax)
clear_bit(oldkey, dev->keybit);
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 82b44f1c1a13..3e32d60c8b1e 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -680,18 +680,9 @@ static int __init chr_dev_init(void)
S_IFCHR | devlist[i].mode, devlist[i].name);
}
- rand_initialize();
#if defined (CONFIG_FB)
fbmem_init();
#endif
- tty_init();
-#ifdef CONFIG_M68K_PRINTER
- lp_m68k_init();
-#endif
- misc_init();
-#ifdef CONFIG_FTAPE
- ftape_init();
-#endif
return 0;
}
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index e808cfa31236..8211052cecfe 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -277,7 +277,7 @@ int misc_deregister(struct miscdevice * misc)
EXPORT_SYMBOL(misc_register);
EXPORT_SYMBOL(misc_deregister);
-int __init misc_init(void)
+static int __init misc_init(void)
{
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *ent;
@@ -320,3 +320,4 @@ int __init misc_init(void)
}
return 0;
}
+module_init(misc_init);
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 6cc938bbbf30..44d551ba1091 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -977,11 +977,11 @@ do_it_again:
if (file->f_op->write != redirected_tty_write && current->tty == tty) {
if (tty->pgrp <= 0)
printk("read_chan: tty->pgrp <= 0!\n");
- else if (current->pgrp != tty->pgrp) {
+ else if (process_group(current) != tty->pgrp) {
if (is_ignored(SIGTTIN) ||
- is_orphaned_pgrp(current->pgrp))
+ is_orphaned_pgrp(process_group(current)))
return -EIO;
- kill_pg(current->pgrp, SIGTTIN, 1);
+ kill_pg(process_group(current), SIGTTIN, 1);
return -ERESTARTSYS;
}
}
diff --git a/drivers/char/random.c b/drivers/char/random.c
index c36d2ea46b07..c782ff3622a8 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1493,16 +1493,16 @@ static void init_std_data(struct entropy_store *r)
}
}
-void __init rand_initialize(void)
+static int __init rand_initialize(void)
{
int i;
if (create_entropy_store(DEFAULT_POOL_SIZE, &random_state))
- return; /* Error, return */
+ goto err;
if (batch_entropy_init(BATCH_ENTROPY_SIZE, random_state))
- return; /* Error, return */
+ goto err;
if (create_entropy_store(SECONDARY_POOL_SIZE, &sec_random_state))
- return; /* Error, return */
+ goto err;
clear_entropy_store(random_state);
clear_entropy_store(sec_random_state);
init_std_data(random_state);
@@ -1515,7 +1515,11 @@ void __init rand_initialize(void)
memset(&mouse_timer_state, 0, sizeof(struct timer_rand_state));
memset(&extract_timer_state, 0, sizeof(struct timer_rand_state));
extract_timer_state.dont_count_entropy = 1;
+ return 0;
+err:
+ return -1;
}
+module_init(rand_initialize);
void rand_initialize_irq(int irq)
{
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index 777f8ae5321e..9327ebe6b874 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -234,14 +234,12 @@ int rio_probe_addrs[]= {0xc0000, 0xd0000, 0xe0000};
support up to 64 bits on 64bit architectures. -- REW 20/06/99 */
long rio_irqmask = -1;
-#ifndef TWO_ZERO
MODULE_AUTHOR("Rogier Wolff <R.E.Wolff@bitwizard.nl>, Patrick van de Lageweg <patrick@bitwizard.nl>");
MODULE_DESCRIPTION("RIO driver");
MODULE_LICENSE("GPL");
MODULE_PARM(rio_poll, "i");
MODULE_PARM(rio_debug, "i");
MODULE_PARM(rio_irqmask, "i");
-#endif
static struct real_driver rio_real_driver = {
rio_disable_tx_interrupts,
@@ -1034,13 +1032,6 @@ static void __exit rio_release_drivers(void)
func_exit();
}
-#ifdef TWO_ZERO
-#define PDEV unsigned char pci_bus, unsigned pci_fun
-#define pdev pci_bus, pci_fun
-#else
-#define PDEV struct pci_dev *pdev
-#endif
-
#ifdef CONFIG_PCI
/* This was written for SX, but applies to RIO too...
@@ -1062,7 +1053,7 @@ static void __exit rio_release_drivers(void)
EEprom. As the bit is read/write for the CPU, we can fix it here,
if we detect that it isn't set correctly. -- REW */
-void fix_rio_pci (PDEV)
+void fix_rio_pci (struct pci_dev *pdev)
{
unsigned int hwbase;
unsigned long rebase;
@@ -1095,12 +1086,7 @@ static int __init rio_init(void)
int okboard;
#ifdef CONFIG_PCI
-#ifndef TWO_ZERO
struct pci_dev *pdev = NULL;
-#else
- unsigned char pci_bus, pci_fun;
- /* in 2.2.x pdev is a pointer defining a PCI device. In 2.0 its the bus/fn */
-#endif
unsigned int tint;
unsigned short tshort;
#endif
@@ -1128,17 +1114,11 @@ static int __init rio_init(void)
#ifdef CONFIG_PCI
/* First look for the JET devices: */
-#ifndef TWO_ZERO
while ((pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX,
PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8,
pdev))) {
if (pci_enable_device(pdev)) continue;
-#else
- for (i=0;i< RIO_NBOARDS;i++) {
- if (pcibios_find_device (PCI_VENDOR_ID_SPECIALIX,
- PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8, i,
- &pci_bus, &pci_fun)) break;
-#endif
+
/* Specialix has a whole bunch of cards with
0x2000 as the device ID. They say its because
the standard requires it. Stupid standard. */
@@ -1196,16 +1176,9 @@ static int __init rio_init(void)
} else {
iounmap((char*) (p->RIOHosts[p->RIONumHosts].Caddr));
}
-
-#ifdef TWO_ZERO
- } /* We have two variants with the opening brace, so to prevent */
-#else
- } /* Emacs from getting confused we have two closing braces too. */
-#endif
+ }
/* Then look for the older PCI card.... : */
-#ifndef TWO_ZERO
-
/* These older PCI cards have problems (only byte-mode access is
supported), which makes them a bit awkward to support.
@@ -1219,12 +1192,6 @@ static int __init rio_init(void)
PCI_DEVICE_ID_SPECIALIX_RIO,
pdev))) {
if (pci_enable_device(pdev)) continue;
-#else
- for (i=0;i< RIO_NBOARDS;i++) {
- if (pcibios_find_device (PCI_VENDOR_ID_SPECIALIX,
- PCI_DEVICE_ID_SPECIALIX_RIO, i,
- &pci_bus, &pci_fun)) break;
-#endif
#ifdef CONFIG_RIO_OLDPCI
pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &tint);
@@ -1272,11 +1239,7 @@ static int __init rio_init(void)
printk (KERN_ERR "Found an older RIO PCI card, but the driver is not "
"compiled to support it.\n");
#endif
-#ifdef TWO_ZERO
- } /* We have two variants with the opening brace, so to prevent */
-#else
- } /* Emacs from getting confused we have two closing braces too. */
-#endif
+ }
#endif /* PCI */
/* Now probe for ISA cards... */
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 8f969928c68b..50fab08d460f 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -956,7 +956,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
* Info->count is now 1; so it's safe to sleep now.
*/
info->session = current->session;
- info->pgrp = current->pgrp;
+ info->pgrp = process_group(current);
if ((info->flags & ROCKET_INITIALIZED) == 0) {
cp = &info->channel;
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index 277b9cd33657..a65506e8f6bd 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -92,40 +92,7 @@
#include <linux/delay.h>
#include <linux/version.h>
#include <linux/pci.h>
-
-
-/* ************************************************************** */
-/* * This section can be removed when 2.0 becomes outdated.... * */
-/* ************************************************************** */
-
-#if LINUX_VERSION_CODE < 131328 /* Less than 2.1.0 */
-#define TWO_ZERO
-#else
-#if LINUX_VERSION_CODE < 131371 /* less than 2.1.43 */
-/* This has not been extensively tested yet. Sorry. */
-#warning "You're on your own between 2.1.0 and 2.1.43.... "
-#warning "Please use a recent kernel."
-#endif
-#endif
-
-
-#ifdef TWO_ZERO
-#define Get_user(a,b) a = get_user(b)
-#define copy_from_user(a,b,c) memcpy_fromfs(a,b,c)
-#define copy_to_user(a,b,c) memcpy_tofs(a,b,c)
-#define queue_task queue_task_irq_off
-#else
-#define Get_user(a,b) get_user(a,b)
-#endif
-
-/* ************************************************************** */
-/* * End of compatibility section.. * */
-/* ************************************************************** */
-
-
-#ifndef TWO_ZERO
#include <asm/uaccess.h>
-#endif
#include "specialix_io8.h"
#include "cd1865.h"
@@ -1733,7 +1700,7 @@ static int sx_set_modem_info(struct specialix_port * port, unsigned int cmd,
if (error)
return error;
- Get_user(arg, (unsigned long *) value);
+ get_user(arg, (unsigned long *) value);
switch (cmd) {
case TIOCMBIS:
/* if (arg & TIOCM_RTS)
@@ -1925,7 +1892,7 @@ static int sx_ioctl(struct tty_struct * tty, struct file * filp,
(unsigned long *) arg);
return 0;
case TIOCSSOFTCAR:
- Get_user(arg, (unsigned long *) arg);
+ get_user(arg, (unsigned long *) arg);
tty->termios->c_cflag =
((tty->termios->c_cflag & ~CLOCAL) |
(arg ? CLOCAL : 0));
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index e809b8e1a9c8..27ca5381fc24 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -2356,14 +2356,6 @@ static void __exit sx_release_drivers(void)
func_exit();
}
-#ifdef TWO_ZERO
-#define PDEV unsigned char pci_bus, unsigned pci_fun
-#define pdev pci_bus, pci_fun
-#else
-#define PDEV struct pci_dev *pdev
-#endif
-
-
#ifdef CONFIG_PCI
/********************************************************
* Setting bit 17 in the CNTRL register of the PLX 9050 *
@@ -2376,7 +2368,7 @@ static void __exit sx_release_drivers(void)
EEprom. As the bit is read/write for the CPU, we can fix it here,
if we detect that it isn't set correctly. -- REW */
-static void fix_sx_pci (PDEV, struct sx_board *board)
+static void fix_sx_pci (struct pci_dev *pdev, struct sx_board *board)
{
unsigned int hwbase;
unsigned long rebase;
@@ -2406,12 +2398,7 @@ static int __init sx_init(void)
struct sx_board *board;
#ifdef CONFIG_PCI
-#ifndef TWO_ZERO
struct pci_dev *pdev = NULL;
-#else
- unsigned char pci_bus, pci_fun;
- /* in 2.2.x pdev is a pointer defining a PCI device. In 2.0 its the bus/fn */
-#endif
unsigned int tint;
unsigned short tshort;
#endif
@@ -2431,19 +2418,12 @@ static int __init sx_init(void)
}
#ifdef CONFIG_PCI
-#ifndef TWO_ZERO
while ((pdev = pci_find_device (PCI_VENDOR_ID_SPECIALIX,
PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8,
pdev))) {
if (pci_enable_device(pdev))
continue;
-#else
- for (i=0;i< SX_NBOARDS;i++) {
- if (pcibios_find_device (PCI_VENDOR_ID_SPECIALIX,
- PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8, i,
- &pci_bus, &pci_fun))
- break;
-#endif
+
/* Specialix has a whole bunch of cards with
0x2000 as the device ID. They say its because
the standard requires it. Stupid standard. */
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 8d1f8c6d3c23..41935ac3e375 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -325,13 +325,13 @@ int tty_check_change(struct tty_struct * tty)
printk(KERN_WARNING "tty_check_change: tty->pgrp <= 0!\n");
return 0;
}
- if (current->pgrp == tty->pgrp)
+ if (process_group(current) == tty->pgrp)
return 0;
if (is_ignored(SIGTTOU))
return 0;
- if (is_orphaned_pgrp(current->pgrp))
+ if (is_orphaned_pgrp(process_group(current)))
return -EIO;
- (void) kill_pg(current->pgrp,SIGTTOU,1);
+ (void) kill_pg(process_group(current), SIGTTOU, 1);
return -ERESTARTSYS;
}
@@ -1406,7 +1406,7 @@ got_driver:
task_unlock(current);
current->tty_old_pgrp = 0;
tty->session = current->session;
- tty->pgrp = current->pgrp;
+ tty->pgrp = process_group(current);
}
return 0;
}
@@ -1580,7 +1580,7 @@ static int tiocsctty(struct tty_struct *tty, int arg)
task_unlock(current);
current->tty_old_pgrp = 0;
tty->session = current->session;
- tty->pgrp = current->pgrp;
+ tty->pgrp = process_group(current);
return 0;
}
@@ -2423,7 +2423,7 @@ static struct cdev vc0_cdev;
* Ok, now we can initialize the rest of the tty devices and can count
* on memory allocations, interrupts etc..
*/
-void __init tty_init(void)
+static int __init tty_init(void)
{
strcpy(tty_cdev.kobj.name, "dev.tty");
cdev_init(&tty_cdev, &tty_fops);
@@ -2512,4 +2512,6 @@ void __init tty_init(void)
#ifdef CONFIG_A2232
a2232board_init();
#endif
+ return 0;
}
+module_init(tty_init);
diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
index 6f1b766fddcf..055872a85889 100644
--- a/drivers/eisa/eisa-bus.c
+++ b/drivers/eisa/eisa-bus.c
@@ -427,6 +427,11 @@ module_param(disable_dev, intarray, 0444);
postcore_initcall (eisa_init);
+#ifndef CONFIG_EISA_ALWAYS
+int EISA_bus;
+EXPORT_SYMBOL(EISA_bus);
+#endif
+
EXPORT_SYMBOL (eisa_bus_type);
EXPORT_SYMBOL (eisa_driver_register);
EXPORT_SYMBOL (eisa_driver_unregister);
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 26c0af5eec9f..b38f1e83d865 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -1744,8 +1744,7 @@ static void nodemgr_add_host(struct hpsb_host *host)
sprintf(hi->daemon_name, "knodemgrd_%d", host->id);
- hi->pid = kernel_thread(nodemgr_host_thread, hi,
- CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ hi->pid = kernel_thread(nodemgr_host_thread, hi, CLONE_KERNEL);
if (hi->pid < 0) {
HPSB_ERR ("NodeMgr: failed to start %s thread for %s",
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 10a13ac90c48..ca56ac39e2b8 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -208,7 +208,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
struct evdev *evdev = list->evdev;
struct input_dev *dev = evdev->handle.dev;
struct input_absinfo abs;
- int i, t, u;
+ int i, t, u, v;
if (!evdev->exist) return -ENODEV;
@@ -239,14 +239,12 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case EVIOCSKEYCODE:
if (get_user(t, ((int *) arg) + 0)) return -EFAULT;
if (t < 0 || t > dev->keycodemax || !dev->keycodesize) return -EINVAL;
+ if (get_user(v, ((int *) arg) + 1)) return -EFAULT;
u = INPUT_KEYCODE(dev, t);
- if (get_user(INPUT_KEYCODE(dev, t), ((int *) arg) + 1)) return -EFAULT;
-
- for (i = 0; i < dev->keycodemax; i++)
- if(INPUT_KEYCODE(dev, t) == u) break;
+ INPUT_KEYCODE(dev, t) = v;
+ for (i = 0; i < dev->keycodemax; i++) if (v == u) break;
if (i == dev->keycodemax) clear_bit(u, dev->keybit);
- set_bit(INPUT_KEYCODE(dev, t), dev->keybit);
-
+ set_bit(v, dev->keybit);
return 0;
case EVIOCSFF:
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 5cee24bf4383..45d9bdffdbe4 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -426,8 +426,10 @@ void input_register_device(struct input_dev *dev)
init_timer(&dev->timer);
dev->timer.data = (long) dev;
dev->timer.function = input_repeat_key;
- dev->rep[REP_DELAY] = HZ/4;
- dev->rep[REP_PERIOD] = HZ/33;
+ if (!dev->rep[REP_DELAY])
+ dev->rep[REP_DELAY] = HZ/4;
+ if (!dev->rep[REP_PERIOD])
+ dev->rep[REP_PERIOD] = HZ/33;
INIT_LIST_HEAD(&dev->h_list);
list_add_tail(&dev->node, &input_dev_list);
@@ -676,20 +678,10 @@ static int input_handlers_read(char *buf, char **start, off_t pos, int count, in
return (count > cnt) ? cnt : count;
}
-#endif
-
-struct class input_class = {
- .name = "input",
-};
-
-static int __init input_init(void)
+static int __init input_proc_init(void)
{
struct proc_dir_entry *entry;
- int retval = -ENOMEM;
-
- class_register(&input_class);
-#ifdef CONFIG_PROC_FS
proc_bus_input_dir = proc_mkdir("input", proc_bus);
if (proc_bus_input_dir == NULL)
return -ENOMEM;
@@ -708,7 +700,22 @@ static int __init input_init(void)
return -ENOMEM;
}
entry->owner = THIS_MODULE;
+ return 0;
+}
+#else /* !CONFIG_PROC_FS */
+static inline int input_proc_init(void) { return 0; }
#endif
+
+struct class input_class = {
+ .name = "input",
+};
+
+static int __init input_init(void)
+{
+ int retval = -ENOMEM;
+
+ class_register(&input_class);
+ input_proc_init();
retval = register_chrdev(INPUT_MAJOR, "input", &input_fops);
if (retval) {
printk(KERN_ERR "input: unable to register char major %d", INPUT_MAJOR);
@@ -730,11 +737,10 @@ static int __init input_init(void)
static void __exit input_exit(void)
{
-#ifdef CONFIG_PROC_FS
remove_proc_entry("devices", proc_bus_input_dir);
remove_proc_entry("handlers", proc_bus_input_dir);
remove_proc_entry("input", proc_bus);
-#endif
+
devfs_remove("input");
unregister_chrdev(INPUT_MAJOR, "input");
class_unregister(&input_class);
diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
index 8c3561a26068..7f7278e19ab6 100644
--- a/drivers/input/joystick/Kconfig
+++ b/drivers/input/joystick/Kconfig
@@ -155,7 +155,8 @@ source "drivers/input/joystick/iforce/Kconfig"
config JOYSTICK_WARRIOR
tristate "Logitech WingMan Warrior joystick"
- depends on INPUT && INPUT_JOYSTICK && SERIO
+ depends on INPUT && INPUT_JOYSTICK
+ select SERIO
help
Say Y here if you have a Logitech WingMan Warrior joystick connected
to your computer's serial port.
@@ -167,7 +168,8 @@ config JOYSTICK_WARRIOR
config JOYSTICK_MAGELLAN
tristate "LogiCad3d Magellan/SpaceMouse 6dof controllers"
- depends on INPUT && INPUT_JOYSTICK && SERIO
+ depends on INPUT && INPUT_JOYSTICK
+ select SERIO
help
Say Y here if you have a Magellan or Space Mouse 6DOF controller
connected to your computer's serial port.
@@ -179,7 +181,8 @@ config JOYSTICK_MAGELLAN
config JOYSTICK_SPACEORB
tristate "SpaceTec SpaceOrb/Avenger 6dof controllers"
- depends on INPUT && INPUT_JOYSTICK && SERIO
+ depends on INPUT && INPUT_JOYSTICK
+ select SERIO
help
Say Y here if you have a SpaceOrb 360 or SpaceBall Avenger 6DOF
controller connected to your computer's serial port.
@@ -191,7 +194,8 @@ config JOYSTICK_SPACEORB
config JOYSTICK_SPACEBALL
tristate "SpaceTec SpaceBall 6dof controllers"
- depends on INPUT && INPUT_JOYSTICK && SERIO
+ depends on INPUT && INPUT_JOYSTICK
+ select SERIO
help
Say Y here if you have a SpaceTec SpaceBall 2003/3003/4000 FLX
controller connected to your computer's serial port. For the
@@ -204,7 +208,8 @@ config JOYSTICK_SPACEBALL
config JOYSTICK_STINGER
tristate "Gravis Stinger gamepad"
- depends on INPUT && INPUT_JOYSTICK && SERIO
+ depends on INPUT && INPUT_JOYSTICK
+ select SERIO
help
Say Y here if you have a Gravis Stinger connected to one of your
serial ports.
@@ -216,7 +221,8 @@ config JOYSTICK_STINGER
config JOYSTICK_TWIDDLER
tristate "Twiddler as a joystick"
- depends on INPUT && INPUT_JOYSTICK && SERIO
+ depends on INPUT && INPUT_JOYSTICK
+ select SERIO
help
Say Y here if you have a Handykey Twiddler connected to your
computer's serial port and want to use it as a joystick.
diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c
index 091fe2e887fa..9d757ce3f8ec 100644
--- a/drivers/input/joystick/db9.c
+++ b/drivers/input/joystick/db9.c
@@ -55,7 +55,9 @@ MODULE_PARM(db9_3, "2i");
#define DB9_MULTI_0802 0x08
#define DB9_MULTI_0802_2 0x09
#define DB9_CD32_PAD 0x0A
-#define DB9_MAX_PAD 0x0B
+#define DB9_SATURN_DPP 0x0B
+#define DB9_SATURN_DPP_2 0x0C
+#define DB9_MAX_PAD 0x0D
#define DB9_UP 0x01
#define DB9_DOWN 0x02
@@ -69,10 +71,7 @@ MODULE_PARM(db9_3, "2i");
#define DB9_NORMAL 0x0a
#define DB9_NOSELECT 0x08
-#define DB9_SATURN0 0x00
-#define DB9_SATURN1 0x02
-#define DB9_SATURN2 0x04
-#define DB9_SATURN3 0x06
+#define DB9_MAX_DEVICES 2
#define DB9_GENESIS6_DELAY 14
#define DB9_REFRESH_TIME HZ/100
@@ -82,7 +81,7 @@ static int db9_2[] __initdata = { -1, 0 };
static int db9_3[] __initdata = { -1, 0 };
struct db9 {
- struct input_dev dev[2];
+ struct input_dev dev[DB9_MAX_DEVICES];
struct timer_list timer;
struct pardevice *pd;
int mode;
@@ -96,12 +95,247 @@ static short db9_multi_btn[] = { BTN_TRIGGER, BTN_THUMB };
static short db9_genesis_btn[] = { BTN_START, BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_MODE };
static short db9_cd32_btn[] = { BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_TL, BTN_TR, BTN_START };
-static char db9_buttons[DB9_MAX_PAD] = { 0, 1, 2, 4, 0, 6, 8, 8, 1, 1, 7 };
+static char db9_buttons[DB9_MAX_PAD] = { 0, 1, 2, 4, 0, 6, 8, 9, 1, 1, 7, 9, 9 };
static short *db9_btn[DB9_MAX_PAD] = { NULL, db9_multi_btn, db9_multi_btn, db9_genesis_btn, NULL, db9_genesis_btn,
- db9_genesis_btn, db9_cd32_btn, db9_multi_btn, db9_multi_btn, db9_cd32_btn };
+ db9_genesis_btn, db9_cd32_btn, db9_multi_btn, db9_multi_btn, db9_cd32_btn,
+ db9_cd32_btn, db9_cd32_btn };
static char *db9_name[DB9_MAX_PAD] = { NULL, "Multisystem joystick", "Multisystem joystick (2 fire)", "Genesis pad",
NULL, "Genesis 5 pad", "Genesis 6 pad", "Saturn pad", "Multisystem (0.8.0.2) joystick",
- "Multisystem (0.8.0.2-dual) joystick", "Amiga CD-32 pad" };
+ "Multisystem (0.8.0.2-dual) joystick", "Amiga CD-32 pad", "Saturn dpp", "Saturn dpp dual" };
+
+static const int db9_max_pads[DB9_MAX_PAD] = { 0, 1, 1, 1, 0, 1, 1, 6, 1, 2, 1, 6, 12 };
+static const int db9_num_axis[DB9_MAX_PAD] = { 0, 2, 2, 2, 0, 2, 2, 7, 2, 2, 2 ,7, 7 };
+static const short db9_abs[] = { ABS_X, ABS_Y, ABS_RX, ABS_RY, ABS_RZ, ABS_Z, ABS_HAT0X, ABS_HAT0Y, ABS_HAT1X, ABS_HAT1Y };
+static const int db9_bidirectional[DB9_MAX_PAD] = { 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0 };
+static const int db9_reverse[DB9_MAX_PAD] = { 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0 };
+
+/*
+ * Saturn controllers
+ */
+#define DB9_SATURN_DELAY 300
+static const int db9_saturn_byte[] = { 1, 1, 1, 2, 2, 2, 2, 2, 1 };
+static const unsigned char db9_saturn_mask[] = { 0x04, 0x01, 0x02, 0x40, 0x20, 0x10, 0x08, 0x80, 0x08 };
+
+/*
+ * db9_saturn_write_sub() writes 2 bit data.
+ */
+static void db9_saturn_write_sub(struct parport *port, int type, unsigned char data, int powered, int pwr_sub)
+{
+ unsigned char c;
+
+ switch (type) {
+ case 1: /* DPP1 */
+ c = 0x80 | 0x30 | (powered ? 0x08 : 0) | (pwr_sub ? 0x04 : 0) | data;
+ parport_write_data(port, c);
+ break;
+ case 2: /* DPP2 */
+ c = 0x40 | data << 4 | (powered ? 0x08 : 0) | (pwr_sub ? 0x04 : 0) | 0x03;
+ parport_write_data(port, c);
+ break;
+ case 0: /* DB9 */
+ c = ((((data & 2) ? 2 : 0) | ((data & 1) ? 4 : 0)) ^ 0x02) | !powered;
+ parport_write_control(port, c);
+ break;
+ }
+}
+
+/*
+ * gc_saturn_read_sub() reads 4 bit data.
+ */
+static unsigned char db9_saturn_read_sub(struct parport *port, int type)
+{
+ unsigned char data;
+
+ if (type) {
+ /* DPP */
+ data = parport_read_status(port) ^ 0x80;
+ return (data & 0x80 ? 1 : 0) | (data & 0x40 ? 2 : 0)
+ | (data & 0x20 ? 4 : 0) | (data & 0x10 ? 8 : 0);
+ } else {
+ /* DB9 */
+ data = parport_read_data(port) & 0x0f;
+ return (data & 0x8 ? 1 : 0) | (data & 0x4 ? 2 : 0)
+ | (data & 0x2 ? 4 : 0) | (data & 0x1 ? 8 : 0);
+ }
+}
+
+/*
+ * db9_saturn_read_analog() sends clock and reads 8 bit data.
+ */
+static unsigned char db9_saturn_read_analog(struct parport *port, int type, int powered)
+{
+ unsigned char data;
+
+ db9_saturn_write_sub(port, type, 0, powered, 0);
+ udelay(DB9_SATURN_DELAY);
+ data = db9_saturn_read_sub(port, type) << 4;
+ db9_saturn_write_sub(port, type, 2, powered, 0);
+ udelay(DB9_SATURN_DELAY);
+ data |= db9_saturn_read_sub(port, type);
+ return data;
+}
+
+/*
+ * db9_saturn_read_packet() reads whole saturn packet at connector
+ * and returns device identifier code.
+ */
+static unsigned char db9_saturn_read_packet(struct parport *port, unsigned char *data, int type, int powered)
+{
+ int i, j;
+ unsigned char tmp;
+
+ db9_saturn_write_sub(port, type, 3, powered, 0);
+ data[0] = db9_saturn_read_sub(port, type);
+ switch (data[0] & 0x0f) {
+ case 0xf:
+ /* 1111 no pad */
+ return data[0] = 0xff;
+ case 0x4: case 0x4 | 0x8:
+ /* ?100 : digital controller */
+ db9_saturn_write_sub(port, type, 0, powered, 1);
+ data[2] = db9_saturn_read_sub(port, type) << 4;
+ db9_saturn_write_sub(port, type, 2, powered, 1);
+ data[1] = db9_saturn_read_sub(port, type) << 4;
+ db9_saturn_write_sub(port, type, 1, powered, 1);
+ data[1] |= db9_saturn_read_sub(port, type);
+ db9_saturn_write_sub(port, type, 3, powered, 1);
+ /* data[2] |= db9_saturn_read_sub(port, type); */
+ data[2] |= data[0];
+ return data[0] = 0x02;
+ case 0x1:
+ /* 0001 : analog controller or multitap */
+ db9_saturn_write_sub(port, type, 2, powered, 0);
+ udelay(DB9_SATURN_DELAY);
+ data[0] = db9_saturn_read_analog(port, type, powered);
+ if (data[0] != 0x41) {
+ /* read analog controller */
+ for (i = 0; i < (data[0] & 0x0f); i++)
+ data[i + 1] = db9_saturn_read_analog(port, type, powered);
+ db9_saturn_write_sub(port, type, 3, powered, 0);
+ return data[0];
+ } else {
+ /* read multitap */
+ if (db9_saturn_read_analog(port, type, powered) != 0x60)
+ return data[0] = 0xff;
+ for (i = 0; i < 60; i += 10) {
+ data[i] = db9_saturn_read_analog(port, type, powered);
+ if (data[i] != 0xff)
+ /* read each pad */
+ for (j = 0; j < (data[i] & 0x0f); j++)
+ data[i + j + 1] = db9_saturn_read_analog(port, type, powered);
+ }
+ db9_saturn_write_sub(port, type, 3, powered, 0);
+ return 0x41;
+ }
+ case 0x0:
+ /* 0000 : mouse */
+ db9_saturn_write_sub(port, type, 2, powered, 0);
+ udelay(DB9_SATURN_DELAY);
+ tmp = db9_saturn_read_analog(port, type, powered);
+ if (tmp == 0xff) {
+ for (i = 0; i < 3; i++)
+ data[i + 1] = db9_saturn_read_analog(port, type, powered);
+ db9_saturn_write_sub(port, type, 3, powered, 0);
+ return data[0] = 0xe3;
+ }
+ default:
+ return data[0];
+ }
+}
+
+/*
+ * db9_saturn_report() analyzes packet and reports.
+ */
+static int db9_saturn_report(unsigned char id, unsigned char data[60], struct input_dev *dev, int n, int max_pads)
+{
+ int tmp, i, j;
+
+ tmp = (id == 0x41) ? 60 : 10;
+ for (j = 0; (j < tmp) && (n < max_pads); j += 10, n++) {
+ switch (data[j]) {
+ case 0x16: /* multi controller (analog 4 axis) */
+ input_report_abs(dev + n, db9_abs[5], data[j + 6]);
+ case 0x15: /* mission stick (analog 3 axis) */
+ input_report_abs(dev + n, db9_abs[3], data[j + 4]);
+ input_report_abs(dev + n, db9_abs[4], data[j + 5]);
+ case 0x13: /* racing controller (analog 1 axis) */
+ input_report_abs(dev + n, db9_abs[2], data[j + 3]);
+ case 0x34: /* saturn keyboard (udlr ZXC ASD QE Esc) */
+ case 0x02: /* digital pad (digital 2 axis + buttons) */
+ input_report_abs(dev + n, db9_abs[0], !(data[j + 1] & 128) - !(data[j + 1] & 64));
+ input_report_abs(dev + n, db9_abs[1], !(data[j + 1] & 32) - !(data[j + 1] & 16));
+ for (i = 0; i < 9; i++)
+ input_report_key(dev + n, db9_cd32_btn[i], ~data[j + db9_saturn_byte[i]] & db9_saturn_mask[i]);
+ break;
+ case 0x19: /* mission stick x2 (analog 6 axis + buttons) */
+ input_report_abs(dev + n, db9_abs[0], !(data[j + 1] & 128) - !(data[j + 1] & 64));
+ input_report_abs(dev + n, db9_abs[1], !(data[j + 1] & 32) - !(data[j + 1] & 16));
+ for (i = 0; i < 9; i++)
+ input_report_key(dev + n, db9_cd32_btn[i], ~data[j + db9_saturn_byte[i]] & db9_saturn_mask[i]);
+ input_report_abs(dev + n, db9_abs[2], data[j + 3]);
+ input_report_abs(dev + n, db9_abs[3], data[j + 4]);
+ input_report_abs(dev + n, db9_abs[4], data[j + 5]);
+ /*
+ input_report_abs(dev + n, db9_abs[8], (data[j + 6] & 128 ? 0 : 1) - (data[j + 6] & 64 ? 0 : 1));
+ input_report_abs(dev + n, db9_abs[9], (data[j + 6] & 32 ? 0 : 1) - (data[j + 6] & 16 ? 0 : 1));
+ */
+ input_report_abs(dev + n, db9_abs[6], data[j + 7]);
+ input_report_abs(dev + n, db9_abs[7], data[j + 8]);
+ input_report_abs(dev + n, db9_abs[5], data[j + 9]);
+ break;
+ case 0xd3: /* sankyo ff (analog 1 axis + stop btn) */
+ input_report_key(dev + n, BTN_A, data[j + 3] & 0x80);
+ input_report_abs(dev + n, db9_abs[2], data[j + 3] & 0x7f);
+ break;
+ case 0xe3: /* shuttle mouse (analog 2 axis + buttons. signed value) */
+ input_report_key(dev + n, BTN_START, data[j + 1] & 0x08);
+ input_report_key(dev + n, BTN_A, data[j + 1] & 0x04);
+ input_report_key(dev + n, BTN_C, data[j + 1] & 0x02);
+ input_report_key(dev + n, BTN_B, data[j + 1] & 0x01);
+ input_report_abs(dev + n, db9_abs[2], data[j + 2] ^ 0x80);
+ input_report_abs(dev + n, db9_abs[3], (0xff-(data[j + 3] ^ 0x80))+1); /* */
+ break;
+ case 0xff:
+ default: /* no pad */
+ input_report_abs(dev + n, db9_abs[0], 0);
+ input_report_abs(dev + n, db9_abs[1], 0);
+ for (i = 0; i < 9; i++)
+ input_report_key(dev + n, db9_cd32_btn[i], 0);
+ break;
+ }
+ }
+ return n;
+}
+
+static int db9_saturn(int mode, struct parport *port, struct input_dev *dev)
+{
+ unsigned char id, data[60];
+ int type, n, max_pads;
+ int tmp, i;
+
+ switch (mode) {
+ case DB9_SATURN_PAD:
+ type = 0;
+ n = 1;
+ break;
+ case DB9_SATURN_DPP:
+ type = 1;
+ n = 1;
+ break;
+ case DB9_SATURN_DPP_2:
+ type = 1;
+ n = 2;
+ break;
+ default:
+ return -1;
+ }
+ max_pads = min(db9_max_pads[mode], DB9_MAX_DEVICES);
+ for (tmp = 0, i = 0; i < n; i++) {
+ id = db9_saturn_read_packet(port, data, type + i, 1);
+ tmp = db9_saturn_report(id, data, dev, tmp, max_pads);
+ }
+ return 0;
+}
static void db9_timer(unsigned long private)
{
@@ -222,28 +456,10 @@ static void db9_timer(unsigned long private)
break;
case DB9_SATURN_PAD:
+ case DB9_SATURN_DPP:
+ case DB9_SATURN_DPP_2:
- parport_write_control(port, DB9_SATURN0);
- data = parport_read_data(port);
-
- input_report_key(dev, BTN_Y, ~data & DB9_LEFT);
- input_report_key(dev, BTN_Z, ~data & DB9_DOWN);
- input_report_key(dev, BTN_TL, ~data & DB9_UP);
- input_report_key(dev, BTN_TR, ~data & DB9_RIGHT);
-
- parport_write_control(port, DB9_SATURN2);
- data = parport_read_data(port);
-
- input_report_abs(dev, ABS_X, (data & DB9_RIGHT ? 0 : 1) - (data & DB9_LEFT ? 0 : 1));
- input_report_abs(dev, ABS_Y, (data & DB9_DOWN ? 0 : 1) - (data & DB9_UP ? 0 : 1));
-
- parport_write_control(port, DB9_NORMAL);
- data = parport_read_data(port);
-
- input_report_key(dev, BTN_A, ~data & DB9_LEFT);
- input_report_key(dev, BTN_B, ~data & DB9_UP);
- input_report_key(dev, BTN_C, ~data & DB9_DOWN);
- input_report_key(dev, BTN_X, ~data & DB9_RIGHT);
+ db9_saturn(db9->mode, port, dev);
break;
case DB9_CD32_PAD:
@@ -279,8 +495,10 @@ static int db9_open(struct input_dev *dev)
if (!db9->used++) {
parport_claim(db9->pd);
parport_write_data(port, 0xff);
- parport_data_reverse(port);
- parport_write_control(port, DB9_NORMAL);
+ if (db9_reverse[db9->mode]) {
+ parport_data_reverse(port);
+ parport_write_control(port, DB9_NORMAL);
+ }
mod_timer(&db9->timer, jiffies + DB9_REFRESH_TIME);
}
@@ -321,11 +539,13 @@ static struct db9 __init *db9_probe(int *config)
return NULL;
}
- if (!(pp->modes & PARPORT_MODE_TRISTATE) && config[1] != DB9_MULTI_0802) {
- printk(KERN_ERR "db9.c: specified parport is not bidirectional\n");
- return NULL;
+ if (db9_bidirectional[config[1]]) {
+ if (!(pp->modes & PARPORT_MODE_TRISTATE)) {
+ printk(KERN_ERR "db9.c: specified parport is not bidirectional\n");
+ return NULL;
+ }
}
-
+
if (!(db9 = kmalloc(sizeof(struct db9), GFP_KERNEL)))
return NULL;
memset(db9, 0, sizeof(struct db9));
@@ -343,7 +563,7 @@ static struct db9 __init *db9_probe(int *config)
return NULL;
}
- for (i = 0; i < 1 + (db9->mode == DB9_MULTI_0802_2); i++) {
+ for (i = 0; i < (min(db9_max_pads[db9->mode], DB9_MAX_DEVICES)); i++) {
sprintf(db9->phys[i], "%s/input%d", db9->pd->port->name, i);
@@ -359,14 +579,19 @@ static struct db9 __init *db9_probe(int *config)
db9->dev[i].id.version = 0x0100;
db9->dev[i].evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
- db9->dev[i].absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
-
for (j = 0; j < db9_buttons[db9->mode]; j++)
set_bit(db9_btn[db9->mode][j], db9->dev[i].keybit);
-
- db9->dev[i].absmin[ABS_X] = -1; db9->dev[i].absmax[ABS_X] = 1;
- db9->dev[i].absmin[ABS_Y] = -1; db9->dev[i].absmax[ABS_Y] = 1;
-
+ for (j = 0; j < db9_num_axis[db9->mode]; j++) {
+ set_bit(db9_abs[j], db9->dev[i].absbit);
+ if (j < 2) {
+ db9->dev[i].absmin[db9_abs[j]] = -1;
+ db9->dev[i].absmax[db9_abs[j]] = 1;
+ } else {
+ db9->dev[i].absmin[db9_abs[j]] = 1;
+ db9->dev[i].absmax[db9_abs[j]] = 255;
+ db9->dev[i].absflat[db9_abs[j]] = 0;
+ }
+ }
input_register_device(db9->dev + i);
printk(KERN_INFO "input: %s on %s\n", db9->dev[i].name, db9->pd->port->name);
}
@@ -419,7 +644,7 @@ void __exit db9_exit(void)
for (i = 0; i < 3; i++)
if (db9_base[i]) {
- for (j = 0; j < 1 + (db9_base[i]->mode == DB9_MULTI_0802_2); j++)
+ for (j = 0; j < min(db9_max_pads[db9_base[i]->mode], DB9_MAX_DEVICES); j++)
input_unregister_device(db9_base[i]->dev + j);
parport_unregister_device(db9_base[i]->pd);
}
diff --git a/drivers/input/joystick/iforce/iforce-packets.c b/drivers/input/joystick/iforce/iforce-packets.c
index 176c5e889186..0c37044ef85a 100644
--- a/drivers/input/joystick/iforce/iforce-packets.c
+++ b/drivers/input/joystick/iforce/iforce-packets.c
@@ -166,8 +166,7 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data,
iforce->expect_packet = 0;
iforce->ecmd = cmd;
memcpy(iforce->edata, data, IFORCE_MAX_LENGTH);
- if (waitqueue_active(&iforce->wait))
- wake_up(&iforce->wait);
+ wake_up(&iforce->wait);
}
#endif
@@ -264,7 +263,7 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
set_current_state(TASK_INTERRUPTIBLE);
add_wait_queue(&iforce->wait, &wait);
- if (usb_submit_urb(iforce->ctrl, GFP_KERNEL)) {
+ if (usb_submit_urb(iforce->ctrl, GFP_ATOMIC)) {
set_current_state(TASK_RUNNING);
remove_wait_queue(&iforce->wait, &wait);
return -1;
diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c
index 0acb3f9b6c1d..a2cefd078385 100644
--- a/drivers/input/joystick/iforce/iforce-usb.c
+++ b/drivers/input/joystick/iforce/iforce-usb.c
@@ -116,8 +116,7 @@ static void iforce_usb_out(struct urb *urb, struct pt_regs *regs)
iforce_usb_xmit(iforce);
- if (waitqueue_active(&iforce->wait))
- wake_up(&iforce->wait);
+ wake_up(&iforce->wait);
}
static void iforce_usb_ctrl(struct urb *urb, struct pt_regs *regs)
@@ -125,8 +124,7 @@ static void iforce_usb_ctrl(struct urb *urb, struct pt_regs *regs)
struct iforce *iforce = urb->context;
if (urb->status) return;
iforce->ecmd = 0xff00 | urb->actual_length;
- if (waitqueue_active(&iforce->wait))
- wake_up(&iforce->wait);
+ wake_up(&iforce->wait);
}
static int iforce_usb_probe(struct usb_interface *intf,
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index d210fba2b127..fa4c33278e4b 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -14,7 +14,8 @@ config INPUT_KEYBOARD
config KEYBOARD_ATKBD
tristate "AT keyboard support" if EMBEDDED || !X86
default y
- depends on INPUT && INPUT_KEYBOARD && SERIO
+ depends on INPUT && INPUT_KEYBOARD
+ select SERIO_I8042
help
Say Y here if you want to use a standard AT or PS/2 keyboard. Usually
you'll need this, unless you have a different type keyboard (USB, ADB
@@ -30,7 +31,8 @@ config KEYBOARD_ATKBD
config KEYBOARD_SUNKBD
tristate "Sun Type 4 and Type 5 keyboard support"
- depends on INPUT && INPUT_KEYBOARD && SERIO
+ depends on INPUT && INPUT_KEYBOARD
+ select SERIO
help
Say Y here if you want to use a Sun Type 4 or Type 5 keyboard,
connected either to the Sun keyboard connector or to an serial
@@ -43,7 +45,8 @@ config KEYBOARD_SUNKBD
config KEYBOARD_XTKBD
tristate "XT Keyboard support"
- depends on INPUT && INPUT_KEYBOARD && SERIO
+ depends on INPUT && INPUT_KEYBOARD
+ select SERIO
help
Say Y here if you want to use the old IBM PC/XT keyboard (or
compatible) on your system. This is only possible with a
@@ -57,7 +60,8 @@ config KEYBOARD_XTKBD
config KEYBOARD_NEWTON
tristate "Newton keyboard"
- depends on INPUT && INPUT_KEYBOARD && SERIO
+ depends on INPUT && INPUT_KEYBOARD
+ select SERIO
help
Say Y here if you have a Newton keyboard on a serial port.
@@ -92,7 +96,8 @@ config KEYBOARD_AMIGA
config KEYBOARD_98KBD
tristate "NEC PC-9800 Keyboard support"
- depends on X86_PC9800 && INPUT && INPUT_KEYBOARD && SERIO
+ depends on X86_PC9800 && INPUT && INPUT_KEYBOARD
+ select SERIO
help
Say Y here if you want to use the NEC PC-9801/PC-9821 keyboard (or
compatible) on your system.
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 719def669f8f..82c987799edb 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -18,6 +18,7 @@
#include <linux/input.h>
#include <linux/serio.h>
#include <linux/workqueue.h>
+#include <linux/timer.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
MODULE_DESCRIPTION("AT and PS/2 keyboard driver");
@@ -40,8 +41,8 @@ static int atkbd_reset = 1;
static unsigned char atkbd_set2_keycode[512] = {
0, 67, 65, 63, 61, 59, 60, 88, 0, 68, 66, 64, 62, 15, 41, 85,
0, 56, 42,182, 29, 16, 2, 89, 0, 0, 44, 31, 30, 17, 3, 90,
- 0, 46, 45, 32, 18, 5, 4, 91, 0, 57, 47, 33, 20, 19, 6, 0,
- 0, 49, 48, 35, 34, 21, 7, 0, 0, 0, 50, 36, 22, 8, 9, 0,
+ 0, 46, 45, 32, 18, 5, 4, 91, 90, 57, 47, 33, 20, 19, 6, 0,
+ 91, 49, 48, 35, 34, 21, 7, 0, 0, 0, 50, 36, 22, 8, 9, 0,
0, 51, 37, 23, 24, 11, 10, 0, 0, 52, 53, 38, 39, 25, 12, 0,
122, 89, 40,120, 26, 13, 0, 0, 58, 54, 28, 27, 0, 43, 0, 0,
85, 86, 90, 91, 92, 93, 14, 94, 95, 79,183, 75, 71,121, 0,123,
@@ -87,10 +88,10 @@ static unsigned char atkbd_set3_keycode[512] = {
#define ATKBD_CMD_GSCANSET 0x11f0
#define ATKBD_CMD_SSCANSET 0x10f0
#define ATKBD_CMD_GETID 0x02f2
+#define ATKBD_CMD_SETREP 0x10f3
#define ATKBD_CMD_ENABLE 0x00f4
#define ATKBD_CMD_RESET_DIS 0x00f5
#define ATKBD_CMD_RESET_BAT 0x02ff
-#define ATKBD_CMD_SETALL_MB 0x00f8
#define ATKBD_CMD_RESEND 0x00fe
#define ATKBD_CMD_EX_ENABLE 0x10ea
#define ATKBD_CMD_EX_SETLEDS 0x20eb
@@ -114,12 +115,14 @@ struct atkbd {
unsigned char keycode[512];
struct input_dev dev;
struct serio *serio;
+ struct timer_list timer;
char name[64];
char phys[32];
unsigned char cmdbuf[4];
unsigned char cmdcnt;
unsigned char set;
unsigned char release;
+ int lastkey;
volatile signed char ack;
unsigned char emul;
unsigned short id;
@@ -142,6 +145,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags);
#endif
+#if !defined(__i386__) && !defined (__x86_64__)
if ((flags & (SERIO_FRAME | SERIO_PARITY)) && (~flags & SERIO_TIMEOUT) && !atkbd->resend && atkbd->write) {
printk("atkbd.c: frame/parity error: %02x\n", flags);
serio_write(serio, ATKBD_CMD_RESEND);
@@ -151,6 +155,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
if (!flags)
atkbd->resend = 0;
+#endif
switch (code) {
case ATKBD_RET_ACK:
@@ -195,6 +200,15 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
atkbd->set, code, serio->phys, atkbd->release ? "released" : "pressed");
break;
default:
+#if 0
+ if (!atkbd->release) {
+ mod_timer(&atkbd->timer,
+ jiffies + (test_bit(atkbd->keycode[code],
+ atkbd->dev.key) ? HZ/33 : HZ/4) + HZ/100);
+ atkbd->lastkey = atkbd->keycode[code];
+ }
+#endif
+
input_regs(&atkbd->dev, regs);
input_report_key(&atkbd->dev, atkbd->keycode[code], !atkbd->release);
input_sync(&atkbd->dev);
@@ -205,6 +219,13 @@ out:
return IRQ_HANDLED;
}
+static void atkbd_force_key_up(unsigned long data)
+{
+ struct atkbd *atkbd = (void *) data;
+ input_report_key(&atkbd->dev, atkbd->lastkey, 0);
+ input_sync(&atkbd->dev);
+}
+
/*
* atkbd_sendbyte() sends a byte to the keyboard, and waits for
* acknowledge. It doesn't handle resends according to the keyboard
@@ -214,7 +235,7 @@ out:
static int atkbd_sendbyte(struct atkbd *atkbd, unsigned char byte)
{
- int timeout = 10000; /* 100 msec */
+ int timeout = 20000; /* 200 msec */
atkbd->ack = 0;
#ifdef ATKBD_DEBUG
@@ -322,13 +343,50 @@ static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int co
}
/*
- * Enable keyboard.
+ * atkbd_probe() probes for an AT keyboard on a serio port.
*/
-static void atkbd_enable(struct atkbd *atkbd)
+
+static int atkbd_probe(struct atkbd *atkbd)
{
- if (atkbd_command(atkbd, NULL, ATKBD_CMD_ENABLE))
- printk(KERN_ERR "atkbd.c: Failed to enable keyboard on %s\n",
- atkbd->serio->phys);
+ unsigned char param[2];
+
+/*
+ * Some systems, where the bit-twiddling when testing the io-lines of the
+ * controller may confuse the keyboard need a full reset of the keyboard. On
+ * these systems the BIOS also usually doesn't do it for us.
+ */
+
+ if (atkbd_reset)
+ if (atkbd_command(atkbd, NULL, ATKBD_CMD_RESET_BAT))
+ printk(KERN_WARNING "atkbd.c: keyboard reset failed on %s\n", atkbd->serio->phys);
+
+/*
+ * Then we check the keyboard ID. We should get 0xab83 under normal conditions.
+ * Some keyboards report different values, but the first byte is always 0xab or
+ * 0xac. Some old AT keyboards don't report anything. If a mouse is connected, this
+ * should make sure we don't try to set the LEDs on it.
+ */
+
+ if (atkbd_command(atkbd, param, ATKBD_CMD_GETID)) {
+
+/*
+ * If the get ID command failed, we check if we can at least set the LEDs on
+ * the keyboard. This should work on every keyboard out there. It also turns
+ * the LEDs off, which we want anyway.
+ */
+ param[0] = 0;
+ if (atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS))
+ return -1;
+ atkbd->id = 0xabba;
+ return 0;
+ }
+
+ if (param[0] != 0xab && param[0] != 0xac)
+ return -1;
+ atkbd->id = (param[0] << 8) | param[1];
+
+
+ return 0;
}
/*
@@ -365,103 +423,57 @@ static int atkbd_set_3(struct atkbd *atkbd)
return 4;
}
-/*
- * Try to set the set we want.
- */
+ if (atkbd_set != 3)
+ return 2;
- param[0] = atkbd_set;
+ param[0] = 3;
if (atkbd_command(atkbd, param, ATKBD_CMD_SSCANSET))
return 2;
-/*
- * Read set number. Beware here. Some keyboards always send '2'
- * or some other number regardless into what mode they have been
- * attempted to be set. Other keyboards treat the '0' command as
- * 'set to set 0', and not 'report current set' as they should.
- * In that case we time out, and return 2.
- */
-
param[0] = 0;
if (atkbd_command(atkbd, param, ATKBD_CMD_GSCANSET))
return 2;
-/*
- * Here we return the set number the keyboard reports about
- * itself.
- */
+ if (param[0] != 3)
+ return 2;
- return (param[0] == 3) ? 3 : 2;
+ return 3;
}
-/*
- * atkbd_probe() probes for an AT keyboard on a serio port.
- */
-
-static int atkbd_probe(struct atkbd *atkbd)
+static int atkbd_enable(struct atkbd *atkbd)
{
- unsigned char param[2];
-
-/*
- * Some systems, where the bit-twiddling when testing the io-lines of the
- * controller may confuse the keyboard need a full reset of the keyboard. On
- * these systems the BIOS also usually doesn't do it for us.
- */
-
- if (atkbd_reset)
- if (atkbd_command(atkbd, NULL, ATKBD_CMD_RESET_BAT))
- printk(KERN_WARNING
- "atkbd.c: keyboard reset failed on %s\n",
- atkbd->serio->phys);
+ unsigned char param[1];
/*
- * Then we check the keyboard ID. We should get 0xab83 under normal conditions.
- * Some keyboards report different values, but the first byte is always 0xab or
- * 0xac. Some old AT keyboards don't report anything.
+ * Set the LEDs to a defined state.
*/
- if (atkbd_command(atkbd, param, ATKBD_CMD_GETID)) {
+ param[0] = 0;
+ if (atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS))
+ return -1;
/*
- * If the get ID command failed, we check if we can at least set the LEDs on
- * the keyboard. This should work on every keyboard out there. It also turns
- * the LEDs off, which we want anyway.
+ * Set autorepeat to fastest possible.
*/
- param[0] = 0;
- if (atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS))
- return -1;
- atkbd->id = 0xabba;
- return 0;
- }
- if (param[0] != 0xab && param[0] != 0xac)
+ param[0] = 0;
+ if (atkbd_command(atkbd, param, ATKBD_CMD_SETREP))
return -1;
- atkbd->id = (param[0] << 8) | param[1];
/*
- * Set the LEDs to a defined state.
+ * Enable the keyboard to receive keystrokes.
*/
- param[0] = 0;
- if (atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS))
+ if (atkbd_command(atkbd, NULL, ATKBD_CMD_ENABLE)) {
+ printk(KERN_ERR "atkbd.c: Failed to enable keyboard on %s\n",
+ atkbd->serio->phys);
return -1;
+ }
return 0;
}
/*
- * Disable autorepeat. We don't need it, as we do it in software anyway,
- * because that way can get faster repeat, and have less system load (less
- * accesses to the slow ISA hardware). If this fails, we don't care, and will
- * just ignore the repeated keys.
- *
- * This command is for scancode set 3 only.
- */
-static void atkbd_disable_autorepeat(struct atkbd *atkbd)
-{
- atkbd_command(atkbd, NULL, ATKBD_CMD_SETALL_MB);
-}
-
-/*
* atkbd_cleanup() restores the keyboard state so that BIOS is happy after a
* reboot.
*/
@@ -485,7 +497,7 @@ static void atkbd_disconnect(struct serio *serio)
}
/*
- * atkbd_connect() is called when the serio module finds an interface
+ * atkbd_connect() is called when the serio module finds and interface
* that isn't handled yet by an appropriate device driver. We check if
* there is an AT keyboard out there and if yes, we register ourselves
* to the input module.
@@ -513,6 +525,9 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev)
atkbd->dev.ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL);
} else atkbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+ atkbd->dev.rep[REP_DELAY] = HZ/4 + HZ/50;
+ atkbd->dev.rep[REP_PERIOD] = HZ/33;
+
atkbd->serio = serio;
init_input_dev(&atkbd->dev);
@@ -525,6 +540,10 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev)
serio->private = atkbd;
+ init_timer(&atkbd->timer);
+ atkbd->timer.data = (long) atkbd;
+ atkbd->timer.function = atkbd_force_key_up;
+
if (serio_open(serio, dev)) {
kfree(atkbd);
return;
@@ -539,9 +558,8 @@ static void atkbd_connect(struct serio *serio, struct serio_dev *dev)
}
atkbd->set = atkbd_set_3(atkbd);
- if (atkbd->set == 3)
- atkbd_disable_autorepeat(atkbd);
atkbd_enable(atkbd);
+
} else {
atkbd->set = 2;
atkbd->id = 0xab00;
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index a6b481994163..25bb551723e2 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -14,14 +14,13 @@ config INPUT_MOUSE
config MOUSE_PS2
tristate "PS/2 mouse"
default y
- depends on INPUT && INPUT_MOUSE && SERIO
+ depends on INPUT && INPUT_MOUSE
+ select SERIO_I8042
---help---
Say Y here if you have a PS/2 mouse connected to your system. This
includes the standard 2 or 3-button PS/2 mouse, as well as PS/2
mice with wheels and extra buttons, Microsoft, Logitech or Genius
- compatible. Support for Synaptics TouchPads is also included.
- For Synaptics TouchPad support in XFree86 you'll need this XFree86
- driver: http://w1.894.telia.com/~u89404340/touchpad/index.html
+ compatible.
If unsure, say Y.
@@ -30,9 +29,26 @@ config MOUSE_PS2
The module will be called psmouse. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
+config MOUSE_PS2_SYNAPTICS
+ bool "Synaptics TouchPad"
+ default n
+ depends on INPUT && INPUT_MOUSE && MOUSE_PS2
+ ---help---
+ Say Y here if you have a Synaptics TouchPad connected to your system.
+ This touchpad is found on many modern laptop computers.
+
+ Note that you also need a user space driver to interpret the data
+ generated by the kernel. A compatible driver for XFree86 is available
+ from http://w1.894.telia.com/~u89404340/touchpad/index.html
+
+ The gpm program is not yet able to interpret the data from this
+ driver, so if you need to use the touchpad in the console, you have to
+ say N for now.
+
config MOUSE_SERIAL
tristate "Serial mouse"
- depends on INPUT && INPUT_MOUSE && SERIO
+ depends on INPUT && INPUT_MOUSE
+ select SERIO
---help---
Say Y here if you have a serial (RS-232, COM port) mouse connected
to your system. This includes Sun, MouseSystems, Microsoft,
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 030d23149e2e..4ed0da4e7d7e 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -17,6 +17,7 @@
#include <linux/input.h>
#include <linux/serio.h>
#include <linux/init.h>
+#include <linux/pm.h>
#include "psmouse.h"
#include "synaptics.h"
#include "logips2pp.h"
@@ -29,6 +30,8 @@ MODULE_PARM(psmouse_resolution, "i");
MODULE_PARM_DESC(psmouse_resolution, "Resolution, in dpi.");
MODULE_PARM(psmouse_smartscroll, "i");
MODULE_PARM_DESC(psmouse_smartscroll, "Logitech Smartscroll autorepeat, 1 = enabled (default), 0 = disabled.");
+MODULE_PARM(psmouse_resetafter, "i");
+MODULE_PARM_DESC(psmouse_resetafter, "Reset Synaptics Touchpad after so many bad packets (0 = never).");
MODULE_LICENSE("GPL");
#define PSMOUSE_LOGITECH_SMARTSCROLL 1
@@ -36,11 +39,12 @@ MODULE_LICENSE("GPL");
static int psmouse_noext;
int psmouse_resolution;
int psmouse_smartscroll = PSMOUSE_LOGITECH_SMARTSCROLL;
+unsigned int psmouse_resetafter;
-static char *psmouse_protocols[] = { "None", "PS/2", "PS2++", "PS2T++", "GenPS/2", "ImPS/2", "ImExPS/2", "Synaptics"};
+static char *psmouse_protocols[] = { "None", "PS/2", "PS2++", "PS2T++", "GenPS/2", "ImPS/2", "ImExPS/2", "SynPS/2"};
/*
- * psmouse_process_packet() anlyzes the PS/2 mouse packet contents and
+ * psmouse_process_packet() analyzes the PS/2 mouse packet contents and
* reports relevant events to the input module.
*/
@@ -108,6 +112,9 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
{
struct psmouse *psmouse = serio->private;
+ if (psmouse->state == PSMOUSE_IGNORE)
+ goto out;
+
if (psmouse->acking) {
switch (data) {
case PSMOUSE_RET_ACK:
@@ -132,20 +139,35 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
}
if (psmouse->pktcnt && time_after(jiffies, psmouse->last + HZ/2)) {
- printk(KERN_WARNING "psmouse.c: Lost synchronization, throwing %d bytes away.\n", psmouse->pktcnt);
+ printk(KERN_WARNING "psmouse.c: %s at %s lost synchronization, throwing %d bytes away.\n",
+ psmouse->name, psmouse->phys, psmouse->pktcnt);
psmouse->pktcnt = 0;
}
psmouse->last = jiffies;
psmouse->packet[psmouse->pktcnt++] = data;
- if (psmouse->pktcnt == 3 + (psmouse->type >= PSMOUSE_GENPS)) {
- psmouse_process_packet(psmouse, regs);
- psmouse->pktcnt = 0;
- goto out;
+ if (psmouse->packet[0] == PSMOUSE_RET_BAT) {
+ if (psmouse->pktcnt == 1)
+ goto out;
+
+ if (psmouse->pktcnt == 2) {
+ if (psmouse->packet[1] == PSMOUSE_RET_ID) {
+ psmouse->state = PSMOUSE_IGNORE;
+ serio_rescan(serio);
+ goto out;
+ }
+ if (psmouse->type == PSMOUSE_SYNAPTICS) {
+ /* neither 0xAA nor 0x00 are valid first bytes
+ * for a packet in absolute mode
+ */
+ psmouse->pktcnt = 0;
+ goto out;
+ }
+ }
}
- if (psmouse->pktcnt == 1 && psmouse->type == PSMOUSE_SYNAPTICS) {
+ if (psmouse->type == PSMOUSE_SYNAPTICS) {
/*
* The synaptics driver has its own resync logic,
* so it needs to receive all bytes one at a time.
@@ -155,8 +177,9 @@ static irqreturn_t psmouse_interrupt(struct serio *serio,
goto out;
}
- if (psmouse->pktcnt == 1 && psmouse->packet[0] == PSMOUSE_RET_BAT) {
- serio_rescan(serio);
+ if (psmouse->pktcnt == 3 + (psmouse->type >= PSMOUSE_GENPS)) {
+ psmouse_process_packet(psmouse, regs);
+ psmouse->pktcnt = 0;
goto out;
}
out:
@@ -200,7 +223,7 @@ int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command)
psmouse->cmdcnt = receive;
if (command == PSMOUSE_CMD_RESET_BAT)
- timeout = 2000000; /* 2 sec */
+ timeout = 4000000; /* 4 sec */
if (command & 0xff)
if (psmouse_sendbyte(psmouse, command & 0xff))
@@ -227,7 +250,7 @@ int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command)
for (i = 0; i < receive; i++)
param[i] = psmouse->cmdbuf[(receive - 1) - i];
- if (psmouse->cmdcnt)
+ if (psmouse->cmdcnt)
return (psmouse->cmdcnt = 0) - 1;
return 0;
@@ -450,14 +473,18 @@ static void psmouse_initialize(struct psmouse *psmouse)
*/
psmouse_command(psmouse, param, PSMOUSE_CMD_SETSTREAM);
+}
/*
- * Last, we enable the mouse so that we get reports from it.
+ * psmouse_activate() enables the mouse so that we get motion reports from it.
*/
+static void psmouse_activate(struct psmouse *psmouse)
+{
if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_ENABLE))
printk(KERN_WARNING "psmouse.c: Failed to enable mouse on %s\n", psmouse->serio->phys);
+ psmouse->state = PSMOUSE_ACTIVATED;
}
/*
@@ -478,13 +505,39 @@ static void psmouse_cleanup(struct serio *serio)
static void psmouse_disconnect(struct serio *serio)
{
struct psmouse *psmouse = serio->private;
+
+ psmouse->state = PSMOUSE_IGNORE;
+ synaptics_disconnect(psmouse);
input_unregister_device(&psmouse->dev);
serio_close(serio);
- synaptics_disconnect(psmouse);
kfree(psmouse);
}
/*
+ * Reinitialize mouse hardware after software suspend.
+ */
+
+static int psmouse_pm_callback(struct pm_dev *dev, pm_request_t request, void *data)
+{
+ struct psmouse *psmouse = dev->data;
+ struct serio_dev *ser_dev = psmouse->serio->dev;
+
+ synaptics_disconnect(psmouse);
+
+ /* We need to reopen the serio port to reinitialize the i8042 controller */
+ serio_close(psmouse->serio);
+ serio_open(psmouse->serio, ser_dev);
+
+ /* Probe and re-initialize the mouse */
+ psmouse_probe(psmouse);
+ psmouse_initialize(psmouse);
+ synaptics_pt_init(psmouse);
+ psmouse_activate(psmouse);
+
+ return 0;
+}
+
+/*
* psmouse_connect() is a callback from the serio module when
* an unhandled serio port is found.
*/
@@ -492,8 +545,10 @@ static void psmouse_disconnect(struct serio *serio)
static void psmouse_connect(struct serio *serio, struct serio_dev *dev)
{
struct psmouse *psmouse;
+ struct pm_dev *pmdev;
- if ((serio->type & SERIO_TYPE) != SERIO_8042)
+ if ((serio->type & SERIO_TYPE) != SERIO_8042 &&
+ (serio->type & SERIO_TYPE) != SERIO_PS_PSTHRU)
return;
if (!(psmouse = kmalloc(sizeof(struct psmouse), GFP_KERNEL)))
@@ -506,6 +561,7 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev)
psmouse->dev.keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
psmouse->dev.relbit[0] = BIT(REL_X) | BIT(REL_Y);
+ psmouse->state = PSMOUSE_NEW_DEVICE;
psmouse->serio = serio;
psmouse->dev.private = psmouse;
@@ -522,6 +578,12 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev)
return;
}
+ pmdev = pm_register(PM_SYS_DEV, PM_SYS_UNKNOWN, psmouse_pm_callback);
+ if (pmdev) {
+ psmouse->dev.pm_dev = pmdev;
+ pmdev->data = psmouse;
+ }
+
sprintf(psmouse->devname, "%s %s %s",
psmouse_protocols[psmouse->type], psmouse->vendor, psmouse->name);
sprintf(psmouse->phys, "%s/input0",
@@ -539,6 +601,10 @@ static void psmouse_connect(struct serio *serio, struct serio_dev *dev)
printk(KERN_INFO "input: %s on %s\n", psmouse->devname, serio->phys);
psmouse_initialize(psmouse);
+
+ synaptics_pt_init(psmouse);
+
+ psmouse_activate(psmouse);
}
static struct serio_dev psmouse_dev = {
@@ -567,9 +633,16 @@ static int __init psmouse_smartscroll_setup(char *str)
return 1;
}
+static int __init psmouse_resetafter_setup(char *str)
+{
+ get_option(&str, &psmouse_resetafter);
+ return 1;
+}
+
__setup("psmouse_noext", psmouse_noext_setup);
__setup("psmouse_resolution=", psmouse_resolution_setup);
__setup("psmouse_smartscroll=", psmouse_smartscroll_setup);
+__setup("psmouse_resetafter=", psmouse_resetafter_setup);
#endif
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
index 05a24de18d7d..a69cb72d8a80 100644
--- a/drivers/input/mouse/psmouse.h
+++ b/drivers/input/mouse/psmouse.h
@@ -13,9 +13,15 @@
#define PSMOUSE_CMD_RESET_BAT 0x02ff
#define PSMOUSE_RET_BAT 0xaa
+#define PSMOUSE_RET_ID 0x00
#define PSMOUSE_RET_ACK 0xfa
#define PSMOUSE_RET_NAK 0xfe
+/* psmouse states */
+#define PSMOUSE_NEW_DEVICE 0
+#define PSMOUSE_ACTIVATED 1
+#define PSMOUSE_IGNORE 2
+
struct psmouse {
void *private;
struct input_dev dev;
@@ -29,6 +35,7 @@ struct psmouse {
unsigned char type;
unsigned char model;
unsigned long last;
+ unsigned char state;
char acking;
volatile char ack;
char error;
@@ -36,16 +43,17 @@ struct psmouse {
char phys[32];
};
-#define PSMOUSE_PS2 1
-#define PSMOUSE_PS2PP 2
-#define PSMOUSE_PS2TPP 3
-#define PSMOUSE_GENPS 4
-#define PSMOUSE_IMPS 5
-#define PSMOUSE_IMEX 6
-#define PSMOUSE_SYNAPTICS 7
+#define PSMOUSE_PS2 1
+#define PSMOUSE_PS2PP 2
+#define PSMOUSE_PS2TPP 3
+#define PSMOUSE_GENPS 4
+#define PSMOUSE_IMPS 5
+#define PSMOUSE_IMEX 6
+#define PSMOUSE_SYNAPTICS 7
int psmouse_command(struct psmouse *psmouse, unsigned char *param, int command);
extern int psmouse_smartscroll;
+extern unsigned int psmouse_resetafter;
#endif /* _PSMOUSE_H */
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 5fa695eb774e..9ba48609d77e 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -1,6 +1,9 @@
/*
* Synaptics TouchPad PS/2 mouse driver
*
+ * 2003 Dmitry Torokhov <dtor@mail.ru>
+ * Added support for pass-through port
+ *
* 2003 Peter Osterlund <petero2@telia.com>
* Ported to 2.5 input device infrastructure.
*
@@ -21,6 +24,7 @@
#include <linux/module.h>
#include <linux/input.h>
+#include <linux/serio.h>
#include "psmouse.h"
#include "synaptics.h"
@@ -71,7 +75,7 @@ static int synaptics_set_mode(struct psmouse *psmouse, unsigned char mode)
if (synaptics_special_cmd(psmouse, mode))
return -1;
- param[0] = 0x14;
+ param[0] = SYN_PS_SET_MODE2;
if (psmouse_command(psmouse, param, PSMOUSE_CMD_SETRATE))
return -1;
return 0;
@@ -83,7 +87,7 @@ static int synaptics_reset(struct psmouse *psmouse)
if (psmouse_command(psmouse, r, PSMOUSE_CMD_RESET_BAT))
return -1;
- if (r[0] == 0xAA && r[1] == 0x00)
+ if (r[0] == PSMOUSE_RET_BAT && r[1] == PSMOUSE_RET_ID)
return 0;
return -1;
}
@@ -106,16 +110,25 @@ static int synaptics_model_id(struct psmouse *psmouse, unsigned long int *model_
* Read the capability-bits from the touchpad
* see also the SYN_CAP_* macros
*/
-static int synaptics_capability(struct psmouse *psmouse, unsigned long int *capability)
+static int synaptics_capability(struct psmouse *psmouse, unsigned long int *capability, unsigned long int *ext_cap)
{
unsigned char cap[3];
if (synaptics_send_cmd(psmouse, SYN_QUE_CAPABILITIES, cap))
return -1;
*capability = (cap[0]<<16) | (cap[1]<<8) | cap[2];
- if (SYN_CAP_VALID(*capability))
- return 0;
- return -1;
+ *ext_cap = 0;
+ if (!SYN_CAP_VALID(*capability))
+ return -1;
+
+ if (SYN_EXT_CAP_REQUESTS(*capability)) {
+ if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB, cap)) {
+ printk(KERN_ERR "Synaptics claims to have extended capabilities,"
+ " but I'm not able to read them.");
+ } else
+ *ext_cap = (cap[0]<<16) | (cap[1]<<8) | cap[2];
+ }
+ return 0;
}
/*
@@ -134,19 +147,11 @@ static int synaptics_identify(struct psmouse *psmouse, unsigned long int *ident)
return -1;
}
-static int synaptics_enable_device(struct psmouse *psmouse)
-{
- if (psmouse_command(psmouse, NULL, PSMOUSE_CMD_ENABLE))
- return -1;
- return 0;
-}
-
static void print_ident(struct synaptics_data *priv)
{
printk(KERN_INFO "Synaptics Touchpad, model: %ld\n", SYN_ID_MODEL(priv->identity));
- printk(KERN_INFO " Firware: %ld.%ld\n", SYN_ID_MAJOR(priv->identity),
+ printk(KERN_INFO " Firmware: %ld.%ld\n", SYN_ID_MAJOR(priv->identity),
SYN_ID_MINOR(priv->identity));
-
if (SYN_MODEL_ROT180(priv->model_id))
printk(KERN_INFO " 180 degree mounted touchpad\n");
if (SYN_MODEL_PORTRAIT(priv->model_id))
@@ -159,12 +164,17 @@ static void print_ident(struct synaptics_data *priv)
if (SYN_CAP_EXTENDED(priv->capabilities)) {
printk(KERN_INFO " Touchpad has extended capability bits\n");
- if (SYN_CAP_FOUR_BUTTON(priv->capabilities))
+ if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
+ printk(KERN_INFO " -> %d multi-buttons, i.e. besides standard buttons\n",
+ (int)(SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap)));
+ else if (SYN_CAP_FOUR_BUTTON(priv->capabilities))
printk(KERN_INFO " -> four buttons\n");
if (SYN_CAP_MULTIFINGER(priv->capabilities))
printk(KERN_INFO " -> multifinger detection\n");
if (SYN_CAP_PALMDETECT(priv->capabilities))
printk(KERN_INFO " -> palm detection\n");
+ if (SYN_CAP_PASS_THROUGH(priv->capabilities))
+ printk(KERN_INFO " -> pass-through port\n");
}
}
@@ -172,6 +182,7 @@ static int query_hardware(struct psmouse *psmouse)
{
struct synaptics_data *priv = psmouse->private;
int retries = 0;
+ int mode;
while ((retries++ < 3) && synaptics_reset(psmouse))
printk(KERN_ERR "synaptics reset failed\n");
@@ -180,17 +191,107 @@ static int query_hardware(struct psmouse *psmouse)
return -1;
if (synaptics_model_id(psmouse, &priv->model_id))
return -1;
- if (synaptics_capability(psmouse, &priv->capabilities))
+ if (synaptics_capability(psmouse, &priv->capabilities, &priv->ext_cap))
return -1;
- if (synaptics_set_mode(psmouse, (SYN_BIT_ABSOLUTE_MODE |
- SYN_BIT_HIGH_RATE |
- SYN_BIT_DISABLE_GESTURE |
- SYN_BIT_W_MODE)))
+
+ mode = SYN_BIT_ABSOLUTE_MODE | SYN_BIT_HIGH_RATE;
+ if (SYN_ID_MAJOR(priv->identity) >= 4)
+ mode |= SYN_BIT_DISABLE_GESTURE;
+ if (SYN_CAP_EXTENDED(priv->capabilities))
+ mode |= SYN_BIT_W_MODE;
+ if (synaptics_set_mode(psmouse, mode))
return -1;
- synaptics_enable_device(psmouse);
+ return 0;
+}
- print_ident(priv);
+/*****************************************************************************
+ * Synaptics pass-through PS/2 port support
+ ****************************************************************************/
+static int synaptics_pt_open(struct serio *port)
+{
+ return 0;
+}
+
+static void synaptics_pt_close(struct serio *port)
+{
+}
+
+static int synaptics_pt_write(struct serio *port, unsigned char c)
+{
+ struct psmouse *parent = port->driver;
+ char rate_param = SYN_PS_CLIENT_CMD; /* indicates that we want pass-through port */
+
+ if (synaptics_special_cmd(parent, c))
+ return -1;
+ if (psmouse_command(parent, &rate_param, PSMOUSE_CMD_SETRATE))
+ return -1;
+ return 0;
+}
+
+static inline int synaptics_is_pt_packet(unsigned char *buf)
+{
+ return (buf[0] & 0xFC) == 0x84 && (buf[3] & 0xCC) == 0xC4;
+}
+
+static void synaptics_pass_pt_packet(struct serio *ptport, unsigned char *packet)
+{
+ struct psmouse *child = ptport->private;
+
+ if (child) {
+ if (child->state == PSMOUSE_ACTIVATED) {
+ serio_interrupt(ptport, packet[1], 0, NULL);
+ serio_interrupt(ptport, packet[4], 0, NULL);
+ serio_interrupt(ptport, packet[5], 0, NULL);
+ if (child->type >= PSMOUSE_GENPS)
+ serio_interrupt(ptport, packet[2], 0, NULL);
+ } else if (child->state != PSMOUSE_IGNORE) {
+ serio_interrupt(ptport, packet[1], 0, NULL);
+ }
+ }
+}
+
+int synaptics_pt_init(struct psmouse *psmouse)
+{
+ struct synaptics_data *priv = psmouse->private;
+ struct serio *port;
+ struct psmouse *child;
+
+ if (psmouse->type != PSMOUSE_SYNAPTICS)
+ return -1;
+ if (!SYN_CAP_EXTENDED(priv->capabilities))
+ return -1;
+ if (!SYN_CAP_PASS_THROUGH(priv->capabilities))
+ return -1;
+
+ priv->ptport = port = kmalloc(sizeof(struct serio), GFP_KERNEL);
+ if (!port) {
+ printk(KERN_ERR "synaptics: not enough memory to allocate serio port\n");
+ return -1;
+ }
+
+ memset(port, 0, sizeof(struct serio));
+ port->type = SERIO_PS_PSTHRU;
+ port->name = "Synaptics pass-through";
+ port->phys = "synaptics-pt/serio0";
+ port->write = synaptics_pt_write;
+ port->open = synaptics_pt_open;
+ port->close = synaptics_pt_close;
+ port->driver = psmouse;
+
+ printk(KERN_INFO "serio: %s port at %s\n", port->name, psmouse->phys);
+ serio_register_slave_port(port);
+
+ /* adjust the touchpad to child's choice of protocol */
+ child = port->private;
+ if (child && child->type >= PSMOUSE_GENPS) {
+ if (synaptics_set_mode(psmouse, (SYN_BIT_ABSOLUTE_MODE |
+ SYN_BIT_HIGH_RATE |
+ SYN_BIT_DISABLE_GESTURE |
+ SYN_BIT_FOUR_BYTE_CLIENT |
+ SYN_BIT_W_MODE)))
+ printk(KERN_INFO "synaptics: failed to enable 4-byte guest protocol\n");
+ }
return 0;
}
@@ -213,22 +314,27 @@ int synaptics_init(struct psmouse *psmouse)
{
struct synaptics_data *priv;
+#ifndef CONFIG_MOUSE_PS2_SYNAPTICS
+ return -1;
+#endif
psmouse->private = priv = kmalloc(sizeof(struct synaptics_data), GFP_KERNEL);
if (!priv)
return -1;
memset(priv, 0, sizeof(struct synaptics_data));
- priv->inSync = 1;
+ priv->out_of_sync = 0;
if (query_hardware(psmouse)) {
printk(KERN_ERR "Unable to query/initialize Synaptics hardware.\n");
goto init_fail;
}
+ print_ident(priv);
+
/*
* The x/y limits are taken from the Synaptics TouchPad interfacing Guide,
* which says that they should be valid regardless of the actual size of
- * the senser.
+ * the sensor.
*/
set_bit(EV_ABS, psmouse->dev.evbit);
set_abs_params(&psmouse->dev, ABS_X, 1472, 5472, 0, 0);
@@ -243,7 +349,24 @@ int synaptics_init(struct psmouse *psmouse)
set_bit(BTN_RIGHT, psmouse->dev.keybit);
set_bit(BTN_FORWARD, psmouse->dev.keybit);
set_bit(BTN_BACK, psmouse->dev.keybit);
-
+ if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
+ switch (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
+ default:
+ printk(KERN_ERR "This touchpad reports more than 8 multi-buttons, don't know how to handle.\n");
+ case 8:
+ set_bit(BTN_7, psmouse->dev.keybit);
+ set_bit(BTN_6, psmouse->dev.keybit);
+ case 6:
+ set_bit(BTN_5, psmouse->dev.keybit);
+ set_bit(BTN_4, psmouse->dev.keybit);
+ case 4:
+ set_bit(BTN_3, psmouse->dev.keybit);
+ set_bit(BTN_2, psmouse->dev.keybit);
+ case 2:
+ set_bit(BTN_1, psmouse->dev.keybit);
+ set_bit(BTN_0, psmouse->dev.keybit);
+ break;
+ }
clear_bit(EV_REL, psmouse->dev.evbit);
clear_bit(REL_X, psmouse->dev.relbit);
clear_bit(REL_Y, psmouse->dev.relbit);
@@ -259,42 +382,85 @@ void synaptics_disconnect(struct psmouse *psmouse)
{
struct synaptics_data *priv = psmouse->private;
- kfree(priv);
+ if (psmouse->type == PSMOUSE_SYNAPTICS && priv) {
+ synaptics_set_mode(psmouse, 0);
+ if (priv->ptport) {
+ serio_unregister_slave_port(priv->ptport);
+ kfree(priv->ptport);
+ }
+ kfree(priv);
+ }
}
/*****************************************************************************
* Functions to interpret the absolute mode packets
****************************************************************************/
-static void synaptics_parse_hw_state(struct synaptics_data *priv, struct synaptics_hw_state *hw)
+static void synaptics_parse_hw_state(unsigned char buf[], struct synaptics_data *priv, struct synaptics_hw_state *hw)
{
- unsigned char *buf = priv->proto_buf;
-
- hw->x = (((buf[3] & 0x10) << 8) |
- ((buf[1] & 0x0f) << 8) |
- buf[4]);
- hw->y = (((buf[3] & 0x20) << 7) |
- ((buf[1] & 0xf0) << 4) |
- buf[5]);
-
- hw->z = buf[2];
- hw->w = (((buf[0] & 0x30) >> 2) |
- ((buf[0] & 0x04) >> 1) |
- ((buf[3] & 0x04) >> 2));
-
- hw->left = (buf[0] & 0x01) ? 1 : 0;
- hw->right = (buf[0] & 0x2) ? 1 : 0;
hw->up = 0;
hw->down = 0;
+ hw->b0 = 0;
+ hw->b1 = 0;
+ hw->b2 = 0;
+ hw->b3 = 0;
+ hw->b4 = 0;
+ hw->b5 = 0;
+ hw->b6 = 0;
+ hw->b7 = 0;
+
+ if (SYN_MODEL_NEWABS(priv->model_id)) {
+ hw->x = (((buf[3] & 0x10) << 8) |
+ ((buf[1] & 0x0f) << 8) |
+ buf[4]);
+ hw->y = (((buf[3] & 0x20) << 7) |
+ ((buf[1] & 0xf0) << 4) |
+ buf[5]);
+
+ hw->z = buf[2];
+ hw->w = (((buf[0] & 0x30) >> 2) |
+ ((buf[0] & 0x04) >> 1) |
+ ((buf[3] & 0x04) >> 2));
+
+ hw->left = (buf[0] & 0x01) ? 1 : 0;
+ hw->right = (buf[0] & 0x02) ? 1 : 0;
+ if (SYN_CAP_EXTENDED(priv->capabilities) &&
+ (SYN_CAP_FOUR_BUTTON(priv->capabilities))) {
+ hw->up = ((buf[3] & 0x01)) ? 1 : 0;
+ if (hw->left)
+ hw->up = !hw->up;
+ hw->down = ((buf[3] & 0x02)) ? 1 : 0;
+ if (hw->right)
+ hw->down = !hw->down;
+ }
+ if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) &&
+ ((buf[3] & 2) ? !hw->right : hw->right)) {
+ switch (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
+ default:
+ ; /* we did comment while initialising... */
+ case 8:
+ hw->b7 = ((buf[5] & 0x08)) ? 1 : 0;
+ hw->b6 = ((buf[4] & 0x08)) ? 1 : 0;
+ case 6:
+ hw->b5 = ((buf[5] & 0x04)) ? 1 : 0;
+ hw->b4 = ((buf[4] & 0x04)) ? 1 : 0;
+ case 4:
+ hw->b3 = ((buf[5] & 0x02)) ? 1 : 0;
+ hw->b2 = ((buf[4] & 0x02)) ? 1 : 0;
+ case 2:
+ hw->b1 = ((buf[5] & 0x01)) ? 1 : 0;
+ hw->b0 = ((buf[4] & 0x01)) ? 1 : 0;
+ }
+ }
+ } else {
+ hw->x = (((buf[1] & 0x1f) << 8) | buf[2]);
+ hw->y = (((buf[4] & 0x1f) << 8) | buf[5]);
+
+ hw->z = (((buf[0] & 0x30) << 2) | (buf[3] & 0x3F));
+ hw->w = (((buf[1] & 0x80) >> 4) | ((buf[0] & 0x04) >> 1));
- if (SYN_CAP_EXTENDED(priv->capabilities) &&
- (SYN_CAP_FOUR_BUTTON(priv->capabilities))) {
- hw->up = ((buf[3] & 0x01)) ? 1 : 0;
- if (hw->left)
- hw->up = !hw->up;
- hw->down = ((buf[3] & 0x02)) ? 1 : 0;
- if (hw->right)
- hw->down = !hw->down;
+ hw->left = (buf[0] & 0x01) ? 1 : 0;
+ hw->right = (buf[0] & 0x02) ? 1 : 0;
}
}
@@ -307,7 +473,7 @@ static void synaptics_process_packet(struct psmouse *psmouse)
struct synaptics_data *priv = psmouse->private;
struct synaptics_hw_state hw;
- synaptics_parse_hw_state(priv, &hw);
+ synaptics_parse_hw_state(psmouse->packet, priv, &hw);
if (hw.z > 0) {
int w_ok = 0;
@@ -347,7 +513,24 @@ static void synaptics_process_packet(struct psmouse *psmouse)
input_report_key(dev, BTN_RIGHT, hw.right);
input_report_key(dev, BTN_FORWARD, hw.up);
input_report_key(dev, BTN_BACK, hw.down);
-
+ if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
+ switch(SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
+ default:
+ ; /* we did comment while initialising... */
+ case 8:
+ input_report_key(dev, BTN_7, hw.b7);
+ input_report_key(dev, BTN_6, hw.b6);
+ case 6:
+ input_report_key(dev, BTN_5, hw.b5);
+ input_report_key(dev, BTN_4, hw.b4);
+ case 4:
+ input_report_key(dev, BTN_3, hw.b3);
+ input_report_key(dev, BTN_2, hw.b2);
+ case 2:
+ input_report_key(dev, BTN_1, hw.b1);
+ input_report_key(dev, BTN_0, hw.b0);
+ break;
+ }
input_sync(dev);
}
@@ -355,35 +538,59 @@ void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
{
struct input_dev *dev = &psmouse->dev;
struct synaptics_data *priv = psmouse->private;
- unsigned char *pBuf = priv->proto_buf;
- unsigned char u = psmouse->packet[0];
+ unsigned char data = psmouse->packet[psmouse->pktcnt - 1];
+ int newabs = SYN_MODEL_NEWABS(priv->model_id);
input_regs(dev, regs);
- pBuf[priv->proto_buf_tail++] = u;
-
- /* check first byte */
- if ((priv->proto_buf_tail == 1) && ((u & 0xC8) != 0x80)) {
- priv->inSync = 0;
- priv->proto_buf_tail = 0;
- printk(KERN_WARNING "Synaptics driver lost sync at 1st byte\n");
- return;
- }
+ switch (psmouse->pktcnt) {
+ case 1:
+ if (newabs ? ((data & 0xC8) != 0x80) : ((data & 0xC0) != 0xC0)) {
+ printk(KERN_WARNING "Synaptics driver lost sync at 1st byte\n");
+ goto bad_sync;
+ }
+ break;
+ case 2:
+ if (!newabs && ((data & 0x60) != 0x00)) {
+ printk(KERN_WARNING "Synaptics driver lost sync at 2nd byte\n");
+ goto bad_sync;
+ }
+ break;
+ case 4:
+ if (newabs ? ((data & 0xC8) != 0xC0) : ((data & 0xC0) != 0x80)) {
+ printk(KERN_WARNING "Synaptics driver lost sync at 4th byte\n");
+ goto bad_sync;
+ }
+ break;
+ case 5:
+ if (!newabs && ((data & 0x60) != 0x00)) {
+ printk(KERN_WARNING "Synaptics driver lost sync at 5th byte\n");
+ goto bad_sync;
+ }
+ break;
+ default:
+ if (psmouse->pktcnt >= 6) { /* Full packet received */
+ if (priv->out_of_sync) {
+ priv->out_of_sync = 0;
+ printk(KERN_NOTICE "Synaptics driver resynced.\n");
+ }
- /* check 4th byte */
- if ((priv->proto_buf_tail == 4) && ((u & 0xc8) != 0xc0)) {
- priv->inSync = 0;
- priv->proto_buf_tail = 0;
- printk(KERN_WARNING "Synaptics driver lost sync at 4th byte\n");
- return;
- }
+ if (priv->ptport && synaptics_is_pt_packet(psmouse->packet))
+ synaptics_pass_pt_packet(priv->ptport, psmouse->packet);
+ else
+ synaptics_process_packet(psmouse);
- if (priv->proto_buf_tail >= 6) { /* Full packet received */
- if (!priv->inSync) {
- priv->inSync = 1;
- printk(KERN_NOTICE "Synaptics driver resynced.\n");
+ psmouse->pktcnt = 0;
}
- synaptics_process_packet(psmouse);
- priv->proto_buf_tail = 0;
+ break;
+ }
+ return;
+
+ bad_sync:
+ priv->out_of_sync++;
+ psmouse->pktcnt = 0;
+ if (psmouse_resetafter > 0 && priv->out_of_sync == psmouse_resetafter) {
+ psmouse->state = PSMOUSE_IGNORE;
+ serio_rescan(psmouse->serio);
}
}
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index 6e3e029a3bdd..4dad98abd54e 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -12,6 +12,7 @@
extern void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs);
extern int synaptics_init(struct psmouse *psmouse);
+extern int synaptics_pt_init(struct psmouse *psmouse);
extern void synaptics_disconnect(struct psmouse *psmouse);
/* synaptics queries */
@@ -22,12 +23,14 @@ extern void synaptics_disconnect(struct psmouse *psmouse);
#define SYN_QUE_SERIAL_NUMBER_PREFIX 0x06
#define SYN_QUE_SERIAL_NUMBER_SUFFIX 0x07
#define SYN_QUE_RESOLUTION 0x08
+#define SYN_QUE_EXT_CAPAB 0x09
/* synatics modes */
#define SYN_BIT_ABSOLUTE_MODE (1 << 7)
#define SYN_BIT_HIGH_RATE (1 << 6)
#define SYN_BIT_SLEEP_MODE (1 << 3)
#define SYN_BIT_DISABLE_GESTURE (1 << 2)
+#define SYN_BIT_FOUR_BYTE_CLIENT (1 << 1)
#define SYN_BIT_W_MODE (1 << 0)
/* synaptics model ID bits */
@@ -42,11 +45,14 @@ extern void synaptics_disconnect(struct psmouse *psmouse);
/* synaptics capability bits */
#define SYN_CAP_EXTENDED(c) ((c) & (1 << 23))
+#define SYN_CAP_PASS_THROUGH(c) ((c) & (1 << 7))
#define SYN_CAP_SLEEP(c) ((c) & (1 << 4))
#define SYN_CAP_FOUR_BUTTON(c) ((c) & (1 << 3))
#define SYN_CAP_MULTIFINGER(c) ((c) & (1 << 1))
#define SYN_CAP_PALMDETECT(c) ((c) & (1 << 0))
#define SYN_CAP_VALID(c) ((((c) & 0x00ff00) >> 8) == 0x47)
+#define SYN_EXT_CAP_REQUESTS(c) ((((c) & 0x700000) >> 20) == 1)
+#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12)
/* synaptics modes query bits */
#define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7))
@@ -62,6 +68,10 @@ extern void synaptics_disconnect(struct psmouse *psmouse);
#define SYN_ID_MINOR(i) (((i) >> 16) & 0xff)
#define SYN_ID_IS_SYNAPTICS(i) ((((i) >> 8) & 0xff) == 0x47)
+/* synaptics special commands */
+#define SYN_PS_SET_MODE2 0x14
+#define SYN_PS_CLIENT_CMD 0x28
+
/*
* A structure to describe the state of the touchpad hardware (buttons and pad)
*/
@@ -75,21 +85,28 @@ struct synaptics_hw_state {
int right;
int up;
int down;
+ int b0;
+ int b1;
+ int b2;
+ int b3;
+ int b4;
+ int b5;
+ int b6;
+ int b7;
};
struct synaptics_data {
/* Data read from the touchpad */
unsigned long int model_id; /* Model-ID */
unsigned long int capabilities; /* Capabilities */
+ unsigned long int ext_cap; /* Extended Capabilities */
unsigned long int identity; /* Identification */
/* Data for normal processing */
- unsigned char proto_buf[6]; /* Buffer for Packet */
- unsigned char last_byte; /* last received byte */
- int inSync; /* Packets in sync */
- int proto_buf_tail;
-
+ unsigned int out_of_sync; /* # of packets out of sync */
int old_w; /* Previous w value */
+
+ struct serio *ptport; /* pass-through port */
};
#endif /* _SYNAPTICS_H */
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index 8e86e6efee80..30312bf387dc 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -2,7 +2,7 @@
# Input core configuration
#
config SERIO
- tristate "Serial i/o support (needed for keyboard and mouse)"
+ tristate "Serial i/o support" if EMBEDDED || !X86
default y
---help---
Say Yes here if you have any input device that uses serial I/O to
@@ -21,7 +21,7 @@ config SERIO
config SERIO_I8042
tristate "i8042 PC Keyboard controller" if EMBEDDED || !X86
default y
- depends on SERIO
+ select SERIO
---help---
i8042 is the chip over which the standard AT keyboard and PS/2
mouse are connected to the computer. If you use these devices,
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index 7112bdcda8f8..ea0a680966c3 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -73,7 +73,7 @@ static int amba_kmi_open(struct serio *io)
writeb(kmi->divisor, KMICLKDIV);
writeb(KMICR_EN, KMICR);
- ret = request_irq(kmi->irq, amba_kmi_int, 0, kmi->io.phys, kmi);
+ ret = request_irq(kmi->irq, amba_kmi_int, 0, "kmi-pl050", kmi);
if (ret) {
printk(KERN_ERR "kmi: failed to claim IRQ%d\n", kmi->irq);
writeb(0, KMICR);
@@ -108,11 +108,11 @@ static int amba_kmi_probe(struct amba_device *dev, void *id)
kmi->io.write = amba_kmi_write;
kmi->io.open = amba_kmi_open;
kmi->io.close = amba_kmi_close;
- kmi->io.name = dev->dev.name;
+ kmi->io.name = dev->dev.bus_id;
kmi->io.phys = dev->dev.bus_id;
kmi->io.driver = kmi;
- kmi->res = request_mem_region(dev->res.start, KMI_SIZE, kmi->io.phys);
+ kmi->res = request_mem_region(dev->res.start, KMI_SIZE, "kmi-pl050");
if (!kmi->res) {
kfree(kmi);
return -EBUSY;
@@ -147,14 +147,12 @@ static int amba_kmi_remove(struct amba_device *dev)
return 0;
}
-static int amba_kmi_resume(struct amba_device *dev, u32 level)
+static int amba_kmi_resume(struct amba_device *dev)
{
struct amba_kmi_port *kmi = amba_get_drvdata(dev);
- if (level == RESUME_ENABLE) {
- /* kick the serio layer to rescan this port */
- serio_rescan(&kmi->io);
- }
+ /* kick the serio layer to rescan this port */
+ serio_rescan(&kmi->io);
return 0;
}
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index 78c51d96dea6..2288eb45f1be 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -49,7 +49,9 @@ MODULE_LICENSE("GPL");
EXPORT_SYMBOL(serio_interrupt);
EXPORT_SYMBOL(serio_register_port);
+EXPORT_SYMBOL(serio_register_slave_port);
EXPORT_SYMBOL(serio_unregister_port);
+EXPORT_SYMBOL(serio_unregister_slave_port);
EXPORT_SYMBOL(serio_register_device);
EXPORT_SYMBOL(serio_unregister_device);
EXPORT_SYMBOL(serio_open);
@@ -166,6 +168,17 @@ void serio_register_port(struct serio *serio)
up(&serio_sem);
}
+/*
+ * Same as serio_register_port but does not try to acquire serio_sem.
+ * Should be used when registering a serio from other input device's
+ * connect() function.
+ */
+void serio_register_slave_port(struct serio *serio)
+{
+ list_add_tail(&serio->node, &serio_list);
+ serio_find_dev(serio);
+}
+
void serio_unregister_port(struct serio *serio)
{
down(&serio_sem);
@@ -175,6 +188,18 @@ void serio_unregister_port(struct serio *serio)
up(&serio_sem);
}
+/*
+ * Same as serio_unregister_port but does not try to acquire serio_sem.
+ * Should be used when unregistering a serio from other input device's
+ * disconnect() function.
+ */
+void serio_unregister_slave_port(struct serio *serio)
+{
+ list_del_init(&serio->node);
+ if (serio->dev && serio->dev->disconnect)
+ serio->dev->disconnect(serio);
+}
+
void serio_register_device(struct serio_dev *dev)
{
struct serio *serio;
@@ -204,9 +229,11 @@ void serio_unregister_device(struct serio_dev *dev)
/* called from serio_dev->connect/disconnect methods under serio_sem */
int serio_open(struct serio *serio, struct serio_dev *dev)
{
- if (serio->open(serio))
- return -1;
serio->dev = dev;
+ if (serio->open(serio)) {
+ serio->dev = NULL;
+ return -1;
+ }
return 0;
}
@@ -221,8 +248,7 @@ static int __init serio_init(void)
{
int pid;
- pid = kernel_thread(serio_thread, NULL,
- CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ pid = kernel_thread(serio_thread, NULL, CLONE_KERNEL);
if (!pid) {
printk(KERN_WARNING "serio: Failed to start kseriod\n");
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 7201dc6c10b8..df6d96dffa5a 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -12,7 +12,8 @@ config INPUT_TOUCHSCREEN
config TOUCHSCREEN_BITSY
tristate "Compaq iPAQ H3600 (Bitsy) touchscreen input driver"
- depends on SA1100_BITSY && INPUT && INPUT_TOUCHSCREEN && SERIO
+ depends on SA1100_BITSY && INPUT && INPUT_TOUCHSCREEN
+ select SERIO
help
Say Y here if you have the h3600 (Bitsy) touchscreen.
@@ -25,7 +26,8 @@ config TOUCHSCREEN_BITSY
config TOUCHSCREEN_GUNZE
tristate "Gunze AHL-51S touchscreen"
- depends on INPUT && INPUT_TOUCHSCREEN && SERIO
+ depends on INPUT && INPUT_TOUCHSCREEN
+ select SERIO
help
Say Y here if you have the Gunze AHL-51 touchscreen connected to
your system.
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
index d845e5bfcd18..547cd9329401 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -45,7 +45,6 @@
static char *main_revision = "$Revision: 1.40 $";
-int errno = 0;
static int major;
static int dbgmask;
diff --git a/drivers/isdn/hardware/eicon/i4lididrv.c b/drivers/isdn/hardware/eicon/i4lididrv.c
index c1a8be7e19c4..5eda595b7f2f 100644
--- a/drivers/isdn/hardware/eicon/i4lididrv.c
+++ b/drivers/isdn/hardware/eicon/i4lididrv.c
@@ -293,7 +293,7 @@ diva_init_thread(void)
{
int pid = 0;
- pid = kernel_thread(divad_thread, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ pid = kernel_thread(divad_thread, NULL, CLONE_KERNEL);
if (pid >= 0) {
divad_pid = pid;
}
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 996e8c5a9612..390b0f484d26 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -1989,7 +1989,8 @@ modem_write_profile(atemu * m)
memcpy(m->pmsn, m->msn, ISDN_MSNLEN);
memcpy(m->plmsn, m->lmsn, ISDN_LMSNLEN);
if ((get_isdn_dev())->profd)
- kill_pg_info(SIGIO, SEND_SIG_PRIV, (get_isdn_dev())->profd->pgrp);
+ kill_pg_info(SIGIO, SEND_SIG_PRIV,
+ process_group((get_isdn_dev())->profd));
}
static struct tty_operations modem_ops = {
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 438e05f462d5..a20a9e899ef4 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -266,8 +266,7 @@ adb_probe_task(void *x)
static void
__adb_probe_task(void *data)
{
- adb_probe_task_pid = kernel_thread(adb_probe_task, NULL,
- SIGCHLD | CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ adb_probe_task_pid = kernel_thread(adb_probe_task, NULL, SIGCHLD | CLONE_KERNEL);
}
static DECLARE_WORK(adb_reset_work, __adb_probe_task, NULL);
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c
index 5b4ab407765b..89d4aaaf622f 100644
--- a/drivers/macintosh/mediabay.c
+++ b/drivers/macintosh/mediabay.c
@@ -694,8 +694,7 @@ static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_ma
/* Startup kernel thread */
if (i == 0)
- kernel_thread(media_bay_task, NULL,
- CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ kernel_thread(media_bay_task, NULL, CLONE_KERNEL);
return 0;
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index 55528181ab92..60efe39db6cd 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -397,8 +397,7 @@ int register_mtd_blktrans(struct mtd_blktrans_ops *tr)
tr->blkcore_priv->rq->queuedata = tr;
- ret = kernel_thread(mtd_blktrans_thread, tr,
- CLONE_FS|CLONE_FILES|CLONE_SIGHAND);
+ ret = kernel_thread(mtd_blktrans_thread, tr, CLONE_KERNEL);
if (ret < 0) {
blk_cleanup_queue(tr->blkcore_priv->rq);
unregister_blkdev(tr->major, tr->name);
diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c
index f5a5b8cd31a4..b5b199eef9d2 100644
--- a/drivers/net/3c501.c
+++ b/drivers/net/3c501.c
@@ -123,6 +123,7 @@ static const char version[] =
#include <linux/config.h> /* for CONFIG_IP_MULTICAST */
#include <linux/spinlock.h>
#include <linux/ethtool.h>
+#include <linux/delay.h>
#include <asm/uaccess.h>
#include <asm/bitops.h>
@@ -241,7 +242,7 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
if (dev->irq < 2)
{
- unsigned long irq_mask, delay;
+ unsigned long irq_mask;
irq_mask = probe_irq_on();
inb(RX_STATUS); /* Clear pending interrupts. */
@@ -250,8 +251,7 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
outb(0x00, AX_CMD);
- delay = jiffies + HZ/50;
- while (time_before(jiffies, delay)) ;
+ mdelay(20);
autoirq = probe_irq_off(irq_mask);
if (autoirq == 0)
diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c
index 44e86a1355d4..d1607cabd3e2 100644
--- a/drivers/net/3c505.c
+++ b/drivers/net/3c505.c
@@ -298,17 +298,13 @@ inline static void adapter_reset(struct net_device *dev)
set_hsf(dev, HSF_PCB_NAK);
}
outb_control(adapter->hcr_val | ATTN | DIR, dev);
- timeout = jiffies + 1*HZ/100;
- while (time_before_eq(jiffies, timeout));
+ mdelay(10);
outb_control(adapter->hcr_val & ~ATTN, dev);
- timeout = jiffies + 1*HZ/100;
- while (time_before_eq(jiffies, timeout));
+ mdelay(10);
outb_control(adapter->hcr_val | FLSH, dev);
- timeout = jiffies + 1*HZ/100;
- while (time_before_eq(jiffies, timeout));
+ mdelay(10);
outb_control(adapter->hcr_val & ~FLSH, dev);
- timeout = jiffies + 1*HZ/100;
- while (time_before_eq(jiffies, timeout));
+ mdelay(10);
outb_control(orig_hcr, dev);
if (!start_receive(dev, &adapter->tx_pcb))
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c
index 9ef643420408..d3e3d819b9cb 100644
--- a/drivers/net/3c515.c
+++ b/drivers/net/3c515.c
@@ -59,7 +59,6 @@ static int max_interrupt_work = 20;
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/isapnp.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
diff --git a/drivers/net/Space.c b/drivers/net/Space.c
index 673ebcced980..651ffca8a9be 100644
--- a/drivers/net/Space.c
+++ b/drivers/net/Space.c
@@ -58,7 +58,6 @@ extern int at1500_probe(struct net_device *);
extern int at1700_probe(struct net_device *);
extern int fmv18x_probe(struct net_device *);
extern int eth16i_probe(struct net_device *);
-extern int depca_probe(struct net_device *);
extern int i82596_probe(struct net_device *);
extern int ewrk3_probe(struct net_device *);
extern int el1_probe(struct net_device *);
@@ -252,9 +251,6 @@ static struct devprobe isa_probes[] __initdata = {
#ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */
{eepro_probe, 0},
#endif
-#ifdef CONFIG_DEPCA /* DEC DEPCA */
- {depca_probe, 0},
-#endif
#ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */
{ewrk3_probe, 0},
#endif
diff --git a/drivers/net/ac3200.c b/drivers/net/ac3200.c
index 5fc6d725e29c..8cba7e2ce149 100644
--- a/drivers/net/ac3200.c
+++ b/drivers/net/ac3200.c
@@ -25,6 +25,7 @@ static const char version[] =
"ac3200.c:v1.01 7/1/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
#include <linux/module.h>
+#include <linux/eisa.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index 3350a70c2103..eaa214a5a518 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -1757,7 +1757,8 @@ static int __init ace_init(struct net_device *dev)
* Wait for the firmware to spin up - max 3 seconds.
*/
myjif = jiffies + 3 * HZ;
- while (time_before(jiffies, myjif) && !ap->fw_running);
+ while (time_before(jiffies, myjif) && !ap->fw_running)
+ cpu_relax();
if (!ap->fw_running) {
printk(KERN_ERR "%s: Firmware NOT running!\n", dev->name);
diff --git a/drivers/net/arm/ether00.c b/drivers/net/arm/ether00.c
index 8124d193a426..8824494c4b51 100644
--- a/drivers/net/arm/ether00.c
+++ b/drivers/net/arm/ether00.c
@@ -19,7 +19,7 @@
*/
/* includes */
-
+#include <linux/config.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/sched.h>
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index f0399fc818b0..284c405a8030 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -24,10 +24,15 @@
* 2003/06/25 - Shmulik Hen <shmulik.hen at intel dot com>
* - Fixed signed/unsigned calculation errors that caused load sharing
* to collapse to one slave under very heavy UDP Tx stress.
+ *
+ * 2003/08/06 - Amir Noam <amir.noam at intel dot com>
+ * - Add support for setting bond's MAC address with special
+ * handling required for ALB/TLB.
*/
#include <linux/skbuff.h>
#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
#include <linux/pkt_sched.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
@@ -943,10 +948,11 @@ alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
}
/* hw is a boolean parameter that determines whether we should try and
- * set the hw address of the hw as well as the hw address of the net_device
+ * set the hw address of the device as well as the hw address of the
+ * net_device
*/
static int
-alb_set_mac_addr(struct slave *slave, u8 addr[], int hw)
+alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw)
{
struct net_device *dev = NULL;
struct sockaddr s_addr;
@@ -954,16 +960,16 @@ alb_set_mac_addr(struct slave *slave, u8 addr[], int hw)
dev = slave->dev;
if (!hw) {
- memcpy(dev->dev_addr, addr, ETH_ALEN);
+ memcpy(dev->dev_addr, addr, dev->addr_len);
return 0;
}
/* for rlb each slave must have a unique hw mac addresses so that */
/* each slave will receive packets destined to a different mac */
- memcpy(s_addr.sa_data, addr, ETH_ALEN);
+ memcpy(s_addr.sa_data, addr, dev->addr_len);
s_addr.sa_family = dev->type;
if (dev->set_mac_address(dev, &s_addr)) {
- printk(KERN_DEBUG "bonding: Error: alb_set_mac_addr:"
+ printk(KERN_DEBUG "bonding: Error: alb_set_slave_mac_addr:"
" dev->set_mac_address of dev %s failed!"
" ALB mode requires that the base driver"
" support setting the hw address also when"
@@ -987,8 +993,8 @@ alb_swap_mac_addr(struct bonding *bond,
slaves_state_differ = (SLAVE_IS_OK(slave1) != SLAVE_IS_OK(slave2));
memcpy(tmp_mac_addr, slave1->dev->dev_addr, ETH_ALEN);
- alb_set_mac_addr(slave1, slave2->dev->dev_addr, bond->alb_info.rlb_enabled);
- alb_set_mac_addr(slave2, tmp_mac_addr, bond->alb_info.rlb_enabled);
+ alb_set_slave_mac_addr(slave1, slave2->dev->dev_addr, bond->alb_info.rlb_enabled);
+ alb_set_slave_mac_addr(slave2, tmp_mac_addr, bond->alb_info.rlb_enabled);
/* fasten the change in the switch */
if (SLAVE_IS_OK(slave1)) {
@@ -1153,8 +1159,8 @@ alb_handle_addr_collision_on_attach(struct bonding *bond, struct slave *slave)
}
if (tmp_slave1) {
- alb_set_mac_addr(slave, tmp_slave1->perm_hwaddr,
- bond->alb_info.rlb_enabled);
+ alb_set_slave_mac_addr(slave, tmp_slave1->perm_hwaddr,
+ bond->alb_info.rlb_enabled);
printk(KERN_WARNING "bonding: Warning: the hw address "
"of slave %s is in use by the bond; "
@@ -1172,6 +1178,67 @@ alb_handle_addr_collision_on_attach(struct bonding *bond, struct slave *slave)
return 0;
}
+/**
+ * alb_set_mac_address
+ * @bond:
+ * @addr:
+ *
+ * In TLB mode all slaves are configured to the bond's hw address, but set
+ * their dev_addr field to different addresses (based on their permanent hw
+ * addresses).
+ *
+ * For each slave, this function sets the interface to the new address and then
+ * changes its dev_addr field to its previous value.
+ *
+ * Unwinding assumes bond's mac address has not yet changed.
+ */
+static inline int
+alb_set_mac_address(struct bonding *bond, void *addr)
+{
+ struct sockaddr sa;
+ struct slave *slave;
+ char tmp_addr[ETH_ALEN];
+ int error;
+
+ if (bond->alb_info.rlb_enabled) {
+ return 0;
+ }
+
+ slave = bond_get_first_slave(bond);
+ for (; slave; slave = bond_get_next_slave(bond, slave)) {
+ if (slave->dev->set_mac_address == NULL) {
+ error = -EOPNOTSUPP;
+ goto unwind;
+ }
+
+ /* save net_device's current hw address */
+ memcpy(tmp_addr, slave->dev->dev_addr, ETH_ALEN);
+
+ error = slave->dev->set_mac_address(slave->dev, addr);
+
+ /* restore net_device's hw address */
+ memcpy(slave->dev->dev_addr, tmp_addr, ETH_ALEN);
+
+ if (error) {
+ goto unwind;
+ }
+ }
+
+ return 0;
+
+unwind:
+ memcpy(sa.sa_data, bond->device->dev_addr, bond->device->addr_len);
+ sa.sa_family = bond->device->type;
+ slave = bond_get_first_slave(bond);
+ for (; slave; slave = bond_get_next_slave(bond, slave)) {
+ memcpy(tmp_addr, slave->dev->dev_addr, ETH_ALEN);
+ slave->dev->set_mac_address(slave->dev, &sa);
+ memcpy(slave->dev->dev_addr, tmp_addr, ETH_ALEN);
+ }
+
+ return error;
+}
+
/************************ exported alb funcions ************************/
int
@@ -1262,16 +1329,15 @@ bond_alb_xmit(struct sk_buff *skb, struct net_device *dev)
hash_size = 16;
break;
-#ifdef FIXME
case ETH_P_IPX:
- if (skb->nh.ipxh->ipx_checksum !=
+ if (ipx_hdr(skb)->ipx_checksum !=
__constant_htons(IPX_NO_CHECKSUM)) {
/* something is wrong with this packet */
do_tx_balance = 0;
break;
}
- if (skb->nh.ipxh->ipx_type !=
+ if (ipx_hdr(skb)->ipx_type !=
__constant_htons(IPX_TYPE_NCP)) {
/* The only protocol worth balancing in
* this family since it has an "ARP" like
@@ -1284,7 +1350,6 @@ bond_alb_xmit(struct sk_buff *skb, struct net_device *dev)
hash_start = (char*)eth_data->h_dest;
hash_size = ETH_ALEN;
break;
-#endif
case ETH_P_ARP:
do_tx_balance = 0;
@@ -1444,8 +1509,8 @@ bond_alb_init_slave(struct bonding *bond, struct slave *slave)
{
int err = 0;
- err = alb_set_mac_addr(slave, slave->perm_hwaddr,
- bond->alb_info.rlb_enabled);
+ err = alb_set_slave_mac_addr(slave, slave->perm_hwaddr,
+ bond->alb_info.rlb_enabled);
if (err) {
return err;
}
@@ -1569,10 +1634,61 @@ bond_alb_assign_current_slave(struct bonding *bond, struct slave *new_slave)
alb_swap_mac_addr(bond, swap_slave, new_slave);
} else {
/* set the new_slave to the bond mac address */
- alb_set_mac_addr(new_slave, bond->device->dev_addr,
- bond->alb_info.rlb_enabled);
+ alb_set_slave_mac_addr(new_slave, bond->device->dev_addr,
+ bond->alb_info.rlb_enabled);
/* fasten bond mac on new current slave */
alb_send_learning_packets(new_slave, bond->device->dev_addr);
}
}
+int
+bond_alb_set_mac_address(struct net_device *dev, void *addr)
+{
+ struct bonding *bond = dev->priv;
+ struct sockaddr *sa = addr;
+ struct slave *swap_slave = NULL;
+ int error = 0;
+
+ if (!is_valid_ether_addr(sa->sa_data)) {
+ return -EADDRNOTAVAIL;
+ }
+
+ error = alb_set_mac_address(bond, addr);
+ if (error) {
+ return error;
+ }
+
+ memcpy(dev->dev_addr, sa->sa_data, dev->addr_len);
+
+ /* If there is no current_slave there is nothing else to do.
+ * Otherwise we'll need to pass the new address to it and handle
+ * duplications.
+ */
+ if (bond->current_slave == NULL) {
+ return 0;
+ }
+
+ swap_slave = bond_get_first_slave(bond);
+ while (swap_slave) {
+ if (!memcmp(swap_slave->dev->dev_addr, dev->dev_addr, ETH_ALEN)) {
+ break;
+ }
+ swap_slave = bond_get_next_slave(bond, swap_slave);
+ }
+
+ if (swap_slave) {
+ alb_swap_mac_addr(bond, swap_slave, bond->current_slave);
+ } else {
+ alb_set_slave_mac_addr(bond->current_slave, dev->dev_addr,
+ bond->alb_info.rlb_enabled);
+
+ alb_send_learning_packets(bond->current_slave, dev->dev_addr);
+ if (bond->alb_info.rlb_enabled) {
+ /* inform clients mac address has changed */
+ rlb_req_update_slave_clients(bond, bond->current_slave);
+ }
+ }
+
+ return 0;
+}
+
diff --git a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h
index 8b69c8a8f4b9..d3f4291706ef 100644
--- a/drivers/net/bonding/bond_alb.h
+++ b/drivers/net/bonding/bond_alb.h
@@ -17,6 +17,13 @@
*
* The full GNU General Public License is included in this distribution in the
* file called LICENSE.
+ *
+ *
+ * Changes:
+ *
+ * 2003/08/06 - Amir Noam <amir.noam at intel dot com>
+ * - Add support for setting bond's MAC address with special
+ * handling required for ALB/TLB.
*/
#ifndef __BOND_ALB_H__
@@ -122,6 +129,7 @@ void bond_alb_handle_link_change(struct bonding *bond, struct slave *slave, char
void bond_alb_assign_current_slave(struct bonding *bond, struct slave *new_slave);
int bond_alb_xmit(struct sk_buff *skb, struct net_device *dev);
void bond_alb_monitor(struct bonding *bond);
+int bond_alb_set_mac_address(struct net_device *dev, void *addr);
#endif /* __BOND_ALB_H__ */
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 356c27ec5423..949c58d469c7 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -408,6 +408,24 @@
* and free it separately; use standard list operations instead
* of pre-allocated array of bonds.
* Version to 2.3.0.
+ *
+ * 2003/08/07 - Jay Vosburgh <fubar at us dot ibm dot com>,
+ * Amir Noam <amir.noam at intel dot com> and
+ * Shmulik Hen <shmulik.hen at intel dot com>
+ * - Propagating master's settings: Distinguish between modes that
+ * use a primary slave from those that don't, and propagate settings
+ * accordingly; Consolidate change_active opeartions and add
+ * reselect_active and find_best opeartions; Decouple promiscuous
+ * handling from the multicast mode setting; Add support for changing
+ * HW address and MTU with proper unwind; Consolidate procfs code,
+ * add CHANGENAME handler; Enhance netdev notification handling.
+ * Version to 2.4.0.
+ *
+ * 2003/09/15 - Stephen Hemminger <shemminger at osdl dot org>,
+ * Amir Noam <amir.noam at intel dot com>
+ * - Convert /proc to seq_file interface.
+ * Change /proc/net/bondX/info to /proc/net/bonding/bondX.
+ * Set version to 2.4.1.
*/
#include <linux/config.h>
@@ -441,6 +459,8 @@
#include <linux/skbuff.h>
#include <net/sock.h>
#include <linux/rtnetlink.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
#include <linux/if_bonding.h>
#include <linux/smp.h>
@@ -452,8 +472,8 @@
#include "bond_3ad.h"
#include "bond_alb.h"
-#define DRV_VERSION "2.3.0"
-#define DRV_RELDATE "August 6, 2003"
+#define DRV_VERSION "2.4.1"
+#define DRV_RELDATE "September 15, 2003"
#define DRV_NAME "bonding"
#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"
@@ -473,6 +493,11 @@ DRV_NAME ".c:v" DRV_VERSION " (" DRV_RELDATE ")\n";
#define MAX_ARP_IP_TARGETS 16
#endif
+#define USES_PRIMARY(mode) \
+ (((mode) == BOND_MODE_ACTIVEBACKUP) || \
+ ((mode) == BOND_MODE_TLB) || \
+ ((mode) == BOND_MODE_ALB))
+
struct bond_parm_tbl {
char *modename;
int mode;
@@ -536,6 +561,9 @@ static struct bond_parm_tbl bond_lacp_tbl[] = {
};
static LIST_HEAD(bond_dev_list);
+#ifdef CONFIG_PROC_FS
+static struct proc_dir_entry *bond_proc_dir = NULL;
+#endif
MODULE_PARM(max_bonds, "i");
MODULE_PARM_DESC(max_bonds, "Max number of bonded devices");
@@ -567,7 +595,6 @@ static struct net_device_stats *bond_get_stats(struct net_device *dev);
static void bond_mii_monitor(struct net_device *dev);
static void loadbalance_arp_monitor(struct net_device *dev);
static void activebackup_arp_monitor(struct net_device *dev);
-static int bond_event(struct notifier_block *this, unsigned long event, void *ptr);
static void bond_mc_list_destroy(struct bonding *bond);
static void bond_mc_add(bonding_t *bond, void *addr, int alen);
static void bond_mc_delete(bonding_t *bond, void *addr, int alen);
@@ -581,22 +608,17 @@ static int bond_enslave(struct net_device *master, struct net_device *slave);
static int bond_release(struct net_device *master, struct net_device *slave);
static int bond_release_all(struct net_device *master);
static int bond_sethwaddr(struct net_device *master, struct net_device *slave);
+static void change_active_interface(struct bonding *bond, struct slave *new);
+static void reselect_active_interface(struct bonding *bond);
+static struct slave *find_best_interface(struct bonding *bond);
-/* Caller must hold bond->ptrlock for write */
-static inline struct slave*
-bond_assign_current_slave(struct bonding *bond,struct slave *newslave)
-{
- if ((bond_mode == BOND_MODE_TLB) ||
- (bond_mode == BOND_MODE_ALB)) {
- bond_alb_assign_current_slave(bond, newslave);
- } else {
- bond->current_slave = newslave;
- }
-
- return bond->current_slave;
-}
/* #define BONDING_DEBUG 1 */
+#ifdef BONDING_DEBUG
+#define dprintk(x...) printk(x...)
+#else /* BONDING_DEBUG */
+#define dprintk(x...) do {} while (0)
+#endif /* BONDING_DEBUG */
/* several macros */
@@ -691,7 +713,7 @@ update_slave_cnt(bonding_t *bond, int incr)
* belongs to <bond>. It returns <slave> in case it's needed.
* Nothing is freed on return, structures are just unchained.
* If the bond->current_slave pointer was pointing to <slave>,
- * it's replaced with bond->next, or NULL if not applicable.
+ * it should be changed by the calling function.
*
* bond->lock held for writing by caller.
*/
@@ -725,17 +747,6 @@ bond_detach_slave(bonding_t *bond, slave_t *slave)
update_slave_cnt(bond, -1);
- /* no need to hold ptrlock since bond lock is
- * already held for writing
- */
- if (slave == bond->current_slave) {
- if ( bond->next != (slave_t *)bond) { /* found one slave */
- bond_assign_current_slave(bond, bond->next);
- } else {
- bond_assign_current_slave(bond, NULL);
- }
- }
-
return slave;
}
@@ -1167,23 +1178,22 @@ static inline int dmi_same(struct dev_mc_list *dmi1, struct dev_mc_list *dmi2)
}
/*
- * Push the promiscuity flag down to all slaves
+ * Push the promiscuity flag down to appropriate slaves
*/
static void bond_set_promiscuity(bonding_t *bond, int inc)
{
slave_t *slave;
- switch (multicast_mode) {
- case BOND_MULTICAST_ACTIVE :
- /* write lock already acquired */
- if (bond->current_slave != NULL)
+
+ if (USES_PRIMARY(bond_mode)) {
+ if (bond->current_slave) {
dev_set_promiscuity(bond->current_slave->dev, inc);
- break;
- case BOND_MULTICAST_ALL :
- for (slave = bond->prev; slave != (slave_t*)bond; slave = slave->prev)
+ }
+
+ } else {
+ for (slave = bond->prev; slave != (slave_t*)bond;
+ slave = slave->prev) {
dev_set_promiscuity(slave->dev, inc);
- break;
- case BOND_MULTICAST_DISABLED :
- break;
+ }
}
}
@@ -1229,20 +1239,23 @@ static void set_multicast_list(struct net_device *master)
bonding_t *bond = master->priv;
struct dev_mc_list *dmi;
- if (multicast_mode == BOND_MULTICAST_DISABLED)
- return;
- /*
- * Lock the private data for the master
- */
write_lock_bh(&bond->lock);
- /* set promiscuity flag to slaves */
+ /*
+ * Do promisc before checking multicast_mode
+ */
if ( (master->flags & IFF_PROMISC) && !(bond->flags & IFF_PROMISC) )
bond_set_promiscuity(bond, 1);
if ( !(master->flags & IFF_PROMISC) && (bond->flags & IFF_PROMISC) )
bond_set_promiscuity(bond, -1);
+ if (multicast_mode == BOND_MULTICAST_DISABLED) {
+ bond->flags = master->flags;
+ write_unlock_bh(&bond->lock);
+ return;
+ }
+
/* set allmulti flag to slaves */
if ( (master->flags & IFF_ALLMULTI) && !(bond->flags & IFF_ALLMULTI) )
bond_set_allmulti(bond, 1);
@@ -1274,32 +1287,40 @@ static void set_multicast_list(struct net_device *master)
/*
* Update the mc list and multicast-related flags for the new and
- * old active slaves (if any) according to the multicast mode
+ * old active slaves (if any) according to the multicast mode, and
+ * promiscuous flags unconditionally.
*/
static void bond_mc_update(bonding_t *bond, slave_t *new, slave_t *old)
{
struct dev_mc_list *dmi;
- switch(multicast_mode) {
- case BOND_MULTICAST_ACTIVE :
+ if (USES_PRIMARY(bond_mode)) {
if (bond->device->flags & IFF_PROMISC) {
- if (old != NULL && new != old)
+ if (old)
dev_set_promiscuity(old->dev, -1);
- dev_set_promiscuity(new->dev, 1);
+ if (new)
+ dev_set_promiscuity(new->dev, 1);
}
+ }
+
+ switch(multicast_mode) {
+ case BOND_MULTICAST_ACTIVE :
if (bond->device->flags & IFF_ALLMULTI) {
- if (old != NULL && new != old)
+ if (old)
dev_set_allmulti(old->dev, -1);
- dev_set_allmulti(new->dev, 1);
+ if (new)
+ dev_set_allmulti(new->dev, 1);
}
/* first remove all mc addresses from old slave if any,
and _then_ add them to new active slave */
- if (old != NULL && new != old) {
+ if (old) {
for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next)
dev_mc_delete(old->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
}
- for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next)
- dev_mc_add(new->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
+ if (new) {
+ for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next)
+ dev_mc_add(new->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
+ }
break;
case BOND_MULTICAST_ALL :
/* nothing to do: mc list is already up-to-date on all slaves */
@@ -1415,7 +1436,7 @@ static int bond_enslave(struct net_device *master_dev,
* The application already set the master's
* mac address to that of the first slave
*/
- memcpy(addr.sa_data, master_dev->dev_addr, ETH_ALEN);
+ memcpy(addr.sa_data, master_dev->dev_addr, master_dev->addr_len);
addr.sa_family = slave_dev->type;
err = slave_dev->set_mac_address(slave_dev, &addr);
if (err) {
@@ -1461,11 +1482,19 @@ static int bond_enslave(struct net_device *master_dev,
}
}
- if (multicast_mode == BOND_MULTICAST_ALL) {
- /* set promiscuity level to new slave */
- if (master_dev->flags & IFF_PROMISC)
+ /* set promiscuity level to new slave */
+ if (master_dev->flags & IFF_PROMISC) {
+ /* If the mode USES_PRIMARY, then the new slave gets the
+ * master's promisc (and mc) settings only if it becomes the
+ * current_slave, and that is taken care of later when calling
+ * bond_change_active()
+ */
+ if (!USES_PRIMARY(bond_mode)) {
dev_set_promiscuity(slave_dev, 1);
+ }
+ }
+ if (multicast_mode == BOND_MULTICAST_ALL) {
/* set allmulti level to new slave */
if (master_dev->flags & IFF_ALLMULTI)
dev_set_allmulti(slave_dev, 1);
@@ -1578,9 +1607,7 @@ static int bond_enslave(struct net_device *master_dev,
#endif
/* first slave or no active slave yet, and this link
is OK, so make this interface the active one */
- bond_assign_current_slave(bond, new_slave);
- bond_set_slave_active_flags(new_slave);
- bond_mc_update(bond, new_slave, NULL);
+ change_active_interface(bond, new_slave);
}
else {
#ifdef BONDING_DEBUG
@@ -1630,7 +1657,7 @@ static int bond_enslave(struct net_device *master_dev,
/* first slave or no active slave yet, and this link
* is OK, so make this interface the active one
*/
- bond_assign_current_slave(bond, new_slave);
+ change_active_interface(bond, new_slave);
}
/* if there is a primary slave, remember it */
@@ -1645,8 +1672,13 @@ static int bond_enslave(struct net_device *master_dev,
#endif
/* always active in trunk mode */
new_slave->state = BOND_STATE_ACTIVE;
+
+ /* In trunking mode there is little meaning to current_slave
+ * anyway (it holds no special properties of the bond device),
+ * so we can change it without calling change_active_interface()
+ */
if (bond->current_slave == NULL)
- bond_assign_current_slave(bond, new_slave);
+ bond->current_slave = new_slave;
}
write_unlock_bh(&bond->lock);
@@ -1737,6 +1769,13 @@ static int bond_change_active(struct net_device *master_dev, struct net_device *
return -ENODEV;
}
+ /* Verify that master_dev is indeed the master of slave_dev */
+ if (!(slave_dev->flags & IFF_SLAVE) ||
+ (slave_dev->master != master_dev)) {
+
+ return -EINVAL;
+ }
+
bond = (struct bonding *) master_dev->priv;
write_lock_bh(&bond->lock);
slave = (slave_t *)bond;
@@ -1761,16 +1800,7 @@ static int bond_change_active(struct net_device *master_dev, struct net_device *
(oldactive != NULL)&&
(newactive->link == BOND_LINK_UP)&&
IS_UP(newactive->dev)) {
- if (bond_mode == BOND_MODE_ACTIVEBACKUP) {
- bond_set_slave_inactive_flags(oldactive);
- bond_set_slave_active_flags(newactive);
- }
-
- bond_mc_update(bond, newactive, oldactive);
- bond_assign_current_slave(bond, newactive);
- printk("%s : activate %s(old : %s)\n",
- master_dev->name, newactive->dev->name,
- oldactive->dev->name);
+ change_active_interface(bond, newactive);
} else {
ret = -EINVAL;
}
@@ -1778,47 +1808,26 @@ static int bond_change_active(struct net_device *master_dev, struct net_device *
return ret;
}
-/* Choose a new valid interface from the pool, set it active
- * and make it the current slave. If no valid interface is
- * found, the oldest slave in BACK state is choosen and
- * activated. If none is found, it's considered as no
- * interfaces left so the current slave is set to NULL.
- * The result is a pointer to the current slave.
- *
- * Since this function sends messages tails through printk, the caller
- * must have started something like `printk(KERN_INFO "xxxx ");'.
+/**
+ * find_best_interface - select the best available slave to be the active one
+ * @bond: our bonding struct
*
* Warning: Caller must hold ptrlock for writing.
*/
-slave_t *change_active_interface(bonding_t *bond)
+static struct slave *find_best_interface(struct bonding *bond)
{
- slave_t *newslave, *oldslave;
- slave_t *bestslave = NULL;
+ struct slave *newslave, *oldslave;
+ struct slave *bestslave = NULL;
int mintime;
newslave = oldslave = bond->current_slave;
if (newslave == NULL) { /* there were no active slaves left */
if (bond->next != (slave_t *)bond) { /* found one slave */
- newslave = bond_assign_current_slave(bond, bond->next);
+ newslave = bond->next;
} else {
-
- printk (" but could not find any %s interface.\n",
- (bond_mode == BOND_MODE_ACTIVEBACKUP) ? "backup":"other");
- bond_assign_current_slave(bond, NULL);
return NULL; /* still no slave, return NULL */
}
- } else if (bond_mode == BOND_MODE_ACTIVEBACKUP) {
- /* make sure oldslave doesn't send arps - this could
- * cause a ping-pong effect between interfaces since they
- * would be able to tx arps - in active backup only one
- * slave should be able to tx arps, and that should be
- * the current_slave; the only exception is when all
- * slaves have gone down, then only one non-current slave can
- * send arps at a time; clearing oldslaves' mc list is handled
- * later in this function.
- */
- bond_set_slave_inactive_flags(oldslave);
}
mintime = updelay;
@@ -1833,22 +1842,12 @@ slave_t *change_active_interface(bonding_t *bond)
newslave = bond->primary_slave;
}
+ /* remember where to stop iterating over the slaves */
+ oldslave = newslave;
+
do {
if (IS_UP(newslave->dev)) {
if (newslave->link == BOND_LINK_UP) {
- /* this one is immediately usable */
- if (bond_mode == BOND_MODE_ACTIVEBACKUP) {
- bond_set_slave_active_flags(newslave);
- bond_mc_update(bond, newslave, oldslave);
- printk (" and making interface %s the active one.\n",
- newslave->dev->name);
- }
- else {
- printk (" and setting pointer to interface %s.\n",
- newslave->dev->name);
- }
-
- bond_assign_current_slave(bond, newslave);
return newslave;
}
else if (newslave->link == BOND_LINK_BACK) {
@@ -1861,46 +1860,105 @@ slave_t *change_active_interface(bonding_t *bond)
}
} while ((newslave = newslave->next) != oldslave);
- /* no usable backup found, we'll see if we at least got a link that was
- coming back for a long time, and could possibly already be usable.
- */
-
- if (bestslave != NULL) {
- /* early take-over. */
- printk (" and making interface %s the active one %d ms earlier.\n",
- bestslave->dev->name,
- (updelay - bestslave->delay)*miimon);
-
- bestslave->delay = 0;
- bestslave->link = BOND_LINK_UP;
- bestslave->jiffies = jiffies;
- bond_set_slave_active_flags(bestslave);
- bond_mc_update(bond, bestslave, oldslave);
- bond_assign_current_slave(bond, bestslave);
- return bestslave;
- }
-
- if ((bond_mode == BOND_MODE_ACTIVEBACKUP) &&
- (multicast_mode == BOND_MULTICAST_ACTIVE) &&
- (oldslave != NULL)) {
- /* flush bonds (master's) mc_list from oldslave since it wasn't
- * updated (and deleted) above
- */
- bond_mc_list_flush(oldslave->dev, bond->device);
- if (bond->device->flags & IFF_PROMISC) {
- dev_set_promiscuity(oldslave->dev, -1);
+ return bestslave;
+}
+
+/**
+ * change_active_interface - change the active slave into the specified one
+ * @bond: our bonding struct
+ * @new: the new slave to make the active one
+ *
+ * Set the new slave to the bond's settings and unset them on the old
+ * current_slave.
+ * Setting include flags, mc-list, promiscuity, allmulti, etc.
+ *
+ * If @new's link state is %BOND_LINK_BACK we'll set it to %BOND_LINK_UP,
+ * because it is apparently the best available slave we have, even though its
+ * updelay hasn't timed out yet.
+ *
+ * Warning: Caller must hold ptrlock for writing.
+ */
+static void change_active_interface(struct bonding *bond, struct slave *new)
+{
+ struct slave *old = bond->current_slave;
+
+ if (old == new) {
+ return;
+ }
+
+ if (new) {
+ if (new->link == BOND_LINK_BACK) {
+ if (USES_PRIMARY(bond_mode)) {
+ printk (KERN_INFO
+ "%s: making interface %s the new "
+ "active one %d ms earlier.\n",
+ bond->device->name, new->dev->name,
+ (updelay - new->delay) * miimon);
+ }
+
+ new->delay = 0;
+ new->link = BOND_LINK_UP;
+ new->jiffies = jiffies;
+
+ if (bond_mode == BOND_MODE_8023AD) {
+ bond_3ad_handle_link_change(new, BOND_LINK_UP);
+ }
+
+ if ((bond_mode == BOND_MODE_TLB) ||
+ (bond_mode == BOND_MODE_ALB)) {
+ bond_alb_handle_link_change(bond, new, BOND_LINK_UP);
+ }
+ } else {
+ if (USES_PRIMARY(bond_mode)) {
+ printk (KERN_INFO
+ "%s: making interface %s the new active one.\n",
+ bond->device->name, new->dev->name);
+ }
}
- if (bond->device->flags & IFF_ALLMULTI) {
- dev_set_allmulti(oldslave->dev, -1);
+ }
+
+ if (bond_mode == BOND_MODE_ACTIVEBACKUP) {
+ if (old) {
+ bond_set_slave_inactive_flags(old);
+ }
+
+ if (new) {
+ bond_set_slave_active_flags(new);
}
}
- printk (" but could not find any %s interface.\n",
- (bond_mode == BOND_MODE_ACTIVEBACKUP) ? "backup":"other");
-
- /* absolutely nothing found. let's return NULL */
- bond_assign_current_slave(bond, NULL);
- return NULL;
+ if (USES_PRIMARY(bond_mode)) {
+ bond_mc_update(bond, new, old);
+ }
+
+ if ((bond_mode == BOND_MODE_TLB) ||
+ (bond_mode == BOND_MODE_ALB)) {
+ bond_alb_assign_current_slave(bond, new);
+ } else {
+ bond->current_slave = new;
+ }
+}
+
+/**
+ * reselect_active_interface - select a new active slave, if needed
+ * @bond: our bonding struct
+ *
+ * This functions shoud be called when one of the following occurs:
+ * - The old current_slave has been released or lost its link.
+ * - The primary_slave has got its link back.
+ * - A slave has got its link back and there's no old current_slave.
+ *
+ * Warning: Caller must hold ptrlock for writing.
+ */
+static void reselect_active_interface(struct bonding *bond)
+{
+ struct slave *best_slave;
+
+ best_slave = find_best_interface(bond);
+
+ if (best_slave != bond->current_slave) {
+ change_active_interface(bond, best_slave);
+ }
}
/*
@@ -1949,12 +2007,12 @@ static int bond_release(struct net_device *master, struct net_device *slave)
"of %s to a different address "
"to avoid conflicts.\n",
slave->name,
- slave->dev_addr[0],
- slave->dev_addr[1],
- slave->dev_addr[2],
- slave->dev_addr[3],
- slave->dev_addr[4],
- slave->dev_addr[5],
+ our_slave->perm_hwaddr[0],
+ our_slave->perm_hwaddr[1],
+ our_slave->perm_hwaddr[2],
+ our_slave->perm_hwaddr[3],
+ our_slave->perm_hwaddr[4],
+ our_slave->perm_hwaddr[5],
bond->device->name,
slave->name);
}
@@ -1967,6 +2025,11 @@ static int bond_release(struct net_device *master, struct net_device *slave)
bond_3ad_unbind_slave(our_slave);
}
+ printk (KERN_INFO "%s: releasing %s interface %s\n",
+ master->name,
+ (our_slave->state == BOND_STATE_ACTIVE) ? "active" : "backup",
+ slave->name);
+
/* release the slave from its bond */
bond_detach_slave(bond, our_slave);
@@ -1974,18 +2037,11 @@ static int bond_release(struct net_device *master, struct net_device *slave)
bond->primary_slave = NULL;
}
- printk (KERN_INFO "%s: releasing %s interface %s",
- master->name,
- (our_slave->state == BOND_STATE_ACTIVE) ? "active" : "backup",
- slave->name);
-
- if (our_slave == old_current) {
- /* find a new interface and be verbose */
- change_active_interface(bond);
- } else {
- printk(".\n");
+ if (bond->current_slave == our_slave) {
+ change_active_interface(bond, NULL);
+ reselect_active_interface(bond);
}
-
+
if (bond->current_slave == NULL) {
printk(KERN_INFO
"%s: now running without any active interface !\n",
@@ -2013,16 +2069,22 @@ static int bond_release(struct net_device *master, struct net_device *slave)
return -EINVAL;
}
+ /* unset promiscuity level from slave */
+ if (master->flags & IFF_PROMISC) {
+ /* If the mode USES_PRIMARY, then we should only remove its
+ * promisc settings if it was the current_slave, but that was
+ * already taken care of above when we detached the slave
+ */
+ if (!USES_PRIMARY(bond_mode)) {
+ dev_set_promiscuity(slave, -1);
+ }
+ }
+
/* undo settings and restore original values */
-
if (multicast_mode == BOND_MULTICAST_ALL) {
/* flush master's mc_list from slave */
bond_mc_list_flush (slave, master);
- /* unset promiscuity level from slave */
- if (master->flags & IFF_PROMISC)
- dev_set_promiscuity(slave, -1);
-
/* unset allmulti level from slave */
if (master->flags & IFF_ALLMULTI)
dev_set_allmulti(slave, -1);
@@ -2089,7 +2151,7 @@ static int bond_release_all(struct net_device *master)
}
old_current = bond->current_slave;
- bond_assign_current_slave(bond, NULL);
+ change_active_interface(bond, NULL);
bond->current_arp_slave = NULL;
bond->primary_slave = NULL;
@@ -2118,17 +2180,17 @@ static int bond_release_all(struct net_device *master)
*/
write_unlock_bh(&bond->lock);
- if (multicast_mode == BOND_MULTICAST_ALL
- || (multicast_mode == BOND_MULTICAST_ACTIVE
- && old_current == our_slave)) {
+ /* unset promiscuity level from slave */
+ if (master->flags & IFF_PROMISC) {
+ if (!USES_PRIMARY(bond_mode)) {
+ dev_set_promiscuity(slave_dev, -1);
+ }
+ }
+ if (multicast_mode == BOND_MULTICAST_ALL) {
/* flush master's mc_list from slave */
bond_mc_list_flush (slave_dev, master);
- /* unset promiscuity level from slave */
- if (master->flags & IFF_PROMISC)
- dev_set_promiscuity(slave_dev, -1);
-
/* unset allmulti level from slave */
if (master->flags & IFF_ALLMULTI)
dev_set_allmulti(slave_dev, -1);
@@ -2274,9 +2336,7 @@ static void bond_mii_monitor(struct net_device *master)
write_lock(&bond->ptrlock);
if (slave == bond->current_slave) {
/* find a new interface and be verbose */
- change_active_interface(bond);
- } else {
- printk(".\n");
+ reselect_active_interface(bond);
}
write_unlock(&bond->ptrlock);
slave_died = 1;
@@ -2372,7 +2432,7 @@ static void bond_mii_monitor(struct net_device *master)
write_lock(&bond->ptrlock);
if ( (bond->primary_slave != NULL)
&& (slave == bond->primary_slave) )
- change_active_interface(bond);
+ reselect_active_interface(bond);
write_unlock(&bond->ptrlock);
}
else
@@ -2418,40 +2478,8 @@ static void bond_mii_monitor(struct net_device *master)
/* no active interface at the moment or need to bring up the primary */
if (oldcurrent == NULL) { /* no active interface at the moment */
if (bestslave != NULL) { /* last chance to find one ? */
- if (bestslave->link == BOND_LINK_UP) {
- printk (KERN_INFO
- "%s: making interface %s the new active one.\n",
- master->name, bestslave->dev->name);
- } else {
- printk (KERN_INFO
- "%s: making interface %s the new "
- "active one %d ms earlier.\n",
- master->name, bestslave->dev->name,
- (updelay - bestslave->delay) * miimon);
-
- bestslave->delay = 0;
- bestslave->link = BOND_LINK_UP;
- bestslave->jiffies = jiffies;
-
- /* notify ad that the link status has changed */
- if (bond_mode == BOND_MODE_8023AD) {
- bond_3ad_handle_link_change(bestslave, BOND_LINK_UP);
- }
-
- if ((bond_mode == BOND_MODE_TLB) ||
- (bond_mode == BOND_MODE_ALB)) {
- bond_alb_handle_link_change(bond, bestslave, BOND_LINK_UP);
- }
- }
-
- if (bond_mode == BOND_MODE_ACTIVEBACKUP) {
- bond_set_slave_active_flags(bestslave);
- bond_mc_update(bond, bestslave, NULL);
- } else if (bond_mode != BOND_MODE_8023AD) {
- bestslave->state = BOND_STATE_ACTIVE;
- }
write_lock(&bond->ptrlock);
- bond_assign_current_slave(bond, bestslave);
+ change_active_interface(bond, bestslave);
write_unlock(&bond->ptrlock);
} else if (slave_died) {
/* print this message only once a slave has just died */
@@ -2535,7 +2563,7 @@ static void loadbalance_arp_monitor(struct net_device *master)
"for interface %s, ",
master->name,
slave->dev->name);
- change_active_interface(bond);
+ reselect_active_interface(bond);
} else {
printk(KERN_INFO
"%s: interface %s is now up\n",
@@ -2567,7 +2595,7 @@ static void loadbalance_arp_monitor(struct net_device *master)
write_lock(&bond->ptrlock);
if (slave == bond->current_slave) {
- change_active_interface(bond);
+ reselect_active_interface(bond);
}
write_unlock(&bond->ptrlock);
}
@@ -2645,9 +2673,7 @@ static void activebackup_arp_monitor(struct net_device *master)
if ((bond->current_slave == NULL) &&
((jiffies - slave->dev->trans_start) <=
the_delta_in_ticks)) {
- bond_assign_current_slave(bond, slave);
- bond_set_slave_active_flags(slave);
- bond_mc_update(bond, slave, NULL);
+ change_active_interface(bond, slave);
bond->current_arp_slave = NULL;
} else if (bond->current_slave != slave) {
/* this slave has just come up but we
@@ -2737,7 +2763,8 @@ static void activebackup_arp_monitor(struct net_device *master)
master->name,
slave->dev->name);
write_lock(&bond->ptrlock);
- slave = change_active_interface(bond);
+ reselect_active_interface(bond);
+ slave = bond->current_slave;
write_unlock(&bond->ptrlock);
bond->current_arp_slave = slave;
if (slave != NULL) {
@@ -2756,13 +2783,10 @@ static void activebackup_arp_monitor(struct net_device *master)
bond->primary_slave->dev->name);
/* primary is up so switch to it */
- bond_set_slave_inactive_flags(slave);
- bond_mc_update(bond, bond->primary_slave, slave);
write_lock(&bond->ptrlock);
- bond_assign_current_slave(bond, bond->primary_slave);
+ change_active_interface(bond, bond->primary_slave);
write_unlock(&bond->ptrlock);
slave = bond->primary_slave;
- bond_set_slave_active_flags(slave);
slave->jiffies = jiffies;
} else {
bond->current_arp_slave = NULL;
@@ -2805,7 +2829,7 @@ static void activebackup_arp_monitor(struct net_device *master)
/* if the link state is up at this point, we
* mark it down - this can happen if we have
* simultaneous link failures and
- * change_active_interface doesn't make this
+ * reselect_active_interface doesn't make this
* one the current slave so it is still marked
* up when it is actually down
*/
@@ -3050,15 +3074,9 @@ static int bond_ioctl(struct net_device *master_dev, struct ifreq *ifr, int cmd)
case SIOCBONDRELEASE:
ret = bond_release(master_dev, slave_dev);
break;
- case BOND_SETHWADDR_OLD:
- case SIOCBONDSETHWADDR:
- ret = bond_sethwaddr(master_dev, slave_dev);
- break;
case BOND_CHANGE_ACTIVE_OLD:
case SIOCBONDCHANGEACTIVE:
- if ((bond_mode == BOND_MODE_ACTIVEBACKUP) ||
- (bond_mode == BOND_MODE_TLB) ||
- (bond_mode == BOND_MODE_ALB)) {
+ if (USES_PRIMARY(bond_mode)) {
ret = bond_change_active(master_dev, slave_dev);
}
else {
@@ -3180,7 +3198,7 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *dev)
dev_queue_xmit(skb);
write_lock(&bond->ptrlock);
- bond_assign_current_slave(bond, slave->next);
+ bond->current_slave = slave->next;
write_unlock(&bond->ptrlock);
read_unlock(&bond->lock);
@@ -3367,162 +3385,480 @@ static struct net_device_stats *bond_get_stats(struct net_device *dev)
}
#ifdef CONFIG_PROC_FS
-static int bond_read_proc(char *buf, char **start, off_t off, int count, int *eof, void *data)
+
+#define SEQ_START_TOKEN ((void *)1)
+
+static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
{
- struct bonding *bond = (struct bonding *) data;
- int len = 0;
- u16 link;
- slave_t *slave = NULL;
+ struct bonding *bond = seq->private;
+ loff_t off = 0;
+ struct slave *slave;
/* make sure the bond won't be taken away */
read_lock(&dev_base_lock);
+ read_lock_bh(&bond->lock);
- len += sprintf(buf + len, "%s\n", version);
-
- /*
- * This function locks the mutex, so we can't lock it until
- * afterwards
- */
- link = bond_check_mii_link(bond);
+ if (*pos == 0) {
+ return SEQ_START_TOKEN;
+ }
- len += sprintf(buf + len, "Bonding Mode: %s\n",
- bond_mode_name());
+ for (slave = bond->prev; slave != (slave_t *)bond;
+ slave = slave->prev) {
- if ((bond_mode == BOND_MODE_ACTIVEBACKUP) ||
- (bond_mode == BOND_MODE_TLB) ||
- (bond_mode == BOND_MODE_ALB)) {
- read_lock_bh(&bond->lock);
- read_lock(&bond->ptrlock);
- if (bond->current_slave != NULL) {
- len += sprintf(buf + len,
- "Currently Active Slave: %s\n",
- bond->current_slave->dev->name);
+ if (++off == *pos) {
+ return slave;
}
- read_unlock(&bond->ptrlock);
- read_unlock_bh(&bond->lock);
}
- len += sprintf(buf + len, "MII Status: ");
- len += sprintf(buf + len,
- link == BMSR_LSTATUS ? "up\n" : "down\n");
- len += sprintf(buf + len, "MII Polling Interval (ms): %d\n",
- miimon);
- len += sprintf(buf + len, "Up Delay (ms): %d\n",
- updelay * miimon);
- len += sprintf(buf + len, "Down Delay (ms): %d\n",
- downdelay * miimon);
- len += sprintf(buf + len, "Multicast Mode: %s\n",
- multicast_mode_name());
+ return NULL;
+}
+
+static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ struct bonding *bond = seq->private;
+ struct slave *slave = v;
- read_lock_bh(&bond->lock);
+ ++*pos;
+ if (v == SEQ_START_TOKEN) {
+ slave = bond->prev;
+ } else {
+ slave = slave->prev;
+ }
+
+ return (slave == (struct slave *) bond) ? NULL : slave;
+}
+
+static void bond_info_seq_stop(struct seq_file *seq, void *v)
+{
+ struct bonding *bond = seq->private;
+
+ read_unlock_bh(&bond->lock);
+ read_unlock(&dev_base_lock);
+}
+
+static void bond_info_show_master(struct seq_file *seq, struct bonding *bond)
+{
+ struct slave *curr;
+
+ read_lock(&bond->ptrlock);
+ curr = bond->current_slave;
+ read_unlock(&bond->ptrlock);
+
+ seq_printf(seq, "Bonding Mode: %s\n", bond_mode_name());
+
+ if (USES_PRIMARY(bond_mode)) {
+ if (curr) {
+ seq_printf(seq,
+ "Currently Active Slave: %s\n",
+ curr->dev->name);
+ }
+ }
+
+ seq_printf(seq, "MII Status: %s\n", (curr) ? "up" : "down");
+ seq_printf(seq, "MII Polling Interval (ms): %d\n", miimon);
+ seq_printf(seq, "Up Delay (ms): %d\n", updelay * miimon);
+ seq_printf(seq, "Down Delay (ms): %d\n", downdelay * miimon);
+ seq_printf(seq, "Multicast Mode: %s\n", multicast_mode_name());
if (bond_mode == BOND_MODE_8023AD) {
struct ad_info ad_info;
- len += sprintf(buf + len, "\n802.3ad info\n");
+ seq_puts(seq, "\n802.3ad info\n");
if (bond_3ad_get_active_agg_info(bond, &ad_info)) {
- len += sprintf(buf + len, "bond %s has no active aggregator\n", bond->device->name);
+ seq_printf(seq, "bond %s has no active aggregator\n",
+ bond->device->name);
} else {
- len += sprintf(buf + len, "Active Aggregator Info:\n");
+ seq_printf(seq, "Active Aggregator Info:\n");
+
+ seq_printf(seq, "\tAggregator ID: %d\n",
+ ad_info.aggregator_id);
+ seq_printf(seq, "\tNumber of ports: %d\n",
+ ad_info.ports);
+ seq_printf(seq, "\tActor Key: %d\n",
+ ad_info.actor_key);
+ seq_printf(seq, "\tPartner Key: %d\n",
+ ad_info.partner_key);
+ seq_printf(seq, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n",
+ ad_info.partner_system[0],
+ ad_info.partner_system[1],
+ ad_info.partner_system[2],
+ ad_info.partner_system[3],
+ ad_info.partner_system[4],
+ ad_info.partner_system[5]);
+ }
+ }
+}
+
+static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave)
+{
+ seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
+ seq_printf(seq, "MII Status: %s\n",
+ (slave->link == BOND_LINK_UP) ? "up" : "down");
+ seq_printf(seq, "Link Failure Count: %d\n",
+ slave->link_failure_count);
+
+ if (app_abi_ver >= 1) {
+ seq_printf(seq,
+ "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n",
+ slave->perm_hwaddr[0],
+ slave->perm_hwaddr[1],
+ slave->perm_hwaddr[2],
+ slave->perm_hwaddr[3],
+ slave->perm_hwaddr[4],
+ slave->perm_hwaddr[5]);
+ }
- len += sprintf(buf + len, "\tAggregator ID: %d\n", ad_info.aggregator_id);
- len += sprintf(buf + len, "\tNumber of ports: %d\n", ad_info.ports);
- len += sprintf(buf + len, "\tActor Key: %d\n", ad_info.actor_key);
- len += sprintf(buf + len, "\tPartner Key: %d\n", ad_info.partner_key);
- len += sprintf(buf + len, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n",
- ad_info.partner_system[0],
- ad_info.partner_system[1],
- ad_info.partner_system[2],
- ad_info.partner_system[3],
- ad_info.partner_system[4],
- ad_info.partner_system[5]);
+ if (bond_mode == BOND_MODE_8023AD) {
+ const struct aggregator *agg
+ = SLAVE_AD_INFO(slave).port.aggregator;
+
+ if (agg) {
+ seq_printf(seq, "Aggregator ID: %d\n",
+ agg->aggregator_identifier);
+ } else {
+ seq_puts(seq, "Aggregator ID: N/A\n");
}
}
+}
- for (slave = bond->prev; slave != (slave_t *)bond;
+static int bond_info_seq_show(struct seq_file *seq, void *v)
+{
+ if (v == SEQ_START_TOKEN) {
+ seq_printf(seq, "%s\n", version);
+ bond_info_show_master(seq, seq->private);
+ } else {
+ bond_info_show_slave(seq, v);
+ }
+
+ return 0;
+}
+
+static struct seq_operations bond_info_seq_ops = {
+ .start = bond_info_seq_start,
+ .next = bond_info_seq_next,
+ .stop = bond_info_seq_stop,
+ .show = bond_info_seq_show,
+};
+
+static int bond_info_open(struct inode *inode, struct file *file)
+{
+ struct seq_file *seq;
+ struct proc_dir_entry *proc;
+ int rc;
+
+ rc = seq_open(file, &bond_info_seq_ops);
+ if (!rc) {
+ /* recover the pointer buried in proc_dir_entry data */
+ seq = file->private_data;
+ proc = PDE(inode);
+ seq->private = proc->data;
+ }
+ return rc;
+}
+
+static struct file_operations bond_info_fops = {
+ .owner = THIS_MODULE,
+ .open = bond_info_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+
+static int bond_create_proc_info(struct bonding *bond)
+{
+ struct net_device *dev = bond->device;
+
+ if (bond_proc_dir) {
+ bond->bond_proc_file = create_proc_entry(dev->name,
+ S_IRUGO,
+ bond_proc_dir);
+ if (bond->bond_proc_file == NULL) {
+ printk(KERN_WARNING
+ "%s: Cannot create /proc/net/bonding/%s\n",
+ dev->name, dev->name);
+ } else {
+ bond->bond_proc_file->data = bond;
+ bond->bond_proc_file->proc_fops = &bond_info_fops;
+ bond->bond_proc_file->owner = THIS_MODULE;
+ memcpy(bond->procdir_name, dev->name, IFNAMSIZ);
+ }
+ }
+
+ return 0;
+}
+
+static void bond_destroy_proc_info(struct bonding *bond)
+{
+ if (bond_proc_dir && bond->bond_proc_file) {
+ remove_proc_entry(bond->procdir_name, bond_proc_dir);
+ memset(bond->procdir_name, 0, IFNAMSIZ);
+ bond->bond_proc_file = NULL;
+ }
+}
+#endif /* CONFIG_PROC_FS */
+
+/*
+ * Change HW address
+ *
+ * Note that many devices must be down to change the HW address, and
+ * downing the master releases all slaves. We can make bonds full of
+ * bonding devices to test this, however.
+ */
+static inline int
+bond_set_mac_address(struct net_device *dev, void *addr)
+{
+ struct bonding *bond = dev->priv;
+ struct sockaddr *sa = addr, tmp_sa;
+ struct slave *slave;
+ int error;
+
+ dprintk(KERN_INFO "bond_set_mac_address %p %s\n", dev,
+ dev->name);
+
+ if (!is_valid_ether_addr(sa->sa_data)) {
+ return -EADDRNOTAVAIL;
+ }
+
+ for (slave = bond->prev; slave != (struct slave *)bond;
slave = slave->prev) {
- len += sprintf(buf + len, "\nSlave Interface: %s\n", slave->dev->name);
+ dprintk(KERN_INFO "bond_set_mac: slave %p %s\n", slave,
+ slave->dev->name);
+ if (slave->dev->set_mac_address == NULL) {
+ error = -EOPNOTSUPP;
+ dprintk(KERN_INFO "bond_set_mac EOPNOTSUPP %s\n",
+ slave->dev->name);
+ goto unwind;
+ }
- len += sprintf(buf + len, "MII Status: ");
+ error = slave->dev->set_mac_address(slave->dev, addr);
+ if (error) {
+ /* TODO: consider downing the slave
+ * and retry ?
+ * User should expect communications
+ * breakage anyway until ARP finish
+ * updating, so...
+ */
+ dprintk(KERN_INFO "bond_set_mac err %d %s\n",
+ error, slave->dev->name);
+ goto unwind;
+ }
+ }
- len += sprintf(buf + len,
- slave->link == BOND_LINK_UP ?
- "up\n" : "down\n");
- len += sprintf(buf + len, "Link Failure Count: %d\n",
- slave->link_failure_count);
+ /* success */
+ memcpy(dev->dev_addr, sa->sa_data, dev->addr_len);
+ return 0;
- if (app_abi_ver >= 1) {
- len += sprintf(buf + len,
- "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n",
- slave->perm_hwaddr[0],
- slave->perm_hwaddr[1],
- slave->perm_hwaddr[2],
- slave->perm_hwaddr[3],
- slave->perm_hwaddr[4],
- slave->perm_hwaddr[5]);
+unwind:
+ memcpy(tmp_sa.sa_data, dev->dev_addr, dev->addr_len);
+ tmp_sa.sa_family = dev->type;
+
+ for (slave = slave->next; slave != bond->next;
+ slave = slave->next) {
+ int tmp_error;
+
+ tmp_error = slave->dev->set_mac_address(slave->dev, &tmp_sa);
+ if (tmp_error) {
+ dprintk(KERN_INFO "bond_set_mac_address: "
+ "unwind err %d dev %s\n",
+ tmp_error, slave->dev->name);
}
+ }
- if (bond_mode == BOND_MODE_8023AD) {
- struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator;
+ return error;
+}
- if (agg) {
- len += sprintf(buf + len, "Aggregator ID: %d\n",
- agg->aggregator_identifier);
- } else {
- len += sprintf(buf + len, "Aggregator ID: N/A\n");
- }
+/*
+ * Change the MTU of all of a master's slaves to match the master
+ */
+static inline int
+bond_change_mtu(struct net_device *dev, int newmtu)
+{
+ bonding_t *bond = dev->priv;
+ slave_t *slave;
+ int error;
+
+ dprintk(KERN_INFO "CM: b %p nm %d\n", bond, newmtu);
+ for (slave = bond->prev; slave != (slave_t *)bond;
+ slave = slave->prev) {
+ dprintk(KERN_INFO "CM: s %p s->p %p c_m %p\n", slave,
+ slave->prev, slave->dev->change_mtu);
+ if (slave->dev->change_mtu) {
+ error = slave->dev->change_mtu(slave->dev, newmtu);
+ } else {
+ slave->dev->mtu = newmtu;
+ error = 0;
+ }
+
+ if (error) {
+ /* If we failed to set the slave's mtu to the new value
+ * we must abort the operation even in ACTIVE_BACKUP
+ * mode, because if we allow the backup slaves to have
+ * different mtu values than the active slave we'll
+ * need to change their mtu when doing a failover. That
+ * means changing their mtu from timer context, which
+ * is probably not a good idea.
+ */
+ dprintk(KERN_INFO "bond_change_mtu err %d %s\n",
+ error, slave->dev->name);
+ goto unwind;
}
}
- read_unlock_bh(&bond->lock);
- /*
- * Figure out the calcs for the /proc/net interface
- */
- if (len <= off + count) {
- *eof = 1;
+ dev->mtu = newmtu;
+ return 0;
+
+
+unwind:
+ for (slave = slave->next; slave != bond->next;
+ slave = slave->next) {
+
+ if (slave->dev->change_mtu) {
+ slave->dev->change_mtu(slave->dev, dev->mtu);
+ } else {
+ slave->dev->mtu = dev->mtu;
+ }
}
- *start = buf + off;
- len -= off;
- if (len > count) {
- len = count;
+
+ return error;
+}
+
+/*
+ * Change device name
+ */
+static inline int bond_event_changename(struct bonding *bond)
+{
+#ifdef CONFIG_PROC_FS
+ bond_destroy_proc_info(bond);
+ bond_create_proc_info(bond);
+#endif
+
+ return NOTIFY_DONE;
+}
+
+static int bond_master_netdev_event(unsigned long event, struct net_device *event_dev)
+{
+ struct bonding *bond, *event_bond = NULL;
+
+ list_for_each_entry(bond, &bond_dev_list, bond_list) {
+ if (bond == event_dev->priv) {
+ event_bond = bond;
+ break;
+ }
}
- if (len < 0) {
- len = 0;
+
+ if (event_bond == NULL) {
+ return NOTIFY_DONE;
}
- read_unlock(&dev_base_lock);
+ switch (event) {
+ case NETDEV_CHANGENAME:
+ return bond_event_changename(event_bond);
+ case NETDEV_UNREGISTER:
+ /*
+ * TODO: remove a bond from the list?
+ */
+ break;
+ default:
+ break;
+ }
- return len;
+ return NOTIFY_DONE;
}
-#endif /* CONFIG_PROC_FS */
-static int bond_event(struct notifier_block *this, unsigned long event,
- void *ptr)
+static int bond_slave_netdev_event(unsigned long event, struct net_device *event_dev)
{
- struct net_device *event_dev = (struct net_device *)ptr;
struct net_device *master = event_dev->master;
- if ((event == NETDEV_UNREGISTER) && (master != NULL)) {
- bond_release(master, event_dev);
+ switch (event) {
+ case NETDEV_UNREGISTER:
+ if (master != NULL) {
+ bond_release(master, event_dev);
+ }
+ break;
+ case NETDEV_CHANGE:
+ /*
+ * TODO: is this what we get if somebody
+ * sets up a hierarchical bond, then rmmod's
+ * one of the slave bonding devices?
+ */
+ break;
+ case NETDEV_DOWN:
+ /*
+ * ... Or is it this?
+ */
+ break;
+ case NETDEV_CHANGEMTU:
+ /*
+ * TODO: Should slaves be allowed to
+ * independently alter their MTU? For
+ * an active-backup bond, slaves need
+ * not be the same type of device, so
+ * MTUs may vary. For other modes,
+ * slaves arguably should have the
+ * same MTUs. To do this, we'd need to
+ * take over the slave's change_mtu
+ * function for the duration of their
+ * servitude.
+ */
+ break;
+ case NETDEV_CHANGENAME:
+ /*
+ * TODO: handle changing the primary's name
+ */
+ break;
+ default:
+ break;
}
return NOTIFY_DONE;
}
+/*
+ * bond_netdev_event: handle netdev notifier chain events.
+ *
+ * This function receives events for the netdev chain. The caller (an
+ * ioctl handler calling notifier_call_chain) holds the necessary
+ * locks for us to safely manipulate the slave devices (RTNL lock,
+ * dev_probe_lock).
+ */
+static int bond_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
+{
+ struct net_device *event_dev = (struct net_device *)ptr;
+ unsigned short flags;
+ int res = NOTIFY_DONE;
+
+ dprintk(KERN_INFO "bond_netdev_event n_b %p ev %lx ptr %p\n",
+ this, event, ptr);
+
+ flags = event_dev->flags & (IFF_MASTER | IFF_SLAVE);
+ switch (flags) {
+ case IFF_MASTER:
+ res = bond_master_netdev_event(event, event_dev);
+ break;
+ case IFF_SLAVE:
+ res = bond_slave_netdev_event(event, event_dev);
+ break;
+ default:
+ /* A master that is also a slave ? */
+ break;
+ }
+
+ return res;
+}
+
static struct notifier_block bond_netdev_notifier = {
- .notifier_call = bond_event,
+ .notifier_call = bond_netdev_event,
};
-static void bond_deinit(struct net_device *dev)
+static inline void bond_deinit(struct net_device *dev)
{
struct bonding *bond = dev->priv;
list_del(&bond->bond_list);
#ifdef CONFIG_PROC_FS
- remove_proc_entry("info", bond->bond_proc_dir);
- remove_proc_entry(dev->name, proc_net);
+ bond_destroy_proc_info(bond);
#endif
}
@@ -3535,10 +3871,21 @@ static void bond_free_all(void)
unregister_netdev(dev);
bond_deinit(dev);
- kfree(dev);
+ free_netdev(dev);
+ }
+
+#ifdef CONFIG_PROC_FS
+ if (bond_proc_dir) {
+ remove_proc_entry(DRV_NAME, proc_net);
+ bond_proc_dir = NULL;
}
+#endif
}
+/*
+ * Does not allocate but creates a /proc entry.
+ * Allowed to fail.
+ */
static int __init bond_init(struct net_device *dev)
{
struct bonding *bond;
@@ -3553,12 +3900,15 @@ static int __init bond_init(struct net_device *dev)
rwlock_init(&bond->lock);
rwlock_init(&bond->ptrlock);
+ /* Initialize pointers */
bond->next = bond->prev = (slave_t *)bond;
bond->current_slave = NULL;
bond->current_arp_slave = NULL;
bond->device = dev;
/* Initialize the device structure. */
+ dev->set_mac_address = bond_set_mac_address;
+
switch (bond_mode) {
case BOND_MODE_ACTIVEBACKUP:
dev->hard_start_xmit = bond_xmit_activebackup;
@@ -3578,6 +3928,7 @@ static int __init bond_init(struct net_device *dev)
case BOND_MODE_TLB:
case BOND_MODE_ALB:
dev->hard_start_xmit = bond_alb_xmit;
+ dev->set_mac_address = bond_alb_set_mac_address;
break;
default:
printk(KERN_ERR "Unknown bonding mode %d\n", bond_mode);
@@ -3589,7 +3940,7 @@ static int __init bond_init(struct net_device *dev)
dev->stop = bond_close;
dev->set_multicast_list = set_multicast_list;
dev->do_ioctl = bond_ioctl;
-
+ dev->change_mtu = bond_change_mtu;
dev->tx_queue_len = 0;
dev->flags |= IFF_MASTER|IFF_MULTICAST;
#ifdef CONFIG_NET_FASTROUTE
@@ -3616,27 +3967,10 @@ static int __init bond_init(struct net_device *dev)
} else {
printk("out ARP monitoring\n");
}
-
+
#ifdef CONFIG_PROC_FS
- bond->bond_proc_dir = proc_mkdir(dev->name, proc_net);
- if (bond->bond_proc_dir == NULL) {
- printk(KERN_ERR "%s: Cannot init /proc/net/%s/\n",
- dev->name, dev->name);
- return -ENOMEM;
- }
- bond->bond_proc_dir->owner = THIS_MODULE;
-
- bond->bond_proc_info_file =
- create_proc_read_entry("info", 0, bond->bond_proc_dir,
- bond_read_proc, bond);
- if (bond->bond_proc_info_file == NULL) {
- printk(KERN_ERR "%s: Cannot init /proc/net/%s/info\n",
- dev->name, dev->name);
- remove_proc_entry(dev->name, proc_net);
- return -ENOMEM;
- }
- bond->bond_proc_info_file->owner = THIS_MODULE;
-#endif /* CONFIG_PROC_FS */
+ bond_create_proc_info(bond);
+#endif
list_add_tail(&bond->bond_list, &bond_dev_list);
@@ -3693,6 +4027,12 @@ static int __init bonding_init(void)
}
}
+ if (USES_PRIMARY(bond_mode)) {
+ multicast_mode = BOND_MULTICAST_ACTIVE;
+ } else {
+ multicast_mode = BOND_MULTICAST_ALL;
+ }
+
if (multicast) {
multicast_mode = bond_parse_parm(multicast, bond_mc_tbl);
if (multicast_mode == -1) {
@@ -3905,9 +4245,7 @@ static int __init bonding_init(void)
"link failures! see bonding.txt for details.\n");
}
- if ((primary != NULL) && (bond_mode != BOND_MODE_ACTIVEBACKUP) &&
- (bond_mode != BOND_MODE_TLB) &&
- (bond_mode != BOND_MODE_ALB)){
+ if ((primary != NULL) && !USES_PRIMARY(bond_mode)) {
/* currently, using a primary only makes sense
* in active backup, TLB or ALB modes
*/
@@ -3918,6 +4256,16 @@ static int __init bonding_init(void)
primary = NULL;
}
+#ifdef CONFIG_PROC_FS
+ bond_proc_dir = proc_mkdir(DRV_NAME, proc_net);
+ if (bond_proc_dir == NULL) {
+ printk(KERN_WARNING
+ "bonding_init(): can not create /proc/net/" DRV_NAME);
+ } else {
+ bond_proc_dir->owner = THIS_MODULE;
+ }
+#endif
+
rtnl_lock();
err = 0;
@@ -3932,7 +4280,7 @@ static int __init bonding_init(void)
err = dev_alloc_name(dev, "bond%d");
if (err < 0) {
- kfree(dev);
+ free_netdev(dev);
goto out_err;
}
@@ -3942,7 +4290,7 @@ static int __init bonding_init(void)
*/
err = bond_init(dev);
if (err < 0) {
- kfree(dev);
+ free_netdev(dev);
goto out_err;
}
@@ -3951,7 +4299,7 @@ static int __init bonding_init(void)
err = register_netdevice(dev);
if (err < 0) {
bond_deinit(dev);
- kfree(dev);
+ free_netdev(dev);
goto out_err;
}
}
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index a8aa800a7421..8358c8085542 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -101,8 +101,8 @@ typedef struct bonding {
struct timer_list arp_timer;
struct net_device_stats stats;
#ifdef CONFIG_PROC_FS
- struct proc_dir_entry *bond_proc_dir;
- struct proc_dir_entry *bond_proc_info_file;
+ struct proc_dir_entry *bond_proc_file;
+ char procdir_name[IFNAMSIZ];
#endif /* CONFIG_PROC_FS */
struct list_head bond_list;
struct net_device *device;
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 343bf90f27e1..af8b183799b0 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -90,7 +90,6 @@
or override something. */
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/version.h>
/*
* Set this to zero to disable DMA code
diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index 623b9b54d796..e9700be21569 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -1,4 +1,4 @@
-/* depca.c: A DIGITAL DEPCA & EtherWORKS ethernet driver for linux.
+/* depca.c: A DIGITAL DEPCA & EtherWORKS ethernet driver for linux.
Written 1994, 1995 by David C. Davies.
@@ -253,7 +253,8 @@
#include <linux/types.h>
#include <linux/unistd.h>
#include <linux/ctype.h>
-#include <linux/mca-legacy.h>
+#include <linux/moduleparam.h>
+#include <linux/device.h>
#include <asm/uaccess.h>
#include <asm/bitops.h>
@@ -265,7 +266,6 @@
#endif
#ifdef CONFIG_EISA
-#include <linux/device.h>
#include <linux/eisa.h>
#endif
@@ -305,21 +305,21 @@ static int depca_debug = 1;
** EISA bus defines
*/
#define DEPCA_EISA_IO_PORTS 0x0c00 /* I/O port base address, slot 0 */
-#define MAX_EISA_SLOTS 16
-#define EISA_SLOT_INC 0x1000
/*
** ISA Bus defines
*/
#define DEPCA_RAM_BASE_ADDRESSES {0xc0000,0xd0000,0xe0000,0x00000}
-#define DEPCA_IO_PORTS {0x300, 0x200, 0}
#define DEPCA_TOTAL_SIZE 0x10
-static short mem_chkd;
-/*
-** Adapter ID for the MCA EtherWORKS DE210/212 adapter
-*/
-#define DE212_ID 0x6def
+static struct {
+ u_long iobase;
+ struct platform_device *device;
+} depca_io_ports[] = {
+ { 0x300, NULL },
+ { 0x200, NULL },
+ { 0 , NULL },
+};
/*
** Name <-> Adapter mapping
@@ -330,34 +330,86 @@ static short mem_chkd;
"DE210","DE212",\
"DE422",\
""}
-static enum {
+
+static char* __initdata depca_signature[] = DEPCA_SIGNATURE;
+
+enum depca_type {
DEPCA, de100, de101, de200, de201, de202, de210, de212, de422, unknown
-} adapter;
+};
+
+static char depca_string[] = "depca";
+
+static int depca_device_remove (struct device *device);
#ifdef CONFIG_EISA
struct eisa_device_id depca_eisa_ids[] = {
- { "DEC4220" },
+ { "DEC4220", de422 },
{ "" }
};
static int depca_eisa_probe (struct device *device);
-static int depca_eisa_remove (struct device *device);
struct eisa_driver depca_eisa_driver = {
.id_table = depca_eisa_ids,
.driver = {
- .name = "depca",
+ .name = depca_string,
.probe = depca_eisa_probe,
- .remove = __devexit_p (depca_eisa_remove)
+ .remove = __devexit_p (depca_device_remove)
}
};
#endif
+#ifdef CONFIG_MCA
+/*
+** Adapter ID for the MCA EtherWORKS DE210/212 adapter
+*/
+#define DE210_ID 0x628d
+#define DE212_ID 0x6def
+
+static short depca_mca_adapter_ids[] = {
+ DE210_ID,
+ DE212_ID,
+ 0x0000
+};
+
+static char *depca_mca_adapter_name[] = {
+ "DEC EtherWORKS MC Adapter (DE210)",
+ "DEC EtherWORKS MC Adapter (DE212)",
+ NULL
+};
+
+static enum depca_type depca_mca_adapter_type[] = {
+ de210,
+ de212,
+ 0
+};
+
+static int depca_mca_probe (struct device *);
+
+static struct mca_driver depca_mca_driver = {
+ .id_table = depca_mca_adapter_ids,
+ .driver = {
+ .name = depca_string,
+ .bus = &mca_bus_type,
+ .probe = depca_mca_probe,
+ .remove = __devexit_p(depca_device_remove),
+ },
+};
+#endif
+
+static int depca_isa_probe (struct device *);
+
+static struct device_driver depca_isa_driver = {
+ .name = depca_string,
+ .bus = &platform_bus_type,
+ .probe = depca_isa_probe,
+ .remove = __devexit_p(depca_device_remove),
+};
+
/*
** Miscellaneous info...
*/
#define DEPCA_STRLEN 16
-#define MAX_NUM_DEPCAS 2
/*
** Memory Alignment. Each descriptor is 4 longwords long. To force a
@@ -402,10 +454,13 @@ struct depca_init {
#define DEPCA_PKT_BIN_SZ 128 /* Should be >=100 unless you
increase DEPCA_PKT_STAT_SZ */
struct depca_private {
- char devname[DEPCA_STRLEN]; /* Device Product String */
char adapter_name[DEPCA_STRLEN]; /* /proc/ioports string */
- char adapter; /* Adapter type */
- char mca_slot; /* MCA slot, if MCA else -1 */
+ enum depca_type adapter; /* Adapter type */
+ enum {
+ DEPCA_BUS_MCA = 1,
+ DEPCA_BUS_ISA,
+ DEPCA_BUS_EISA,
+ } depca_bus; /* type of bus */
struct depca_init init_block; /* Shadow Initialization block */
/* CPU address space fields */
struct depca_rx_desc *rx_ring; /* Pointer to start of RX descriptor ring */
@@ -467,45 +522,39 @@ static void set_multicast_list(struct net_device *dev);
/*
** Private functions
*/
-static int depca_hw_init(struct net_device *dev, u_long ioaddr, int mca_slot);
static void depca_init_ring(struct net_device *dev);
static int depca_rx(struct net_device *dev);
static int depca_tx(struct net_device *dev);
static void LoadCSRs(struct net_device *dev);
static int InitRestartDepca(struct net_device *dev);
-static void DepcaSignature(char *name, u_long paddr);
+static int DepcaSignature(char *name, u_long paddr);
static int DevicePresent(u_long ioaddr);
static int get_hw_addr(struct net_device *dev);
static void SetMulticastFilter(struct net_device *dev);
-static void isa_probe(struct net_device *dev, u_long iobase);
-#ifdef CONFIG_MCA
-static void mca_probe(struct net_device *dev, u_long iobase);
-#endif
-static struct net_device *alloc_device(struct net_device *dev, u_long iobase);
-static int depca_dev_index(char *s);
-static struct net_device *insert_device(struct net_device *dev, u_long iobase, int (*init) (struct net_device *));
static int load_packet(struct net_device *dev, struct sk_buff *skb);
static void depca_dbg_open(struct net_device *dev);
-#ifdef MODULE
-static int autoprobed = 1, loading_module = 1;
-# else
static u_char de1xx_irq[] __initdata = { 2, 3, 4, 5, 7, 9, 0 };
static u_char de2xx_irq[] __initdata = { 5, 9, 10, 11, 15, 0 };
static u_char de422_irq[] __initdata = { 5, 9, 10, 11, 0 };
static u_char *depca_irq;
-static int autoprobed, loading_module;
-#endif /* MODULE */
-static char name[DEPCA_STRLEN];
-static int num_depcas, num_eth;
+static int irq;
+static int io;
+static char *adapter_name;
static int mem; /* For loadable module assignment
use insmod mem=0x????? .... */
-static char *adapter_name; /* = '\0'; If no PROM when loadable module
- use insmod adapter_name=DE??? ...
- bss initializes this to zero
- */
+module_param (irq, int, 0);
+module_param (io, int, 0);
+module_param (adapter_name, charp, 0);
+module_param (mem, int, 0);
+MODULE_PARM_DESC(irq, "DEPCA IRQ number");
+MODULE_PARM_DESC(io, "DEPCA I/O base address");
+MODULE_PARM_DESC(adapter_name, "DEPCA adapter name");
+MODULE_PARM_DESC(mem, "DEPCA shared memory address");
+MODULE_LICENSE("GPL");
+
/*
** Miscellaneous defines...
*/
@@ -513,52 +562,30 @@ static char *adapter_name; /* = '\0'; If no PROM when loadable module
outw(CSR0, DEPCA_ADDR);\
outw(STOP, DEPCA_DATA)
-int __init depca_probe(struct net_device *dev)
-{
- int tmp = num_depcas, status = -ENODEV;
- u_long iobase = dev->base_addr;
-
- SET_MODULE_OWNER(dev);
-
- if ((iobase == 0) && loading_module) {
- printk("Autoprobing is not supported when loading a module based driver.\n");
- status = -EIO;
- } else {
-#ifdef CONFIG_MCA
- mca_probe(dev, iobase);
-#endif
- isa_probe(dev, iobase);
-#ifdef CONFIG_EISA
- eisa_driver_register (&depca_eisa_driver);
-#endif
-
- if ((tmp == num_depcas) && (iobase != 0) && loading_module) {
- printk("%s: depca_probe() cannot find device at 0x%04lx.\n", dev->name, iobase);
- }
-
- /*
- ** Walk the device list to check that at least one device
- ** initialised OK
- */
- for (; (dev->priv == NULL) && (dev->next != NULL); dev = dev->next);
-
- if (dev->priv)
- status = 0;
- if (iobase == 0)
- autoprobed = 1;
- }
-
- return status;
-}
-
-static int __init depca_hw_init(struct net_device *dev, u_long ioaddr, int mca_slot)
+static int __init depca_hw_init (struct net_device *dev, struct device *device)
{
struct depca_private *lp;
int i, j, offset, netRAM, mem_len, status = 0;
s16 nicsr;
- u_long mem_start = 0, mem_base[] = DEPCA_RAM_BASE_ADDRESSES;
- int is_eisa = ((ioaddr & 0x0fff) == DEPCA_EISA_IO_PORTS);
+ u_long ioaddr;
+ u_long mem_start;
+ /*
+ * We are now supposed to enter this function with the
+ * following fields filled with proper values :
+ *
+ * dev->base_addr
+ * lp->mem_start
+ * lp->depca_bus
+ * lp->adapter
+ *
+ * dev->irq can be set if known from device configuration (on
+ * MCA or EISA) or module option. Otherwise, it will be auto
+ * detected.
+ */
+
+ ioaddr = dev->base_addr;
+
STOP_DEPCA;
nicsr = inb(DEPCA_NICSR);
@@ -569,24 +596,34 @@ static int __init depca_hw_init(struct net_device *dev, u_long ioaddr, int mca_s
return -ENXIO;
}
- do {
- strcpy(name, (adapter_name ? adapter_name : ""));
- mem_start = (mem ? mem & 0xf0000 : mem_base[mem_chkd++]);
- DepcaSignature(name, mem_start);
- } while (!mem && mem_base[mem_chkd] && (adapter == unknown));
+ lp = (struct depca_private *) dev->priv;
+ mem_start = lp->mem_start;
- if ((adapter == unknown) || !mem_start) { /* DEPCA device not found */
+ if (!mem_start || lp->adapter < DEPCA || lp->adapter >=unknown)
return -ENXIO;
- }
- dev->base_addr = ioaddr;
+ printk ("%s: %s at 0x%04lx",
+ device->bus_id, depca_signature[lp->adapter], ioaddr);
+
+ switch (lp->depca_bus) {
+#ifdef CONFIG_MCA
+ case DEPCA_BUS_MCA:
+ printk(" (MCA slot %d)", to_mca_device(device)->slot + 1);
+ break;
+#endif
- if (mca_slot != -1) {
- printk("%s: %s at 0x%04lx (MCA slot %d)", dev->name, name, ioaddr, mca_slot);
- } else if (is_eisa) { /* EISA slot address */
- printk("%s: %s at 0x%04lx (EISA slot %d)", dev->name, name, ioaddr, (int) ((ioaddr >> 12) & 0x0f));
- } else { /* ISA port address */
- printk("%s: %s at 0x%04lx", dev->name, name, ioaddr);
+#ifdef CONFIG_EISA
+ case DEPCA_BUS_EISA:
+ printk(" (EISA slot %d)", to_eisa_device(device)->slot);
+ break;
+#endif
+
+ case DEPCA_BUS_ISA:
+ break;
+
+ default:
+ printk("Unknown DEPCA bus %d\n", lp->depca_bus);
+ return -ENXIO;
}
printk(", h/w address ");
@@ -601,18 +638,20 @@ static int __init depca_hw_init(struct net_device *dev, u_long ioaddr, int mca_s
printk("%2.2x", dev->dev_addr[i]);
/* Set up the maximum amount of network RAM(kB) */
- netRAM = ((adapter != DEPCA) ? 64 : 48);
- if ((nicsr & _128KB) && (adapter == de422))
+ netRAM = ((lp->adapter != DEPCA) ? 64 : 48);
+ if ((nicsr & _128KB) && (lp->adapter == de422))
netRAM = 128;
- offset = 0x0000;
/* Shared Memory Base Address */
if (nicsr & BUF) {
- offset = 0x8000; /* 32kbyte RAM offset */
nicsr &= ~BS; /* DEPCA RAM in top 32k */
netRAM -= 32;
+
+ /* Only EISA/ISA needs start address to be re-computed */
+ if (lp->depca_bus != DEPCA_BUS_MCA)
+ mem_start += 0x8000;
}
- mem_start += offset; /* (E)ISA start address */
+
if ((mem_len = (NUM_RX_DESC * (sizeof(struct depca_rx_desc) + RX_BUFF_SZ) + NUM_TX_DESC * (sizeof(struct depca_tx_desc) + TX_BUFF_SZ) + sizeof(struct depca_init)))
> (netRAM << 10)) {
printk(",\n requests %dkB RAM: only %dkB is available!\n", (mem_len >> 10), netRAM);
@@ -622,23 +661,14 @@ static int __init depca_hw_init(struct net_device *dev, u_long ioaddr, int mca_s
printk(",\n has %dkB RAM at 0x%.5lx", netRAM, mem_start);
/* Enable the shadow RAM. */
- if (adapter != DEPCA) {
+ if (lp->adapter != DEPCA) {
nicsr |= SHE;
outb(nicsr, DEPCA_NICSR);
}
- /* Define the device private memory */
- if (!is_eisa) {
- dev->priv = (void *) kmalloc(sizeof(struct depca_private), GFP_KERNEL);
- if (dev->priv == NULL)
- return -ENOMEM;
- }
- lp = (struct depca_private *) dev->priv;
- memset((char *) dev->priv, 0, sizeof(struct depca_private));
- lp->adapter = adapter;
- lp->mca_slot = mca_slot;
lp->lock = SPIN_LOCK_UNLOCKED;
- sprintf(lp->adapter_name, "%s (%s)", name, dev->name);
+ sprintf(lp->adapter_name, "%s (%s)",
+ depca_signature[lp->adapter], device->bus_id);
status = -EBUSY;
/* Initialisation Block */
@@ -702,7 +732,6 @@ static int __init depca_hw_init(struct net_device *dev, u_long ioaddr, int mca_s
/* To auto-IRQ we enable the initialization-done and DMA err,
interrupts. For now we will always get a DMA error. */
if (dev->irq < 2) {
-#ifndef MODULE
unsigned char irqnum;
unsigned long irq_mask, delay;
@@ -725,6 +754,9 @@ static int __init depca_hw_init(struct net_device *dev, u_long ioaddr, int mca_s
case de422:
depca_irq = de422_irq;
break;
+
+ default:
+ break; /* Not reached */
}
/* Trigger an initialization just for the interrupt. */
@@ -733,6 +765,7 @@ static int __init depca_hw_init(struct net_device *dev, u_long ioaddr, int mca_s
delay = jiffies + HZ/50;
while (time_before(jiffies, delay))
yield();
+
irqnum = probe_irq_off(irq_mask);
status = -ENXIO;
@@ -746,13 +779,11 @@ static int __init depca_hw_init(struct net_device *dev, u_long ioaddr, int mca_s
printk(" and uses IRQ%d.\n", dev->irq);
}
- status = -ENXIO;
if (!dev->irq) {
printk(" but incorrect IRQ line detected.\n");
- goto out_priv;
+ return -ENXIO;
}
}
-#endif /* MODULE */
} else {
printk(" and assigned IRQ%d.\n", dev->irq);
}
@@ -773,17 +804,14 @@ static int __init depca_hw_init(struct net_device *dev, u_long ioaddr, int mca_s
dev->mem_start = 0;
- /* Fill in the generic field of the device structure. */
- if (!is_eisa)
- ether_setup(dev);
+ device->driver_data = dev;
+ SET_NETDEV_DEV (dev, device);
+
+ register_netdev (dev);
return 0;
- out_priv:
- if (!is_eisa) {
- kfree(dev->priv);
- dev->priv = NULL;
- } else {
- unregister_netdev (dev);
- }
+
+ out_priv:
+
return status;
}
@@ -1284,215 +1312,265 @@ static void SetMulticastFilter(struct net_device *dev)
return;
}
+static int __init depca_common_init (u_long ioaddr, struct net_device **devp)
+{
+ int status = 0;
+
+ if (!request_region (ioaddr, DEPCA_TOTAL_SIZE, depca_string)) {
+ status = -EBUSY;
+ goto out;
+ }
+
+ if (DevicePresent(ioaddr)) {
+ status = -ENODEV;
+ goto out_release;
+ }
+
+ if (!(*devp = alloc_etherdev (sizeof (struct depca_private)))) {
+ status = -ENOMEM;
+ goto out_release;
+ }
+
+ return 0;
+
+ out_release:
+ release_region (ioaddr, DEPCA_TOTAL_SIZE);
+ out:
+ return status;
+}
+
#ifdef CONFIG_MCA
/*
** Microchannel bus I/O device probe
*/
-static void __init mca_probe(struct net_device *dev, u_long ioaddr)
+static int __init depca_mca_probe(struct device *device)
{
unsigned char pos[2];
unsigned char where;
- unsigned long iobase;
- int irq;
- int slot = 0;
+ unsigned long iobase, mem_start;
+ int irq, err;
+ struct mca_device *mdev = to_mca_device (device);
+ struct net_device *dev;
+ struct depca_private *lp;
/*
- ** See if we've been here before.
- */
- if ((!ioaddr && autoprobed) || (ioaddr && !loading_module))
- return;
-
- if (MCA_bus) {
- /*
- ** Search for the adapter. If an address has been given, search
- ** specifically for the card at that address. Otherwise find the
- ** first card in the system.
- */
- while ((dev != NULL) && ((slot = mca_find_adapter(DE212_ID, slot)) != MCA_NOTFOUND)) {
- pos[0] = mca_read_stored_pos(slot, 2);
- pos[1] = mca_read_stored_pos(slot, 3);
-
- /*
- ** IO of card is handled by bits 1 and 2 of pos0.
- **
- ** bit2 bit1 IO
- ** 0 0 0x2c00
- ** 0 1 0x2c10
- ** 1 0 0x2c20
- ** 1 1 0x2c30
- */
- where = (pos[0] & 6) >> 1;
- iobase = 0x2c00 + (0x10 * where);
-
- if ((ioaddr) && (ioaddr != iobase)) {
- /*
- ** Card was found, but not at the right IO location. Continue
- ** scanning from the next MCA slot up for another card.
- */
- slot++;
- continue;
- }
-
- /*
- ** Found the adapter we were looking for. Now start setting it up.
- **
- ** First work on decoding the IRQ. It's stored in the lower 4 bits
- ** of pos1. Bits are as follows (from the ADF file):
- **
- ** Bits
- ** 3 2 1 0 IRQ
- ** --------------------
- ** 0 0 1 0 5
- ** 0 0 0 1 9
- ** 0 1 0 0 10
- ** 1 0 0 0 11
- * */
- where = pos[1] & 0x0f;
- switch (where) {
- case 1:
- irq = 9;
- break;
- case 2:
- irq = 5;
- break;
- case 4:
- irq = 10;
- break;
- case 8:
- irq = 11;
- break;
- default:
- printk("%s: mca_probe IRQ error. You should never get here (%d).\n", dev->name, where);
- return;
- }
+ ** Search for the adapter. If an address has been given, search
+ ** specifically for the card at that address. Otherwise find the
+ ** first card in the system.
+ */
+
+ pos[0] = mca_device_read_stored_pos(mdev, 2);
+ pos[1] = mca_device_read_stored_pos(mdev, 3);
- /*
- ** Shared memory address of adapter is stored in bits 3-5 of pos0.
- ** They are mapped as follows:
- **
- ** Bit
- ** 5 4 3 Memory Addresses
- ** 0 0 0 C0000-CFFFF (64K)
- ** 1 0 0 C8000-CFFFF (32K)
- ** 0 0 1 D0000-DFFFF (64K)
- ** 1 0 1 D8000-DFFFF (32K)
- ** 0 1 0 E0000-EFFFF (64K)
- ** 1 1 0 E8000-EFFFF (32K)
- */
- where = (pos[0] & 0x18) >> 3;
- mem = 0xc0000 + (where * 0x10000);
- if (pos[0] & 0x20) {
- mem += 0x8000;
- }
+ /*
+ ** IO of card is handled by bits 1 and 2 of pos0.
+ **
+ ** bit2 bit1 IO
+ ** 0 0 0x2c00
+ ** 0 1 0x2c10
+ ** 1 0 0x2c20
+ ** 1 1 0x2c30
+ */
+ where = (pos[0] & 6) >> 1;
+ iobase = 0x2c00 + (0x10 * where);
- /*
- ** Get everything allocated and initialized... (almost just
- ** like the ISA and EISA probes)
- */
- if (!request_region (iobase, DEPCA_TOTAL_SIZE, "depca")) {
- if (autoprobed)
- printk(KERN_WARNING "%s: region already allocated at 0x%04lx.\n", dev->name, iobase);
- goto next;
- }
- if (DevicePresent(iobase) != 0) {
- /*
- ** If the MCA configuration says the card should be here,
- ** it really should be here.
- */
- printk(KERN_ERR "%s: MCA reports card at 0x%lx but it is not responding.\n", dev->name, iobase);
- goto release_next;
- }
+ /*
+ ** Found the adapter we were looking for. Now start setting it up.
+ **
+ ** First work on decoding the IRQ. It's stored in the lower 4 bits
+ ** of pos1. Bits are as follows (from the ADF file):
+ **
+ ** Bits
+ ** 3 2 1 0 IRQ
+ ** --------------------
+ ** 0 0 1 0 5
+ ** 0 0 0 1 9
+ ** 0 1 0 0 10
+ ** 1 0 0 0 11
+ */
+ where = pos[1] & 0x0f;
+ switch (where) {
+ case 1:
+ irq = 9;
+ break;
+ case 2:
+ irq = 5;
+ break;
+ case 4:
+ irq = 10;
+ break;
+ case 8:
+ irq = 11;
+ break;
+ default:
+ printk("%s: mca_probe IRQ error. You should never get here (%d).\n", dev->name, where);
+ return -EINVAL;
+ }
- if (!(dev = alloc_device(dev, iobase)))
- goto release_next;
+ /*
+ ** Shared memory address of adapter is stored in bits 3-5 of pos0.
+ ** They are mapped as follows:
+ **
+ ** Bit
+ ** 5 4 3 Memory Addresses
+ ** 0 0 0 C0000-CFFFF (64K)
+ ** 1 0 0 C8000-CFFFF (32K)
+ ** 0 0 1 D0000-DFFFF (64K)
+ ** 1 0 1 D8000-DFFFF (32K)
+ ** 0 1 0 E0000-EFFFF (64K)
+ ** 1 1 0 E8000-EFFFF (32K)
+ */
+ where = (pos[0] & 0x18) >> 3;
+ mem_start = 0xc0000 + (where * 0x10000);
+ if (pos[0] & 0x20) {
+ mem_start += 0x8000;
+ }
- num_eth++;
- dev->irq = irq;
- if (depca_hw_init(dev, iobase, slot))
- goto release_next;
+ /* claim the slot */
+ strncpy(mdev->name, depca_mca_adapter_name[mdev->index],
+ sizeof(mdev->name));
+ mca_device_set_claim(mdev, 1);
+
+ /*
+ ** Get everything allocated and initialized... (almost just
+ ** like the ISA and EISA probes)
+ */
+ irq = mca_device_transform_irq(mdev, irq);
+ iobase = mca_device_transform_ioport(mdev, iobase);
+
+ if ((err = depca_common_init (iobase, &dev)))
+ goto out_unclaim;
+
+ dev->irq = irq;
+ dev->base_addr = iobase;
+ lp = dev->priv;
+ lp->depca_bus = DEPCA_BUS_MCA;
+ lp->adapter = depca_mca_adapter_type[mdev->index];
+ lp->mem_start = mem_start;
+
+ if ((err = depca_hw_init(dev, device)))
+ goto out_free;
- /*
- ** Adapter initialized correctly: Name it in
- ** /proc/mca.
- */
- mca_set_adapter_name(slot, "DE210/212 Ethernet Adapter");
- mca_mark_as_used(slot);
- num_depcas++;
-
- /*
- ** If this is a probe by a module, return after setting up the
- ** given card.
- */
- if (ioaddr)
- return;
-
- /*
- ** Set up to check the next slot and loop.
- */
- slot++;
- continue;
+ return 0;
- release_next:
- release_region (iobase, DEPCA_TOTAL_SIZE);
- next:
- slot++;
- }
- }
+ out_free:
+ free_netdev (dev);
+ release_region (iobase, DEPCA_TOTAL_SIZE);
+ out_unclaim:
+ mca_device_set_claim(mdev, 0);
- return;
+ return err;;
}
#endif
/*
** ISA bus I/O device probe
*/
-static void __init isa_probe(struct net_device *dev, u_long ioaddr)
+
+static void depca_platform_release (struct device *device)
{
- int i = num_depcas, maxSlots;
- s32 ports[] = DEPCA_IO_PORTS;
-
- if (!ioaddr && autoprobed)
- return; /* Been here before ! */
- if (ioaddr > 0x400)
- return; /* EISA Address */
- if (i >= MAX_NUM_DEPCAS)
- return; /* Too many ISA adapters */
-
- if (ioaddr == 0) { /* Autoprobing */
- maxSlots = MAX_NUM_DEPCAS;
- } else { /* Probe a specific location */
- ports[i] = ioaddr;
- maxSlots = i + 1;
- }
+ struct platform_device *pldev;
+
+ /* free device */
+ pldev = to_platform_device (device);
+ kfree (pldev);
+}
+
+static void __init depca_platform_probe (void)
+{
+ int i;
+ struct platform_device *pldev;
- for (; (i < maxSlots) && (dev != NULL) && ports[i]; i++) {
- if (!request_region (ports[i], DEPCA_TOTAL_SIZE, "depca")) {
- if (autoprobed)
- printk("%s: region already allocated at 0x%04x.\n", dev->name, ports[i]);
+ for (i = 0; depca_io_ports[i].iobase; i++) {
+ depca_io_ports[i].device = NULL;
+
+ /* if an address has been specified on the command
+ * line, use it (if valid) */
+ if (io && io != depca_io_ports[i].iobase)
continue;
- }
+
+ if (!(pldev = kmalloc (sizeof (*pldev), GFP_KERNEL)))
+ continue;
+
+ memset (pldev, 0, sizeof (*pldev));
+ pldev->name = depca_string;
+ pldev->id = i;
+ pldev->dev.platform_data = (void *) depca_io_ports[i].iobase;
+ pldev->dev.release = depca_platform_release;
+ depca_io_ports[i].device = pldev;
- if (DevicePresent(ports[i])) {
- release_region (ports[i], DEPCA_TOTAL_SIZE);
+ if (platform_device_register (pldev)) {
+ kfree (pldev);
+ depca_io_ports[i].device = NULL;
continue;
}
- if (!(dev = alloc_device(dev, ports[i]))) {
- release_region (ports[i], DEPCA_TOTAL_SIZE);
- continue;
+ if (!pldev->dev.driver) {
+ /* The driver was not bound to this device, there was
+ * no hardware at this address. Unregister it, as the
+ * release fuction will take care of freeing the
+ * allocated structure */
+
+ depca_io_ports[i].device = NULL;
+ platform_device_unregister (pldev);
}
+ }
+}
- num_eth++;
+static enum depca_type __init depca_shmem_probe (ulong *mem_start)
+{
+ u_long mem_base[] = DEPCA_RAM_BASE_ADDRESSES;
+ enum depca_type adapter = unknown;
+ int i;
- if (depca_hw_init(dev, ports[i], -1)) {
- release_region (ports[i], DEPCA_TOTAL_SIZE);
- continue;
- }
+ for (i = 0; mem_base[i]; i++) {
+ *mem_start = mem ? mem : mem_base[i];
+ adapter = DepcaSignature (adapter_name, *mem_start);
+ if (adapter != unknown)
+ break;
+ }
+
+ return adapter;
+}
- num_depcas++;
+static int __init depca_isa_probe (struct device *device)
+{
+ struct net_device *dev;
+ struct depca_private *lp;
+ u_long ioaddr, mem_start = 0;
+ enum depca_type adapter = unknown;
+ int status = 0;
+
+ ioaddr = (u_long) device->platform_data;
+
+ if ((status = depca_common_init (ioaddr, &dev)))
+ goto out;
+
+ adapter = depca_shmem_probe (&mem_start);
+
+ if (adapter == unknown) {
+ status = -ENODEV;
+ goto out_free;
}
- return;
+ dev->base_addr = ioaddr;
+ dev->irq = irq; /* Use whatever value the user gave
+ * us, and 0 if he didn't. */
+ lp = dev->priv;
+ lp->depca_bus = DEPCA_BUS_ISA;
+ lp->adapter = adapter;
+ lp->mem_start = mem_start;
+
+ if ((status = depca_hw_init(dev, device)))
+ goto out_free;
+
+ return 0;
+
+ out_free:
+ free_netdev (dev);
+ release_region (ioaddr, DEPCA_TOTAL_SIZE);
+ out:
+ return status;
}
/*
@@ -1504,202 +1582,120 @@ static int __init depca_eisa_probe (struct device *device)
{
struct eisa_device *edev;
struct net_device *dev;
- u_long iobase;
+ struct depca_private *lp;
+ u_long ioaddr, mem_start;
int status = 0;
edev = to_eisa_device (device);
- iobase = edev->base_addr + DEPCA_EISA_IO_PORTS;
+ ioaddr = edev->base_addr + DEPCA_EISA_IO_PORTS;
- if (!request_region (iobase, DEPCA_TOTAL_SIZE, "depca")) {
- status = -EBUSY;
+ if ((status = depca_common_init (ioaddr, &dev)))
goto out;
- }
-
- if (DevicePresent(iobase)) {
- status = -ENODEV;
- goto out_release;
- }
- if (!(dev = init_etherdev (NULL, sizeof (struct depca_private)))) {
- status = -ENOMEM;
- goto out_release;
- }
-
- eisa_set_drvdata (edev, dev);
+ /* It would have been nice to get card configuration from the
+ * card. Unfortunately, this register is write-only (shares
+ * it's address with the ethernet prom)... As we don't parse
+ * the EISA configuration structures (yet... :-), just rely on
+ * the ISA probing to sort it out... */
+
+ depca_shmem_probe (&mem_start);
- if ((status = depca_hw_init(dev, iobase, -1)))
+ dev->base_addr = ioaddr;
+ dev->irq = irq;
+ lp = dev->priv;
+ lp->depca_bus = DEPCA_BUS_EISA;
+ lp->adapter = edev->id.driver_data;
+ lp->mem_start = mem_start;
+
+ if ((status = depca_hw_init(dev, device)))
goto out_free;
-
- num_depcas++;
+
return 0;
out_free:
- kfree (dev);
- out_release:
- release_region (iobase, DEPCA_TOTAL_SIZE);
+ free_netdev (dev);
+ release_region (ioaddr, DEPCA_TOTAL_SIZE);
out:
return status;
}
+#endif
-static int __devexit depca_eisa_remove (struct device *device)
+static int __devexit depca_device_remove (struct device *device)
{
struct net_device *dev;
- struct eisa_device *edev;
struct depca_private *lp;
+ int bus;
- edev = to_eisa_device (device);
- dev = eisa_get_drvdata (edev);
+ dev = device->driver_data;
lp = dev->priv;
unregister_netdev (dev);
iounmap (lp->sh_mem);
release_mem_region (lp->mem_start, lp->mem_len);
release_region (dev->base_addr, DEPCA_TOTAL_SIZE);
- kfree (dev);
+ bus = lp->depca_bus;
+ free_netdev (dev);
return 0;
}
-#endif
-
-/*
-** Search the entire 'eth' device list for a fixed probe. If a match isn't
-** found then check for an autoprobe or unused device location. If they
-** are not available then insert a new device structure at the end of
-** the current list.
-*/
-static struct net_device *__init alloc_device(struct net_device *dev, u_long iobase)
-{
- struct net_device *adev = NULL;
- int fixed = 0, new_dev = 0;
-
- num_eth = depca_dev_index(dev->name);
- if (loading_module)
- return dev;
-
- while (1) {
- if (((dev->base_addr == DEPCA_NDA) || (dev->base_addr == 0)) && !adev) {
- adev = dev;
- } else if ((dev->priv == NULL) && (dev->base_addr == iobase)) {
- fixed = 1;
- } else {
- if (dev->next == NULL) {
- new_dev = 1;
- } else if (strncmp(dev->next->name, "eth", 3) != 0) {
- new_dev = 1;
- }
- }
- if ((dev->next == NULL) || new_dev || fixed)
- break;
- dev = dev->next;
- num_eth++;
- }
- if (adev && !fixed) {
- dev = adev;
- num_eth = depca_dev_index(dev->name);
- new_dev = 0;
- }
-
- if (((dev->next == NULL) && ((dev->base_addr != DEPCA_NDA) && (dev->base_addr != 0)) && !fixed) || new_dev) {
- num_eth++; /* New device */
- dev = insert_device(dev, iobase, depca_probe);
- }
-
- return dev;
-}
-
-/*
-** If at end of eth device list and can't use current entry, malloc
-** one up. If memory could not be allocated, print an error message.
-*/
-static struct net_device *__init insert_device(struct net_device *dev, u_long iobase, int (*init) (struct net_device *))
-{
- struct net_device *new;
-
- new = (struct net_device *) kmalloc(sizeof(struct net_device), GFP_KERNEL);
- if (new == NULL) {
- printk("eth%d: Device not initialised, insufficient memory\n", num_eth);
- return NULL;
- } else {
- new->next = dev->next;
- dev->next = new;
- dev = dev->next; /* point to the new device */
- if (num_eth > 9999) {
- sprintf(dev->name, "eth????"); /* New device name */
- } else {
- sprintf(dev->name, "eth%d", num_eth); /* New device name */
- }
- dev->base_addr = iobase; /* assign the io address */
- dev->init = init; /* initialisation routine */
- }
-
- return dev;
-}
-
-static int __init depca_dev_index(char *s)
-{
- int i = 0, j = 0;
-
- for (; *s; s++) {
- if (isdigit(*s)) {
- j = 1;
- i = (i * 10) + (*s - '0');
- } else if (j)
- break;
- }
-
- return i;
-}
/*
** Look for a particular board name in the on-board Remote Diagnostics
** and Boot (readb) ROM. This will also give us a clue to the network RAM
** base address.
*/
-static void __init DepcaSignature(char *name, u_long paddr)
+static int __init DepcaSignature(char *name, u_long base_addr)
{
u_int i, j, k;
- const char *signatures[] = DEPCA_SIGNATURE;
void *ptr;
char tmpstr[16];
+ u_long prom_addr = base_addr + 0xc000;
+ u_long mem_addr = base_addr + 0x8000; /* 32KB */
+
+ /* Can't reserve the prom region, it is already marked as
+ * used, at least on x86. Instead, reserve a memory region a
+ * board would certainly use. If it works, go ahead. If not,
+ * run like hell... */
+
+ if (!request_mem_region (mem_addr, 16, depca_string))
+ return unknown;
/* Copy the first 16 bytes of ROM */
- ptr = ioremap(paddr + 0xc000, 16);
+
+ ptr = ioremap(prom_addr, 16);
if (ptr == NULL) {
- printk(KERN_ERR "depca: I/O remap failed at %lx\n", paddr + 0xc000);
- adapter = unknown;
- return;
+ printk(KERN_ERR "depca: I/O remap failed at %lx\n", prom_addr);
+ return unknown;
}
for (i = 0; i < 16; i++) {
tmpstr[i] = readb(ptr + i);
}
iounmap(ptr);
+ release_mem_region (mem_addr, 16);
+
/* Check if PROM contains a valid string */
- for (i = 0; *signatures[i] != '\0'; i++) {
- for (j = 0, k = 0; j < 16 && k < strlen(signatures[i]); j++) {
- if (signatures[i][k] == tmpstr[j]) { /* track signature */
+ for (i = 0; *depca_signature[i] != '\0'; i++) {
+ for (j = 0, k = 0; j < 16 && k < strlen(depca_signature[i]); j++) {
+ if (depca_signature[i][k] == tmpstr[j]) { /* track signature */
k++;
} else { /* lost signature; begin search again */
k = 0;
}
}
- if (k == strlen(signatures[i]))
+ if (k == strlen(depca_signature[i]))
break;
}
/* Check if name string is valid, provided there's no PROM */
- if (*name && (i == unknown)) {
- for (i = 0; *signatures[i] != '\0'; i++) {
- if (strcmp(name, signatures[i]) == 0)
+ if (name && *name && (i == unknown)) {
+ for (i = 0; *depca_signature[i] != '\0'; i++) {
+ if (strcmp(name, depca_signature[i]) == 0)
break;
}
}
- /* Update search results */
- strcpy(name, signatures[i]);
- adapter = i;
-
- return;
+ return i;
}
/*
@@ -1773,10 +1769,11 @@ static int __init DevicePresent(u_long ioaddr)
static int __init get_hw_addr(struct net_device *dev)
{
u_long ioaddr = dev->base_addr;
+ struct depca_private *lp = dev->priv;
int i, k, tmp, status = 0;
u_short j, x, chksum;
- x = (((adapter == de100) || (adapter == de101)) ? 1 : 0);
+ x = (((lp->adapter == de100) || (lp->adapter == de101)) ? 1 : 0);
for (i = 0, k = 0, j = 0; j < 3; j++) {
k <<= 1;
@@ -2083,55 +2080,40 @@ static int depca_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
return status;
}
-#ifdef MODULE
-static struct net_device thisDepca;
-static int irq = 7; /* EDIT THESE LINE FOR YOUR CONFIGURATION */
-static int io = 0x200; /* Or use the irq= io= options to insmod */
-MODULE_PARM(irq, "i");
-MODULE_PARM(io, "i");
-MODULE_PARM_DESC(irq, "DEPCA IRQ number");
-MODULE_PARM_DESC(io, "DEPCA I/O base address");
-
-/* See depca_probe() for autoprobe messages when a module */
-int init_module(void)
+static int __init depca_module_init (void)
{
- thisDepca.irq = irq;
- thisDepca.base_addr = io;
- thisDepca.init = depca_probe;
+ int err = 0;
- if (register_netdev(&thisDepca) != 0)
- return -EIO;
-
- return 0;
+#if CONFIG_MCA
+ err = mca_register_driver (&depca_mca_driver);
+#endif
+#ifdef CONFIG_EISA
+ err |= eisa_driver_register (&depca_eisa_driver);
+#endif
+ err |= driver_register (&depca_isa_driver);
+ depca_platform_probe ();
+
+ return err;
}
-void cleanup_module(void)
+static void __exit depca_module_exit (void)
{
- struct depca_private *lp = thisDepca.priv;
-
- unregister_netdev(&thisDepca);
- if (lp) {
- iounmap(lp->sh_mem);
- release_mem_region (lp->mem_start, lp->mem_len);
-#ifdef CONFIG_MCA
- if (lp->mca_slot != -1)
- mca_mark_as_unused(lp->mca_slot);
+ int i;
+#if CONFIG_MCA
+ mca_unregister_driver (&depca_mca_driver);
#endif
- kfree(lp);
- thisDepca.priv = NULL;
- }
- thisDepca.irq = 0;
+#ifdef CONFIG_EISA
+ eisa_driver_unregister (&depca_eisa_driver);
+#endif
+ driver_unregister (&depca_isa_driver);
- release_region(thisDepca.base_addr, DEPCA_TOTAL_SIZE);
+ for (i = 0; depca_io_ports[i].iobase; i++) {
+ if (depca_io_ports[i].device) {
+ platform_device_unregister (depca_io_ports[i].device);
+ depca_io_ports[i].device = NULL;
+ }
+ }
}
-#endif /* MODULE */
-MODULE_LICENSE("GPL");
-
-/*
- * Local variables:
- * compile-command: "gcc -D__KERNEL__ -I/linux/include -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -malign-loops=2 -malign-jumps=2 -malign-functions=2 -O2 -m486 -c depca.c"
- *
- * compile-command: "gcc -D__KERNEL__ -DMODULE -I/linux/include -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -malign-loops=2 -malign-jumps=2 -malign-functions=2 -O2 -m486 -c depca.c"
- * End:
- */
+module_init (depca_module_init);
+module_exit (depca_module_exit);
diff --git a/drivers/net/dgrs.c b/drivers/net/dgrs.c
index 21fd87cd4999..84652b61a8a4 100644
--- a/drivers/net/dgrs.c
+++ b/drivers/net/dgrs.c
@@ -84,6 +84,7 @@
*/
#include <linux/module.h>
+#include <linux/eisa.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/delay.h>
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 4bf0772ee632..168d89fa8cb4 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1536,19 +1536,24 @@ e1000_tx_map(struct e1000_adapter *adapter, struct sk_buff *skb,
struct e1000_buffer *buffer_info;
unsigned int len = skb->len, max_per_txd = E1000_MAX_DATA_PER_TXD;
unsigned int offset = 0, size, count = 0, i;
+#ifdef NETIF_F_TSO
+ unsigned int mss;
+#endif
+ unsigned int nr_frags;
+ unsigned int f;
#ifdef NETIF_F_TSO
- unsigned int mss = skb_shinfo(skb)->tso_size;
+ mss = skb_shinfo(skb)->tso_size;
/* The controller does a simple calculation to
* make sure there is enough room in the FIFO before
* initiating the DMA for each buffer. The calc is:
* 4 = ceil(buffer len/mss). To make sure we don't
* overrun the FIFO, adjust the max buffer len if mss
* drops. */
- if(mss) max_per_txd = min(mss << 2, max_per_txd);
+ if (mss)
+ max_per_txd = min(mss << 2, max_per_txd);
#endif
- unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
- unsigned int f;
+ nr_frags = skb_shinfo(skb)->nr_frags;
len -= skb->data_len;
i = tx_ring->next_to_use;
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c
index 93a29e4a94a6..a9a45c144b81 100644
--- a/drivers/net/eepro.c
+++ b/drivers/net/eepro.c
@@ -897,14 +897,12 @@ static int eepro_grab_irq(struct net_device *dev)
eepro_sw2bank0(ioaddr); /* Switch back to Bank 0 */
if (request_irq (*irqp, NULL, SA_SHIRQ, "bogus", dev) != EBUSY) {
- unsigned long irq_mask, delay;
+ unsigned long irq_mask;
/* Twinkle the interrupt, and check if it's seen */
irq_mask = probe_irq_on();
eepro_diag(ioaddr); /* RESET the 82595 */
-
- delay = jiffies + HZ/50;
- while (time_before(jiffies, delay)) ;
+ mdelay(20);
if (*irqp == probe_irq_off(irq_mask)) /* It's a good IRQ line */
break;
diff --git a/drivers/net/es3210.c b/drivers/net/es3210.c
index 96952230b132..a46ee65e173a 100644
--- a/drivers/net/es3210.c
+++ b/drivers/net/es3210.c
@@ -49,6 +49,7 @@ static const char version[] =
"es3210.c: Driver revision v0.03, 14/09/96\n";
#include <linux/module.h>
+#include <linux/eisa.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c
index bc2402359aee..af7e100facc1 100644
--- a/drivers/net/ewrk3.c
+++ b/drivers/net/ewrk3.c
@@ -564,7 +564,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
if (dev->irq < 2) {
#ifndef MODULE
u_char irqnum;
- unsigned long irq_mask, delay;
+ unsigned long irq_mask;
irq_mask = probe_irq_on();
@@ -578,8 +578,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
irqnum = irq[((icr & IRQ_SEL) >> 4)];
- delay = jiffies + HZ/50;
- while (time_before(jiffies, delay)) ;
+ mdelay(20);
dev->irq = probe_irq_off(irq_mask);
if ((dev->irq) && (irqnum == dev->irq)) {
printk(" and uses IRQ%d.\n", dev->irq);
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c
index f36ba3e63c7c..14e472b5dfae 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -68,7 +68,6 @@
/*****************************************************************************/
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c
index dc69693d7f21..17dc08f263c3 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -71,7 +71,6 @@
/*****************************************************************************/
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/ioport.h>
#include <linux/string.h>
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index 50b5a38afb9d..daf34e2361ce 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -61,7 +61,6 @@
/*****************************************************************************/
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/ioport.h>
#include <linux/string.h>
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
index 980dbbe807f5..c05577280b56 100644
--- a/drivers/net/hamradio/hdlcdrv.c
+++ b/drivers/net/hamradio/hdlcdrv.c
@@ -43,7 +43,6 @@
/*****************************************************************************/
#include <linux/config.h>
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/net.h>
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c
index bc0cca8c8463..cee45d0cebbf 100644
--- a/drivers/net/hamradio/scc.c
+++ b/drivers/net/hamradio/scc.c
@@ -171,6 +171,7 @@
#include <linux/ctype.h>
#include <linux/kernel.h>
#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
#include <net/ax25.h>
@@ -202,8 +203,8 @@ static void scc_key_trx (struct scc_channel *scc, char tx);
static irqreturn_t scc_isr(int irq, void *dev_id, struct pt_regs *regs);
static void scc_init_timer(struct scc_channel *scc);
-static int scc_net_setup(struct scc_channel *scc, unsigned char *name, int addev);
-static int scc_net_init(struct net_device *dev);
+static int scc_net_alloc(const char *name, struct scc_channel *scc);
+static void scc_net_setup(struct net_device *dev);
static int scc_net_open(struct net_device *dev);
static int scc_net_close(struct net_device *dev);
static void scc_net_rx(struct scc_channel *scc, struct sk_buff *skb);
@@ -235,7 +236,7 @@ static io_port Vector_Latch;
/* These provide interrupt save 2-step access to the Z8530 registers */
-static spinlock_t iolock; /* Guards paired accesses */
+static spinlock_t iolock = SPIN_LOCK_UNLOCKED; /* Guards paired accesses */
static inline unsigned char InReg(io_port port, unsigned char reg)
{
@@ -1512,34 +1513,28 @@ static void z8530_init(void)
* Allocate device structure, err, instance, and register driver
*/
-static int scc_net_setup(struct scc_channel *scc, unsigned char *name, int addev)
+static int scc_net_alloc(const char *name, struct scc_channel *scc)
{
+ int err;
struct net_device *dev;
- if (dev_get(name))
- {
- printk(KERN_INFO "Z8530drv: device %s already exists.\n", name);
- return -EEXIST;
- }
-
- if ((scc->dev = (struct net_device *) kmalloc(sizeof(struct net_device), GFP_KERNEL)) == NULL)
+ dev = alloc_netdev(0, name, scc_net_setup);
+ if (!dev)
return -ENOMEM;
- dev = scc->dev;
- memset(dev, 0, sizeof(struct net_device));
-
- strcpy(dev->name, name);
- dev->priv = (void *) scc;
- dev->init = scc_net_init;
-
+ dev->priv = scc;
+ scc->dev = dev;
spin_lock_init(&scc->lock);
-
- if ((addev? register_netdevice(dev) : register_netdev(dev)) != 0) {
- kfree(dev);
- return -EIO;
- }
- SET_MODULE_OWNER(dev);
+ err = register_netdev(dev);
+ if (err) {
+ printk(KERN_ERR "%s: can't register network device (%d)\n",
+ name, err);
+ free_netdev(dev);
+ scc->dev = NULL;
+ return err;
+ }
+
return 0;
}
@@ -1556,8 +1551,9 @@ static unsigned char ax25_nocall[AX25_ADDR_LEN] =
/* ----> Initialize device <----- */
-static int scc_net_init(struct net_device *dev)
+static void scc_net_setup(struct net_device *dev)
{
+ SET_MODULE_OWNER(dev);
dev->tx_queue_len = 16; /* should be enough... */
dev->open = scc_net_open;
@@ -1581,7 +1577,6 @@ static int scc_net_init(struct net_device *dev)
dev->mtu = AX25_DEF_PACLEN;
dev->addr_len = AX25_ADDR_LEN;
- return 0;
}
/* ----> open network device <---- */
@@ -1719,10 +1714,10 @@ static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
struct scc_mem_config memcfg;
struct scc_hw_config hwcfg;
struct scc_calibrate cal;
+ struct scc_channel *scc;
int chan;
- unsigned char device_name[10];
+ unsigned char device_name[IFNAMSIZ];
void *arg;
- struct scc_channel *scc;
scc = (struct scc_channel *) dev->priv;
arg = (void *) ifr->ifr_data;
@@ -1828,8 +1823,10 @@ static int scc_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
request_region(SCC_Info[2*Nchips+chan].ctrl, 1, "scc ctrl");
request_region(SCC_Info[2*Nchips+chan].data, 1, "scc data");
- if (Nchips+chan != 0)
- scc_net_setup(&SCC_Info[2*Nchips+chan], device_name, 1);
+ if (Nchips+chan != 0 &&
+ scc_net_alloc(device_name,
+ &SCC_Info[2*Nchips+chan]))
+ return -EINVAL;
}
}
@@ -1978,39 +1975,58 @@ static struct net_device_stats *scc_net_get_stats(struct net_device *dev)
/* * dump statistics to /proc/net/z8530drv * */
/* ******************************************************************** */
+#ifdef CONFIG_PROC_FS
-static int scc_net_get_info(char *buffer, char **start, off_t offset, int length)
+static inline struct scc_channel *scc_net_seq_idx(loff_t pos)
{
- struct scc_channel *scc;
- struct scc_kiss *kiss;
- struct scc_stat *stat;
- int len = 0;
- off_t pos = 0;
- off_t begin = 0;
int k;
- len += sprintf(buffer, "z8530drv-"VERSION"\n");
-
- if (!Driver_Initialized)
- {
- len += sprintf(buffer+len, "not initialized\n");
- goto done;
+ for (k = 0; k < Nchips*2; ++k) {
+ if (!SCC_Info[k].init)
+ continue;
+ if (pos-- == 0)
+ return &SCC_Info[k];
}
+ return NULL;
+}
- if (!Nchips)
- {
- len += sprintf(buffer+len, "chips missing\n");
- goto done;
+static void *scc_net_seq_start(struct seq_file *seq, loff_t *pos)
+{
+ return *pos ? scc_net_seq_idx(*pos - 1) : SEQ_START_TOKEN;
+
+}
+
+static void *scc_net_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ unsigned k;
+ struct scc_channel *scc = v;
+ ++*pos;
+
+ for (k = (v == SEQ_START_TOKEN) ? 0 : (scc - SCC_Info)+1;
+ k < Nchips*2; ++k) {
+ if (SCC_Info[k].init)
+ return &SCC_Info[k];
}
+ return NULL;
+}
- for (k = 0; k < Nchips*2; k++)
- {
- scc = &SCC_Info[k];
- stat = &scc->stat;
- kiss = &scc->kiss;
+static void scc_net_seq_stop(struct seq_file *seq, void *v)
+{
+}
+
+static int scc_net_seq_show(struct seq_file *seq, void *v)
+{
+ if (v == SEQ_START_TOKEN) {
+ seq_puts(seq, "z8530drv-"VERSION"\n");
+ } else if (!Driver_Initialized) {
+ seq_puts(seq, "not initialized\n");
+ } else if (!Nchips) {
+ seq_puts(seq, "chips missing\n");
+ } else {
+ const struct scc_channel *scc = v;
+ const struct scc_stat *stat = &scc->stat;
+ const struct scc_kiss *kiss = &scc->kiss;
- if (!scc->init)
- continue;
/* dev data ctrl irq clock brand enh vector special option
* baud nrz clocksrc softdcd bufsize
@@ -2021,24 +2037,24 @@ static int scc_net_get_info(char *buffer, char **start, off_t offset, int length
* R ## ## XX ## ## ## ## ## XX ## ## ## ## ## ## ##
*/
- len += sprintf(buffer+len, "%s\t%3.3lx %3.3lx %d %lu %2.2x %d %3.3lx %3.3lx %d\n",
+ seq_printf(seq, "%s\t%3.3lx %3.3lx %d %lu %2.2x %d %3.3lx %3.3lx %d\n",
scc->dev->name,
scc->data, scc->ctrl, scc->irq, scc->clock, scc->brand,
scc->enhanced, Vector_Latch, scc->special,
scc->option);
- len += sprintf(buffer+len, "\t%lu %d %d %d %d\n",
+ seq_printf(seq, "\t%lu %d %d %d %d\n",
scc->modem.speed, scc->modem.nrz,
scc->modem.clocksrc, kiss->softdcd,
stat->bufsize);
- len += sprintf(buffer+len, "\t%lu %lu %lu %lu\n",
+ seq_printf(seq, "\t%lu %lu %lu %lu\n",
stat->rxints, stat->txints, stat->exints, stat->spints);
- len += sprintf(buffer+len, "\t%lu %lu %d / %lu %lu %d / %d %d\n",
+ seq_printf(seq, "\t%lu %lu %d / %lu %lu %d / %d %d\n",
stat->rxframes, stat->rxerrs, stat->rx_over,
stat->txframes, stat->txerrs, stat->tx_under,
stat->nospace, stat->tx_state);
#define K(x) kiss->x
- len += sprintf(buffer+len, "\t%d %d %d %d %d %d %d %d %d %d %d %d\n",
+ seq_printf(seq, "\t%d %d %d %d %d %d %d %d %d %d %d %d\n",
K(txdelay), K(persist), K(slottime), K(tailtime),
K(fulldup), K(waittime), K(mintime), K(maxkeyup),
K(idletime), K(maxdefer), K(tx_inhibit), K(group));
@@ -2047,43 +2063,49 @@ static int scc_net_get_info(char *buffer, char **start, off_t offset, int length
{
int reg;
- len += sprintf(buffer+len, "\tW ");
+ seq_printf(seq, "\tW ");
for (reg = 0; reg < 16; reg++)
- len += sprintf(buffer+len, "%2.2x ", scc->wreg[reg]);
- len += sprintf(buffer+len, "\n");
+ seq_printf(seq, "%2.2x ", scc->wreg[reg]);
+ seq_printf(seq, "\n");
- len += sprintf(buffer+len, "\tR %2.2x %2.2x XX ", InReg(scc->ctrl,R0), InReg(scc->ctrl,R1));
+ seq_printf(seq, "\tR %2.2x %2.2x XX ", InReg(scc->ctrl,R0), InReg(scc->ctrl,R1));
for (reg = 3; reg < 8; reg++)
- len += sprintf(buffer+len, "%2.2x ", InReg(scc->ctrl, reg));
- len += sprintf(buffer+len, "XX ");
+ seq_printf(seq, "%2.2x ", InReg(scc->ctrl, reg));
+ seq_printf(seq, "XX ");
for (reg = 9; reg < 16; reg++)
- len += sprintf(buffer+len, "%2.2x ", InReg(scc->ctrl, reg));
- len += sprintf(buffer+len, "\n");
+ seq_printf(seq, "%2.2x ", InReg(scc->ctrl, reg));
+ seq_printf(seq, "\n");
}
#endif
- len += sprintf(buffer+len, "\n");
-
- pos = begin + len;
-
- if (pos < offset) {
- len = 0;
- begin = pos;
- }
-
- if (pos > offset + length)
- break;
+ seq_putc(seq, '\n');
}
-done:
+ return 0;
+}
- *start = buffer + (offset - begin);
- len -= (offset - begin);
+static struct seq_operations scc_net_seq_ops = {
+ .start = scc_net_seq_start,
+ .next = scc_net_seq_next,
+ .stop = scc_net_seq_stop,
+ .show = scc_net_seq_show,
+};
- if (len > length) len = length;
- return len;
+static int scc_net_seq_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &scc_net_seq_ops);
}
+static struct file_operations scc_net_seq_fops = {
+ .owner = THIS_MODULE,
+ .open = scc_net_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release_private,
+};
+
+#endif /* CONFIG_PROC_FS */
+
/* ******************************************************************** */
/* * Init SCC driver * */
@@ -2091,23 +2113,18 @@ done:
static int __init scc_init_driver (void)
{
- int result;
- char devname[10];
+ char devname[IFNAMSIZ];
printk(banner);
- spin_lock_init(&iolock);
-
sprintf(devname,"%s0", SCC_DriverName);
- result = scc_net_setup(SCC_Info, devname, 0);
- if (result)
- {
+ if (scc_net_alloc(devname, SCC_Info)) {
printk(KERN_ERR "z8530drv: cannot initialize module\n");
- return result;
+ return -EIO;
}
- proc_net_create("z8530drv", 0, scc_net_get_info);
+ proc_net_fops_create("z8530drv", 0, &scc_net_seq_fops);
return 0;
}
@@ -2117,11 +2134,12 @@ static void __exit scc_cleanup_driver(void)
io_port ctrl;
int k;
struct scc_channel *scc;
+ struct net_device *dev;
- if (Nchips == 0)
+ if (Nchips == 0 && (dev = SCC_Info[0].dev))
{
- unregister_netdev(SCC_Info[0].dev);
- free_netdev(SCC_Info[0].dev);
+ unregister_netdev(dev);
+ free_netdev(dev);
}
/* Guard against chip prattle */
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index e7046c031bb5..58c0a07039e2 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -74,7 +74,6 @@
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
-#include <linux/version.h>
#include <asm/uaccess.h>
#include <linux/init.h>
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index 38c802e16418..3e7facd034d0 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -104,6 +104,7 @@
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
+#include <linux/eisa.h>
#include <linux/pci.h>
#include <linux/spinlock.h>
#include <linux/netdevice.h>
diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c
index 15f1460cb5c3..9c846746e921 100644
--- a/drivers/net/ibmlana.c
+++ b/drivers/net/ibmlana.c
@@ -74,7 +74,6 @@ History:
*************************************************************************/
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/errno.h>
diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
index ca62b7cec493..12547d2d2d7f 100644
--- a/drivers/net/irda/Kconfig
+++ b/drivers/net/irda/Kconfig
@@ -254,18 +254,6 @@ config WINBOND_FIR
<file:Documentation/modules.txt>. The module will be called
w83977af_ir.
-config TOSHIBA_OLD
- tristate "Toshiba Type-O IR Port (old driver)"
- depends on IRDA && BROKEN_ON_SMP
- help
- Say Y here if you want to build support for the Toshiba Type-O IR
- chipset. This chipset is used by the Toshiba Libretto 100CT, and
- many more laptops. This driver is obsolete, will no more be
- maintained and will be removed in favor of the new driver.
- If you want to compile it as a module, say M here and read
- <file:Documentation/modules.txt>.
- The module will be called toshoboe.
-
config TOSHIBA_FIR
tristate "Toshiba Type-O IR Port"
depends on IRDA
@@ -281,18 +269,6 @@ config AU1000_FIR
tristate "Alchemy Au1000 SIR/FIR"
depends on MIPS_AU1000 && IRDA
-config SMC_IRCC_OLD
- tristate "SMC IrCC (old driver) (EXPERIMENTAL)"
- depends on EXPERIMENTAL && IRDA && ISA
- help
- Say Y here if you want to build support for the SMC Infrared
- Communications Controller. It is used in the Fujitsu Lifebook 635t
- and Sony PCG-505TX. This driver is obsolete, will no more be
- maintained and will be removed in favor of the new driver.
- If you want to compile it as a module, say M here and read
- <file:Documentation/modules.txt>. The module will be
- called smc-ircc.
-
config SMC_IRCC_FIR
tristate "SMSC IrCC (EXPERIMENTAL)"
depends on EXPERIMENTAL && IRDA && ISA
diff --git a/drivers/net/irda/Makefile b/drivers/net/irda/Makefile
index a05395e2dcd1..c0a59b3855c8 100644
--- a/drivers/net/irda/Makefile
+++ b/drivers/net/irda/Makefile
@@ -12,9 +12,7 @@ obj-$(CONFIG_USB_IRDA) += irda-usb.o
obj-$(CONFIG_NSC_FIR) += nsc-ircc.o
obj-$(CONFIG_WINBOND_FIR) += w83977af_ir.o
obj-$(CONFIG_SA1100_FIR) += sa1100_ir.o
-obj-$(CONFIG_TOSHIBA_OLD) += toshoboe.o
obj-$(CONFIG_TOSHIBA_FIR) += donauboe.o
-obj-$(CONFIG_SMC_IRCC_OLD) += smc-ircc.o irport.o
obj-$(CONFIG_SMC_IRCC_FIR) += smsc-ircc2.o
obj-$(CONFIG_ALI_FIR) += ali-ircc.o
obj-$(CONFIG_VLSI_FIR) += vlsi_ir.o
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index c4866c84fbc0..380f6488745b 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -89,7 +89,6 @@ static int ali_ircc_close(struct ali_ircc_cb *self);
static int ali_ircc_setup(chipio_t *info);
static int ali_ircc_is_receiving(struct ali_ircc_cb *self);
-static int ali_ircc_net_init(struct net_device *dev);
static int ali_ircc_net_open(struct net_device *dev);
static int ali_ircc_net_close(struct net_device *dev);
static int ali_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
@@ -255,14 +254,14 @@ static int ali_ircc_open(int i, chipio_t *info)
if ((ali_ircc_setup(info)) == -1)
return -1;
- /* Allocate new instance of the driver */
- self = kmalloc(sizeof(struct ali_ircc_cb), GFP_KERNEL);
- if (self == NULL)
- {
+ dev = alloc_netdev(sizeof(*self), "irda%d", irda_device_setup);
+ if (dev == NULL) {
ERROR("%s(), can't allocate memory for control block!\n", __FUNCTION__);
return -ENOMEM;
}
- memset(self, 0, sizeof(struct ali_ircc_cb));
+
+ self = dev->priv;
+ self->netdev = dev;
spin_lock_init(&self->lock);
/* Need to store self somewhere */
@@ -282,9 +281,8 @@ static int ali_ircc_open(int i, chipio_t *info)
if (!request_region(self->io.fir_base, self->io.fir_ext, driver_name)) {
WARNING("%s(), can't get iobase of 0x%03x\n", __FUNCTION__,
self->io.fir_base);
- dev_self[i] = NULL;
- kfree(self);
- return -ENODEV;
+ err = -ENODEV;
+ goto err_out1;
}
/* Initialize QoS for this device */
@@ -307,19 +305,17 @@ static int ali_ircc_open(int i, chipio_t *info)
/* Allocate memory if needed */
self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize,
GFP_KERNEL |GFP_DMA);
- if (self->rx_buff.head == NULL)
- {
- kfree(self);
- return -ENOMEM;
+ if (self->rx_buff.head == NULL) {
+ err = -ENOMEM;
+ goto err_out2;
}
memset(self->rx_buff.head, 0, self->rx_buff.truesize);
self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize,
GFP_KERNEL|GFP_DMA);
if (self->tx_buff.head == NULL) {
- kfree(self->rx_buff.head);
- kfree(self);
- return -ENOMEM;
+ err = -ENOMEM;
+ goto err_out3;
}
memset(self->tx_buff.head, 0, self->tx_buff.truesize);
@@ -332,28 +328,21 @@ static int ali_ircc_open(int i, chipio_t *info)
self->tx_fifo.len = self->tx_fifo.ptr = self->tx_fifo.free = 0;
self->tx_fifo.tail = self->tx_buff.head;
- if (!(dev = dev_alloc("irda%d", &err))) {
- ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__);
- return -ENOMEM;
- }
-
- dev->priv = (void *) self;
- self->netdev = dev;
+ /* Keep track of module usage */
+ SET_MODULE_OWNER(dev);
+
/* Override the network functions we need to use */
- dev->init = ali_ircc_net_init;
dev->hard_start_xmit = ali_ircc_sir_hard_xmit;
dev->open = ali_ircc_net_open;
dev->stop = ali_ircc_net_close;
dev->do_ioctl = ali_ircc_net_ioctl;
dev->get_stats = ali_ircc_net_get_stats;
- rtnl_lock();
- err = register_netdevice(dev);
- rtnl_unlock();
+ err = register_netdev(dev);
if (err) {
ERROR("%s(), register_netdev() failed!\n", __FUNCTION__);
- return -1;
+ goto err_out4;
}
MESSAGE("IrDA: Registered device %s\n", dev->name);
@@ -370,6 +359,17 @@ static int ali_ircc_open(int i, chipio_t *info)
IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __FUNCTION__);
return 0;
+
+ err_out4:
+ kfree(self->tx_buff.head);
+ err_out3:
+ kfree(self->rx_buff.head);
+ err_out2:
+ release_region(self->io.fir_base, self->io.fir_ext);
+ err_out1:
+ dev_self[i] = NULL;
+ free_netdev(dev);
+ return err;
}
@@ -390,8 +390,7 @@ static int __exit ali_ircc_close(struct ali_ircc_cb *self)
iobase = self->io.fir_base;
/* Remove netdevice */
- if (self->netdev)
- unregister_netdev(self->netdev);
+ unregister_netdev(self->netdev);
/* Release the PORT that this driver is using */
IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", __FUNCTION__, self->io.fir_base);
@@ -404,7 +403,7 @@ static int __exit ali_ircc_close(struct ali_ircc_cb *self)
kfree(self->rx_buff.head);
dev_self[self->index] = NULL;
- kfree(self);
+ free_netdev(self->netdev);
IRDA_DEBUG(2, "%s(), ----------------- End -----------------\n", __FUNCTION__);
@@ -1291,29 +1290,6 @@ static int ali_ircc_sir_write(int iobase, int fifo_size, __u8 *buf, int len)
}
/*
- * Function ali_ircc_net_init (dev)
- *
- * Initialize network device
- *
- */
-static int ali_ircc_net_init(struct net_device *dev)
-{
- IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
-
- /* Keep track of module usage */
- SET_MODULE_OWNER(dev);
-
- /* Setup to be a normal IrDA network device driver */
- irda_device_setup(dev);
-
- /* Insert overrides below this line! */
-
- IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );
-
- return 0;
-}
-
-/*
* Function ali_ircc_net_open (dev)
*
* Start the device
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index db20dcc0ef7b..11ff089e616b 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -1396,20 +1396,6 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<');
return IRQ_HANDLED;
}
-static int
-toshoboe_net_init (struct net_device *dev)
-{
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
-
- /* Keep track of module usage */
- SET_MODULE_OWNER(dev);
-
- /* Setup to be a normal IrDA network device driver */
- irda_device_setup (dev);
-
- /* Insert overrides below this line! */
- return 0;
-}
static int
toshoboe_net_open (struct net_device *dev)
@@ -1589,14 +1575,13 @@ toshoboe_close (struct pci_dev *pci_dev)
self->rx_bufs[i] = NULL;
}
- if (self->netdev)
- unregister_netdev(self->netdev);
+ unregister_netdev(self->netdev);
kfree (self->ringbuf);
self->ringbuf = NULL;
self->ring = NULL;
- return;
+ free_netdev(self->netdev);
}
static int
@@ -1613,17 +1598,17 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
if ((err=pci_enable_device(pci_dev)))
return err;
- self = kmalloc (sizeof (struct toshoboe_cb), GFP_KERNEL);
-
- if (self == NULL)
+ dev = alloc_netdev(sizeof (struct toshoboe_cb), "irda%d",
+ irda_device_setup);
+ if (dev == NULL)
{
printk (KERN_ERR DRIVER_NAME ": can't allocate memory for "
"IrDA control block\n");
return -ENOMEM;
}
- memset (self, 0, sizeof (struct toshoboe_cb));
-
+ self = dev->priv;
+ self->netdev = dev;
self->pdev = pci_dev;
self->base = pci_resource_start(pci_dev,0);
@@ -1732,33 +1717,20 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
}
#endif
- if (!(dev = dev_alloc ("irda%d", &err)))
- {
- printk (KERN_ERR DRIVER_NAME ": dev_alloc() failed\n");
- err = -ENOMEM;
- goto freebufs;
- }
-
- dev->priv = (void *) self;
- self->netdev = dev;
-
- printk (KERN_INFO "IrDA: Registered device %s\n", dev->name);
-
- dev->init = toshoboe_net_init;
+ SET_MODULE_OWNER(dev);
dev->hard_start_xmit = toshoboe_hard_xmit;
dev->open = toshoboe_net_open;
dev->stop = toshoboe_net_close;
dev->do_ioctl = toshoboe_net_ioctl;
- rtnl_lock ();
- err = register_netdevice (dev);
- rtnl_unlock ();
+ err = register_netdev(dev);
if (err)
{
printk (KERN_ERR DRIVER_NAME ": register_netdev() failed\n");
err = -ENOMEM;
goto freebufs;
}
+ printk (KERN_INFO "IrDA: Registered device %s\n", dev->name);
pci_set_drvdata(pci_dev,self);
@@ -1779,7 +1751,7 @@ freeregion:
release_region (self->io.fir_base, self->io.fir_ext);
freeself:
- kfree (self);
+ free_netdev(dev);
return err;
}
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 164f8b32c5f3..4b0c4fde5f37 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -112,7 +112,6 @@ static int irda_usb_close(struct irda_usb_cb *self);
static void speed_bulk_callback(struct urb *urb, struct pt_regs *regs);
static void write_bulk_callback(struct urb *urb, struct pt_regs *regs);
static void irda_usb_receive(struct urb *urb, struct pt_regs *regs);
-static int irda_usb_net_init(struct net_device *dev);
static int irda_usb_net_open(struct net_device *dev);
static int irda_usb_net_close(struct net_device *dev);
static int irda_usb_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
@@ -901,24 +900,6 @@ static int irda_usb_is_receiving(struct irda_usb_cb *self)
* be dealt with below...
*/
-/*------------------------------------------------------------------*/
-/*
- * Callback when a new IrDA device is created.
- */
-static int irda_usb_net_init(struct net_device *dev)
-{
- IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
-
- /* Keep track of module usage */
- SET_MODULE_OWNER(dev);
-
- /* Set up to be a normal IrDA network device driver */
- irda_device_setup(dev);
-
- /* Insert overrides below this line! */
-
- return 0;
-}
/*------------------------------------------------------------------*/
/*
@@ -1195,15 +1176,18 @@ static inline int irda_usb_open(struct irda_usb_cb *self)
memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU);
/* Create a network device for us */
- if (!(netdev = dev_alloc("irda%d", &err))) {
- ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__);
- return -1;
+ netdev = alloc_netdev(0, "irda%d", irda_device_setup);
+ if (!netdev) {
+ ERROR("%s(), alloc_net_dev() failed!\n", __FUNCTION__);
+ return -ENOMEM;
}
+
+ SET_MODULE_OWNER(dev);
+
self->netdev = netdev;
netdev->priv = (void *) self;
/* Override the network functions we need to use */
- netdev->init = irda_usb_net_init;
netdev->hard_start_xmit = irda_usb_hard_xmit;
netdev->tx_timeout = irda_usb_net_timeout;
netdev->watchdog_timeo = 250*HZ/1000; /* 250 ms > USB timeout */
@@ -1212,12 +1196,12 @@ static inline int irda_usb_open(struct irda_usb_cb *self)
netdev->get_stats = irda_usb_net_get_stats;
netdev->do_ioctl = irda_usb_net_ioctl;
- rtnl_lock();
- err = register_netdevice(netdev);
- rtnl_unlock();
+ err = register_netdev(netdev);
if (err) {
ERROR("%s(), register_netdev() failed!\n", __FUNCTION__);
- return -1;
+ self->netdev = NULL;
+ free_netdev(netdev);
+ return err;
}
MESSAGE("IrDA: Registered device %s\n", netdev->name);
@@ -1236,9 +1220,11 @@ static inline int irda_usb_close(struct irda_usb_cb *self)
ASSERT(self != NULL, return -1;);
/* Remove netdevice */
- if (self->netdev)
+ if (self->netdev) {
unregister_netdev(self->netdev);
- self->netdev = NULL;
+ free_netdev(self->netdev);
+ self->netdev = NULL;
+ }
/* Remove the speed buffer */
if (self->speed_buff != NULL) {
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index 11bb1143f23a..af88184cd759 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -143,7 +143,6 @@ static int nsc_ircc_is_receiving(struct nsc_ircc_cb *self);
static int nsc_ircc_read_dongle_id (int iobase);
static void nsc_ircc_init_dongle_interface (int iobase, int dongle_id);
-static int nsc_ircc_net_init(struct net_device *dev);
static int nsc_ircc_net_open(struct net_device *dev);
static int nsc_ircc_net_close(struct net_device *dev);
static int nsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
@@ -261,14 +260,16 @@ static int __init nsc_ircc_open(int i, chipio_t *info)
MESSAGE("%s, driver loaded (Dag Brattli)\n", driver_name);
- /* Allocate new instance of the driver */
- self = kmalloc(sizeof(struct nsc_ircc_cb), GFP_KERNEL);
- if (self == NULL) {
+ dev = alloc_netdev(sizeof(struct nsc_ircc_cb), "irda%d",
+ irda_device_setup);
+ if (dev == NULL) {
ERROR("%s(), can't allocate memory for "
"control block!\n", __FUNCTION__);
return -ENOMEM;
}
- memset(self, 0, sizeof(struct nsc_ircc_cb));
+
+ self = dev->priv;
+ self->netdev = dev;
spin_lock_init(&self->lock);
/* Need to store self somewhere */
@@ -288,9 +289,8 @@ static int __init nsc_ircc_open(int i, chipio_t *info)
if (!ret) {
WARNING("%s(), can't get iobase of 0x%03x\n",
__FUNCTION__, self->io.fir_base);
- dev_self[i] = NULL;
- kfree(self);
- return -ENODEV;
+ err = -ENODEV;
+ goto out1;
}
/* Initialize QoS for this device */
@@ -313,17 +313,17 @@ static int __init nsc_ircc_open(int i, chipio_t *info)
self->rx_buff.head = (__u8 *) kmalloc(self->rx_buff.truesize,
GFP_KERNEL|GFP_DMA);
if (self->rx_buff.head == NULL) {
- kfree(self);
- return -ENOMEM;
+ err = -ENOMEM;
+ goto out2;
+
}
memset(self->rx_buff.head, 0, self->rx_buff.truesize);
self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize,
GFP_KERNEL|GFP_DMA);
if (self->tx_buff.head == NULL) {
- kfree(self->rx_buff.head);
- kfree(self);
- return -ENOMEM;
+ err = -ENOMEM;
+ goto out3;
}
memset(self->tx_buff.head, 0, self->tx_buff.truesize);
@@ -336,28 +336,18 @@ static int __init nsc_ircc_open(int i, chipio_t *info)
self->tx_fifo.len = self->tx_fifo.ptr = self->tx_fifo.free = 0;
self->tx_fifo.tail = self->tx_buff.head;
- if (!(dev = dev_alloc("irda%d", &err))) {
- ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__);
- return -ENOMEM;
- }
-
- dev->priv = (void *) self;
- self->netdev = dev;
-
/* Override the network functions we need to use */
- dev->init = nsc_ircc_net_init;
+ SET_MODULE_OWNER(dev);
dev->hard_start_xmit = nsc_ircc_hard_xmit_sir;
dev->open = nsc_ircc_net_open;
dev->stop = nsc_ircc_net_close;
dev->do_ioctl = nsc_ircc_net_ioctl;
dev->get_stats = nsc_ircc_net_get_stats;
- rtnl_lock();
- err = register_netdevice(dev);
- rtnl_unlock();
+ err = register_netdev(dev);
if (err) {
ERROR("%s(), register_netdev() failed!\n", __FUNCTION__);
- return -1;
+ goto out4;
}
MESSAGE("IrDA: Registered device %s\n", dev->name);
@@ -380,6 +370,16 @@ static int __init nsc_ircc_open(int i, chipio_t *info)
pmdev->data = self;
return 0;
+ out4:
+ kfree(self->tx_buff.head);
+ out3:
+ kfree(self->rx_buff.head);
+ out2:
+ release_region(self->io.fir_base, self->io.fir_ext);
+ out1:
+ free_netdev(dev);
+ dev_self[i] = NULL;
+ return err;
}
/*
@@ -399,8 +399,7 @@ static int __exit nsc_ircc_close(struct nsc_ircc_cb *self)
iobase = self->io.fir_base;
/* Remove netdevice */
- if (self->netdev)
- unregister_netdev(self->netdev);
+ unregister_netdev(self->netdev);
/* Release the PORT that this driver is using */
IRDA_DEBUG(4, "%s(), Releasing Region %03x\n",
@@ -414,7 +413,7 @@ static int __exit nsc_ircc_close(struct nsc_ircc_cb *self)
kfree(self->rx_buff.head);
dev_self[self->index] = NULL;
- kfree(self);
+ free_netdev(self->netdev);
return 0;
}
@@ -1991,27 +1990,6 @@ static int nsc_ircc_is_receiving(struct nsc_ircc_cb *self)
}
/*
- * Function nsc_ircc_net_init (dev)
- *
- * Initialize network device
- *
- */
-static int nsc_ircc_net_init(struct net_device *dev)
-{
- IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
-
- /* Keep track of module usage */
- SET_MODULE_OWNER(dev);
-
- /* Setup to be a normal IrDA network device driver */
- irda_device_setup(dev);
-
- /* Insert overrides below this line! */
-
- return 0;
-}
-
-/*
* Function nsc_ircc_net_open (dev)
*
* Start the device
diff --git a/drivers/net/irda/sir_kthread.c b/drivers/net/irda/sir_kthread.c
index 5e7f455432c2..620b524bd80e 100644
--- a/drivers/net/irda/sir_kthread.c
+++ b/drivers/net/irda/sir_kthread.c
@@ -132,7 +132,7 @@ static int irda_thread(void *startup)
if (list_empty(&irda_rq_queue.request_list))
schedule();
else
- set_task_state(current, TASK_RUNNING);
+ __set_task_state(current, TASK_RUNNING);
remove_wait_queue(&irda_rq_queue.kick, &wait);
/* make swsusp happy with our thread */
@@ -165,7 +165,7 @@ static void flush_irda_queue(void)
if (atomic_read(&irda_rq_queue.num_pending))
schedule();
else
- set_task_state(current, TASK_RUNNING);
+ __set_task_state(current, TASK_RUNNING);
remove_wait_queue(&irda_rq_queue.done, &wait);
}
}
diff --git a/drivers/net/irda/smc-ircc.c b/drivers/net/irda/smc-ircc.c
deleted file mode 100644
index 91f476547a83..000000000000
--- a/drivers/net/irda/smc-ircc.c
+++ /dev/null
@@ -1,1258 +0,0 @@
-/*********************************************************************
- *
- * Filename: smc-ircc.c
- * Version: 0.4
- * Description: Driver for the SMC Infrared Communications Controller
- * Status: Experimental.
- * Author: Thomas Davis (tadavis@jps.net)
- * Created at:
- * Modified at: Tue Feb 22 10:05:06 2000
- * Modified by: Dag Brattli <dag@brattli.net>
- * Modified at: Tue Jun 26 2001
- * Modified by: Stefani Seibold <stefani@seibold.net>
- * Modified at: Thur Apr 18 2002
- * Modified by: Jeff Snyder <je4d@pobox.com>
- *
- * Copyright (c) 2001 Stefani Seibold
- * Copyright (c) 1999-2001 Dag Brattli
- * Copyright (c) 1998-1999 Thomas Davis,
- * All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- *
- * SIO's: all SIO documentet by SMC (June, 2001)
- * Applicable Models : Fujitsu Lifebook 635t, Sony PCG-505TX,
- * Dell Inspiron 8000
- *
- ********************************************************************/
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/skbuff.h>
-#include <linux/netdevice.h>
-#include <linux/ioport.h>
-#include <linux/delay.h>
-#include <linux/slab.h>
-#include <linux/init.h>
-#include <linux/rtnetlink.h>
-#include <linux/serial_reg.h>
-
-#include <asm/io.h>
-#include <asm/dma.h>
-#include <asm/byteorder.h>
-
-#include <linux/pm.h>
-
-#include <net/irda/wrapper.h>
-#include <net/irda/irda.h>
-#include <net/irda/irda_device.h>
-#include <net/irda/smc-ircc.h>
-#include <net/irda/irport.h>
-
-struct smc_chip {
- char *name;
- u16 flags;
- u8 devid;
- u8 rev;
-};
-typedef struct smc_chip smc_chip_t;
-
-static const char *driver_name = "smc-ircc";
-
-#define DIM(x) (sizeof(x)/(sizeof(*(x))))
-
-#define CHIP_IO_EXTENT 8
-
-static struct ircc_cb *dev_self[] = { NULL, NULL};
-
-/* Some prototypes */
-static int ircc_open(unsigned int iobase, unsigned int board_addr);
-static int ircc_dma_receive(struct ircc_cb *self, int iobase);
-static void ircc_dma_receive_complete(struct ircc_cb *self, int iobase);
-static int ircc_hard_xmit(struct sk_buff *skb, struct net_device *dev);
-static void ircc_dma_xmit(struct ircc_cb *self, int iobase, int bofs);
-static void ircc_change_speed(void *priv, u32 speed);
-static irqreturn_t ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-static int ircc_net_open(struct net_device *dev);
-static int ircc_net_close(struct net_device *dev);
-static int ircc_pmproc(struct pm_dev *dev, pm_request_t rqst, void *data);
-
-#define KEY55_1 0 /* SuperIO Configuration mode with Key <0x55> */
-#define KEY55_2 1 /* SuperIO Configuration mode with Key <0x55,0x55> */
-#define NoIRDA 2 /* SuperIO Chip has no IRDA Port */
-#define SIR 0 /* SuperIO Chip has only slow IRDA */
-#define FIR 4 /* SuperIO Chip has fast IRDA */
-#define SERx4 8 /* SuperIO Chip supports 115,2 KBaud * 4=460,8 KBaud */
-
-/* These are the currently known SMC SuperIO chipsets */
-static smc_chip_t __initdata fdc_chips_flat[]=
-{
- /* Base address 0x3f0 or 0x370 */
- { "37C44", KEY55_1|NoIRDA, 0x00, 0x00 }, /* This chip can not detected */
- { "37C665GT", KEY55_2|NoIRDA, 0x65, 0x01 },
- { "37C665GT", KEY55_2|NoIRDA, 0x66, 0x01 },
- { "37C669", KEY55_2|SIR|SERx4, 0x03, 0x02 },
- { "37C669", KEY55_2|SIR|SERx4, 0x04, 0x02 }, /* ID? */
- { "37C78", KEY55_2|NoIRDA, 0x78, 0x00 },
- { "37N769", KEY55_1|FIR|SERx4, 0x28, 0x00 },
- { "37N869", KEY55_1|FIR|SERx4, 0x29, 0x00 },
- { NULL }
-};
-
-static smc_chip_t __initdata fdc_chips_paged[]=
-{
- /* Base address 0x3f0 or 0x370 */
- { "37B72X", KEY55_1|SIR|SERx4, 0x4c, 0x00 },
- { "37B77X", KEY55_1|SIR|SERx4, 0x43, 0x00 },
- { "37B78X", KEY55_1|SIR|SERx4, 0x44, 0x00 },
- { "37B80X", KEY55_1|SIR|SERx4, 0x42, 0x00 },
- { "37C67X", KEY55_1|FIR|SERx4, 0x40, 0x00 },
- { "37C93X", KEY55_2|SIR|SERx4, 0x02, 0x01 },
- { "37C93XAPM", KEY55_1|SIR|SERx4, 0x30, 0x01 },
- { "37C93XFR", KEY55_2|FIR|SERx4, 0x03, 0x01 },
- { "37M707", KEY55_1|SIR|SERx4, 0x42, 0x00 },
- { "37M81X", KEY55_1|SIR|SERx4, 0x4d, 0x00 },
- { "37N958FR", KEY55_1|FIR|SERx4, 0x09, 0x04 },
- { "37N971", KEY55_1|FIR|SERx4, 0x0a, 0x00 },
- { "37N972", KEY55_1|FIR|SERx4, 0x0b, 0x00 },
- { NULL }
-};
-
-static smc_chip_t __initdata lpc_chips_flat[]=
-{
- /* Base address 0x2E or 0x4E */
- { "47N227", KEY55_1|FIR|SERx4, 0x5a, 0x00 },
- { "47N267", KEY55_1|FIR|SERx4, 0x5e, 0x00 },
- { NULL }
-};
-
-static smc_chip_t __initdata lpc_chips_paged[]=
-{
- /* Base address 0x2E or 0x4E */
- { "47B27X", KEY55_1|SIR|SERx4, 0x51, 0x00 },
- { "47B37X", KEY55_1|SIR|SERx4, 0x52, 0x00 },
- { "47M10X", KEY55_1|SIR|SERx4, 0x59, 0x00 },
- { "47M120", KEY55_1|NoIRDA|SERx4, 0x5c, 0x00 },
- { "47M13X", KEY55_1|SIR|SERx4, 0x59, 0x00 },
- { "47M14X", KEY55_1|SIR|SERx4, 0x5f, 0x00 },
- { "47N252", KEY55_1|FIR|SERx4, 0x0e, 0x00 },
- { "47S42X", KEY55_1|SIR|SERx4, 0x57, 0x00 },
- { NULL }
-};
-
-static int ircc_irq=255;
-static int ircc_dma=255;
-static int ircc_fir=0;
-static int ircc_sir=0;
-static int ircc_cfg=0;
-
-static unsigned short dev_count=0;
-
-static inline void register_bank(int iobase, int bank)
-{
- outb(((inb(iobase+IRCC_MASTER) & 0xf0) | (bank & 0x07)),
- iobase+IRCC_MASTER);
-}
-
-static int __init smc_access(unsigned short cfg_base,unsigned char reg)
-{
- IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
-
- outb(reg, cfg_base);
-
- if (inb(cfg_base)!=reg)
- return -1;
-
- return 0;
-}
-
-static const smc_chip_t * __init smc_probe(unsigned short cfg_base,u8 reg,const smc_chip_t *chip,char *type)
-{
- u8 devid,xdevid,rev;
-
- IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
-
- /* Leave configuration */
-
- outb(0xaa, cfg_base);
-
- if (inb(cfg_base)==0xaa) /* not a smc superio chip */
- return NULL;
-
- outb(reg, cfg_base);
-
- xdevid=inb(cfg_base+1);
-
- /* Enter configuration */
-
- outb(0x55, cfg_base);
-
- if (smc_access(cfg_base,0x55)) /* send second key and check */
- return NULL;
-
- /* probe device ID */
-
- if (smc_access(cfg_base,reg))
- return NULL;
-
- devid=inb(cfg_base+1);
-
- if (devid==0) /* typical value for unused port */
- return NULL;
-
- if (devid==0xff) /* typical value for unused port */
- return NULL;
-
- /* probe revision ID */
-
- if (smc_access(cfg_base,reg+1))
- return NULL;
-
- rev=inb(cfg_base+1);
-
- if (rev>=128) /* i think this will make no sense */
- return NULL;
-
- if (devid==xdevid) /* protection against false positives */
- return NULL;
-
- /* Check for expected device ID; are there others? */
-
- while(chip->devid!=devid) {
-
- chip++;
-
- if (chip->name==NULL)
- return NULL;
- }
- if (chip->rev>rev)
- return NULL;
-
- MESSAGE("found SMC SuperIO Chip (devid=0x%02x rev=%02X base=0x%04x): %s%s\n",devid,rev,cfg_base,type,chip->name);
-
- if (chip->flags&NoIRDA)
- MESSAGE("chipset does not support IRDA\n");
-
- return chip;
-}
-
-/*
- * Function smc_superio_flat (chip, base, type)
- *
- * Try get configuration of a smc SuperIO chip with flat register model
- *
- */
-static int __init smc_superio_flat(const smc_chip_t *chips, unsigned short cfg_base, char *type)
-{
- unsigned short fir_io;
- unsigned short sir_io;
- u8 mode;
- int ret = -ENODEV;
-
- IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
-
- if (smc_probe(cfg_base,0xD,chips,type)==NULL)
- return ret;
-
- outb(0x0c, cfg_base);
-
- mode = inb(cfg_base+1);
- mode = (mode & 0x38) >> 3;
-
- /* Value for IR port */
- if (mode && mode < 4) {
- /* SIR iobase */
- outb(0x25, cfg_base);
- sir_io = inb(cfg_base+1) << 2;
-
- /* FIR iobase */
- outb(0x2b, cfg_base);
- fir_io = inb(cfg_base+1) << 3;
-
- if (fir_io) {
- if (ircc_open(fir_io, sir_io) == 0)
- ret=0;
- }
- }
-
- /* Exit configuration */
- outb(0xaa, cfg_base);
-
- return ret;
-}
-
-/*
- * Function smc_superio_paged (chip, base, type)
- *
- * Try get configuration of a smc SuperIO chip with paged register model
- *
- */
-static int __init smc_superio_paged(const smc_chip_t *chips, unsigned short cfg_base, char *type)
-{
- unsigned short fir_io;
- unsigned short sir_io;
- int ret = -ENODEV;
-
- IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
-
- if (smc_probe(cfg_base,0x20,chips,type)==NULL)
- return ret;
-
- /* Select logical device (UART2) */
- outb(0x07, cfg_base);
- outb(0x05, cfg_base + 1);
-
- /* SIR iobase */
- outb(0x60, cfg_base);
- sir_io = inb(cfg_base + 1) << 8;
- outb(0x61, cfg_base);
- sir_io |= inb(cfg_base + 1);
-
- /* Read FIR base */
- outb(0x62, cfg_base);
- fir_io = inb(cfg_base + 1) << 8;
- outb(0x63, cfg_base);
- fir_io |= inb(cfg_base + 1);
- outb(0x2b, cfg_base); /* ??? */
-
- if (fir_io) {
- if (ircc_open(fir_io, sir_io) == 0)
- ret=0;
- }
-
- /* Exit configuration */
- outb(0xaa, cfg_base);
-
- return ret;
-}
-
-static int __init smc_superio_fdc(unsigned short cfg_base)
-{
- if (check_region(cfg_base, 2) < 0) {
- IRDA_DEBUG(0, "%s: can't get cfg_base of 0x%03x\n", __FUNCTION__ ,
- cfg_base);
- return -1;
- }
-
- if (!smc_superio_flat(fdc_chips_flat,cfg_base,"FDC")||!smc_superio_paged(fdc_chips_paged,cfg_base,"FDC"))
- return 0;
-
- return -1;
-}
-
-static int __init smc_superio_lpc(unsigned short cfg_base)
-{
-#if 0
- if (check_region(cfg_base, 2) < 0) {
- IRDA_DEBUG(0, "%s: can't get cfg_base of 0x%03x\n", __FUNCTION__ ,
- cfg_base);
- return -1;
- }
-#endif
-
- if (!smc_superio_flat(lpc_chips_flat,cfg_base,"LPC")||!smc_superio_paged(lpc_chips_paged,cfg_base,"LPC"))
- return 0;
-
- return -1;
-}
-
-/*
- * Function ircc_init ()
- *
- * Initialize chip. Just try to find out how many chips we are dealing with
- * and where they are
- */
-int __init ircc_init(void)
-{
- int ret=-ENODEV;
-
- IRDA_DEBUG(0, "%s\n", __FUNCTION__ );
-
- dev_count=0;
-
- if ((ircc_fir>0)&&(ircc_sir>0)) {
- MESSAGE(" Overriding FIR address 0x%04x\n", ircc_fir);
- MESSAGE(" Overriding SIR address 0x%04x\n", ircc_sir);
-
- if (ircc_open(ircc_fir, ircc_sir) == 0)
- return 0;
-
- return -ENODEV;
- }
-
- /* try user provided configuration register base address */
- if (ircc_cfg>0) {
- MESSAGE(" Overriding configuration address 0x%04x\n", ircc_cfg);
- if (!smc_superio_fdc(ircc_cfg))
- ret=0;
- }
-
- /* Trys to open for all the SMC chipsets we know about */
-
- IRDA_DEBUG(0,
- "%s Try to open all known SMC chipsets\n", __FUNCTION__ );
-
- if (!smc_superio_fdc(0x3f0))
- ret=0;
- if (!smc_superio_fdc(0x370))
- ret=0;
- if (!smc_superio_fdc(0xe0))
- ret=0;
- if (!smc_superio_lpc(0x2e))
- ret=0;
- if (!smc_superio_lpc(0x4e))
- ret=0;
-
- return ret;
-}
-
-/*
- * Function ircc_open (iobase, irq)
- *
- * Try to open driver instance
- *
- */
-static int __init ircc_open(unsigned int fir_base, unsigned int sir_base)
-{
- struct ircc_cb *self;
- struct irport_cb *irport;
- unsigned char low, high, chip, config, dma, irq, version;
- unsigned long flags;
-
-
- IRDA_DEBUG(0, "%s\n", __FUNCTION__ );
-
- if (check_region(fir_base, CHIP_IO_EXTENT) < 0) {
- IRDA_DEBUG(0, "%s: can't get fir_base of 0x%03x\n", __FUNCTION__ ,
- fir_base);
- return -ENODEV;
- }
-#if POSSIBLE_USED_BY_SERIAL_DRIVER
- if (check_region(sir_base, CHIP_IO_EXTENT) < 0) {
- IRDA_DEBUG(0, "%s: can't get sir_base of 0x%03x\n", __FUNCTION__ ,
- sir_base);
- return -ENODEV;
- }
-#endif
-
- register_bank(fir_base, 3);
-
- high = inb(fir_base+IRCC_ID_HIGH);
- low = inb(fir_base+IRCC_ID_LOW);
- chip = inb(fir_base+IRCC_CHIP_ID);
- version = inb(fir_base+IRCC_VERSION);
- config = inb(fir_base+IRCC_INTERFACE);
-
- irq = config >> 4 & 0x0f;
- dma = config & 0x0f;
-
- if (high != 0x10 || low != 0xb8 || (chip != 0xf1 && chip != 0xf2)) {
- IRDA_DEBUG(0,
- "%s(), addr 0x%04x - no device found!\n", __FUNCTION__ , fir_base);
- return -ENODEV;
- }
- MESSAGE("SMC IrDA Controller found\n IrCC version %d.%d, "
- "firport 0x%03x, sirport 0x%03x dma=%d, irq=%d\n",
- chip & 0x0f, version, fir_base, sir_base, dma, irq);
-
- if (dev_count >= DIM(dev_self)) {
- IRDA_DEBUG(0,
- "%s(), to many devices!\n", __FUNCTION__ );
- return -ENOMEM;
- }
-
- /*
- * Allocate new instance of the driver
- */
- self = kmalloc(sizeof(struct ircc_cb), GFP_KERNEL);
- if (self == NULL) {
- ERROR("%s, Can't allocate memory for control block!\n",
- driver_name);
- return -ENOMEM;
- }
- memset(self, 0, sizeof(struct ircc_cb));
-
- /* Max DMA buffer size needed = (data_size + 6) * (window_size) + 6; */
- self->rx_buff.truesize = 4000;
- self->tx_buff.truesize = 4000;
-
- self->rx_buff.head = (u8 *) kmalloc(self->rx_buff.truesize,
- GFP_KERNEL|GFP_DMA);
- if (self->rx_buff.head == NULL) {
- ERROR("%s, Can't allocate memory for receive buffer!\n",
- driver_name);
- kfree(self);
- return -ENOMEM;
- }
-
- self->tx_buff.head = (u8 *) kmalloc(self->tx_buff.truesize,
- GFP_KERNEL|GFP_DMA);
- if (self->tx_buff.head == NULL) {
- ERROR("%s, Can't allocate memory for transmit buffer!\n",
- driver_name);
- kfree(self->rx_buff.head);
- kfree(self);
- return -ENOMEM;
- }
-
- irport = irport_open(dev_count, sir_base, irq);
- if (!irport) {
- kfree(self->tx_buff.head);
- kfree(self->rx_buff.head);
- kfree(self);
- return -ENODEV;
- }
-
- memset(self->rx_buff.head, 0, self->rx_buff.truesize);
- memset(self->tx_buff.head, 0, self->tx_buff.truesize);
-
- /* Need to store self somewhere */
- dev_self[dev_count++] = self;
-
- /* Steal the network device from irport */
- self->netdev = irport->netdev;
- self->irport = irport;
-
- irport->priv = self;
-
- /* Keep track of module usage */
- SET_MODULE_OWNER(self->netdev);
-
- /* Initialize IO */
- self->io = &irport->io;
- self->io->fir_base = fir_base;
- self->io->sir_base = sir_base; /* Used by irport */
- self->io->fir_ext = CHIP_IO_EXTENT;
- self->io->sir_ext = 8; /* Used by irport */
-
- if (ircc_irq < 255) {
- if (ircc_irq!=irq)
- MESSAGE("%s, Overriding IRQ - chip says %d, using %d\n",
- driver_name, irq, ircc_irq);
- self->io->irq = ircc_irq;
- }
- else
- self->io->irq = irq;
- if (ircc_dma < 255) {
- if (ircc_dma!=dma)
- MESSAGE("%s, Overriding DMA - chip says %d, using %d\n",
- driver_name, dma, ircc_dma);
- self->io->dma = ircc_dma;
- }
- else
- self->io->dma = dma;
-
- request_region(self->io->fir_base, CHIP_IO_EXTENT, driver_name);
-
- /* Don't allow irport to change under us - Jean II */
- spin_lock_irqsave(&self->irport->lock, flags);
-
- /* Initialize QoS for this device */
- irda_init_max_qos_capabilies(&irport->qos);
-
- /* The only value we must override it the baudrate */
- irport->qos.baud_rate.bits = IR_9600|IR_19200|IR_38400|IR_57600|
- IR_115200|IR_576000|IR_1152000|(IR_4000000 << 8);
-
- irport->qos.min_turn_time.bits = 0x07;
- irport->qos.window_size.bits = 0x01;
- irda_qos_bits_to_value(&irport->qos);
-
- irport->flags = IFF_FIR|IFF_MIR|IFF_SIR|IFF_DMA|IFF_PIO;
-
-
- self->rx_buff.in_frame = FALSE;
- self->rx_buff.state = OUTSIDE_FRAME;
- self->tx_buff.data = self->tx_buff.head;
- self->rx_buff.data = self->rx_buff.head;
-
- /* Override the speed change function, since we must control it now */
- irport->change_speed = &ircc_change_speed;
- irport->interrupt = &ircc_interrupt;
- self->netdev->open = &ircc_net_open;
- self->netdev->stop = &ircc_net_close;
-
- irport_start(self->irport);
- spin_unlock_irqrestore(&self->irport->lock, flags);
-
- self->pmdev = pm_register(PM_SYS_DEV, PM_SYS_IRDA, ircc_pmproc);
- if (self->pmdev)
- self->pmdev->data = self;
-
- /* Power on device */
-
- outb(0x00, fir_base+IRCC_MASTER);
-
- return 0;
-}
-
-/*
- * Function ircc_change_speed (self, baud)
- *
- * Change the speed of the device
- *
- * This function should be called with irq off and spin-lock.
- */
-static void ircc_change_speed(void *priv, u32 speed)
-{
- int iobase, ir_mode, ctrl, fast;
- struct ircc_cb *self = (struct ircc_cb *) priv;
- struct net_device *dev;
-
- IRDA_DEBUG(0, "%s\n", __FUNCTION__ );
-
- ASSERT(self != NULL, return;);
-
- dev = self->netdev;
- iobase = self->io->fir_base;
-
- /* Update accounting for new speed */
- self->io->speed = speed;
-
- outb(IRCC_MASTER_RESET, iobase+IRCC_MASTER);
- outb(0x00, iobase+IRCC_MASTER);
-
- switch (speed) {
- default:
- IRDA_DEBUG(0, "%s(), unknown baud rate of %d\n", __FUNCTION__ ,
- speed);
- /* FALLTHROUGH */
- case 9600:
- case 19200:
- case 38400:
- case 57600:
- case 115200:
- ir_mode = IRCC_CFGA_IRDA_SIR_A;
- ctrl = 0;
- fast = 0;
- break;
- case 576000:
- ir_mode = IRCC_CFGA_IRDA_HDLC;
- ctrl = IRCC_CRC;
- fast = 0;
- IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __FUNCTION__ );
- break;
- case 1152000:
- ir_mode = IRCC_CFGA_IRDA_HDLC;
- ctrl = IRCC_1152 | IRCC_CRC;
- fast = 0;
- IRDA_DEBUG(0, "%s(), handling baud of 1152000\n", __FUNCTION__ );
- break;
- case 4000000:
- ir_mode = IRCC_CFGA_IRDA_4PPM;
- ctrl = IRCC_CRC;
- fast = IRCC_LCR_A_FAST;
- IRDA_DEBUG(0, "%s(), handling baud of 4000000\n", __FUNCTION__ );
- break;
- }
-
- register_bank(iobase, 0);
- outb(0, iobase+IRCC_IER);
- outb(IRCC_MASTER_INT_EN, iobase+IRCC_MASTER);
-
- /* Make special FIR init if necessary */
- if (speed > 115200) {
- /* No need to lock, already locked - Jean II */
- irport_stop(self->irport);
-
- /* Install FIR transmit handler */
- dev->hard_start_xmit = &ircc_hard_xmit;
-
- /*
- * Don't know why we have to do this, but FIR interrupts
- * stops working if we remove it.
- */
- /* outb(UART_MCR_OUT2, self->io->sir_base + UART_MCR); */
-
- /* Be ready for incoming frames */
- ircc_dma_receive(self, iobase);
- } else {
- /* Install SIR transmit handler */
- dev->hard_start_xmit = &irport_hard_xmit;
- /* No need to lock, already locked - Jean II */
- irport_start(self->irport);
-
- IRDA_DEBUG(0,
- "%s(), using irport to change speed to %d\n", __FUNCTION__ , speed);
- irport_change_speed(self->irport, speed);
- }
-
- register_bank(iobase, 1);
- outb(((inb(iobase+IRCC_SCE_CFGA) & 0x87) | ir_mode),
- iobase+IRCC_SCE_CFGA);
-
-#ifdef SMC_669 /* Uses pin 88/89 for Rx/Tx */
- outb(((inb(iobase+IRCC_SCE_CFGB) & 0x3f) | IRCC_CFGB_MUX_COM),
- iobase+IRCC_SCE_CFGB);
-#else
- outb(((inb(iobase+IRCC_SCE_CFGB) & 0x3f) | IRCC_CFGB_MUX_IR),
- iobase+IRCC_SCE_CFGB);
-#endif
- (void) inb(iobase+IRCC_FIFO_THRESHOLD);
- outb(64, iobase+IRCC_FIFO_THRESHOLD);
-
- register_bank(iobase, 4);
- outb((inb(iobase+IRCC_CONTROL) & 0x30) | ctrl, iobase+IRCC_CONTROL);
-
- register_bank(iobase, 0);
- outb(fast, iobase+IRCC_LCR_A);
-
- netif_start_queue(dev);
-}
-
-/*
- * Function ircc_hard_xmit (skb, dev)
- *
- * Transmit the frame!
- *
- */
-static int ircc_hard_xmit(struct sk_buff *skb, struct net_device *dev)
-{
- struct irport_cb *irport;
- struct ircc_cb *self;
- unsigned long flags;
- s32 speed;
- int iobase;
- int mtt;
-
- irport = (struct irport_cb *) dev->priv;
- self = (struct ircc_cb *) irport->priv;
- ASSERT(self != NULL, return 0;);
-
- iobase = self->io->fir_base;
-
- netif_stop_queue(dev);
-
- /* Make sure tests *& speed change are atomic */
- spin_lock_irqsave(&self->irport->lock, flags);
-
- /* Note : you should make sure that speed changes are not going
- * to corrupt any outgoing frame. Look at nsc-ircc for the gory
- * details - Jean II */
-
- /* Check if we need to change the speed after this frame */
- speed = irda_get_next_speed(skb);
- if ((speed != self->io->speed) && (speed != -1)) {
- /* Check for empty frame */
- if (!skb->len) {
- ircc_change_speed(self, speed);
- dev->trans_start = jiffies;
- spin_unlock_irqrestore(&self->irport->lock, flags);
- dev_kfree_skb(skb);
- return 0;
- } else
- self->new_speed = speed;
- }
-
- memcpy(self->tx_buff.head, skb->data, skb->len);
-
- self->tx_buff.len = skb->len;
- self->tx_buff.data = self->tx_buff.head;
-
- mtt = irda_get_mtt(skb);
- if (mtt) {
- int bofs;
-
- /*
- * Compute how many BOFs (STA or PA's) we need to waste the
- * min turn time given the speed of the link.
- */
- bofs = mtt * (self->io->speed / 1000) / 8000;
- if (bofs > 4095)
- bofs = 4095;
-
- ircc_dma_xmit(self, iobase, bofs);
- } else {
- /* Transmit frame */
- ircc_dma_xmit(self, iobase, 0);
- }
- dev->trans_start = jiffies;
- spin_unlock_irqrestore(&self->irport->lock, flags);
- dev_kfree_skb(skb);
-
- return 0;
-}
-
-/*
- * Function ircc_dma_xmit (self, iobase)
- *
- * Transmit data using DMA
- *
- */
-static void ircc_dma_xmit(struct ircc_cb *self, int iobase, int bofs)
-{
- u8 ctrl;
-
- IRDA_DEBUG(2, "%s\n", __FUNCTION__ );
-#if 0
- /* Disable Rx */
- register_bank(iobase, 0);
- outb(0x00, iobase+IRCC_LCR_B);
-#endif
- register_bank(iobase, 1);
- outb(inb(iobase+IRCC_SCE_CFGB) & ~IRCC_CFGB_DMA_ENABLE,
- iobase+IRCC_SCE_CFGB);
-
- self->io->direction = IO_XMIT;
-
- /* Set BOF additional count for generating the min turn time */
- register_bank(iobase, 4);
- outb(bofs & 0xff, iobase+IRCC_BOF_COUNT_LO);
- ctrl = inb(iobase+IRCC_CONTROL) & 0xf0;
- outb(ctrl | ((bofs >> 8) & 0x0f), iobase+IRCC_BOF_COUNT_HI);
-
- /* Set max Tx frame size */
- outb(self->tx_buff.len >> 8, iobase+IRCC_TX_SIZE_HI);
- outb(self->tx_buff.len & 0xff, iobase+IRCC_TX_SIZE_LO);
-
- /* Setup DMA controller (must be done after enabling chip DMA) */
- setup_dma(self->io->dma, self->tx_buff.data, self->tx_buff.len,
- DMA_TX_MODE);
-
- outb(UART_MCR_OUT2, self->io->sir_base + UART_MCR);
- /* Enable burst mode chip Tx DMA */
- register_bank(iobase, 1);
- outb(inb(iobase+IRCC_SCE_CFGB) | IRCC_CFGB_DMA_ENABLE |
- IRCC_CFGB_DMA_BURST, iobase+IRCC_SCE_CFGB);
-
- /* Enable interrupt */
- outb(IRCC_MASTER_INT_EN, iobase+IRCC_MASTER);
- register_bank(iobase, 0);
- outb(IRCC_IER_ACTIVE_FRAME | IRCC_IER_EOM, iobase+IRCC_IER);
-
- /* Enable transmit */
- outb(IRCC_LCR_B_SCE_TRANSMIT|IRCC_LCR_B_SIP_ENABLE, iobase+IRCC_LCR_B);
-}
-
-/*
- * Function ircc_dma_xmit_complete (self)
- *
- * The transfer of a frame in finished. This function will only be called
- * by the interrupt handler
- *
- */
-static void ircc_dma_xmit_complete(struct ircc_cb *self, int iobase)
-{
- IRDA_DEBUG(2, "%s\n", __FUNCTION__ );
-#if 0
- /* Disable Tx */
- register_bank(iobase, 0);
- outb(0x00, iobase+IRCC_LCR_B);
-#endif
- register_bank(self->io->fir_base, 1);
- outb(inb(self->io->fir_base+IRCC_SCE_CFGB) & ~IRCC_CFGB_DMA_ENABLE,
- self->io->fir_base+IRCC_SCE_CFGB);
-
- /* Check for underrrun! */
- register_bank(iobase, 0);
- if (inb(iobase+IRCC_LSR) & IRCC_LSR_UNDERRUN) {
- self->irport->stats.tx_errors++;
- self->irport->stats.tx_fifo_errors++;
-
- /* Reset error condition */
- register_bank(iobase, 0);
- outb(IRCC_MASTER_ERROR_RESET, iobase+IRCC_MASTER);
- outb(0x00, iobase+IRCC_MASTER);
- } else {
- self->irport->stats.tx_packets++;
- self->irport->stats.tx_bytes += self->tx_buff.len;
- }
-
- /* Check if it's time to change the speed */
- if (self->new_speed) {
- ircc_change_speed(self, self->new_speed);
- self->new_speed = 0;
- }
-
- netif_wake_queue(self->netdev);
-}
-
-/*
- * Function ircc_dma_receive (self)
- *
- * Get ready for receiving a frame. The device will initiate a DMA
- * if it starts to receive a frame.
- *
- */
-static int ircc_dma_receive(struct ircc_cb *self, int iobase)
-{
-#if 0
- /* Turn off chip DMA */
- register_bank(iobase, 1);
- outb(inb(iobase+IRCC_SCE_CFGB) & ~IRCC_CFGB_DMA_ENABLE,
- iobase+IRCC_SCE_CFGB);
-#endif
- setup_dma(self->io->dma, self->rx_buff.data, self->rx_buff.truesize,
- DMA_RX_MODE);
-
- /* Set max Rx frame size */
- register_bank(iobase, 4);
- outb((2050 >> 8) & 0x0f, iobase+IRCC_RX_SIZE_HI);
- outb(2050 & 0xff, iobase+IRCC_RX_SIZE_LO);
-
- self->io->direction = IO_RECV;
- self->rx_buff.data = self->rx_buff.head;
-
- /* Setup DMA controller */
-
- /* Enable receiver */
- register_bank(iobase, 0);
- outb(IRCC_LCR_B_SCE_RECEIVE | IRCC_LCR_B_SIP_ENABLE,
- iobase+IRCC_LCR_B);
-
- /* Enable burst mode chip Rx DMA */
- register_bank(iobase, 1);
- outb(inb(iobase+IRCC_SCE_CFGB) | IRCC_CFGB_DMA_ENABLE |
- IRCC_CFGB_DMA_BURST, iobase+IRCC_SCE_CFGB);
-
- return 0;
-}
-
-/*
- * Function ircc_dma_receive_complete (self)
- *
- * Finished with receiving frames
- *
- */
-static void ircc_dma_receive_complete(struct ircc_cb *self, int iobase)
-{
- struct sk_buff *skb;
- int len, msgcnt;
-
- IRDA_DEBUG(2, "%s\n", __FUNCTION__ );
-#if 0
- /* Disable Rx */
- register_bank(iobase, 0);
- outb(0x00, iobase+IRCC_LCR_B);
-#endif
- register_bank(iobase, 0);
- msgcnt = inb(iobase+IRCC_LCR_B) & 0x08;
-
- IRDA_DEBUG(2, "%s: dma count = %d\n", __FUNCTION__ ,
- get_dma_residue(self->io->dma));
-
- len = self->rx_buff.truesize - get_dma_residue(self->io->dma);
-
- /* Remove CRC */
- if (self->io->speed < 4000000)
- len -= 2;
- else
- len -= 4;
-
- if ((len < 2) || (len > 2050)) {
- WARNING("%s(), bogus len=%d\n", __FUNCTION__, len);
- return;
- }
- IRDA_DEBUG(2, "%s: msgcnt = %d, len=%d\n", __FUNCTION__ , msgcnt, len);
-
- skb = dev_alloc_skb(len+1);
- if (!skb) {
- WARNING("%s(), memory squeeze, dropping frame.\n", __FUNCTION__);
- return;
- }
- /* Make sure IP header gets aligned */
- skb_reserve(skb, 1);
-
- memcpy(skb_put(skb, len), self->rx_buff.data, len);
- self->irport->stats.rx_packets++;
- self->irport->stats.rx_bytes += len;
-
- skb->dev = self->netdev;
- skb->mac.raw = skb->data;
- skb->protocol = htons(ETH_P_IRDA);
- netif_rx(skb);
- self->netdev->last_rx = jiffies;
-}
-
-/*
- * Function ircc_interrupt (irq, dev_id, regs)
- *
- * An interrupt from the chip has arrived. Time to do some work
- *
- */
-static irqreturn_t ircc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-{
- struct net_device *dev = (struct net_device *) dev_id;
- struct irport_cb *irport;
- struct ircc_cb *self;
- int iobase, iir;
-
- if (dev == NULL) {
- printk(KERN_WARNING "%s: irq %d for unknown device.\n",
- driver_name, irq);
- return IRQ_NONE;
- }
- irport = (struct irport_cb *) dev->priv;
- ASSERT(irport != NULL, return IRQ_NONE;);
- self = (struct ircc_cb *) irport->priv;
- ASSERT(self != NULL, return IRQ_NONE;);
-
- /* Check if we should use the SIR interrupt handler */
- if (self->io->speed < 576000) {
- /* Will spinlock itself - Jean II */
- irport_interrupt(irq, dev_id, regs);
- return IRQ_HANDLED;
- }
- iobase = self->io->fir_base;
-
- spin_lock(&self->irport->lock);
-
- register_bank(iobase, 0);
- iir = inb(iobase+IRCC_IIR);
-
- /* Disable interrupts */
- outb(0, iobase+IRCC_IER);
-
- IRDA_DEBUG(2, "%s(), iir = 0x%02x\n", __FUNCTION__ , iir);
-
- if (iir & IRCC_IIR_EOM) {
- if (self->io->direction == IO_RECV)
- ircc_dma_receive_complete(self, iobase);
- else
- ircc_dma_xmit_complete(self, iobase);
-
- ircc_dma_receive(self, iobase);
- }
-
- /* Enable interrupts again */
- register_bank(iobase, 0);
- outb(IRCC_IER_ACTIVE_FRAME|IRCC_IER_EOM, iobase+IRCC_IER);
-
- spin_unlock(&self->irport->lock);
- return IRQ_HANDLED;
-}
-
-#if 0 /* unused */
-/*
- * Function ircc_is_receiving (self)
- *
- * Return TRUE is we are currently receiving a frame
- *
- */
-static int ircc_is_receiving(struct ircc_cb *self)
-{
- int status = FALSE;
- /* int iobase; */
-
- IRDA_DEBUG(0, "%s\n", __FUNCTION__ );
-
- ASSERT(self != NULL, return FALSE;);
-
- IRDA_DEBUG(0, "%s: dma count = %d\n", __FUNCTION__ ,
- get_dma_residue(self->io->dma));
-
- status = (self->rx_buff.state != OUTSIDE_FRAME);
-
- return status;
-}
-#endif /* unused */
-
-/*
- * Function ircc_net_open (dev)
- *
- * Start the device
- *
- */
-static int ircc_net_open(struct net_device *dev)
-{
- struct irport_cb *irport;
- struct ircc_cb *self;
- int iobase;
-
- IRDA_DEBUG(0, "%s\n", __FUNCTION__ );
-
- ASSERT(dev != NULL, return -1;);
- irport = (struct irport_cb *) dev->priv;
- self = (struct ircc_cb *) irport->priv;
-
- ASSERT(self != NULL, return 0;);
-
- iobase = self->io->fir_base;
-
- irport_net_open(dev); /* irport allocates the irq */
-
- /*
- * Always allocate the DMA channel after the IRQ,
- * and clean up on failure.
- */
- if (request_dma(self->io->dma, dev->name)) {
- irport_net_close(dev);
-
- WARNING("%s(), unable to allocate DMA=%d\n", __FUNCTION__, self->io->dma);
- return -EAGAIN;
- }
-
- return 0;
-}
-
-/*
- * Function ircc_net_close (dev)
- *
- * Stop the device
- *
- */
-static int ircc_net_close(struct net_device *dev)
-{
- struct irport_cb *irport;
- struct ircc_cb *self;
- int iobase;
-
- IRDA_DEBUG(0, "%s()\n", __FUNCTION__);
-
- ASSERT(dev != NULL, return -1;);
- irport = (struct irport_cb *) dev->priv;
- self = (struct ircc_cb *) irport->priv;
-
- ASSERT(self != NULL, return 0;);
-
- iobase = self->io->fir_base;
-
- irport_net_close(dev);
-
- disable_dma(self->io->dma);
-
- free_dma(self->io->dma);
-
- return 0;
-}
-
-static void ircc_suspend(struct ircc_cb *self)
-{
- MESSAGE("%s, Suspending\n", driver_name);
-
- if (self->io->suspended)
- return;
-
- ircc_net_close(self->netdev);
-
- self->io->suspended = 1;
-}
-
-static void ircc_wakeup(struct ircc_cb *self)
-{
- if (!self->io->suspended)
- return;
-
- /* The code was doing a "cli()" here, but this can't be right.
- * If you need protection, do it in net_open with a spinlock
- * or give a good reason. - Jean II */
-
- ircc_net_open(self->netdev);
-
- MESSAGE("%s, Waking up\n", driver_name);
-}
-
-static int ircc_pmproc(struct pm_dev *dev, pm_request_t rqst, void *data)
-{
- struct ircc_cb *self = (struct ircc_cb*) dev->data;
- if (self) {
- switch (rqst) {
- case PM_SUSPEND:
- ircc_suspend(self);
- break;
- case PM_RESUME:
- ircc_wakeup(self);
- break;
- }
- }
- return 0;
-}
-
-/*
- * Function ircc_close (self)
- *
- * Close driver instance
- *
- */
-static int __exit ircc_close(struct ircc_cb *self)
-{
- int iobase;
-
- IRDA_DEBUG(0, "%s\n", __FUNCTION__ );
-
- ASSERT(self != NULL, return -1;);
-
- iobase = self->irport->io.fir_base;
-
- if (self->pmdev)
- pm_unregister(self->pmdev);
-
- /* This will destroy irport */
- irport_close(self->irport);
-
- /* Stop interrupts */
- register_bank(iobase, 0);
- outb(0, iobase+IRCC_IER);
- outb(IRCC_MASTER_RESET, iobase+IRCC_MASTER);
- outb(0x00, iobase+IRCC_MASTER);
-#if 0
- /* Reset to SIR mode */
- register_bank(iobase, 1);
- outb(IRCC_CFGA_IRDA_SIR_A|IRCC_CFGA_TX_POLARITY, iobase+IRCC_SCE_CFGA);
- outb(IRCC_CFGB_IR, iobase+IRCC_SCE_CFGB);
-#endif
-
- /* Release the PORT that this driver is using */
- IRDA_DEBUG(0, "%s(), releasing 0x%03x\n", __FUNCTION__ , iobase);
-
- release_region(iobase, CHIP_IO_EXTENT);
-
- if (self->tx_buff.head)
- kfree(self->tx_buff.head);
-
- if (self->rx_buff.head)
- kfree(self->rx_buff.head);
-
- kfree(self);
-
- return 0;
-}
-
-static int __init smc_init(void)
-{
- return ircc_init();
-}
-
-void __exit smc_cleanup(void)
-{
- int i;
-
- IRDA_DEBUG(0, "%s\n", __FUNCTION__ );
-
- for (i=0; i < 2; i++) {
- if (dev_self[i])
- ircc_close(dev_self[i]);
- }
-}
-
-module_init(smc_init);
-module_exit(smc_cleanup);
-
-MODULE_AUTHOR("Thomas Davis <tadavis@jps.net>");
-MODULE_DESCRIPTION("SMC IrCC controller driver");
-MODULE_LICENSE("GPL");
-
-MODULE_PARM(ircc_dma, "1i");
-MODULE_PARM_DESC(ircc_dma, "DMA channel");
-MODULE_PARM(ircc_irq, "1i");
-MODULE_PARM_DESC(ircc_irq, "IRQ line");
-MODULE_PARM(ircc_fir, "1-4i");
-MODULE_PARM_DESC(ircc_fir, "FIR Base Address");
-MODULE_PARM(ircc_sir, "1-4i");
-MODULE_PARM_DESC(ircc_sir, "SIR Base Address");
-MODULE_PARM(ircc_cfg, "1-4i");
-MODULE_PARM_DESC(ircc_cfg, "Configuration register base address");
diff --git a/drivers/net/irda/toshoboe.c b/drivers/net/irda/toshoboe.c
deleted file mode 100644
index ab9a604f3887..000000000000
--- a/drivers/net/irda/toshoboe.c
+++ /dev/null
@@ -1,957 +0,0 @@
-/*********************************************************************
- *
- * Filename: toshoboe.c
- * Version: 0.1
- * Description: Driver for the Toshiba OBOE (or type-O or 700 or 701)
- * FIR Chipset.
- * Status: Experimental.
- * Author: James McKenzie <james@fishsoup.dhs.org>
- * Created at: Sat May 8 12:35:27 1999
- * Modified: Paul Bristow <paul.bristow@technologist.com>
- * Modified: Mon Nov 11 19:10:05 1999
- *
- * Copyright (c) 1999-2000 James McKenzie, All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * Neither James McKenzie nor Cambridge University admit liability nor
- * provide warranty for any of this software. This material is
- * provided "AS-IS" and at no charge.
- *
- * Applicable Models : Libretto 100CT. and many more
- * Toshiba refers to this chip as the type-O IR port.
- *
- ********************************************************************/
-
-/* This driver is experimental, I have only three ir devices */
-/* an olivetti notebook which doesn't have FIR, a toshiba libretto, and */
-/* an hp printer, this works fine at 4MBPS with my HP printer */
-
-static char *rcsid = "$Id: toshoboe.c,v 1.91 1999/06/29 14:21:06 root Exp $";
-
-/* Define this to have only one frame in the XMIT or RECV queue */
-/* Toshiba's drivers do this, but it disables back to back tansfers */
-/* I think that the chip may have some problems certainly, I have */
-/* seen it jump over tasks in the taskfile->xmit with this turned on */
-#define ONETASK
-
-/* To adjust the number of tasks in use edit toshoboe.h */
-
-/* Define this to enable FIR and MIR support */
-#define ENABLE_FAST
-
-/* Size of IO window */
-#define CHIP_IO_EXTENT 0x1f
-
-/* Transmit and receive buffer sizes, adjust at your peril */
-#define RX_BUF_SZ 4196
-#define TX_BUF_SZ 4196
-
-/* No user servicable parts below here */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/types.h>
-#include <linux/skbuff.h>
-#include <linux/netdevice.h>
-#include <linux/ioport.h>
-#include <linux/delay.h>
-#include <linux/slab.h>
-#include <linux/init.h>
-#include <linux/pci.h>
-#include <linux/rtnetlink.h>
-
-#include <asm/system.h>
-#include <asm/io.h>
-
-#include <net/irda/wrapper.h>
-#include <net/irda/irda.h>
-#include <net/irda/irda_device.h>
-
-#include <linux/pm.h>
-
-#include <net/irda/toshoboe.h>
-
-#define PCI_DEVICE_ID_FIR701b 0x0d01
-
-static struct pci_device_id toshoboe_pci_tbl[] = {
- { PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_FIR701, PCI_ANY_ID, PCI_ANY_ID, },
- { PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_FIR701b, PCI_ANY_ID, PCI_ANY_ID, },
- { } /* Terminating entry */
-};
-MODULE_DEVICE_TABLE(pci, toshoboe_pci_tbl);
-
-static const char *driver_name = "toshoboe";
-
-static int max_baud = 4000000;
-
-/* Shutdown the chip and point the taskfile reg somewhere else */
-static void
-toshoboe_stopchip (struct toshoboe_cb *self)
-{
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
-
- outb_p (0x0e, OBOE_REG_11);
-
- outb_p (0x00, OBOE_RST);
- outb_p (0x3f, OBOE_TFP2); /*Write the taskfile address */
- outb_p (0xff, OBOE_TFP1);
- outb_p (0xff, OBOE_TFP0);
- outb_p (0x0f, OBOE_REG_1B);
- outb_p (0xff, OBOE_REG_1A);
- outb_p (0x00, OBOE_ISR); /*FIXME: should i do this to disbale ints */
- outb_p (0x80, OBOE_RST);
- outb_p (0xe, OBOE_LOCK);
-
-}
-
-/*Set the baud rate */
-static void
-toshoboe_setbaud (struct toshoboe_cb *self, int baud)
-{
- unsigned long flags;
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
-
- printk (KERN_WARNING "ToshOboe: setting baud to %d\n", baud);
-
- save_flags (flags);
- cli ();
- switch (baud)
- {
- case 2400:
- outb_p (OBOE_PMDL_SIR, OBOE_PMDL);
- outb_p (OBOE_SMDL_SIR, OBOE_SMDL);
- outb_p (0xbf, OBOE_UDIV);
- break;
- case 4800:
- outb_p (OBOE_PMDL_SIR, OBOE_PMDL);
- outb_p (OBOE_SMDL_SIR, OBOE_SMDL);
- outb_p (0x5f, OBOE_UDIV);
- break;
- case 9600:
- outb_p (OBOE_PMDL_SIR, OBOE_PMDL);
- outb_p (OBOE_SMDL_SIR, OBOE_SMDL);
- outb_p (0x2f, OBOE_UDIV);
- break;
- case 19200:
- outb_p (OBOE_PMDL_SIR, OBOE_PMDL);
- outb_p (OBOE_SMDL_SIR, OBOE_SMDL);
- outb_p (0x17, OBOE_UDIV);
- break;
- case 38400:
- outb_p (OBOE_PMDL_SIR, OBOE_PMDL);
- outb_p (OBOE_SMDL_SIR, OBOE_SMDL);
- outb_p (0xb, OBOE_UDIV);
- break;
- case 57600:
- outb_p (OBOE_PMDL_SIR, OBOE_PMDL);
- outb_p (OBOE_SMDL_SIR, OBOE_SMDL);
- outb_p (0x7, OBOE_UDIV);
- break;
- case 115200:
- outb_p (OBOE_PMDL_SIR, OBOE_PMDL);
- outb_p (OBOE_SMDL_SIR, OBOE_SMDL);
- outb_p (0x3, OBOE_UDIV);
- break;
- case 1152000:
- outb_p (OBOE_PMDL_MIR, OBOE_PMDL);
- outb_p (OBOE_SMDL_MIR, OBOE_SMDL);
- outb_p (0x1, OBOE_UDIV);
- break;
- case 4000000:
- outb_p (OBOE_PMDL_FIR, OBOE_PMDL);
- outb_p (OBOE_SMDL_FIR, OBOE_SMDL);
- outb_p (0x0, OBOE_UDIV);
- break;
- }
-
- restore_flags (flags);
-
- outb_p (0x00, OBOE_RST);
- outb_p (0x80, OBOE_RST);
- outb_p (0x01, OBOE_REG_9);
-
- self->io.speed = baud;
-}
-
-/* Wake the chip up and get it looking at the taskfile */
-static void
-toshoboe_startchip (struct toshoboe_cb *self)
-{
- __u32 physaddr;
-
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
-
-
- outb_p (0, OBOE_LOCK);
- outb_p (0, OBOE_RST);
- outb_p (OBOE_NTR_VAL, OBOE_NTR);
- outb_p (0xf0, OBOE_REG_D);
- outb_p (0xff, OBOE_ISR);
- outb_p (0x0f, OBOE_REG_1B);
- outb_p (0xff, OBOE_REG_1A);
-
-
- physaddr = virt_to_bus (self->taskfile);
-
- outb_p ((physaddr >> 0x0a) & 0xff, OBOE_TFP0);
- outb_p ((physaddr >> 0x12) & 0xff, OBOE_TFP1);
- outb_p ((physaddr >> 0x1a) & 0x3f, OBOE_TFP2);
-
- outb_p (0x0e, OBOE_REG_11);
- outb_p (0x80, OBOE_RST);
-
- toshoboe_setbaud (self, 9600);
-
-}
-
-/*Let the chip look at memory */
-static void
-toshoboe_enablebm (struct toshoboe_cb *self)
-{
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
- pci_set_master (self->pdev);
-}
-
-/*Don't let the chip look at memory */
-static void
-toshoboe_disablebm (struct toshoboe_cb *self)
-{
- __u8 command;
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
-
- pci_read_config_byte (self->pdev, PCI_COMMAND, &command);
- command &= ~PCI_COMMAND_MASTER;
- pci_write_config_byte (self->pdev, PCI_COMMAND, command);
-
-}
-
-/*setup the taskfile */
-static void
-toshoboe_initbuffs (struct toshoboe_cb *self)
-{
- int i;
- unsigned long flags;
-
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
-
- save_flags (flags);
- cli ();
-
- for (i = 0; i < TX_SLOTS; ++i)
- {
- self->taskfile->xmit[i].len = 0;
- self->taskfile->xmit[i].control = 0x00;
- self->taskfile->xmit[i].buffer = virt_to_bus (self->xmit_bufs[i]);
- }
-
- for (i = 0; i < RX_SLOTS; ++i)
- {
- self->taskfile->recv[i].len = 0;
- self->taskfile->recv[i].control = 0x83;
- self->taskfile->recv[i].buffer = virt_to_bus (self->recv_bufs[i]);
- }
-
- restore_flags (flags);
-}
-
-/*Transmit something */
-static int
-toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev)
-{
- struct toshoboe_cb *self;
- __s32 speed;
- int mtt, len;
-
- self = (struct toshoboe_cb *) dev->priv;
-
- ASSERT (self != NULL, return 0;
- );
-
- /* Check if we need to change the speed */
- speed = irda_get_next_speed(skb);
- if ((speed != self->io.speed) && (speed != -1)) {
- /* Check for empty frame */
- if (!skb->len) {
- toshoboe_setbaud(self, speed);
- dev_kfree_skb(skb);
- return 0;
- } else
- self->new_speed = speed;
- }
-
- netif_stop_queue(dev);
-
- if (self->stopped) {
- dev_kfree_skb(skb);
- return 0;
- }
-
-#ifdef ONETASK
- if (self->txpending)
- return -EBUSY;
-
- self->txs = inb_p (OBOE_XMTT) - OBOE_XMTT_OFFSET;
-
- self->txs &= 0x3f;
-
-#endif
-
- if (self->taskfile->xmit[self->txs].control)
- return -EBUSY;
-
-
- if (inb_p (OBOE_RST) & OBOE_RST_WRAP)
- {
- len = async_wrap_skb (skb, self->xmit_bufs[self->txs], TX_BUF_SZ);
- }
- else
- {
- len = skb->len;
- memcpy (self->xmit_bufs[self->txs], skb->data, len);
- }
- self->taskfile->xmit[self->txs].len = len & 0x0fff;
-
-
-
- outb_p (0, OBOE_RST);
- outb_p (0x1e, OBOE_REG_11);
-
- self->taskfile->xmit[self->txs].control = 0x84;
-
- mtt = irda_get_mtt (skb);
- if (mtt)
- udelay (mtt);
-
- self->txpending++;
-
- /*FIXME: ask about busy,media_busy stuff, for the moment */
- /*busy means can't queue any more */
-#ifndef ONETASK
- if (self->txpending != TX_SLOTS)
- {
- netif_wake_queue(dev);
- }
-#endif
-
- outb_p (0x80, OBOE_RST);
- outb_p (1, OBOE_REG_9);
-
- self->txs++;
- self->txs %= TX_SLOTS;
-
- dev_kfree_skb (skb);
-
- return 0;
-}
-
-/*interrupt handler */
-static irqreturn_t
-toshoboe_interrupt (int irq, void *dev_id, struct pt_regs *regs)
-{
- struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id;
- __u8 irqstat;
- struct sk_buff *skb;
-
- if (self == NULL)
- {
- printk (KERN_WARNING "%s: irq %d for unknown device.\n",
- driver_name, irq);
- return IRQ_NONE;
- }
-
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
-
- irqstat = inb_p (OBOE_ISR);
-
-/* woz it us */
- if (!(irqstat & 0xf8))
- return IRQ_NONE;
-
- outb_p (irqstat, OBOE_ISR); /*Acknologede it */
-
-
-/* Txdone */
- if (irqstat & OBOE_ISR_TXDONE)
- {
- self->txpending--;
-
- self->stats.tx_packets++;
-
- if (self->new_speed) {
- toshoboe_setbaud(self, self->new_speed);
-
- self->new_speed = 0;
- }
- /* Tell network layer that we want more frames */
- netif_wake_queue(self->netdev);
- }
-
- if (irqstat & OBOE_ISR_RXDONE)
- {
-
-#ifdef ONETASK
- self->rxs = inb_p (OBOE_RCVT);
- self->rxs += (RX_SLOTS - 1);
- self->rxs %= RX_SLOTS;
-#else
- while (self->taskfile->recv[self->rxs].control == 0)
-#endif
- {
- int len = self->taskfile->recv[self->rxs].len;
-
- if (len > 2)
- len -= 2;
-
- skb = dev_alloc_skb (len + 1);
- if (skb)
- {
- skb_reserve (skb, 1);
-
- skb_put (skb, len);
- memcpy (skb->data, self->recv_bufs[self->rxs], len);
-
- self->stats.rx_packets++;
- skb->dev = self->netdev;
- skb->mac.raw = skb->data;
- skb->protocol = htons (ETH_P_IRDA);
- }
- else
- {
- printk (KERN_INFO
- "%s(), memory squeeze, dropping frame.\n", __FUNCTION__);
- }
-
- self->taskfile->recv[self->rxs].control = 0x83;
- self->taskfile->recv[self->rxs].len = 0x0;
-
- self->rxs++;
- self->rxs %= RX_SLOTS;
-
- if (skb) {
- netif_rx (skb);
- self->netdev->last_rx = jiffies;
- }
-
- }
-
- }
-
- if (irqstat & OBOE_ISR_20)
- {
- printk (KERN_WARNING "Oboe_irq: 20\n");
- }
- if (irqstat & OBOE_ISR_10)
- {
- printk (KERN_WARNING "Oboe_irq: 10\n");
- }
- if (irqstat & 0x8)
- {
- /*FIXME: I think this is a TX or RX error of some sort */
-
- self->stats.tx_errors++;
- self->stats.rx_errors++;
-
- }
- return IRQ_HANDLED;
-}
-
-static int
-toshoboe_net_init (struct net_device *dev)
-{
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
-
- /* Setup to be a normal IrDA network device driver */
- irda_device_setup (dev);
-
- /* Insert overrides below this line! */
- return 0;
-}
-
-
-static void
-toshoboe_initptrs (struct toshoboe_cb *self)
-{
-
- unsigned long flags;
- save_flags (flags);
- cli ();
-
- /*FIXME: need to test this carefully to check which one */
- /*of the two possible startup logics the chip uses */
- /*although it won't make any difference if no-one xmits durining init */
- /*and none what soever if using ONETASK */
-
- self->rxs = inb_p (OBOE_RCVT);
- self->txs = inb_p (OBOE_XMTT) - OBOE_XMTT_OFFSET;
-
-#if 0
- self->rxs = 0;
- self->txs = 0;
-#endif
-#if 0
- self->rxs = RX_SLOTS - 1;
- self->txs = 0;
-#endif
-
-
- self->txpending = 0;
-
- restore_flags (flags);
-
-}
-
-
-static int
-toshoboe_net_open (struct net_device *dev)
-{
- struct toshoboe_cb *self;
- char hwname[32];
-
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
-
- ASSERT (dev != NULL, return -1;
- );
- self = (struct toshoboe_cb *) dev->priv;
-
- ASSERT (self != NULL, return 0;
- );
-
- if (self->stopped)
- return 0;
-
- if (request_irq (self->io.irq, toshoboe_interrupt,
- SA_SHIRQ | SA_INTERRUPT, dev->name, (void *) self))
- {
-
- return -EAGAIN;
- }
-
- toshoboe_initbuffs (self);
- toshoboe_enablebm (self);
- toshoboe_startchip (self);
- toshoboe_initptrs (self);
-
- /* Ready to play! */
- netif_start_queue(dev);
- /* Give self a hardware name */
- sprintf(hwname, "Toshiba-FIR @ 0x%03x", self->base);
- /*
- * Open new IrLAP layer instance, now that everything should be
- * initialized properly
- */
- self->irlap = irlap_open(dev, &self->qos, hwname);
-
- self->open = 1;
-
- MOD_INC_USE_COUNT;
-
- return 0;
-
-}
-
-static int
-toshoboe_net_close (struct net_device *dev)
-{
- struct toshoboe_cb *self;
-
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
-
- ASSERT (dev != NULL, return -1;
- );
- self = (struct toshoboe_cb *) dev->priv;
-
- /* Stop device */
- netif_stop_queue(dev);
-
- /* Stop and remove instance of IrLAP */
- if (self->irlap)
- irlap_close(self->irlap);
- self->irlap = NULL;
-
- self->open = 0;
-
- free_irq (self->io.irq, (void *) self);
-
- if (!self->stopped)
- {
- toshoboe_stopchip (self);
- toshoboe_disablebm (self);
- }
-
- MOD_DEC_USE_COUNT;
-
- return 0;
-
-}
-
-/*
- * Function toshoboe_net_ioctl (dev, rq, cmd)
- *
- * Process IOCTL commands for this device
- *
- */
-static int toshoboe_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
-{
- struct if_irda_req *irq = (struct if_irda_req *) rq;
- struct toshoboe_cb *self;
- unsigned long flags;
- int ret = 0;
-
- ASSERT(dev != NULL, return -1;);
-
- self = dev->priv;
-
- ASSERT(self != NULL, return -1;);
-
- IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__ , dev->name, cmd);
-
- /* Disable interrupts & save flags */
- save_flags(flags);
- cli();
- switch (cmd) {
- case SIOCSBANDWIDTH: /* Set bandwidth */
- if (!capable(CAP_NET_ADMIN)) {
- ret = -EPERM;
- goto out;
- }
- /* toshoboe_setbaud(self, irq->ifr_baudrate); */
- /* Just change speed once - inserted by Paul Bristow */
- self->new_speed = irq->ifr_baudrate;
- break;
- case SIOCSMEDIABUSY: /* Set media busy */
- if (!capable(CAP_NET_ADMIN)) {
- ret = -EPERM;
- goto out;
- }
- irda_device_set_media_busy(self->netdev, TRUE);
- break;
- case SIOCGRECEIVING: /* Check if we are receiving right now */
- irq->ifr_receiving = 0; /* Can't tell */
- break;
- default:
- ret = -EOPNOTSUPP;
- }
-out:
- restore_flags(flags);
- return ret;
-}
-
-MODULE_DESCRIPTION("Toshiba OBOE IrDA Device Driver");
-MODULE_AUTHOR("James McKenzie <james@fishsoup.dhs.org>");
-MODULE_LICENSE("GPL");
-
-MODULE_PARM (max_baud, "i");
-MODULE_PARM_DESC(max_baus, "Maximum baud rate");
-
-static void
-toshoboe_remove (struct pci_dev *pci_dev)
-{
- int i;
- struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
-
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
-
- ASSERT (self != NULL, return;
- );
-
- if (!self->stopped)
- {
- toshoboe_stopchip (self);
- toshoboe_disablebm (self);
- }
-
- release_region (self->io.sir_base, self->io.sir_ext);
-
-
- for (i = 0; i < TX_SLOTS; ++i)
- {
- kfree (self->xmit_bufs[i]);
- self->xmit_bufs[i] = NULL;
- }
-
- for (i = 0; i < RX_SLOTS; ++i)
- {
- kfree (self->recv_bufs[i]);
- self->recv_bufs[i] = NULL;
- }
-
- if (self->netdev)
- unregister_netdev(self->netdev);
-
- kfree (self->taskfilebuf);
- self->taskfilebuf = NULL;
- self->taskfile = NULL;
-
- return;
-
-}
-
-static int
-toshoboe_probe (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
-{
- struct toshoboe_cb *self;
- struct net_device *dev;
- int i = 0;
- int ok = 0;
- int err;
-
- IRDA_DEBUG (4, "%s()\n", __FUNCTION__ );
-
- if ((err=pci_enable_device(pci_dev)))
- return err;
-
- self = kmalloc (sizeof (struct toshoboe_cb), GFP_KERNEL);
-
- if (self == NULL)
- {
- printk (KERN_ERR "IrDA: Can't allocate memory for "
- "IrDA control block!\n");
- return -ENOMEM;
- }
-
- memset (self, 0, sizeof (struct toshoboe_cb));
-
- self->open = 0;
- self->stopped = 0;
- self->pdev = pci_dev;
- self->base = pci_resource_start(pci_dev,0);
-
- self->io.sir_base = self->base;
- self->io.irq = pci_dev->irq;
- self->io.sir_ext = CHIP_IO_EXTENT;
- self->io.speed = 9600;
-
- /* Lock the port that we need */
- if (NULL==request_region (self->io.sir_base, self->io.sir_ext, driver_name))
- {
- IRDA_DEBUG (0, "%s(), can't get iobase of 0x%03x\n", __FUNCTION__ ,
- self->io.sir_base);
-
- err = -EBUSY;
- goto freeself;
- }
-
- irda_init_max_qos_capabilies (&self->qos);
- self->qos.baud_rate.bits = 0;
-
- if (max_baud >= 2400)
- self->qos.baud_rate.bits |= IR_2400;
- /*if (max_baud>=4800) idev->qos.baud_rate.bits|=IR_4800; */
- if (max_baud >= 9600)
- self->qos.baud_rate.bits |= IR_9600;
- if (max_baud >= 19200)
- self->qos.baud_rate.bits |= IR_19200;
- if (max_baud >= 115200)
- self->qos.baud_rate.bits |= IR_115200;
-#ifdef ENABLE_FAST
- if (max_baud >= 576000)
- self->qos.baud_rate.bits |= IR_576000;
- if (max_baud >= 1152000)
- self->qos.baud_rate.bits |= IR_1152000;
- if (max_baud >= 4000000)
- self->qos.baud_rate.bits |= (IR_4000000 << 8);
-#endif
-
-
- self->qos.min_turn_time.bits = 0xff; /*FIXME: what does this do? */
-
- irda_qos_bits_to_value (&self->qos);
-
- self->flags = IFF_SIR | IFF_DMA | IFF_PIO;
-
-#ifdef ENABLE_FAST
- if (max_baud >= 576000)
- self->flags |= IFF_FIR;
-#endif
-
- /* Now setup the endless buffers we need */
-
- self->txs = 0;
- self->rxs = 0;
-
- self->taskfilebuf = kmalloc (OBOE_TASK_BUF_LEN, GFP_KERNEL);
- if (!self->taskfilebuf)
- {
- printk (KERN_ERR "toshoboe: kmalloc for DMA failed()\n");
- err = -ENOMEM;
- goto freeregion;
- }
-
-
- memset (self->taskfilebuf, 0, OBOE_TASK_BUF_LEN);
-
- /*We need to align the taskfile on a taskfile size boundary */
- {
- __u32 addr;
-
- addr = (__u32) self->taskfilebuf;
- addr &= ~(sizeof (struct OboeTaskFile) - 1);
- addr += sizeof (struct OboeTaskFile);
-
- self->taskfile = (struct OboeTaskFile *) addr;
- }
-
- for (i = 0; i < TX_SLOTS; ++i)
- {
- self->xmit_bufs[i] = kmalloc (TX_BUF_SZ, GFP_KERNEL | GFP_DMA);
- if (self->xmit_bufs[i])
- ok++;
- }
-
- for (i = 0; i < RX_SLOTS; ++i)
- {
- self->recv_bufs[i] = kmalloc (TX_BUF_SZ, GFP_KERNEL | GFP_DMA);
- if (self->recv_bufs[i])
- ok++;
- }
-
- if (ok != RX_SLOTS + TX_SLOTS)
- {
- printk (KERN_ERR "toshoboe: kmalloc for buffers failed()\n");
- err = -ENOMEM;
- goto freebufs;
-
- }
-
-
- if (!(dev = dev_alloc("irda%d", &err))) {
- ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__);
- err = -ENOMEM;
- goto freebufs;
- }
- dev->priv = (void *) self;
- self->netdev = dev;
-
- MESSAGE("IrDA: Registered device %s\n", dev->name);
-
- dev->init = toshoboe_net_init;
- dev->hard_start_xmit = toshoboe_hard_xmit;
- dev->open = toshoboe_net_open;
- dev->stop = toshoboe_net_close;
- dev->do_ioctl = toshoboe_net_ioctl;
-
- rtnl_lock();
- err = register_netdevice(dev);
- rtnl_unlock();
- if (err) {
- ERROR("%s(), register_netdev() failed!\n", __FUNCTION__);
- /* XXX there is not freeing for dev? */
- goto freebufs;
- }
- pci_set_drvdata(pci_dev,self);
-
- printk (KERN_WARNING "ToshOboe: Using ");
-#ifdef ONETASK
- printk ("single");
-#else
- printk ("multiple");
-#endif
- printk (" tasks, version %s\n", rcsid);
-
- return (0);
-freebufs:
- for (i = 0; i < TX_SLOTS; ++i)
- if (self->xmit_bufs[i])
- kfree (self->xmit_bufs[i]);
- for (i = 0; i < RX_SLOTS; ++i)
- if (self->recv_bufs[i])
- kfree (self->recv_bufs[i]);
- kfree(self->taskfilebuf);
-freeregion:
- release_region (self->io.sir_base, self->io.sir_ext);
-freeself:
- kfree (self);
- return err;
-}
-
-static int
-toshoboe_suspend (struct pci_dev *pci_dev, u32 crap)
-{
- int i = 10;
- struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
-
- printk (KERN_WARNING "ToshOboe: suspending\n");
-
- if (!self || self->stopped)
- return 0;
-
- self->stopped = 1;
-
- if (!self->open)
- return 0;
-
-/*FIXME: can't sleep here wait one second */
-
- while ((i--) && (self->txpending))
- udelay (100);
-
- toshoboe_stopchip (self);
- toshoboe_disablebm (self);
-
- self->txpending = 0;
- return 0;
-}
-
-
-static int
-toshoboe_resume (struct pci_dev *pci_dev)
-{
- struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
- unsigned long flags;
-
- if (!self)
- return 0;
-
- if (!self->stopped)
- return 0;
-
- if (!self->open)
- {
- self->stopped = 0;
- return 0;
- }
-
- save_flags (flags);
- cli ();
-
- toshoboe_initbuffs (self);
- toshoboe_enablebm (self);
- toshoboe_startchip (self);
-
- toshoboe_setbaud (self, self->io.speed);
-
- toshoboe_initptrs (self);
-
- netif_wake_queue(self->netdev);
- restore_flags (flags);
- printk (KERN_WARNING "ToshOboe: waking up\n");
- return 0;
-}
-
-static struct pci_driver toshoboe_pci_driver = {
- .name = "toshoboe",
- .id_table = toshoboe_pci_tbl,
- .probe = toshoboe_probe,
- .remove = toshoboe_remove,
- .suspend = toshoboe_suspend,
- .resume = toshoboe_resume
-};
-
-int __init
-toshoboe_init (void)
-{
- return pci_module_init(&toshoboe_pci_driver);
-}
-
-void
-toshoboe_cleanup (void)
-{
- pci_unregister_driver(&toshoboe_pci_driver);
-}
-
-module_init(toshoboe_init);
-module_exit(toshoboe_cleanup);
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index 66b133fdccbf..a6e100b51799 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -94,7 +94,6 @@ static irqreturn_t via_ircc_interrupt(int irq, void *dev_id,
static int via_ircc_is_receiving(struct via_ircc_cb *self);
static int via_ircc_read_dongle_id(int iobase);
-static int via_ircc_net_init(struct net_device *dev);
static int via_ircc_net_open(struct net_device *dev);
static int via_ircc_net_close(struct net_device *dev);
static int via_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq,
@@ -330,18 +329,19 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
{
struct net_device *dev;
struct via_ircc_cb *self;
- int ret;
int err;
if ((via_ircc_setup(info, id)) == -1)
return -1;
/* Allocate new instance of the driver */
- self = kmalloc(sizeof(struct via_ircc_cb), GFP_KERNEL);
- if (self == NULL) {
+ dev = alloc_netdev(sizeof(struct via_ircc_cb), "irda%d",
+ irda_device_setup);
+ if (dev == NULL)
return -ENOMEM;
- }
- memset(self, 0, sizeof(struct via_ircc_cb));
+
+ self = dev->priv;
+ self->netdev = dev;
spin_lock_init(&self->lock);
/* Need to store self somewhere */
@@ -360,14 +360,12 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
self->RxDataReady = 0;
/* Reserve the ioports that we need */
- ret = check_region(self->io.fir_base, self->io.fir_ext);
- if (ret < 0) {
+ if (!request_region(self->io.fir_base, self->io.fir_ext, driver_name)) {
// WARNING(__FUNCTION__ "(), can't get iobase of 0x%03x\n",self->io.fir_base);
- dev_self[i] = NULL;
- kfree(self);
- return -ENODEV;
+ err = -ENODEV;
+ goto err_out1;
}
- request_region(self->io.fir_base, self->io.fir_ext, driver_name);
+
/* Initialize QoS for this device */
irda_init_max_qos_capabilies(&self->qos);
/* The only value we must override it the baudrate */
@@ -391,17 +389,16 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
self->rx_buff.head =
(__u8 *) kmalloc(self->rx_buff.truesize, GFP_KERNEL | GFP_DMA);
if (self->rx_buff.head == NULL) {
- kfree(self);
- return -ENOMEM;
+ err = -ENOMEM;
+ goto err_out2;
}
memset(self->rx_buff.head, 0, self->rx_buff.truesize);
self->tx_buff.head =
(__u8 *) kmalloc(self->tx_buff.truesize, GFP_KERNEL | GFP_DMA);
if (self->tx_buff.head == NULL) {
- kfree(self->rx_buff.head);
- kfree(self);
- return -ENOMEM;
+ err = -ENOMEM;
+ goto err_out3;
}
memset(self->tx_buff.head, 0, self->tx_buff.truesize);
@@ -414,30 +411,20 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
self->tx_fifo.len = self->tx_fifo.ptr = self->tx_fifo.free = 0;
self->tx_fifo.tail = self->tx_buff.head;
- if (!(dev = dev_alloc("irda%d", &err))) {
- kfree(self->tx_buff.head);
- kfree(self->rx_buff.head);
- kfree(self);
- return -ENOMEM;
- }
-
- dev->priv = (void *) self;
- self->netdev = dev;
+ /* Keep track of module usage */
+ SET_MODULE_OWNER(dev);
/* Override the network functions we need to use */
- dev->init = via_ircc_net_init;
dev->hard_start_xmit = via_ircc_hard_xmit_sir;
dev->open = via_ircc_net_open;
dev->stop = via_ircc_net_close;
dev->do_ioctl = via_ircc_net_ioctl;
dev->get_stats = via_ircc_net_get_stats;
- rtnl_lock();
- err = register_netdevice(dev);
- rtnl_unlock();
- if (err) {
- return -1;
- }
+ err = register_netdev(dev);
+ if (err)
+ goto err_out4;
+
MESSAGE("IrDA: Registered device %s\n", dev->name);
/* Check if user has supplied the dongle id or not */
@@ -448,6 +435,16 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
self->io.dongle_id);
return 0;
+ err_out4:
+ kfree(self->tx_buff.head);
+ err_out3:
+ kfree(self->rx_buff.head);
+ err_out2:
+ release_region(self->io.fir_base, self->io.fir_ext);
+ err_out1:
+ free_netdev(dev);
+ dev_self[i] = NULL;
+ return err;
}
/*
@@ -468,11 +465,7 @@ static int __exit via_ircc_close(struct via_ircc_cb *self)
ResetChip(iobase, 5); //hardware reset.
/* Remove netdevice */
- if (self->netdev) {
- rtnl_lock();
- unregister_netdevice(self->netdev);
- rtnl_unlock();
- }
+ unregister_netdev(self->netdev);
/* Release the PORT that this driver is using */
IRDA_DEBUG(4, "%s(), Releasing Region %03x\n",
@@ -483,7 +476,8 @@ static int __exit via_ircc_close(struct via_ircc_cb *self)
if (self->rx_buff.head)
kfree(self->rx_buff.head);
dev_self[self->index] = NULL;
- kfree(self);
+
+ free_netdev(self->netdev);
return 0;
}
@@ -1456,26 +1450,6 @@ static int via_ircc_is_receiving(struct via_ircc_cb *self)
return status;
}
-/*
- * Function via_ircc_net_init (dev)
- *
- * Initialize network device
- *
- */
-static int via_ircc_net_init(struct net_device *dev)
-{
- IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
-
- /* Keep track of module usage */
- SET_MODULE_OWNER(dev);
-
- /* Setup to be a normal IrDA network device driver */
- irda_device_setup(dev);
-
- /* Insert overrides below this line! */
-
- return 0;
-}
/*
* Function via_ircc_net_open (dev)
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index f23ce614504b..ea5cfd850485 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -99,7 +99,6 @@ static void w83977af_dma_write(struct w83977af_ir *self, int iobase);
static void w83977af_change_speed(struct w83977af_ir *self, __u32 speed);
static int w83977af_is_receiving(struct w83977af_ir *self);
-static int w83977af_net_init(struct net_device *dev);
static int w83977af_net_open(struct net_device *dev);
static int w83977af_net_close(struct net_device *dev);
static int w83977af_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
@@ -171,14 +170,16 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq,
/*
* Allocate new instance of the driver
*/
- self = kmalloc(sizeof(struct w83977af_ir), GFP_KERNEL);
- if (self == NULL) {
+ dev = alloc_netdev(sizeof(struct w83977af_ir), "irda%d",
+ irda_device_setup);
+ if (dev == NULL) {
printk( KERN_ERR "IrDA: Can't allocate memory for "
"IrDA control block!\n");
err = -ENOMEM;
goto err_out;
}
- memset(self, 0, sizeof(struct w83977af_ir));
+
+ self = dev->priv;
spin_lock_init(&self->lock);
@@ -230,29 +231,21 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq,
self->rx_buff.state = OUTSIDE_FRAME;
self->tx_buff.data = self->tx_buff.head;
self->rx_buff.data = self->rx_buff.head;
-
- if (!(dev = dev_alloc("irda%d", &err))) {
- ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__);
- err = -ENOMEM;
- goto err_out3;
- }
- dev->priv = (void *) self;
self->netdev = dev;
+ /* Keep track of module usage */
+ SET_MODULE_OWNER(dev);
+
/* Override the network functions we need to use */
- dev->init = w83977af_net_init;
dev->hard_start_xmit = w83977af_hard_xmit;
dev->open = w83977af_net_open;
dev->stop = w83977af_net_close;
dev->do_ioctl = w83977af_net_ioctl;
dev->get_stats = w83977af_net_get_stats;
- rtnl_lock();
- err = register_netdevice(dev);
- rtnl_unlock();
+ err = register_netdev(dev);
if (err) {
ERROR("%s(), register_netdevice() failed!\n", __FUNCTION__);
- err = -1;
goto err_out3;
}
MESSAGE("IrDA: Registered device %s\n", dev->name);
@@ -266,7 +259,7 @@ err_out3:
err_out2:
kfree(self->rx_buff.head);
err_out1:
- kfree(self);
+ free_netdev(dev);
err_out:
release_region(iobase, CHIP_IO_EXTENT);
return err;
@@ -299,8 +292,7 @@ static int w83977af_close(struct w83977af_ir *self)
#endif /* CONFIG_USE_W977_PNP */
/* Remove netdevice */
- if (self->netdev)
- unregister_netdev(self->netdev);
+ unregister_netdev(self->netdev);
/* Release the PORT that this driver is using */
IRDA_DEBUG(0 , "%s(), Releasing Region %03x\n",
@@ -313,7 +305,7 @@ static int w83977af_close(struct w83977af_ir *self)
if (self->rx_buff.head)
kfree(self->rx_buff.head);
- kfree(self);
+ free_netdev(self->netdev);
return 0;
}
@@ -1187,28 +1179,6 @@ static int w83977af_is_receiving(struct w83977af_ir *self)
}
/*
- * Function w83977af_net_init (dev)
- *
- *
- *
- */
-static int w83977af_net_init(struct net_device *dev)
-{
- IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
-
- /* Keep track of module usage */
- SET_MODULE_OWNER(dev);
-
- /* Set up to be a normal IrDA network device driver */
- irda_device_setup(dev);
-
- /* Insert overrides below this line! */
-
- return 0;
-}
-
-
-/*
* Function w83977af_net_open (dev)
*
* Start the device
diff --git a/drivers/net/lance.c b/drivers/net/lance.c
index 56cc884228a8..a6862d60c398 100644
--- a/drivers/net/lance.c
+++ b/drivers/net/lance.c
@@ -543,7 +543,7 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
if (dev->irq >= 2)
printk(" assigned IRQ %d", dev->irq);
else if (lance_version != 0) { /* 7990 boards need DMA detection first. */
- unsigned long irq_mask, delay;
+ unsigned long irq_mask;
/* To auto-IRQ we enable the initialization-done and DMA error
interrupts. For ISA boards we get a DMA error, but VLB and PCI
@@ -553,8 +553,7 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
/* Trigger an initialization just for the interrupt. */
outw(0x0041, ioaddr+LANCE_DATA);
- delay = jiffies + HZ/50;
- while (time_before(jiffies, delay)) ;
+ mdelay(20);
dev->irq = probe_irq_off(irq_mask);
if (dev->irq)
printk(", probed IRQ %d", dev->irq);
@@ -621,13 +620,12 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
if (lance_version == 0 && dev->irq == 0) {
/* We may auto-IRQ now that we have a DMA channel. */
/* Trigger an initialization just for the interrupt. */
- unsigned long irq_mask, delay;
+ unsigned long irq_mask;
irq_mask = probe_irq_on();
outw(0x0041, ioaddr+LANCE_DATA);
- delay = jiffies + HZ/25;
- while (time_before(jiffies, delay)) ;
+ mdelay(40);
dev->irq = probe_irq_off(irq_mask);
if (dev->irq == 0) {
printk(" Failed to detect the 7990 IRQ line.\n");
diff --git a/drivers/net/lne390.c b/drivers/net/lne390.c
index ed77dcfeab1f..16e41a1438a2 100644
--- a/drivers/net/lne390.c
+++ b/drivers/net/lne390.c
@@ -35,6 +35,7 @@ static const char *version =
"lne390.c: Driver revision v0.99.1, 01/09/2000\n";
#include <linux/module.h>
+#include <linux/eisa.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
diff --git a/drivers/net/mace.c b/drivers/net/mace.c
index 135af8ee8965..43eccb42921b 100644
--- a/drivers/net/mace.c
+++ b/drivers/net/mace.c
@@ -7,7 +7,6 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
diff --git a/drivers/net/ne2.c b/drivers/net/ne2.c
index 15f5739b1e56..32e59fd124b4 100644
--- a/drivers/net/ne2.c
+++ b/drivers/net/ne2.c
@@ -60,7 +60,6 @@
static const char *version = "ne2.c:v0.91 Nov 16 1998 Wim Dumon <wimpie@kotnet.org>\n";
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fcntl.h>
diff --git a/drivers/net/ne3210.c b/drivers/net/ne3210.c
index 16fc263dbc02..201aa1f59c04 100644
--- a/drivers/net/ne3210.c
+++ b/drivers/net/ne3210.c
@@ -29,6 +29,7 @@ static const char *version =
"ne3210.c: Driver revision v0.03, 30/09/98\n";
#include <linux/module.h>
+#include <linux/eisa.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
diff --git a/drivers/net/net_init.c b/drivers/net/net_init.c
index 9979fbf91dd5..968af8bf1929 100644
--- a/drivers/net/net_init.c
+++ b/drivers/net/net_init.c
@@ -381,7 +381,7 @@ void ether_setup(struct net_device *dev)
dev->hard_header_len = ETH_HLEN;
dev->mtu = 1500; /* eth_mtu */
dev->addr_len = ETH_ALEN;
- dev->tx_queue_len = 100; /* Ethernet wants good queues */
+ dev->tx_queue_len = 1000; /* Ethernet wants good queues */
memset(dev->broadcast,0xFF, ETH_ALEN);
diff --git a/drivers/net/ni5010.c b/drivers/net/ni5010.c
index e9c07dba7c6e..19dedf118748 100644
--- a/drivers/net/ni5010.c
+++ b/drivers/net/ni5010.c
@@ -255,14 +255,13 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
if (dev->irq == 0xff)
;
else if (dev->irq < 2) {
- unsigned long irq_mask, delay;
+ unsigned long irq_mask;
PRINTK2((KERN_DEBUG "%s: I/O #5 passed!\n", dev->name));
irq_mask = probe_irq_on();
trigger_irq(ioaddr);
- delay = jiffies + HZ/50;
- while (time_before(jiffies, delay)) ;
+ mdelay(20);
dev->irq = probe_irq_off(irq_mask);
PRINTK2((KERN_DEBUG "%s: I/O #6 passed!\n", dev->name));
diff --git a/drivers/net/ni52.c b/drivers/net/ni52.c
index 67f857fc37ae..f5d04d487d3a 100644
--- a/drivers/net/ni52.c
+++ b/drivers/net/ni52.c
@@ -492,14 +492,13 @@ static int __init ni52_probe1(struct net_device *dev,int ioaddr)
if(dev->irq < 2)
{
- unsigned long irq_mask, delay;
+ unsigned long irq_mask;
irq_mask = probe_irq_on();
ni_reset586();
ni_attn586();
- delay = jiffies + HZ/50;
- while (time_before(jiffies, delay)) ;
+ mdelay(20);
dev->irq = probe_irq_off(irq_mask);
if(!dev->irq)
{
diff --git a/drivers/net/ni65.c b/drivers/net/ni65.c
index 3ddc5e07ae24..cd9aebbf5a2a 100644
--- a/drivers/net/ni65.c
+++ b/drivers/net/ni65.c
@@ -72,7 +72,6 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#include <linux/version.h>
#include <linux/module.h>
#include <asm/bitops.h>
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 0e315b8d3753..67d71fc92eb5 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -1833,13 +1833,13 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
if (err) {
printk(KERN_INFO "ns83820: unable to register irq %d\n",
pci_dev->irq);
- goto out_unmap;
+ goto out_disable;
}
err = register_netdev(&dev->net_dev);
if (err) {
printk(KERN_INFO "ns83820: unable to register netdev: %d\n", err);
- goto out_unmap;
+ goto out_free_irq;
}
printk("%s: ns83820.c: 0x22c: %08x, subsystem: %04x:%04x\n",
@@ -2025,9 +2025,11 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
return 0;
-out_unmap:
- iounmap(dev->base);
+out_free_irq:
+ free_irq(pci_dev->irq, dev);
out_disable:
+ if (dev->base)
+ iounmap(dev->base);
pci_free_consistent(pci_dev, 4 * DESC_SIZE * NR_TX_DESC, dev->tx_descs, dev->tx_phy_descs);
pci_free_consistent(pci_dev, 4 * DESC_SIZE * NR_RX_DESC, dev->rx_info.descs, dev->rx_info.phy_descs);
pci_disable_device(pci_dev);
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 7e5a91a4510b..2d1341705429 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -145,6 +145,20 @@ typedef struct com20020_dev_t {
dev_node_t node;
} com20020_dev_t;
+static void com20020_setup(struct net_device *dev)
+{
+ struct arcnet_local *lp = dev->priv;
+
+ lp->timeout = timeout;
+ lp->backplane = backplane;
+ lp->clockp = clockp;
+ lp->clockm = clockm & 3;
+ lp->hw.owner = THIS_MODULE;
+
+ /* fill in our module parameters as defaults */
+ dev->dev_addr[0] = node;
+}
+
/*======================================================================
com20020_attach() creates an "instance" of the driver, allocating
@@ -173,18 +187,14 @@ static dev_link_t *com20020_attach(void)
if (!info)
goto fail_alloc_info;
- lp = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
- if (!lp)
- goto fail_alloc_lp;
-
- dev = dev_alloc("arc%d", &ret);
+ dev = alloc_netdev(sizeof(struct arcnet_local), "arc%d",
+ com20020_setup);
if (!dev)
goto fail_alloc_dev;
memset(info, 0, sizeof(struct com20020_dev_t));
- memset(lp, 0, sizeof(struct arcnet_local));
memset(link, 0, sizeof(struct dev_link_t));
- dev->priv = lp;
+ lp = dev->priv;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts1 = 16;
@@ -201,13 +211,6 @@ static dev_link_t *com20020_attach(void)
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.Present = PRESENT_OPTION;
- /* fill in our module parameters as defaults */
- dev->dev_addr[0] = node;
- lp->timeout = timeout;
- lp->backplane = backplane;
- lp->clockp = clockp;
- lp->clockm = clockm & 3;
- lp->hw.owner = THIS_MODULE;
link->irq.Instance = info->dev = dev;
link->priv = info;
@@ -234,8 +237,6 @@ static dev_link_t *com20020_attach(void)
return link;
fail_alloc_dev:
- kfree(lp);
-fail_alloc_lp:
kfree(info);
fail_alloc_info:
kfree(link);
@@ -303,11 +304,9 @@ static void com20020_detach(dev_link_t *link)
/* ...but I/O ports are done automatically by card services */
unregister_netdev(dev);
- MOD_DEC_USE_COUNT;
}
DEBUG(1,"kfree...\n");
- kfree(dev->priv);
free_netdev(dev);
}
DEBUG(1,"kfree2...\n");
@@ -361,7 +360,6 @@ static void com20020_config(dev_link_t *link)
/* Configure card */
link->state |= DEV_CONFIG;
- strcpy(info->node.dev_name, dev->name);
DEBUG(1,"arcnet: baseport1 is %Xh\n", link->io.BasePort1);
i = !CS_SUCCESS;
@@ -407,13 +405,11 @@ static void com20020_config(dev_link_t *link)
goto failed;
}
- MOD_INC_USE_COUNT;
-
lp = dev->priv;
lp->card_name = "PCMCIA COM20020";
lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */
- i = com20020_found(dev, 0);
+ i = com20020_found(dev, 0); /* calls register_netdev */
if (i != 0) {
DEBUG(1,KERN_NOTICE "com20020_cs: com20020_found() failed\n");
@@ -421,6 +417,7 @@ static void com20020_config(dev_link_t *link)
}
info->dev_configured = 1;
+ strcpy(info->node.dev_name, dev->name);
link->dev = &info->node;
link->state &= ~DEV_CONFIG_PENDING;
diff --git a/drivers/net/rcpci45.c b/drivers/net/rcpci45.c
index e7e1a9f2d71a..b1bb757ed01e 100644
--- a/drivers/net/rcpci45.c
+++ b/drivers/net/rcpci45.c
@@ -259,10 +259,12 @@ rcpci45_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
dev->set_config = &RCconfig;
if ((error = register_netdev(dev)))
- goto err_out_free_region;
+ goto err_out_iounmap;
return 0; /* success */
+err_out_iounmap:
+ iounmap((void *) dev->base_addr);
err_out_free_region:
pci_release_regions (pdev);
err_out_free_msgbuf:
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c
index 87c980ff9112..fd8e0c45f74f 100644
--- a/drivers/net/rrunner.c
+++ b/drivers/net/rrunner.c
@@ -30,7 +30,6 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/ioport.h>
@@ -124,7 +123,6 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
rrpriv->pci_dev = pdev;
spin_lock_init(&rrpriv->lock);
- sprintf(rrpriv->name, "RoadRunner serial HIPPI");
dev->irq = pdev->irq;
dev->open = &rr_open;
@@ -228,7 +226,7 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
pci_set_drvdata(pdev, NULL);
}
out2:
- kfree(dev);
+ free_netdev(dev);
out3:
return ret;
}
@@ -236,9 +234,10 @@ static int __devinit rr_init_one(struct pci_dev *pdev,
static void __devexit rr_remove_one (struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
- struct rr_private *rr = (struct rr_private *)dev->priv;
if (dev) {
+ struct rr_private *rr = dev->priv;
+
if (!(readl(&rr->regs->HostCtrl) & NIC_HALTED)){
printk(KERN_ERR "%s: trying to unload running NIC\n",
dev->name);
@@ -721,7 +720,8 @@ static int rr_init1(struct net_device *dev)
* Give the FirmWare time to chew on the `get running' command.
*/
myjif = jiffies + 5 * HZ;
- while (time_before(jiffies, myjif) && !rrpriv->fw_running);
+ while (time_before(jiffies, myjif) && !rrpriv->fw_running)
+ cpu_relax();
netif_start_queue(dev);
@@ -1201,8 +1201,7 @@ static int rr_open(struct net_device *dev)
readl(&regs->HostCtrl);
spin_unlock_irqrestore(&rrpriv->lock, flags);
- if (request_irq(dev->irq, rr_interrupt, SA_SHIRQ, rrpriv->name, dev))
- {
+ if (request_irq(dev->irq, rr_interrupt, SA_SHIRQ, dev->name, dev)) {
printk(KERN_WARNING "%s: Requested IRQ %d is busy\n",
dev->name, dev->irq);
ecode = -EAGAIN;
@@ -1222,7 +1221,6 @@ static int rr_open(struct net_device *dev)
netif_start_queue(dev);
- MOD_INC_USE_COUNT;
return ecode;
error:
@@ -1414,7 +1412,6 @@ static int rr_close(struct net_device *dev)
free_irq(dev->irq, dev);
spin_unlock_irqrestore(&rrpriv->lock, flags);
- MOD_DEC_USE_COUNT;
return 0;
}
@@ -1727,7 +1724,7 @@ static struct pci_driver rr_driver = {
.name = "rrunner",
.id_table = rr_pci_tbl,
.probe = rr_init_one,
- .remove = rr_remove_one,
+ .remove = __devexit_p(rr_remove_one),
};
static int __init rr_init_module(void)
diff --git a/drivers/net/rrunner.h b/drivers/net/rrunner.h
index 4927fe937c43..1049131ed89c 100644
--- a/drivers/net/rrunner.h
+++ b/drivers/net/rrunner.h
@@ -820,7 +820,6 @@ struct rr_private
u32 tx_full;
u32 fw_rev;
volatile short fw_running;
- char name[24]; /* The assigned name */
struct net_device_stats stats;
struct pci_dev *pci_dev;
};
diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c
index 5326dee62c74..dae4c5463973 100644
--- a/drivers/net/sb1000.c
+++ b/drivers/net/sb1000.c
@@ -35,7 +35,6 @@
static char version[] = "sb1000.c:v1.1.2 6/01/98 (fventuri@mediaone.net)\n";
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/interrupt.h>
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index 6422eb2a4208..15cef66f3a73 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -47,7 +47,6 @@
*/
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/timer.h>
diff --git a/drivers/net/sk98lin/h/skdrv1st.h b/drivers/net/sk98lin/h/skdrv1st.h
index d8b3172e9cc0..8b60183652df 100644
--- a/drivers/net/sk98lin/h/skdrv1st.h
+++ b/drivers/net/sk98lin/h/skdrv1st.h
@@ -107,9 +107,6 @@
#ifndef __INC_SKDRV1ST_H
#define __INC_SKDRV1ST_H
-/* Check kernel version */
-#include <linux/version.h>
-
typedef struct s_AC SK_AC;
/* Set card versions */
@@ -135,7 +132,6 @@ typedef struct s_AC SK_AC;
#error You must compile this driver with "-O".
#endif
-#include <linux/version.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/string.h>
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index a38036f73346..3fce1a398217 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -361,7 +361,6 @@
* <linux/module.h>
*
* "h/skdrv1st.h"
- * <linux/version.h>
* <linux/types.h>
* <linux/kernel.h>
* <linux/string.h>
diff --git a/drivers/net/sk_mca.h b/drivers/net/sk_mca.h
index cb29200514ed..d1b5250d153a 100644
--- a/drivers/net/sk_mca.h
+++ b/drivers/net/sk_mca.h
@@ -1,3 +1,5 @@
+#include <linux/version.h>
+
#ifndef _SK_MCA_INCLUDE_
#define _SK_MCA_INCLUDE_
diff --git a/drivers/net/skfp/h/targetos.h b/drivers/net/skfp/h/targetos.h
index 7c6c1bd85bca..94a81eede792 100644
--- a/drivers/net/skfp/h/targetos.h
+++ b/drivers/net/skfp/h/targetos.h
@@ -43,7 +43,6 @@
#undef ADDR
-#include <linux/version.h>
#include <asm/io.h>
#include <linux/netdevice.h>
#include <linux/fddidevice.h>
diff --git a/drivers/net/smc-ultra32.c b/drivers/net/smc-ultra32.c
index 5781d29f2793..aac76a58342d 100644
--- a/drivers/net/smc-ultra32.c
+++ b/drivers/net/smc-ultra32.c
@@ -47,6 +47,7 @@ static const char *version = "smc-ultra32.c: 06/97 v1.00\n";
#include <linux/module.h>
+#include <linux/eisa.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
diff --git a/drivers/net/smc9194.c b/drivers/net/smc9194.c
index 7d9d24d5d326..4d24343c1799 100644
--- a/drivers/net/smc9194.c
+++ b/drivers/net/smc9194.c
@@ -58,7 +58,6 @@ static const char version[] =
"smc9194.c:v0.14 12/15/00 by Erik Stahlman (erik@vt.edu)\n";
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fcntl.h>
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index c5b6999712fb..499b60d0bfd4 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -169,6 +169,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/ioport.h>
+#include <linux/eisa.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
index ba05c25bbbfa..b93d2a88d32b 100644
--- a/drivers/net/tokenring/Kconfig
+++ b/drivers/net/tokenring/Kconfig
@@ -2,13 +2,14 @@
# Token Ring driver configuration
#
-menu "Token Ring devices (depends on LLC=y)"
+menu "Token Ring devices"
depends on NETDEVICES
# So far, we only have PCI, ISA, and MCA token ring devices
config TR
bool "Token Ring driver support"
- depends on (PCI || ISA || MCA || CCW) && LLC=y
+ depends on (PCI || ISA || MCA || CCW)
+ select LLC
help
Token Ring is IBM's way of communication on a local network; the
rest of the world uses Ethernet. To participate on a Token Ring
diff --git a/drivers/net/tokenring/lanstreamer.h b/drivers/net/tokenring/lanstreamer.h
index bd7df5afa857..932cb70c4a7d 100644
--- a/drivers/net/tokenring/lanstreamer.h
+++ b/drivers/net/tokenring/lanstreamer.h
@@ -60,6 +60,8 @@
*
*/
+#include <linux/version.h>
+
#if STREAMER_IOCTL && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#include <asm/ioctl.h>
#define IOCTL_PRINT_RX_BUFS SIOCDEVPRIVATE
diff --git a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c
index 4c4b4dd034ab..fe9bc7a426f3 100644
--- a/drivers/net/tokenring/proteon.c
+++ b/drivers/net/tokenring/proteon.c
@@ -410,7 +410,7 @@ int init_module(void)
}
} else {
for(i = 0; num < ISATR_MAX_ADAPTERS && portlist[i]; i++) {
- if (setup_card(portlist[i], irq[i], dma[i]))
+ if (setup_card(portlist[i], irq[num], dma[num]) == 0)
num++;
}
}
diff --git a/drivers/net/tokenring/skisa.c b/drivers/net/tokenring/skisa.c
index da77f8bdb53f..b0bc243ac9e8 100644
--- a/drivers/net/tokenring/skisa.c
+++ b/drivers/net/tokenring/skisa.c
@@ -423,7 +423,7 @@ int init_module(void)
}
} else {
for(i = 0; num < ISATR_MAX_ADAPTERS && portlist[i]; i++) {
- if (setup_card(portlist[i], irq[i], dma[i]))
+ if (setup_card(portlist[i], irq[num], dma[num]) == 0)
num++;
}
}
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index ef5a3714dd1b..0761bc72691b 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -29,7 +29,6 @@
*/
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/types.h>
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index e1062b3d654b..1931a5b05b3f 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -77,7 +77,6 @@ static const char version[] = "tms380tr.c: v1.10 30/12/2002 by Christoph Goos, A
#endif
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fcntl.h>
diff --git a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig
index df80c5c25e37..54003a7c6cea 100644
--- a/drivers/net/wan/Kconfig
+++ b/drivers/net/wan/Kconfig
@@ -342,6 +342,30 @@ config HDLC_X25
comment "X.25/LAPB support is disabled"
depends on WAN && HDLC && (LAPB!=m || HDLC!=m) && LAPB!=y
+config WANXL
+ tristate "SBE Inc. wanXL support"
+ depends on HDLC && PCI
+ help
+ This driver is for wanXL PCI cards made by SBE Inc. If you have
+ such a card, say Y here and see <http://hq.pm.waw.pl/pub/hdlc/>.
+
+ If you want to compile the driver as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want),
+ say M here and read <file:Documentation/modules.txt>. The module
+ will be called wanxl.
+
+ If unsure, say N here.
+
+config WANXL_BUILD_FIRMWARE
+ bool "rebuild wanXL firmware"
+ depends on WANXL
+ help
+ This option allows you to rebuild firmware run by the QUICC
+ processor. It requires as68k, ld68k and hexdump programs.
+ You should never need this option.
+
+ If unsure, say N here.
+
config PC300
tristate "Cyclades-PC300 support (RS-232/V.35, X.21, T1/E1 boards)"
depends on HDLC && PCI
diff --git a/drivers/net/wan/Makefile b/drivers/net/wan/Makefile
index 4d540014c93f..4383eeacb67e 100644
--- a/drivers/net/wan/Makefile
+++ b/drivers/net/wan/Makefile
@@ -66,3 +66,25 @@ ifeq ($(CONFIG_HDLC_PPP),y)
endif
obj-$(CONFIG_N2) += n2.o
obj-$(CONFIG_C101) += c101.o
+obj-$(CONFIG_WANXL) += wanxl.o
+
+ifeq ($(CONFIG_WANXL_BUILD_FIRMWARE),y)
+ifeq ($(ARCH),m68k)
+ AS68K = $(AS)
+ LD68K = $(LD)
+else
+ AS68K = as68k
+ LD68K = ld68k
+endif
+
+quiet_cmd_build_wanxlfw = BLD FW $@
+ cmd_build_wanxlfw = \
+ $(CPP) -Wp,-MD,$(depfile) -Iinclude $(obj)/wanxlfw.S | $(AS68K) -m68360 -o $(obj)/wanxlfw.o; \
+ $(LD68K) --oformat binary -Ttext 0x1000 $(obj)/wanxlfw.o -o $(obj)/wanxlfw.bin; \
+ hexdump -ve '"\n" 16/1 "0x%02X,"' $(obj)/wanxlfw.bin | sed 's/0x ,//g;1s/^/static u8 firmware[]={/;$$s/,$$/\n};\n/' >$(obj)/wanxlfw.inc; \
+ rm -f $(obj)/wanxlfw.bin $(obj)/wanxlfw.o
+
+$(obj)/wanxlfw.inc: $(obj)/wanxlfw.S
+ $(call if_changed_dep,build_wanxlfw)
+targets += wanxlfw.inc
+endif
diff --git a/drivers/net/wan/comx-hw-comx.c b/drivers/net/wan/comx-hw-comx.c
index 17d797e727b1..a62fe5514470 100644
--- a/drivers/net/wan/comx-hw-comx.c
+++ b/drivers/net/wan/comx-hw-comx.c
@@ -51,7 +51,6 @@
#define VERSION "0.87"
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/proc_fs.h>
diff --git a/drivers/net/wan/comx-hw-locomx.c b/drivers/net/wan/comx-hw-locomx.c
index 45bf7f870848..1d20fed5f6ee 100644
--- a/drivers/net/wan/comx-hw-locomx.c
+++ b/drivers/net/wan/comx-hw-locomx.c
@@ -38,7 +38,6 @@
#include <linux/interrupt.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/proc_fs.h>
diff --git a/drivers/net/wan/comx-hw-mixcom.c b/drivers/net/wan/comx-hw-mixcom.c
index 0881f7e17563..c6fb9ac67c21 100644
--- a/drivers/net/wan/comx-hw-mixcom.c
+++ b/drivers/net/wan/comx-hw-mixcom.c
@@ -41,7 +41,6 @@
#include <linux/interrupt.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/proc_fs.h>
diff --git a/drivers/net/wan/comx-hw-munich.c b/drivers/net/wan/comx-hw-munich.c
index a3a0f400e5a5..35328059a66a 100644
--- a/drivers/net/wan/comx-hw-munich.c
+++ b/drivers/net/wan/comx-hw-munich.c
@@ -30,7 +30,6 @@
#include <linux/config.h>
#include <linux/ctype.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/proc_fs.h>
diff --git a/drivers/net/wan/comx-proto-fr.c b/drivers/net/wan/comx-proto-fr.c
index e1c83300548d..c9551366b74b 100644
--- a/drivers/net/wan/comx-proto-fr.c
+++ b/drivers/net/wan/comx-proto-fr.c
@@ -37,7 +37,6 @@
#define VERSION "0.73"
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/types.h>
#include <linux/jiffies.h>
#include <linux/netdevice.h>
diff --git a/drivers/net/wan/comx-proto-lapb.c b/drivers/net/wan/comx-proto-lapb.c
index ae0f5fde7519..30c818601ecf 100644
--- a/drivers/net/wan/comx-proto-lapb.c
+++ b/drivers/net/wan/comx-proto-lapb.c
@@ -24,7 +24,6 @@
#define VERSION "0.80"
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/proc_fs.h>
diff --git a/drivers/net/wan/comx-proto-ppp.c b/drivers/net/wan/comx-proto-ppp.c
index 991110142d1d..3f4501014739 100644
--- a/drivers/net/wan/comx-proto-ppp.c
+++ b/drivers/net/wan/comx-proto-ppp.c
@@ -34,7 +34,6 @@
#define VERSION "0.23"
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/types.h>
#include <linux/jiffies.h>
#include <linux/netdevice.h>
diff --git a/drivers/net/wan/comx.c b/drivers/net/wan/comx.c
index 1418fd1e7b38..e296504cb02e 100644
--- a/drivers/net/wan/comx.c
+++ b/drivers/net/wan/comx.c
@@ -55,7 +55,6 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/types.h>
#include <linux/jiffies.h>
diff --git a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c
index a66e1a729689..cd1cd85691e8 100644
--- a/drivers/net/wan/cycx_x25.c
+++ b/drivers/net/wan/cycx_x25.c
@@ -78,7 +78,6 @@
#define CYCLOMX_X25_DEBUG 1
-#include <linux/version.h>
#include <linux/errno.h> /* return codes */
#include <linux/if_arp.h> /* ARPHRD_HWX25 */
#include <linux/kernel.h> /* printk(), and other useful stuff */
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c
index e16e4b79a5c3..6d3d2d461a75 100644
--- a/drivers/net/wan/dlci.c
+++ b/drivers/net/wan/dlci.c
@@ -40,7 +40,6 @@
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/string.h>
-#include <linux/init.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index 9d38514a9920..f1dfc6df73cd 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -80,7 +80,6 @@
* - misc crapectomy.
*/
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
diff --git a/drivers/net/wan/lmc/lmc_ver.h b/drivers/net/wan/lmc/lmc_ver.h
index 3e171caeee82..75ea93765c7c 100644
--- a/drivers/net/wan/lmc/lmc_ver.h
+++ b/drivers/net/wan/lmc/lmc_ver.h
@@ -1,3 +1,5 @@
+#include <linux/version.h>
+
#ifndef _IF_LMC_LINUXVER_
#define _IF_LMC_LINUXVER_
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c
index 21d1deffca33..3fa5e3d61007 100644
--- a/drivers/net/wan/pc300_drv.c
+++ b/drivers/net/wan/pc300_drv.c
@@ -227,7 +227,6 @@ static char rcsid[] =
#include <linux/netdevice.h>
#include <linux/spinlock.h>
#include <linux/if.h>
-#include <linux/version.h>
#include <net/syncppp.h>
#include <net/arp.h>
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c
index d683c01f0542..a07c82a57771 100644
--- a/drivers/net/wan/pc300_tty.c
+++ b/drivers/net/wan/pc300_tty.c
@@ -37,7 +37,6 @@
*/
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/errno.h>
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 81b2f271036c..6c620805fe92 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -53,6 +53,7 @@
#include <linux/skbuff.h>
#include <linux/timer.h>
#include <linux/init.h>
+#include <linux/delay.h>
#include <net/arp.h>
@@ -337,13 +338,12 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq )
outb( 0, ioaddr + CSR0 );
if( irq < 2 ) {
- unsigned long irq_mask, delay;
+ unsigned long irq_mask;
irq_mask = probe_irq_on();
outb( EN_INT | TR_REQ, ioaddr + CSR0 );
outb( PR_RES, ioaddr + CSR1 );
- delay = jiffies + HZ/20;
- while (time_before(jiffies, delay)) ;
+ mdelay(50);
irq = probe_irq_off(irq_mask);
outb( 0, ioaddr + CSR0 );
@@ -1562,13 +1562,13 @@ __setup( "sbni=", sbni_setup );
static u32
calc_crc32( u32 crc, u8 *p, u32 len )
{
- register u32 _crc __asm ( "ax" );
+ register u32 _crc;
_crc = crc;
__asm __volatile (
"xorl %%ebx, %%ebx\n"
- "movl %1, %%esi\n"
- "movl %2, %%ecx\n"
+ "movl %2, %%esi\n"
+ "movl %3, %%ecx\n"
"movl $crc32tab, %%edi\n"
"shrl $2, %%ecx\n"
"jz 1f\n"
@@ -1604,7 +1604,7 @@ calc_crc32( u32 crc, u8 *p, u32 len )
"jnz 0b\n"
"1:\n"
- "movl %2, %%ecx\n"
+ "movl %3, %%ecx\n"
"andl $3, %%ecx\n"
"jz 2f\n"
@@ -1629,9 +1629,9 @@ calc_crc32( u32 crc, u8 *p, u32 len )
"xorb 2(%%esi), %%bl\n"
"xorl (%%edi,%%ebx,4), %%eax\n"
"2:\n"
- :
- : "a" (_crc), "g" (p), "g" (len)
- : "ax", "bx", "cx", "dx", "si", "di"
+ : "=a" (_crc)
+ : "0" (_crc), "g" (p), "g" (len)
+ : "bx", "cx", "dx", "si", "di"
);
return _crc;
diff --git a/drivers/net/wan/sdla_chdlc.c b/drivers/net/wan/sdla_chdlc.c
index 5ca0ef0599b3..b00fb7837e72 100644
--- a/drivers/net/wan/sdla_chdlc.c
+++ b/drivers/net/wan/sdla_chdlc.c
@@ -49,7 +49,6 @@
*****************************************************************************/
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h> /* printk(), and other useful stuff */
#include <linux/stddef.h> /* offsetof(), etc. */
#include <linux/errno.h> /* return codes */
@@ -560,8 +559,8 @@ int wpc_init (sdla_t* card, wandev_conf_t* conf)
if (chdlc_set_intr_mode(card, APP_INT_ON_TIMER)){
- printk (KERN_INFO "%s:
- Failed to set interrupt triggers!\n",
+ printk (KERN_INFO "%s: "
+ "Failed to set interrupt triggers!\n",
card->devname);
return -EIO;
}
diff --git a/drivers/net/wan/sdla_fr.c b/drivers/net/wan/sdla_fr.c
index 1a86e09ff325..52f40883d6b7 100644
--- a/drivers/net/wan/sdla_fr.c
+++ b/drivers/net/wan/sdla_fr.c
@@ -139,7 +139,6 @@
*****************************************************************************/
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h> /* printk(), and other useful stuff */
#include <linux/stddef.h> /* offsetof(), etc. */
#include <linux/errno.h> /* return codes */
@@ -147,6 +146,7 @@
#include <linux/slab.h> /* kmalloc(), kfree() */
#include <linux/wanrouter.h> /* WAN router definitions */
#include <linux/wanpipe.h> /* WANPIPE common user API definitions */
+#include <linux/workqueue.h>
#include <linux/if_arp.h> /* ARPHRD_* defines */
#include <asm/byteorder.h> /* htons(), etc. */
#include <asm/io.h> /* for inb(), outb(), etc. */
@@ -247,7 +247,7 @@ typedef struct fr_channel
/* Polling task queue. Each interface
* has its own task queue, which is used
* to defer events from the interrupt */
- struct tq_struct fr_poll_task;
+ struct work_struct fr_poll_work;
struct timer_list fr_arp_timer;
u32 ip_local;
@@ -987,9 +987,7 @@ static int new_if(struct wan_device* wandev, struct net_device* dev,
* We need a poll routine for each network
* interface.
*/
- chan->fr_poll_task.sync = 0;
- chan->fr_poll_task.routine = (void *)(void *)fr_poll;
- chan->fr_poll_task.data = dev;
+ INIT_WORK(&chan->fr_poll_work, (void *)fr_poll, dev);
init_timer(&chan->fr_arp_timer);
chan->fr_arp_timer.data=(unsigned long)dev;
@@ -1212,9 +1210,7 @@ static int if_open(struct net_device* dev)
/* Initialize the task queue */
chan->tq_working=0;
- chan->common.wanpipe_task.sync = 0;
- chan->common.wanpipe_task.routine = (void *)(void *)fr_bh;
- chan->common.wanpipe_task.data = dev;
+ INIT_WORK(&chan->common.wanpipe_work, (void *)fr_bh, dev);
/* Allocate and initialize BH circular buffer */
chan->bh_head = kmalloc((sizeof(bh_data_t)*MAX_BH_BUFF),GFP_ATOMIC);
@@ -2178,7 +2174,7 @@ static void rx_intr (sdla_t* card)
}
- /* Send a packed up the IP stack */
+ /* Send a packet up the IP stack */
skb->dev->last_rx = jiffies;
netif_rx(skb);
++chan->drvstats_rx_intr.rx_intr_bfr_passed_to_stack;
@@ -2216,8 +2212,8 @@ rx_done:
* dlci number.
* 2. Check that network interface is up and
* properly setup.
- * 3. Check for a buffered packed.
- * 4. Transmit the packed.
+ * 3. Check for a buffered packet.
+ * 4. Transmit the packet.
* 5. If we are in WANPIPE mode, mark the
* NET_BH handler.
* 6. If we are in API mode, kick
@@ -4359,8 +4355,8 @@ void s508_s514_unlock(sdla_t *card, unsigned long *smp_flags)
* bh_enqueue
*
* Description:
- * Insert a received packed into a circular
- * rx queue. This packed will be picked up
+ * Insert a received packet into a circular
+ * rx queue. This packet will be picked up
* by fr_bh() and sent up the stack to the
* user.
*
@@ -4411,8 +4407,7 @@ static int bh_enqueue(struct net_device *dev, struct sk_buff *skb)
static void trigger_fr_bh (fr_channel_t *chan)
{
if (!test_and_set_bit(0,&chan->tq_working)){
- wanpipe_queue_tq(&chan->common.wanpipe_task);
- wanpipe_mark_bh();
+ wanpipe_queue_work(&chan->common.wanpipe_work);
}
}
@@ -4435,10 +4430,10 @@ static void trigger_fr_bh (fr_channel_t *chan)
* card into an skb buffer, the skb buffer
* is appended to a circular BH buffer.
* Then the interrupt kicks fr_bh() to finish the
- * job at a later time (no within the interrupt).
+ * job at a later time (not within the interrupt).
*
* Usage:
- * Interrupts use this to defer a taks to
+ * Interrupts use this to defer a task to
* a polling routine.
*
*/
@@ -4527,7 +4522,7 @@ static int fr_bh_cleanup(struct net_device *dev)
static void trigger_fr_poll(struct net_device *dev)
{
fr_channel_t* chan = dev->priv;
- schedule_task(&chan->fr_poll_task);
+ schedule_work(&chan->fr_poll_work);
return;
}
diff --git a/drivers/net/wan/sdla_ft1.c b/drivers/net/wan/sdla_ft1.c
index 490baed9fbab..5e3124856eb0 100644
--- a/drivers/net/wan/sdla_ft1.c
+++ b/drivers/net/wan/sdla_ft1.c
@@ -21,7 +21,6 @@
*****************************************************************************/
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h> /* printk(), and other useful stuff */
#include <linux/stddef.h> /* offsetof(), etc. */
#include <linux/errno.h> /* return codes */
diff --git a/drivers/net/wan/sdla_ppp.c b/drivers/net/wan/sdla_ppp.c
index f68d3abca0fc..1761cb68ab48 100644
--- a/drivers/net/wan/sdla_ppp.c
+++ b/drivers/net/wan/sdla_ppp.c
@@ -91,7 +91,6 @@
*****************************************************************************/
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h> /* printk(), and other useful stuff */
#include <linux/stddef.h> /* offsetof(), etc. */
#include <linux/errno.h> /* return codes */
diff --git a/drivers/net/wan/sdla_x25.c b/drivers/net/wan/sdla_x25.c
index a963ef3debf3..3a93d2fd4fbf 100644
--- a/drivers/net/wan/sdla_x25.c
+++ b/drivers/net/wan/sdla_x25.c
@@ -82,7 +82,6 @@
*=====================================================*/
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h> /* printk(), and other useful stuff */
#include <linux/stddef.h> /* offsetof(), etc. */
#include <linux/errno.h> /* return codes */
@@ -91,6 +90,7 @@
#include <linux/slab.h> /* kmalloc(), kfree() */
#include <linux/wanrouter.h> /* WAN router definitions */
#include <linux/wanpipe.h> /* WANPIPE common user API definitions */
+#include <linux/workqueue.h>
#include <asm/byteorder.h> /* htons(), etc. */
#include <asm/atomic.h>
#include <linux/delay.h> /* Experimental delay */
@@ -790,9 +790,7 @@ int wpx_init (sdla_t* card, wandev_conf_t* conf)
init_global_statistics(card);
- card->u.x.x25_poll_task.sync=0;
- card->u.x.x25_poll_task.routine = (void*)(void*)wpx_poll;
- card->u.x.x25_poll_task.data = card;
+ INIT_WORK(&card->u.x.x25_poll_work, (void *)wpx_poll, card);
init_timer(&card->u.x.x25_timer);
card->u.x.x25_timer.data = (unsigned long)card;
@@ -1175,7 +1173,7 @@ static int if_init(struct net_device* dev)
* Warnings: None
*
* Return: 0 Ok
- * <0 Failur: Interface will not come up.
+ * <0 Failure: Interface will not come up.
*/
static int if_open(struct net_device* dev)
@@ -1190,10 +1188,8 @@ static int if_open(struct net_device* dev)
chan->tq_working = 0;
- /* Initialize the task queue */
- chan->common.wanpipe_task.sync = 0;
- chan->common.wanpipe_task.routine = (void *)(void *)x25api_bh;
- chan->common.wanpipe_task.data = dev;
+ /* Initialize the workqueue */
+ INIT_WORK(&chan->common.wanpipe_work, (void *)x25api_bh, dev);
/* Allocate and initialize BH circular buffer */
/* Add 1 to MAX_BH_BUFF so we don't have test with (MAX_BH_BUFF-1) */
@@ -1732,8 +1728,7 @@ static void rx_intr (sdla_t* card)
chan->rx_skb = NULL;
if (!test_and_set_bit(0, &chan->tq_working)){
- wanpipe_queue_tq(&chan->common.wanpipe_task);
- wanpipe_mark_bh();
+ wanpipe_queue_work(&chan->common.wanpipe_work);
}
return;
}
@@ -2227,7 +2222,7 @@ static void spur_intr (sdla_t* card)
/*====================================================================
* Main polling routine.
- * This routine is repeatedly called by the WANPIPE 'thead' to allow for
+ * This routine is repeatedly called by the WANPIPE 'thread' to allow for
* time-dependent housekeeping work.
*
* Notes:
@@ -2274,7 +2269,7 @@ wpx_poll_exit:
static void trigger_x25_poll(sdla_t *card)
{
- schedule_task(&card->u.x.x25_poll_task);
+ schedule_work(&card->u.x.x25_poll_work);
}
/*====================================================================
diff --git a/drivers/net/wan/sdladrv.c b/drivers/net/wan/sdladrv.c
index 6610ed33e6ba..76ff1e69dbd7 100644
--- a/drivers/net/wan/sdladrv.c
+++ b/drivers/net/wan/sdladrv.c
@@ -91,7 +91,6 @@
#if defined(_LINUX_) /****** Linux *******************************/
#include <linux/config.h>
-#include <linux/version.h>
#include <linux/kernel.h> /* printk(), and other useful stuff */
#include <linux/stddef.h> /* offsetof(), etc. */
#include <linux/errno.h> /* return codes */
@@ -351,7 +350,7 @@ static void sdladrv_cleanup(void)
}
module_init(sdladrv_init);
-module_cleanup(sdladrv_cleanup);
+module_exit(sdladrv_cleanup);
#endif
/******* Kernel APIs ********************************************************/
diff --git a/drivers/net/wan/sdlamain.c b/drivers/net/wan/sdlamain.c
index de695ac6ff6e..8769cc97275d 100644
--- a/drivers/net/wan/sdlamain.c
+++ b/drivers/net/wan/sdlamain.c
@@ -46,7 +46,6 @@
* Jan 02, 1997 Gene Kozin Initial version.
*****************************************************************************/
-#include <linux/version.h>
#include <linux/config.h> /* OS configuration options */
#include <linux/stddef.h> /* offsetof(), etc. */
#include <linux/errno.h> /* return codes */
@@ -189,7 +188,6 @@ static int ioctl_exec (sdla_t* card, sdla_exec_t* u_exec, int);
/* Miscellaneous functions */
STATIC irqreturn_t sdla_isr (int irq, void* dev_id, struct pt_regs *regs);
static void release_hw (sdla_t *card);
-static void run_wanpipe_tq (unsigned long);
static int check_s508_conflicts (sdla_t* card,wandev_conf_t* conf, int*);
static int check_s514_conflicts (sdla_t* card,wandev_conf_t* conf, int*);
@@ -203,29 +201,21 @@ static int check_s514_conflicts (sdla_t* card,wandev_conf_t* conf, int*);
static char drvname[] = "wanpipe";
static char fullname[] = "WANPIPE(tm) Multiprotocol Driver";
static char copyright[] = "(c) 1995-2000 Sangoma Technologies Inc.";
-static int ncards = 0;
-static sdla_t* card_array = NULL; /* adapter data space */
+static int ncards;
+static sdla_t* card_array; /* adapter data space */
-/* Wanpipe's own task queue, used for all API's.
- * All protocol specific tasks will be instered
- * into "wanpipe_tq_custom" task_queue.
+/* Wanpipe's own workqueue, used for all API's.
+ * All protocol specific tasks will be inserted
+ * into the "wanpipe_wq" workqueue.
- * On each rx_interrupt, the whole task queue
- * (wanpipe_tq_custom) will be queued into
- * IMMEDIATE_BH via wanpipe_mark_bh() call.
-
- * The IMMEDIATE_BH will execute run_wanpipe_tq()
- * function, which will execute all pending,
- * tasks in wanpipe_tq_custom queue */
+ * The kernel workqueue mechanism will execute
+ * all pending tasks in the "wanpipe_wq" workqueue.
+ */
-DECLARE_TASK_QUEUE(wanpipe_tq_custom);
-static struct tq_struct wanpipe_tq_task =
-{
- .routine = (void (*)(void *)) run_wanpipe_tq,
- .data = &wanpipe_tq_custom
-};
+struct workqueue_struct *wanpipe_wq;
+DECLARE_WORK(wanpipe_work, NULL, NULL);
-static int wanpipe_bh_critical=0;
+static int wanpipe_bh_critical;
/******* Kernel Loadable Module Entry Points ********************************/
@@ -249,6 +239,10 @@ int wanpipe_init(void)
printk(KERN_INFO "%s v%u.%u %s\n",
fullname, DRV_VERSION, DRV_RELEASE, copyright);
+ wanpipe_wq = create_workqueue("wanpipe_wq");
+ if (!wanpipe_wq)
+ return -ENOMEM;
+
/* Probe for wanpipe cards and return the number found */
printk(KERN_INFO "wanpipe: Probing for WANPIPE hardware.\n");
ncards = wanpipe_hw_probe();
@@ -256,13 +250,16 @@ int wanpipe_init(void)
printk(KERN_INFO "wanpipe: Allocating maximum %i devices: wanpipe%i - wanpipe%i.\n",ncards,1,ncards);
}else{
printk(KERN_INFO "wanpipe: No S514/S508 cards found, unloading modules!\n");
+ destroy_workqueue(wanpipe_wq);
return -ENODEV;
}
/* Verify number of cards and allocate adapter data space */
card_array = kmalloc(sizeof(sdla_t) * ncards, GFP_KERNEL);
- if (card_array == NULL)
+ if (card_array == NULL) {
+ destroy_workqueue(wanpipe_wq);
return -ENOMEM;
+ }
memset(card_array, 0, sizeof(sdla_t) * ncards);
@@ -292,6 +289,7 @@ int wanpipe_init(void)
ncards = cnt; /* adjust actual number of cards */
}else {
kfree(card_array);
+ destroy_workqueue(wanpipe_wq);
printk(KERN_INFO "IN Init Module: NO Cards registered\n");
err = -ENODEV;
}
@@ -316,6 +314,7 @@ static void wanpipe_cleanup(void)
sdla_t* card = &card_array[i];
unregister_wan_device(card->devname);
}
+ destroy_workqueue(wanpipe_wq);
kfree(card_array);
printk(KERN_INFO "\nwanpipe: WANPIPE Modules Unloaded.\n");
@@ -673,15 +672,20 @@ static int check_s508_conflicts (sdla_t* card,wandev_conf_t* conf, int *irq)
/* Make sure I/O port region is available only if we are the
- * master device. If we are running in piggibacking mode,
- * we will use the resources of the master card */
- if (check_region(conf->ioport, SDLA_MAXIORANGE) &&
- !card->wandev.piggyback) {
- printk(KERN_INFO
- "%s: I/O region 0x%X - 0x%X is in use!\n",
- card->wandev.name, conf->ioport,
- conf->ioport + SDLA_MAXIORANGE);
- return -EINVAL;
+ * master device. If we are running in piggybacking mode,
+ * we will use the resources of the master card. */
+ if (!card->wandev.piggyback) {
+ struct resource *rr =
+ request_region(conf->ioport, SDLA_MAXIORANGE, "sdlamain");
+ release_region(conf->ioport, SDLA_MAXIORANGE);
+
+ if (!rr) {
+ printk(KERN_INFO
+ "%s: I/O region 0x%X - 0x%X is in use!\n",
+ card->wandev.name, conf->ioport,
+ conf->ioport + SDLA_MAXIORANGE - 1);
+ return -EINVAL;
+ }
}
return 0;
@@ -1029,7 +1033,6 @@ static int ioctl_exec (sdla_t* card, sdla_exec_t* u_exec, int cmd)
STATIC irqreturn_t sdla_isr (int irq, void* dev_id, struct pt_regs *regs)
{
#define card ((sdla_t*)dev_id)
- int handled = 0;
if(card->hw.type == SDLA_S514) { /* handle interrrupt on S514 */
u32 int_status;
@@ -1210,6 +1213,7 @@ sdla_t * wanpipe_find_card (char *name)
}
return NULL;
}
+
sdla_t * wanpipe_find_card_num (int num)
{
if (num < 1 || num > ncards)
@@ -1218,35 +1222,20 @@ sdla_t * wanpipe_find_card_num (int num)
return &card_array[num];
}
-
-static void run_wanpipe_tq (unsigned long data)
-{
- task_queue *tq_queue = (task_queue *)data;
- if (test_and_set_bit(2,(void*)&wanpipe_bh_critical))
- printk(KERN_INFO "CRITICAL IN RUNNING TASK QUEUE\n");
- run_task_queue (tq_queue);
- clear_bit(2,(void*)&wanpipe_bh_critical);
-
-}
-
-void wanpipe_queue_tq (struct tq_struct *bh_pointer)
+/*
+ * @work_pointer: work_struct to be done;
+ * should already have PREPARE_WORK() or
+ * INIT_WORK() done on it by caller;
+ */
+void wanpipe_queue_work (struct work_struct *work_pointer)
{
- if (test_and_set_bit(1,(void*)&wanpipe_bh_critical))
- printk(KERN_INFO "CRITICAL IN QUEUING TASK\n");
+ if (test_and_set_bit(1, (void*)&wanpipe_bh_critical))
+ printk(KERN_INFO "CRITICAL IN QUEUING WORK\n");
- queue_task(bh_pointer,&wanpipe_tq_custom);
+ queue_work(wanpipe_wq, work_pointer);
clear_bit(1,(void*)&wanpipe_bh_critical);
}
-void wanpipe_mark_bh (void)
-{
- if (!test_and_set_bit(0,(void*)&wanpipe_bh_critical)){
- queue_task(&wanpipe_tq_task,&tq_immediate);
- mark_bh(IMMEDIATE_BH);
- clear_bit(0,(void*)&wanpipe_bh_critical);
- }
-}
-
void wakeup_sk_bh(struct net_device *dev)
{
wanpipe_common_t *chan = dev->priv;
diff --git a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c
index 2f337392ef91..250f5ea9bb75 100644
--- a/drivers/net/wan/sealevel.c
+++ b/drivers/net/wan/sealevel.c
@@ -31,7 +31,6 @@
struct slvl_device
{
- void *if_ptr; /* General purpose pointer (used by SPPP) */
struct z8530_channel *chan;
struct ppp_device netdev;
int channel;
@@ -40,7 +39,7 @@ struct slvl_device
struct slvl_board
{
- struct slvl_device dev[2];
+ struct slvl_device *dev[2];
struct z8530_dev board;
int iobase;
};
@@ -119,7 +118,6 @@ static int sealevel_open(struct net_device *d)
* Go go go
*/
netif_start_queue(d);
- MOD_INC_USE_COUNT;
return 0;
}
@@ -153,7 +151,6 @@ static int sealevel_close(struct net_device *d)
z8530_sync_close(d, slvl->chan);
break;
}
- MOD_DEC_USE_COUNT;
return 0;
}
@@ -202,48 +199,79 @@ static int sealevel_neigh_setup_dev(struct net_device *dev, struct neigh_parms *
return 0;
}
+
+static void slvl_setup(struct net_device *d)
+{
+ d->open = sealevel_open;
+ d->stop = sealevel_close;
+ d->hard_start_xmit = sealevel_queue_xmit;
+ d->get_stats = sealevel_get_stats;
+ d->set_multicast_list = NULL;
+ d->do_ioctl = sealevel_ioctl;
+ d->neigh_setup = sealevel_neigh_setup_dev;
+ d->set_mac_address = NULL;
+
+}
+
+static inline struct slvl_device *slvl_alloc(int iobase, int irq)
+{
+ struct net_device *d;
+ struct slvl_device *sv;
+
+ d = alloc_netdev(sizeof(struct slvl_device), "hdlc%d",
+ slvl_setup);
+
+ if (!d)
+ return NULL;
+
+ sv = d->priv;
+ sv->netdev.dev = d;
+ d->base_addr = iobase;
+ d->irq = irq;
+
+ sppp_attach(&sv->netdev);
+ return sv;
+}
+
+
/*
- * Description block for a Comtrol Hostess SV11 card
+ * Allocate and setup Sealevel board.
*/
-static struct slvl_board *slvl_init(int iobase, int irq, int txdma, int rxdma, int slow)
+static __init struct slvl_board *slvl_init(int iobase, int irq,
+ int txdma, int rxdma, int slow)
{
struct z8530_dev *dev;
- struct slvl_device *sv;
struct slvl_board *b;
- int u;
/*
* Get the needed I/O space
*/
-
+
if(!request_region(iobase, 8, "Sealevel 4021"))
{
printk(KERN_WARNING "sealevel: I/O 0x%X already in use.\n", iobase);
return NULL;
}
- b=(struct slvl_board *)kmalloc(sizeof(struct slvl_board), GFP_KERNEL);
+ b = kmalloc(sizeof(struct slvl_board), GFP_KERNEL);
if(!b)
goto fail3;
-
- memset(b, 0, sizeof(*sv));
-
- b->dev[0].chan = &b->board.chanA;
- b->dev[0].if_ptr = &b->dev[0].netdev;
- b->dev[0].netdev.dev=(struct net_device *)
- kmalloc(sizeof(struct net_device), GFP_KERNEL);
- if(!b->dev[0].netdev.dev)
+
+ memset(b, 0, sizeof(*b));
+ if (!(b->dev[0]= slvl_alloc(iobase, irq)))
goto fail2;
- b->dev[1].chan = &b->board.chanB;
- b->dev[1].if_ptr = &b->dev[1].netdev;
- b->dev[1].netdev.dev=(struct net_device *)
- kmalloc(sizeof(struct net_device), GFP_KERNEL);
- if(!b->dev[1].netdev.dev)
+ b->dev[0]->chan = &b->board.chanA;
+ b->dev[0]->channel = 0;
+
+ if (!(b->dev[1] = slvl_alloc(iobase, irq)))
goto fail1_0;
- dev=&b->board;
+ b->dev[1]->chan = &b->board.chanB;
+ b->dev[1]->channel = 1;
+
+ dev = &b->board;
/*
* Stuff in the I/O addressing
@@ -287,8 +315,8 @@ static struct slvl_board *slvl_init(int iobase, int irq, int txdma, int rxdma, i
dev->irq=irq;
dev->chanA.private=&b->dev[0];
dev->chanB.private=&b->dev[1];
- dev->chanA.netdevice=b->dev[0].netdev.dev;
- dev->chanB.netdevice=b->dev[1].netdev.dev;
+ dev->chanA.netdevice=b->dev[0]->netdev.dev;
+ dev->chanB.netdevice=b->dev[1]->netdev.dev;
dev->chanA.dev=dev;
dev->chanB.dev=dev;
@@ -329,55 +357,18 @@ static struct slvl_board *slvl_init(int iobase, int irq, int txdma, int rxdma, i
enable_irq(irq);
- for(u=0; u<2; u++)
- {
- sv=&b->dev[u];
- sv->channel = u;
-
- if(dev_alloc_name(sv->chan->netdevice,"hdlc%d")>=0)
- {
- struct net_device *d=sv->chan->netdevice;
-
- /*
- * Initialise the PPP components
- */
- sppp_attach(&sv->netdev);
-
- /*
- * Local fields
- */
-
- d->base_addr = iobase;
- d->irq = irq;
- d->priv = sv;
- d->init = NULL;
-
- d->open = sealevel_open;
- d->stop = sealevel_close;
- d->hard_start_xmit = sealevel_queue_xmit;
- d->get_stats = sealevel_get_stats;
- d->set_multicast_list = NULL;
- d->do_ioctl = sealevel_ioctl;
- d->neigh_setup = sealevel_neigh_setup_dev;
- d->set_mac_address = NULL;
+ if (register_netdev(b->dev[0]->netdev.dev))
+ goto dmafail2;
- if(register_netdev(d)==-1)
- {
- printk(KERN_ERR "%s: unable to register device.\n",
- d->name);
- goto fail_unit;
- }
+ if (register_netdev(b->dev[1]->netdev.dev))
+ goto fail_unit;
- break;
- }
- }
z8530_describe(dev, "I/O", iobase);
dev->active=1;
return b;
fail_unit:
- if(u==1)
- unregister_netdev(b->dev[0].chan->netdevice);
+ unregister_netdev(b->dev[0]->netdev.dev);
dmafail2:
free_dma(dev->chanA.rxdma);
@@ -386,9 +377,9 @@ dmafail:
fail:
free_irq(irq, dev);
fail1_1:
- kfree(b->dev[1].netdev.dev);
+ free_netdev(b->dev[1]->netdev.dev);
fail1_0:
- kfree(b->dev[0].netdev.dev);
+ free_netdev(b->dev[0]->netdev.dev);
fail2:
kfree(b);
fail3:
@@ -396,7 +387,7 @@ fail3:
return NULL;
}
-static void slvl_shutdown(struct slvl_board *b)
+static void __exit slvl_shutdown(struct slvl_board *b)
{
int u;
@@ -404,8 +395,11 @@ static void slvl_shutdown(struct slvl_board *b)
for(u=0; u<2; u++)
{
- sppp_detach(b->dev[u].netdev.dev);
- unregister_netdev(b->dev[u].netdev.dev);
+ struct net_device *d = b->dev[u]->netdev.dev;
+ sppp_detach(d);
+
+ unregister_netdev(d);
+ free_netdev(d);
}
free_irq(b->board.irq, &b->board);
@@ -416,7 +410,6 @@ static void slvl_shutdown(struct slvl_board *b)
release_region(b->iobase, 8);
}
-#ifdef MODULE
static int io=0x238;
static int txdma=1;
@@ -441,20 +434,22 @@ MODULE_DESCRIPTION("Modular driver for the SeaLevel 4021");
static struct slvl_board *slvl_unit;
-int init_module(void)
+static int __init slvl_init_module(void)
{
+#ifdef MODULE
printk(KERN_INFO "SeaLevel Z85230 Synchronous Driver v 0.02.\n");
- printk(KERN_INFO "(c) Copyright 1998, Building Number Three Ltd.\n");
- if((slvl_unit=slvl_init(io,irq, txdma, rxdma, slow))==NULL)
- return -ENODEV;
- return 0;
+ printk(KERN_INFO "(c) Copyright 1998, Building Number Three Ltd.\n");
+#endif
+ slvl_unit = slvl_init(io, irq, txdma, rxdma, slow);
+
+ return slvl_unit ? 0 : -ENODEV;
}
-void cleanup_module(void)
+static void __exit slvl_cleanup_module(void)
{
if(slvl_unit)
slvl_shutdown(slvl_unit);
}
-#endif
-
+module_init(slvl_init_module);
+module_exit(slvl_cleanup_module);
diff --git a/drivers/net/wan/wanpipe_multppp.c b/drivers/net/wan/wanpipe_multppp.c
index 0eeb51c7105f..6aa6987d96cb 100644
--- a/drivers/net/wan/wanpipe_multppp.c
+++ b/drivers/net/wan/wanpipe_multppp.c
@@ -18,7 +18,6 @@
*****************************************************************************/
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h> /* printk(), and other useful stuff */
#include <linux/stddef.h> /* offsetof(), etc. */
#include <linux/errno.h> /* return codes */
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c
new file mode 100644
index 000000000000..17f12069a939
--- /dev/null
+++ b/drivers/net/wan/wanxl.c
@@ -0,0 +1,836 @@
+/*
+ * wanXL serial card driver for Linux
+ * host part
+ *
+ * Copyright (C) 2003 Krzysztof Halasa <khc@pm.waw.pl>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License
+ * as published by the Free Software Foundation.
+ *
+ * Status:
+ * - Only DTE (external clock) support with NRZ and NRZI encodings
+ * - wanXL100 will require minor driver modifications, no access to hw
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/slab.h>
+#include <linux/sched.h>
+#include <linux/types.h>
+#include <linux/fcntl.h>
+#include <linux/string.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/netdevice.h>
+#include <linux/hdlc.h>
+#include <linux/pci.h>
+#include <asm/io.h>
+#include <asm/delay.h>
+
+#include "wanxl.h"
+
+static const char* version = "wanXL serial card driver version: 0.46";
+
+#define PLX_CTL_RESET 0x40000000 /* adapter reset */
+
+#undef DEBUG_PKT
+#define DEBUG_PCI
+
+/* MAILBOX #1 - PUTS COMMANDS */
+#define MBX1_CMD_ABORTJ 0x85000000 /* Abort and Jump */
+#ifdef __LITTLE_ENDIAN
+#define MBX1_CMD_BSWAP 0x8C000001 /* little-endian Byte Swap Mode */
+#else
+#define MBX1_CMD_BSWAP 0x8C000000 /* big-endian Byte Swap Mode */
+#endif
+
+/* MAILBOX #2 - DRAM SIZE */
+#define MBX2_MEMSZ_MASK 0xFFFF0000 /* PUTS Memory Size Register mask */
+
+
+typedef struct {
+ hdlc_device hdlc; /* HDLC device struct - must be first */
+ struct card_t *card;
+ spinlock_t lock; /* for wanxl_xmit */
+ int node; /* physical port #0 - 3 */
+ unsigned int clock_type;
+ int tx_in, tx_out;
+ struct sk_buff *tx_skbs[TX_BUFFERS];
+}port_t;
+
+
+typedef struct {
+ desc_t rx_descs[RX_QUEUE_LENGTH];
+ port_status_t port_status[4];
+}card_status_t;
+
+
+typedef struct card_t {
+ int n_ports; /* 1, 2 or 4 ports */
+ u8 irq;
+
+ u8 *plx; /* PLX PCI9060 virtual base address */
+ struct pci_dev *pdev; /* for pdev->slot_name */
+ port_t *ports[4];
+ int rx_in;
+ struct sk_buff *rx_skbs[RX_QUEUE_LENGTH];
+ card_status_t *status; /* shared between host and card */
+ dma_addr_t status_address;
+}card_t;
+
+
+
+static inline port_t* hdlc_to_port(hdlc_device *hdlc)
+{
+ return (port_t*)hdlc;
+}
+
+
+static inline port_t* dev_to_port(struct net_device *dev)
+{
+ return hdlc_to_port(dev_to_hdlc(dev));
+}
+
+
+static inline struct net_device *port_to_dev(port_t* port)
+{
+ return hdlc_to_dev(&port->hdlc);
+}
+
+
+static inline const char* port_name(port_t *port)
+{
+ return hdlc_to_name((hdlc_device*)port);
+}
+
+
+static inline const char* card_name(struct pci_dev *pdev)
+{
+ return pdev->slot_name;
+}
+
+
+static inline port_status_t* get_status(port_t *port)
+{
+ return &port->card->status->port_status[port->node];
+}
+
+
+#ifdef DEBUG_PCI
+static inline dma_addr_t pci_map_single_debug(struct pci_dev *pdev, void *ptr,
+ size_t size, int direction)
+{
+ dma_addr_t addr = pci_map_single(pdev, ptr, size, direction);
+ if (addr + size > 0x100000000LL)
+ printk(KERN_CRIT "wanXL %s: pci_map_single() returned memory"
+ " at 0x%X!\n", card_name(pdev), addr);
+ return addr;
+}
+
+#undef pci_map_single
+#define pci_map_single pci_map_single_debug
+#endif
+
+
+/* Cable and/or personality module change interrupt service */
+static inline void wanxl_cable_intr(port_t *port)
+{
+ u32 value = get_status(port)->cable;
+ int valid = 1;
+ const char *cable, *pm, *dte = "", *dsr = "", *dcd = "";
+
+ switch(value & 0x7) {
+ case STATUS_CABLE_V35: cable = "V.35"; break;
+ case STATUS_CABLE_X21: cable = "X.21"; break;
+ case STATUS_CABLE_V24: cable = "V.24"; break;
+ case STATUS_CABLE_EIA530: cable = "EIA530"; break;
+ case STATUS_CABLE_NONE: cable = "no"; break;
+ default: cable = "invalid";
+ }
+
+ switch((value >> STATUS_CABLE_PM_SHIFT) & 0x7) {
+ case STATUS_CABLE_V35: pm = "V.35"; break;
+ case STATUS_CABLE_X21: pm = "X.21"; break;
+ case STATUS_CABLE_V24: pm = "V.24"; break;
+ case STATUS_CABLE_EIA530: pm = "EIA530"; break;
+ case STATUS_CABLE_NONE: pm = "no personality"; valid = 0; break;
+ default: pm = "invalid personality"; valid = 0;
+ }
+
+ if (valid) {
+ if ((value & 7) == ((value >> STATUS_CABLE_PM_SHIFT) & 7)) {
+ dsr = (value & STATUS_CABLE_DSR) ? ", DSR ON" :
+ ", DSR off";
+ dcd = (value & STATUS_CABLE_DCD) ? ", carrier ON" :
+ ", carrier off";
+ }
+ dte = (value & STATUS_CABLE_DCE) ? " DCE" : " DTE";
+ }
+ printk(KERN_INFO "%s: %s%s module, %s cable%s%s\n",
+ port_name(port), pm, dte, cable, dsr, dcd);
+
+ hdlc_set_carrier(value & STATUS_CABLE_DCD, &port->hdlc);
+}
+
+
+
+/* Transmit complete interrupt service */
+static inline void wanxl_tx_intr(port_t *port)
+{
+ while (1) {
+ desc_t *desc;
+ desc = &get_status(port)->tx_descs[port->tx_in];
+ struct sk_buff *skb = port->tx_skbs[port->tx_in];
+
+ switch (desc->stat) {
+ case PACKET_FULL:
+ case PACKET_EMPTY:
+ netif_wake_queue(port_to_dev(port));
+ return;
+
+ case PACKET_UNDERRUN:
+ port->hdlc.stats.tx_errors++;
+ port->hdlc.stats.tx_fifo_errors++;
+ break;
+
+ default:
+ port->hdlc.stats.tx_packets++;
+ port->hdlc.stats.tx_bytes += skb->len;
+ }
+ desc->stat = PACKET_EMPTY; /* Free descriptor */
+ pci_unmap_single(port->card->pdev, desc->address, skb->len,
+ PCI_DMA_TODEVICE);
+ dev_kfree_skb_irq(skb);
+ port->tx_in = (port->tx_in + 1) % TX_BUFFERS;
+ }
+}
+
+
+
+/* Receive complete interrupt service */
+static inline void wanxl_rx_intr(card_t *card)
+{
+ desc_t *desc;
+ while(desc = &card->status->rx_descs[card->rx_in],
+ desc->stat != PACKET_EMPTY) {
+ struct sk_buff *skb = card->rx_skbs[card->rx_in];
+ port_t *port = card->ports[desc->stat & PACKET_PORT_MASK];
+ struct net_device *dev = port_to_dev(port);
+
+ if ((desc->stat & PACKET_PORT_MASK) > card->n_ports)
+ printk(KERN_CRIT "wanXL %s: received packet for"
+ " nonexistent port\n", card_name(card->pdev));
+
+ else if (!skb)
+ port->hdlc.stats.rx_dropped++;
+
+ else {
+ pci_unmap_single(card->pdev, desc->address,
+ BUFFER_LENGTH, PCI_DMA_FROMDEVICE);
+ skb_put(skb, desc->length);
+
+#ifdef DEBUG_PKT
+ printk(KERN_DEBUG "%s RX(%i):", port_name(port),
+ skb->len);
+ debug_frame(skb);
+#endif
+ port->hdlc.stats.rx_packets++;
+ port->hdlc.stats.rx_bytes += skb->len;
+ skb->mac.raw = skb->data;
+ skb->dev = dev;
+ dev->last_rx = jiffies;
+ skb->protocol = hdlc_type_trans(skb, dev);
+ netif_rx(skb);
+ skb = NULL;
+ }
+
+ if (!skb) {
+ skb = dev_alloc_skb(BUFFER_LENGTH);
+ desc->address = skb ?
+ pci_map_single(card->pdev, skb->data,
+ BUFFER_LENGTH,
+ PCI_DMA_FROMDEVICE) : 0;
+ card->rx_skbs[card->rx_in] = skb;
+ }
+ desc->stat = PACKET_EMPTY; /* Free descriptor */
+ card->rx_in = (card->rx_in + 1) % RX_QUEUE_LENGTH;
+ }
+}
+
+
+
+static irqreturn_t wanxl_intr(int irq, void* dev_id, struct pt_regs *regs)
+{
+ card_t *card = dev_id;
+ int i;
+ u32 stat;
+ int handled = 0;
+
+
+ while((stat = readl(card->plx + PLX_DOORBELL_FROM_CARD)) != 0) {
+ handled = 1;
+ writel(stat, card->plx + PLX_DOORBELL_FROM_CARD);
+
+ for (i = 0; i < card->n_ports; i++) {
+ if (stat & (1 << (DOORBELL_FROM_CARD_TX_0 + i)))
+ wanxl_tx_intr(card->ports[i]);
+ if (stat & (1 << (DOORBELL_FROM_CARD_CABLE_0 + i)))
+ wanxl_cable_intr(card->ports[i]);
+ }
+ if (stat & (1 << DOORBELL_FROM_CARD_RX))
+ wanxl_rx_intr(card);
+ }
+
+ return IRQ_RETVAL(handled);
+}
+
+
+
+static int wanxl_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+ hdlc_device *hdlc = dev_to_hdlc(dev);
+ port_t *port = hdlc_to_port(hdlc);
+
+ spin_lock(&port->lock);
+
+ desc_t *desc = &get_status(port)->tx_descs[port->tx_out];
+ if (desc->stat != PACKET_EMPTY) {
+ /* should never happen - previous xmit should stop queue */
+#ifdef DEBUG_PKT
+ printk(KERN_DEBUG "%s: transmitter buffer full\n",
+ port_name(port));
+#endif
+ netif_stop_queue(dev);
+ spin_unlock_irq(&port->lock);
+ return 1; /* request packet to be queued */
+ }
+
+#ifdef DEBUG_PKT
+ printk(KERN_DEBUG "%s TX(%i):", port_name(port), skb->len);
+ debug_frame(skb);
+#endif
+
+ port->tx_skbs[port->tx_out] = skb;
+ desc->address = pci_map_single(port->card->pdev, skb->data, skb->len,
+ PCI_DMA_TODEVICE);
+ desc->length = skb->len;
+ desc->stat = PACKET_FULL;
+ writel(1 << (DOORBELL_TO_CARD_TX_0 + port->node),
+ port->card->plx + PLX_DOORBELL_TO_CARD);
+ dev->trans_start = jiffies;
+
+ port->tx_out = (port->tx_out + 1) % TX_BUFFERS;
+
+ if (get_status(port)->tx_descs[port->tx_out].stat != PACKET_EMPTY) {
+ netif_stop_queue(dev);
+#ifdef DEBUG_PKT
+ printk(KERN_DEBUG "%s: transmitter buffer full\n",
+ port_name(port));
+#endif
+ }
+
+ spin_unlock(&port->lock);
+ return 0;
+}
+
+
+
+static int wanxl_attach(hdlc_device *hdlc, unsigned short encoding,
+ unsigned short parity)
+{
+ port_t *port = hdlc_to_port(hdlc);
+
+ if (encoding != ENCODING_NRZ &&
+ encoding != ENCODING_NRZI)
+ return -EINVAL;
+
+ if (parity != PARITY_NONE &&
+ parity != PARITY_CRC32_PR1_CCITT &&
+ parity != PARITY_CRC16_PR1_CCITT &&
+ parity != PARITY_CRC32_PR0_CCITT &&
+ parity != PARITY_CRC16_PR0_CCITT)
+ return -EINVAL;
+
+ get_status(port)->encoding = encoding;
+ get_status(port)->parity = parity;
+ return 0;
+}
+
+
+
+static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+ const size_t size = sizeof(sync_serial_settings);
+ sync_serial_settings line;
+ hdlc_device *hdlc = dev_to_hdlc(dev);
+ port_t *port = hdlc_to_port(hdlc);
+
+ if (cmd != SIOCWANDEV)
+ return hdlc_ioctl(dev, ifr, cmd);
+
+ switch (ifr->ifr_settings.type) {
+ case IF_GET_IFACE:
+ ifr->ifr_settings.type = IF_IFACE_SYNC_SERIAL;
+ if (ifr->ifr_settings.size < size) {
+ ifr->ifr_settings.size = size; /* data size wanted */
+ return -ENOBUFS;
+ }
+ line.clock_type = get_status(port)->clocking;
+ line.clock_rate = 0;
+ line.loopback = 0;
+
+ if (copy_to_user(ifr->ifr_settings.ifs_ifsu.sync, &line, size))
+ return -EFAULT;
+ return 0;
+
+ case IF_IFACE_SYNC_SERIAL:
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+ if (dev->flags & IFF_UP)
+ return -EBUSY;
+
+ if (copy_from_user(&line, ifr->ifr_settings.ifs_ifsu.sync,
+ size))
+ return -EFAULT;
+
+ if (line.clock_type != CLOCK_EXT &&
+ line.clock_type != CLOCK_TXFROMRX)
+ return -EINVAL; /* No such clock setting */
+
+ if (line.loopback != 0)
+ return -EINVAL;
+
+ get_status(port)->clocking = line.clock_type;
+ return 0;
+
+ default:
+ return hdlc_ioctl(dev, ifr, cmd);
+ }
+}
+
+
+
+static int wanxl_open(struct net_device *dev)
+{
+ hdlc_device *hdlc = dev_to_hdlc(dev);
+ port_t *port = hdlc_to_port(hdlc);
+ u8 *dbr = port->card->plx + PLX_DOORBELL_TO_CARD;
+ unsigned long timeout;
+ int i;
+
+ if (get_status(port)->open) {
+ printk(KERN_ERR "%s: port already open\n", port_name(port));
+ return -EIO;
+ }
+ if ((i = hdlc_open(hdlc)) != 0)
+ return i;
+
+ port->tx_in = port->tx_out = 0;
+ for (i = 0; i < TX_BUFFERS; i++)
+ get_status(port)->tx_descs[i].stat = PACKET_EMPTY;
+ /* signal the card */
+ writel(1 << (DOORBELL_TO_CARD_OPEN_0 + port->node), dbr);
+
+ timeout = jiffies + HZ;
+ do
+ if (get_status(port)->open)
+ return 0;
+ while (time_after(timeout, jiffies));
+
+ printk(KERN_ERR "%s: unable to open port\n", port_name(port));
+ /* ask the card to close the port, should it be still alive */
+ writel(1 << (DOORBELL_TO_CARD_CLOSE_0 + port->node), dbr);
+ return -EFAULT;
+}
+
+
+
+static int wanxl_close(struct net_device *dev)
+{
+ hdlc_device *hdlc = dev_to_hdlc(dev);
+ port_t *port = hdlc_to_port(hdlc);
+ unsigned long timeout;
+ int i;
+
+ hdlc_close(hdlc);
+ /* signal the card */
+ writel(1 << (DOORBELL_TO_CARD_CLOSE_0 + port->node),
+ port->card->plx + PLX_DOORBELL_TO_CARD);
+
+ timeout = jiffies + HZ;
+ do
+ if (!get_status(port)->open)
+ break;
+ while (time_after(timeout, jiffies));
+
+ if (get_status(port)->open)
+ printk(KERN_ERR "%s: unable to close port\n", port_name(port));
+
+ for (i = 0; i < TX_BUFFERS; i++) {
+ desc_t *desc = &get_status(port)->tx_descs[i];
+
+ if (desc->stat != PACKET_EMPTY) {
+ desc->stat = PACKET_EMPTY;
+ pci_unmap_single(port->card->pdev, desc->address,
+ port->tx_skbs[i]->len,
+ PCI_DMA_TODEVICE);
+ dev_kfree_skb(port->tx_skbs[i]);
+ }
+ }
+ return 0;
+}
+
+
+
+static struct net_device_stats *wanxl_get_stats(struct net_device *dev)
+{
+ hdlc_device *hdlc = dev_to_hdlc(dev);
+ port_t *port = hdlc_to_port(hdlc);
+
+ hdlc->stats.rx_over_errors = get_status(port)->rx_overruns;
+ hdlc->stats.rx_frame_errors = get_status(port)->rx_frame_errors;
+ hdlc->stats.rx_errors = hdlc->stats.rx_over_errors +
+ hdlc->stats.rx_frame_errors;
+ return &hdlc->stats;
+}
+
+
+
+static int wanxl_puts_command(card_t *card, u32 cmd)
+{
+ unsigned long timeout = jiffies + 5 * HZ;
+
+ writel(cmd, card->plx + PLX_MAILBOX_1);
+ do {
+ if (readl(card->plx + PLX_MAILBOX_1) == 0)
+ return 0;
+
+ schedule();
+ }while (time_after(timeout, jiffies));
+
+ return -1;
+}
+
+
+
+static void wanxl_reset(card_t *card)
+{
+ u32 old_value = readl(card->plx + PLX_CONTROL) & ~PLX_CTL_RESET;
+
+ writel(0x80, card->plx + PLX_MAILBOX_0);
+ writel(old_value | PLX_CTL_RESET, card->plx + PLX_CONTROL);
+ readl(card->plx + PLX_CONTROL); /* wait for posted write */
+ udelay(1);
+ writel(old_value, card->plx + PLX_CONTROL);
+ readl(card->plx + PLX_CONTROL); /* wait for posted write */
+}
+
+
+
+static void wanxl_pci_remove_one(struct pci_dev *pdev)
+{
+ card_t *card = pci_get_drvdata(pdev);
+ int i;
+
+ /* unregister and free all host resources */
+ if (card->irq)
+ free_irq(card->irq, card);
+
+ for (i = 0; i < 4; i++)
+ if (card->ports[i])
+ unregister_hdlc_device(&card->ports[i]->hdlc);
+
+ wanxl_reset(card);
+
+ for (i = 0; i < RX_QUEUE_LENGTH; i++)
+ if (card->rx_skbs[i]) {
+ pci_unmap_single(card->pdev,
+ card->status->rx_descs[i].address,
+ BUFFER_LENGTH, PCI_DMA_FROMDEVICE);
+ dev_kfree_skb(card->rx_skbs[i]);
+ }
+
+ if (card->plx)
+ iounmap(card->plx);
+
+ if (card->status)
+ pci_free_consistent(pdev, sizeof(card_status_t),
+ card->status, card->status_address);
+
+ pci_set_drvdata(pdev, NULL);
+ kfree(card);
+ pci_release_regions(pdev);
+}
+
+
+#include "wanxlfw.inc"
+
+static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
+{
+ card_t *card;
+ u32 ramsize, stat;
+ unsigned long timeout;
+ u32 plx_phy; /* PLX PCI base address */
+ u32 mem_phy; /* memory PCI base addr */
+ u8 *mem; /* memory virtual base addr */
+ int i, ports, alloc_size;
+
+ i = pci_enable_device(pdev);
+ if (i)
+ return i;
+
+ /* QUICC can only access first 256 MB of host RAM directly,
+ but PLX9060 DMA does 32-bits for actual packet data transfers */
+
+ /* FIXME when PCI/DMA subsystems are fixed.
+ We set both dma_mask and consistent_dma_mask to 28 bits
+ and pray pci_alloc_consistent() will use this info. It should
+ work on most platforms */
+ if (pci_set_consistent_dma_mask(pdev, 0x0FFFFFFF) ||
+ pci_set_dma_mask(pdev, 0x0FFFFFFF)) {
+ printk(KERN_ERR "No usable DMA configuration\n");
+ return -EIO;
+ }
+
+ i = pci_request_regions(pdev, "wanXL");
+ if (i)
+ return i;
+
+ switch (pdev->device) {
+ case PCI_DEVICE_ID_SBE_WANXL100: ports = 1; break;
+ case PCI_DEVICE_ID_SBE_WANXL200: ports = 2; break;
+ default: ports = 4;
+ }
+
+ alloc_size = sizeof(card_t) + ports * sizeof(port_t);
+ card = kmalloc(alloc_size, GFP_KERNEL);
+ if (card == NULL) {
+ printk(KERN_ERR "wanXL %s: unable to allocate memory\n",
+ card_name(pdev));
+ pci_release_regions(pdev);
+ return -ENOBUFS;
+ }
+ memset(card, 0, alloc_size);
+
+ pci_set_drvdata(pdev, card);
+ card->pdev = pdev;
+ card->n_ports = ports;
+
+ card->status = pci_alloc_consistent(pdev, sizeof(card_status_t),
+ &card->status_address);
+ if (card->status == NULL) {
+ wanxl_pci_remove_one(pdev);
+ return -ENOBUFS;
+ }
+
+#ifdef DEBUG_PCI
+ printk(KERN_DEBUG "wanXL %s: pci_alloc_consistent() returned memory"
+ " at 0x%X\n", card_name(pdev), card->status_address);
+#endif
+
+ /* FIXME when PCI/DMA subsystems are fixed.
+ We set both dma_mask and consistent_dma_mask back to 32 bits
+ to indicate the card can do 32-bit DMA addressing */
+ if (pci_set_consistent_dma_mask(pdev, 0xFFFFFFFF) ||
+ pci_set_dma_mask(pdev, 0xFFFFFFFF)) {
+ printk(KERN_ERR "No usable DMA configuration\n");
+ wanxl_pci_remove_one(pdev);
+ return -EIO;
+ }
+
+ /* set up PLX mapping */
+ plx_phy = pci_resource_start(pdev, 0);
+ card->plx = ioremap_nocache(plx_phy, 0x70);
+
+#if RESET_WHILE_LOADING
+ wanxl_reset(card);
+#endif
+
+ timeout = jiffies + 20 * HZ;
+ while ((stat = readl(card->plx + PLX_MAILBOX_0)) != 0) {
+ if (time_before(timeout, jiffies)) {
+ printk(KERN_WARNING "wanXL %s: timeout waiting for"
+ " PUTS to complete\n", card_name(pdev));
+ wanxl_pci_remove_one(pdev);
+ return -ENODEV;
+ }
+
+ switch(stat & 0xC0) {
+ case 0x00: /* hmm - PUTS completed with non-zero code? */
+ case 0x80: /* PUTS still testing the hardware */
+ break;
+
+ default:
+ printk(KERN_WARNING "wanXL %s: PUTS test 0x%X"
+ " failed\n", card_name(pdev), stat & 0x30);
+ wanxl_pci_remove_one(pdev);
+ return -ENODEV;
+ }
+
+ schedule();
+ }
+
+ /* get on-board memory size (PUTS detects no more than 4 MB) */
+ ramsize = readl(card->plx + PLX_MAILBOX_2) & MBX2_MEMSZ_MASK;
+
+ /* set up on-board RAM mapping */
+ mem_phy = pci_resource_start(pdev, 2);
+
+
+ /* sanity check the board's reported memory size */
+ if (ramsize < BUFFERS_ADDR +
+ (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports) {
+ printk(KERN_WARNING "wanXL %s: no enough on-board RAM"
+ " (%u bytes detected, %u bytes required)\n",
+ card_name(pdev), ramsize, BUFFERS_ADDR +
+ (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * ports);
+ wanxl_pci_remove_one(pdev);
+ return -ENODEV;
+ }
+
+ if (wanxl_puts_command(card, MBX1_CMD_BSWAP)) {
+ printk(KERN_WARNING "wanXL %s: unable to Set Byte Swap"
+ " Mode\n", card_name(pdev));
+ wanxl_pci_remove_one(pdev);
+ return -ENODEV;
+ }
+
+ for (i = 0; i < ports; i++) {
+ port_t *port = (void *)card + sizeof(card_t) +
+ i * sizeof(port_t);
+ struct net_device *dev = hdlc_to_dev(&port->hdlc);
+ spin_lock_init(&port->lock);
+ SET_MODULE_OWNER(dev);
+ dev->tx_queue_len = 50;
+ dev->do_ioctl = wanxl_ioctl;
+ dev->open = wanxl_open;
+ dev->stop = wanxl_close;
+ port->hdlc.attach = wanxl_attach;
+ port->hdlc.xmit = wanxl_xmit;
+ if(register_hdlc_device(&port->hdlc)) {
+ printk(KERN_ERR "wanXL %s: unable to register hdlc"
+ " device\n", card_name(pdev));
+ wanxl_pci_remove_one(pdev);
+ return -ENOBUFS;
+ }
+ card->ports[i] = port;
+ dev->get_stats = wanxl_get_stats;
+ port->card = card;
+ port->node = i;
+ get_status(port)->clocking = CLOCK_EXT;
+ }
+
+ for (i = 0; i < RX_QUEUE_LENGTH; i++) {
+ struct sk_buff *skb = dev_alloc_skb(BUFFER_LENGTH);
+ card->rx_skbs[i] = skb;
+ if (skb)
+ card->status->rx_descs[i].address =
+ pci_map_single(card->pdev, skb->data,
+ BUFFER_LENGTH,
+ PCI_DMA_FROMDEVICE);
+ }
+
+ mem = ioremap_nocache(mem_phy, PDM_OFFSET + sizeof(firmware));
+ for (i = 0; i < sizeof(firmware); i += 4)
+ writel(htonl(*(u32*)(firmware + i)), mem + PDM_OFFSET + i);
+
+ for (i = 0; i < ports; i++)
+ writel(card->status_address +
+ (void *)&card->status->port_status[i] -
+ (void *)card->status, mem + PDM_OFFSET + 4 + i * 4);
+ writel(card->status_address, mem + PDM_OFFSET + 20);
+ writel(PDM_OFFSET, mem);
+ iounmap(mem);
+
+ writel(0, card->plx + PLX_MAILBOX_5);
+
+ if (wanxl_puts_command(card, MBX1_CMD_ABORTJ)) {
+ printk(KERN_WARNING "wanXL %s: unable to Abort and Jump\n",
+ card_name(pdev));
+ wanxl_pci_remove_one(pdev);
+ return -ENODEV;
+ }
+
+ stat = 0;
+ timeout = jiffies + 5 * HZ;
+ do {
+ if ((stat = readl(card->plx + PLX_MAILBOX_5)) != 0)
+ break;
+ schedule();
+ }while (time_after(timeout, jiffies));
+
+ if (!stat) {
+ printk(KERN_WARNING "wanXL %s: timeout while initializing card"
+ "firmware\n", card_name(pdev));
+ wanxl_pci_remove_one(pdev);
+ return -ENODEV;
+ }
+
+#if DETECT_RAM
+ ramsize = stat;
+#endif
+
+ printk(KERN_INFO "wanXL %s: at 0x%X, %u KB of RAM at 0x%X, irq"
+ " %u\n" KERN_INFO "wanXL %s: port", card_name(pdev),
+ plx_phy, ramsize / 1024, mem_phy, pdev->irq, card_name(pdev));
+
+ for (i = 0; i < ports; i++)
+ printk("%s #%i: %s", i ? "," : "", i,
+ port_name(card->ports[i]));
+ printk("\n");
+
+ /* Allocate IRQ */
+ if(request_irq(pdev->irq, wanxl_intr, SA_SHIRQ, "wanXL", card)) {
+ printk(KERN_WARNING "wanXL %s: could not allocate IRQ%i.\n",
+ card_name(pdev), pdev->irq);
+ wanxl_pci_remove_one(pdev);
+ return -EBUSY;
+ }
+ card->irq = pdev->irq;
+
+ return 0;
+}
+
+static struct pci_device_id wanxl_pci_tbl[] __devinitdata = {
+ { PCI_VENDOR_ID_SBE, PCI_DEVICE_ID_SBE_WANXL100, PCI_ANY_ID,
+ PCI_ANY_ID, 0, 0, 0 },
+ { PCI_VENDOR_ID_SBE, PCI_DEVICE_ID_SBE_WANXL200, PCI_ANY_ID,
+ PCI_ANY_ID, 0, 0, 0 },
+ { PCI_VENDOR_ID_SBE, PCI_DEVICE_ID_SBE_WANXL400, PCI_ANY_ID,
+ PCI_ANY_ID, 0, 0, 0 },
+ { 0, }
+};
+
+
+static struct pci_driver wanxl_pci_driver = {
+ name: "wanXL",
+ id_table: wanxl_pci_tbl,
+ probe: wanxl_pci_init_one,
+ remove: wanxl_pci_remove_one,
+};
+
+
+static int __init wanxl_init_module(void)
+{
+#ifdef MODULE
+ printk(KERN_INFO "%s\n", version);
+#endif
+ return pci_module_init(&wanxl_pci_driver);
+}
+
+static void __exit wanxl_cleanup_module(void)
+{
+ pci_unregister_driver(&wanxl_pci_driver);
+}
+
+
+MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
+MODULE_DESCRIPTION("SBE Inc. wanXL serial port driver");
+MODULE_LICENSE("GPL v2");
+MODULE_DEVICE_TABLE(pci, wanxl_pci_tbl);
+
+module_init(wanxl_init_module);
+module_exit(wanxl_cleanup_module);
diff --git a/drivers/net/wan/wanxl.h b/drivers/net/wan/wanxl.h
new file mode 100644
index 000000000000..3f86558f8a6b
--- /dev/null
+++ b/drivers/net/wan/wanxl.h
@@ -0,0 +1,152 @@
+/*
+ * wanXL serial card driver for Linux
+ * definitions common to host driver and card firmware
+ *
+ * Copyright (C) 2003 Krzysztof Halasa <khc@pm.waw.pl>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License
+ * as published by the Free Software Foundation.
+ */
+
+#define RESET_WHILE_LOADING 0
+
+/* you must rebuild the firmware if any of the following is changed */
+#define DETECT_RAM 0 /* needed for > 4MB RAM, 16 MB maximum */
+#define QUICC_MEMCPY_USES_PLX 1 /* must be used if the host has > 256 MB RAM */
+
+
+#define STATUS_CABLE_V35 2
+#define STATUS_CABLE_X21 3
+#define STATUS_CABLE_V24 4
+#define STATUS_CABLE_EIA530 5
+#define STATUS_CABLE_INVALID 6
+#define STATUS_CABLE_NONE 7
+
+#define STATUS_CABLE_DCE 0x8000
+#define STATUS_CABLE_DSR 0x0010
+#define STATUS_CABLE_DCD 0x0008
+#define STATUS_CABLE_PM_SHIFT 5
+
+#define PDM_OFFSET 0x1000
+
+#define TX_BUFFERS 10 /* per port */
+#define RX_BUFFERS 30
+#define RX_QUEUE_LENGTH 40 /* card->host queue length - per card */
+
+#define PACKET_EMPTY 0x00
+#define PACKET_FULL 0x10
+#define PACKET_SENT 0x20 /* TX only */
+#define PACKET_UNDERRUN 0x30 /* TX only */
+#define PACKET_PORT_MASK 0x03 /* RX only */
+
+/* bit numbers in PLX9060 doorbell registers */
+#define DOORBELL_FROM_CARD_TX_0 0 /* packet sent by the card */
+#define DOORBELL_FROM_CARD_TX_1 1
+#define DOORBELL_FROM_CARD_TX_2 2
+#define DOORBELL_FROM_CARD_TX_3 3
+#define DOORBELL_FROM_CARD_RX 4
+#define DOORBELL_FROM_CARD_CABLE_0 5 /* cable/PM/etc. changed */
+#define DOORBELL_FROM_CARD_CABLE_1 6
+#define DOORBELL_FROM_CARD_CABLE_2 7
+#define DOORBELL_FROM_CARD_CABLE_3 8
+
+#define DOORBELL_TO_CARD_OPEN_0 0
+#define DOORBELL_TO_CARD_OPEN_1 1
+#define DOORBELL_TO_CARD_OPEN_2 2
+#define DOORBELL_TO_CARD_OPEN_3 3
+#define DOORBELL_TO_CARD_CLOSE_0 4
+#define DOORBELL_TO_CARD_CLOSE_1 5
+#define DOORBELL_TO_CARD_CLOSE_2 6
+#define DOORBELL_TO_CARD_CLOSE_3 7
+#define DOORBELL_TO_CARD_TX_0 8 /* outbound packet queued */
+#define DOORBELL_TO_CARD_TX_1 9
+#define DOORBELL_TO_CARD_TX_2 10
+#define DOORBELL_TO_CARD_TX_3 11
+
+/* firmware-only status bits, starting from last DOORBELL_TO_CARD + 1 */
+#define TASK_SCC_0 12
+#define TASK_SCC_1 13
+#define TASK_SCC_2 14
+#define TASK_SCC_3 15
+
+#define ALIGN32(x) (((x) + 3) & 0xFFFFFFFC)
+#define BUFFER_LENGTH ALIGN32(HDLC_MAX_MRU + 4) /* 4 bytes for 32-bit CRC */
+
+/* Address of TX and RX buffers in 68360 address space */
+#define BUFFERS_ADDR 0x4000 /* 16 KB */
+
+#ifndef __ASSEMBLER__
+#define PLX_OFFSET 0
+#else
+#define PLX_OFFSET PLX + 0x80
+#endif
+
+#define PLX_MAILBOX_0 (PLX_OFFSET + 0x40)
+#define PLX_MAILBOX_1 (PLX_OFFSET + 0x44)
+#define PLX_MAILBOX_2 (PLX_OFFSET + 0x48)
+#define PLX_MAILBOX_3 (PLX_OFFSET + 0x4C)
+#define PLX_MAILBOX_4 (PLX_OFFSET + 0x50)
+#define PLX_MAILBOX_5 (PLX_OFFSET + 0x54)
+#define PLX_MAILBOX_6 (PLX_OFFSET + 0x58)
+#define PLX_MAILBOX_7 (PLX_OFFSET + 0x5C)
+#define PLX_DOORBELL_TO_CARD (PLX_OFFSET + 0x60)
+#define PLX_DOORBELL_FROM_CARD (PLX_OFFSET + 0x64)
+#define PLX_INTERRUPT_CS (PLX_OFFSET + 0x68)
+#define PLX_CONTROL (PLX_OFFSET + 0x6C)
+
+#ifdef __ASSEMBLER__
+#define PLX_DMA_0_MODE (PLX + 0x100)
+#define PLX_DMA_0_PCI (PLX + 0x104)
+#define PLX_DMA_0_LOCAL (PLX + 0x108)
+#define PLX_DMA_0_LENGTH (PLX + 0x10C)
+#define PLX_DMA_0_DESC (PLX + 0x110)
+#define PLX_DMA_1_MODE (PLX + 0x114)
+#define PLX_DMA_1_PCI (PLX + 0x118)
+#define PLX_DMA_1_LOCAL (PLX + 0x11C)
+#define PLX_DMA_1_LENGTH (PLX + 0x120)
+#define PLX_DMA_1_DESC (PLX + 0x124)
+#define PLX_DMA_CMD_STS (PLX + 0x128)
+#define PLX_DMA_ARBITR_0 (PLX + 0x12C)
+#define PLX_DMA_ARBITR_1 (PLX + 0x130)
+#endif
+
+#define DESC_LENGTH 12
+
+/* offsets from start of status_t */
+/* card to host */
+#define STATUS_OPEN 0
+#define STATUS_CABLE (STATUS_OPEN + 4)
+#define STATUS_RX_OVERRUNS (STATUS_CABLE + 4)
+#define STATUS_RX_FRAME_ERRORS (STATUS_RX_OVERRUNS + 4)
+
+/* host to card */
+#define STATUS_PARITY (STATUS_RX_FRAME_ERRORS + 4)
+#define STATUS_ENCODING (STATUS_PARITY + 4)
+#define STATUS_CLOCKING (STATUS_ENCODING + 4)
+#define STATUS_TX_DESCS (STATUS_CLOCKING + 4)
+
+#ifndef __ASSEMBLER__
+
+typedef struct {
+ volatile u32 stat;
+ u32 address; /* PCI address */
+ volatile u32 length;
+}desc_t;
+
+
+typedef struct {
+// Card to host
+ volatile u32 open;
+ volatile u32 cable;
+ volatile u32 rx_overruns;
+ volatile u32 rx_frame_errors;
+
+// Host to card
+ u32 parity;
+ u32 encoding;
+ u32 clocking;
+ desc_t tx_descs[TX_BUFFERS];
+}port_status_t;
+
+#endif /* __ASSEMBLER__ */
diff --git a/drivers/net/wan/wanxlfw.S b/drivers/net/wan/wanxlfw.S
new file mode 100644
index 000000000000..73aae2bf2f1c
--- /dev/null
+++ b/drivers/net/wan/wanxlfw.S
@@ -0,0 +1,895 @@
+.psize 0
+/*
+ wanXL serial card driver for Linux
+ card firmware part
+
+ Copyright (C) 2003 Krzysztof Halasa <khc@pm.waw.pl>
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of version 2 of the GNU General Public License
+ as published by the Free Software Foundation.
+
+
+
+
+ DPRAM BDs:
+ 0x000 - 0x050 TX#0 0x050 - 0x140 RX#0
+ 0x140 - 0x190 TX#1 0x190 - 0x280 RX#1
+ 0x280 - 0x2D0 TX#2 0x2D0 - 0x3C0 RX#2
+ 0x3C0 - 0x410 TX#3 0x410 - 0x500 RX#3
+
+
+ 000 5FF 1536 Bytes Dual-Port RAM User Data / BDs
+ 600 6FF 256 Bytes Dual-Port RAM User Data / BDs
+ 700 7FF 256 Bytes Dual-Port RAM User Data / BDs
+ C00 CBF 192 Bytes Dual-Port RAM Parameter RAM Page 1
+ D00 DBF 192 Bytes Dual-Port RAM Parameter RAM Page 2
+ E00 EBF 192 Bytes Dual-Port RAM Parameter RAM Page 3
+ F00 FBF 192 Bytes Dual-Port RAM Parameter RAM Page 4
+
+ local interrupts level
+ NMI 7
+ PIT timer, CPM (RX/TX complete) 4
+ PCI9060 DMA and PCI doorbells 3
+ Cable - not used 1
+*/
+
+#include <linux/hdlc.h>
+#include "wanxl.h"
+
+/* memory addresses and offsets */
+
+MAX_RAM_SIZE = 16 * 1024 * 1024 // max RAM supported by hardware
+
+PCI9060_VECTOR = 0x0000006C
+CPM_IRQ_BASE = 0x40
+ERROR_VECTOR = CPM_IRQ_BASE * 4
+SCC1_VECTOR = (CPM_IRQ_BASE + 0x1E) * 4
+SCC2_VECTOR = (CPM_IRQ_BASE + 0x1D) * 4
+SCC3_VECTOR = (CPM_IRQ_BASE + 0x1C) * 4
+SCC4_VECTOR = (CPM_IRQ_BASE + 0x1B) * 4
+CPM_IRQ_LEVEL = 4
+TIMER_IRQ = 128
+TIMER_IRQ_LEVEL = 4
+PITR_CONST = 0x100 + 16 // 1 Hz timer
+
+MBAR = 0x0003FF00
+
+VALUE_WINDOW = 0x40000000
+ORDER_WINDOW = 0xC0000000
+
+PLX = 0xFFF90000
+
+CSRA = 0xFFFB0000
+CSRB = 0xFFFB0002
+CSRC = 0xFFFB0004
+CSRD = 0xFFFB0006
+STATUS_CABLE_LL = 0x2000
+STATUS_CABLE_DTR = 0x1000
+
+DPRBASE = 0xFFFC0000
+
+SCC1_BASE = DPRBASE + 0xC00
+MISC_BASE = DPRBASE + 0xCB0
+SCC2_BASE = DPRBASE + 0xD00
+SCC3_BASE = DPRBASE + 0xE00
+SCC4_BASE = DPRBASE + 0xF00
+
+// offset from SCCx_BASE
+// SCC_xBASE contain offsets from DPRBASE and must be divisible by 8
+SCC_RBASE = 0 // 16-bit RxBD base address
+SCC_TBASE = 2 // 16-bit TxBD base address
+SCC_RFCR = 4 // 8-bit Rx function code
+SCC_TFCR = 5 // 8-bit Tx function code
+SCC_MRBLR = 6 // 16-bit maximum Rx buffer length
+SCC_C_MASK = 0x34 // 32-bit CRC constant
+SCC_C_PRES = 0x38 // 32-bit CRC preset
+SCC_MFLR = 0x46 // 16-bit max Rx frame length (without flags)
+
+REGBASE = DPRBASE + 0x1000
+PICR = REGBASE + 0x026 // 16-bit periodic irq control
+PITR = REGBASE + 0x02A // 16-bit periodic irq timing
+OR1 = REGBASE + 0x064 // 32-bit RAM bank #1 options
+CICR = REGBASE + 0x540 // 32(24)-bit CP interrupt config
+CIMR = REGBASE + 0x548 // 32-bit CP interrupt mask
+CISR = REGBASE + 0x54C // 32-bit CP interrupts in-service
+PADIR = REGBASE + 0x550 // 16-bit PortA data direction bitmap
+PAPAR = REGBASE + 0x552 // 16-bit PortA pin assignment bitmap
+PAODR = REGBASE + 0x554 // 16-bit PortA open drain bitmap
+PADAT = REGBASE + 0x556 // 16-bit PortA data register
+
+PCDIR = REGBASE + 0x560 // 16-bit PortC data direction bitmap
+PCPAR = REGBASE + 0x562 // 16-bit PortC pin assignment bitmap
+PCSO = REGBASE + 0x564 // 16-bit PortC special options
+PCDAT = REGBASE + 0x566 // 16-bit PortC data register
+PCINT = REGBASE + 0x568 // 16-bit PortC interrupt control
+CR = REGBASE + 0x5C0 // 16-bit Command register
+
+SCC1_REGS = REGBASE + 0x600
+SCC2_REGS = REGBASE + 0x620
+SCC3_REGS = REGBASE + 0x640
+SCC4_REGS = REGBASE + 0x660
+SICR = REGBASE + 0x6EC // 32-bit SI clock route
+
+// offset from SCCx_REGS
+SCC_GSMR_L = 0x00 // 32 bits
+SCC_GSMR_H = 0x04 // 32 bits
+SCC_PSMR = 0x08 // 16 bits
+SCC_TODR = 0x0C // 16 bits
+SCC_DSR = 0x0E // 16 bits
+SCC_SCCE = 0x10 // 16 bits
+SCC_SCCM = 0x14 // 16 bits
+SCC_SCCS = 0x17 // 8 bits
+
+#if QUICC_MEMCPY_USES_PLX
+ .macro memcpy_from_pci src, dest, len // len must be < 8 MB
+ addl #3, \len
+ andl #0xFFFFFFFC, \len // always copy n * 4 bytes
+ movel \src, PLX_DMA_0_PCI
+ movel \dest, PLX_DMA_0_LOCAL
+ movel \len, PLX_DMA_0_LENGTH
+ movel #0x0103, PLX_DMA_CMD_STS // start channel 0 transfer
+ bsr memcpy_from_pci_run
+ .endm
+
+ .macro memcpy_to_pci src, dest, len
+ addl #3, \len
+ andl #0xFFFFFFFC, \len // always copy n * 4 bytes
+ movel \src, PLX_DMA_1_LOCAL
+ movel \dest, PLX_DMA_1_PCI
+ movel \len, PLX_DMA_1_LENGTH
+ movel #0x0301, PLX_DMA_CMD_STS // start channel 1 transfer
+ bsr memcpy_to_pci_run
+ .endm
+
+#else
+
+ .macro memcpy src, dest, len // len must be < 65536 bytes
+ movel %d7, -(%sp) // src and dest must be < 256 MB
+ movel \len, %d7 // bits 0 and 1
+ lsrl #2, \len
+ andl \len, \len
+ beq 99f // only 0 - 3 bytes
+ subl #1, \len // for dbf
+98: movel (\src)+, (\dest)+
+ dbfw \len, 98b
+99: movel %d7, \len
+ btstl #1, \len
+ beq 99f
+ movew (\src)+, (\dest)+
+99: btstl #0, \len
+ beq 99f
+ moveb (\src)+, (\dest)+
+99:
+ movel (%sp)+, %d7
+ .endm
+
+ .macro memcpy_from_pci src, dest, len
+ addl #VALUE_WINDOW, \src
+ memcpy \src, \dest, \len
+ .endm
+
+ .macro memcpy_to_pci src, dest, len
+ addl #VALUE_WINDOW, \dest
+ memcpy \src, \dest, \len
+ .endm
+#endif
+
+
+ .macro wait_for_command
+99: btstl #0, CR
+ bne 99b
+ .endm
+
+
+
+
+/****************************** card initialization *******************/
+ .text
+ .global _start
+_start: bra init
+
+ .org _start + 4
+ch_status_addr: .long 0, 0, 0, 0
+rx_descs_addr: .long 0
+
+init:
+#if DETECT_RAM
+ movel OR1, %d0
+ andl #0xF00007FF, %d0 // mask AMxx bits
+ orl #0xFFFF800 & ~(MAX_RAM_SIZE - 1), %d0 // update RAM bank size
+ movel %d0, OR1
+#endif
+
+ addl #VALUE_WINDOW, rx_descs_addr // PCI addresses of shared data
+ clrl %d0 // D0 = 4 * port
+init_1: tstl ch_status_addr(%d0)
+ beq init_2
+ addl #VALUE_WINDOW, ch_status_addr(%d0)
+init_2: addl #4, %d0
+ cmpl #4 * 4, %d0
+ bne init_1
+
+ movel #pci9060_interrupt, PCI9060_VECTOR
+ movel #error_interrupt, ERROR_VECTOR
+ movel #port_interrupt_1, SCC1_VECTOR
+ movel #port_interrupt_2, SCC2_VECTOR
+ movel #port_interrupt_3, SCC3_VECTOR
+ movel #port_interrupt_4, SCC4_VECTOR
+ movel #timer_interrupt, TIMER_IRQ * 4
+
+ movel #0x78000000, CIMR // only SCCx IRQs from CPM
+ movew #(TIMER_IRQ_LEVEL << 8) + TIMER_IRQ, PICR // interrupt from PIT
+ movew #PITR_CONST, PITR
+
+ // SCC1=SCCa SCC2=SCCb SCC3=SCCc SCC4=SCCd prio=4 HP=-1 IRQ=64-79
+ movel #0xD41F40 + (CPM_IRQ_LEVEL << 13), CICR
+ movel #0x543, PLX_DMA_0_MODE // 32-bit, Ready, Burst, IRQ
+ movel #0x543, PLX_DMA_1_MODE
+ movel #0x0, PLX_DMA_0_DESC // from PCI to local
+ movel #0x8, PLX_DMA_1_DESC // from local to PCI
+ movel #0x101, PLX_DMA_CMD_STS // enable both DMA channels
+ // enable local IRQ, DMA, doorbells and PCI IRQ
+ orl #0x000F0300, PLX_INTERRUPT_CS
+
+#if DETECT_RAM
+ bsr ram_test
+#else
+ movel #1, PLX_MAILBOX_5 // non-zero value = init complete
+#endif
+ bsr check_csr
+
+ movew #0xFFFF, PAPAR // all pins are clocks/data
+ clrw PADIR // first function
+ clrw PCSO // CD and CTS always active
+
+
+/****************************** main loop *****************************/
+
+main: movel channel_stats, %d7 // D7 = doorbell + irq status
+ clrl channel_stats
+
+ tstl %d7
+ bne main_1
+ // nothing to do - wait for next event
+ stop #0x2200 // supervisor + IRQ level 2
+ movew #0x2700, %sr // disable IRQs again
+ bra main
+
+main_1: clrl %d0 // D0 = 4 * port
+ clrl %d6 // D6 = doorbell to host value
+
+main_l: btstl #DOORBELL_TO_CARD_CLOSE_0, %d7
+ beq main_op
+ bclrl #DOORBELL_TO_CARD_OPEN_0, %d7 // in case both bits are set
+ bsr close_port
+main_op:
+ btstl #DOORBELL_TO_CARD_OPEN_0, %d7
+ beq main_cl
+ bsr open_port
+main_cl:
+ btstl #DOORBELL_TO_CARD_TX_0, %d7
+ beq main_txend
+ bsr tx
+main_txend:
+ btstl #TASK_SCC_0, %d7
+ beq main_next
+ bsr tx_end
+ bsr rx
+
+main_next:
+ lsrl #1, %d7 // port status for next port
+ addl #4, %d0 // D0 = 4 * next port
+ cmpl #4 * 4, %d0
+ bne main_l
+ movel %d6, PLX_DOORBELL_FROM_CARD // signal the host
+ bra main
+
+
+/****************************** open port *****************************/
+
+open_port: // D0 = 4 * port, D6 = doorbell to host
+ movel ch_status_addr(%d0), %a0 // A0 = port status address
+ tstl STATUS_OPEN(%a0)
+ bne open_port_ret // port already open
+ movel #1, STATUS_OPEN(%a0) // confirm the port is open
+// setup BDs
+ clrl tx_in(%d0)
+ clrl tx_out(%d0)
+ clrl tx_count(%d0)
+ clrl rx_in(%d0)
+
+ movel SICR, %d1 // D1 = clock settings in SICR
+ andl clocking_mask(%d0), %d1
+ cmpl #CLOCK_TXFROMRX, STATUS_CLOCKING(%a0)
+ bne open_port_clock_ext
+ orl clocking_txfromrx(%d0), %d1
+ bra open_port_set_clock
+
+open_port_clock_ext:
+ orl clocking_ext(%d0), %d1
+open_port_set_clock:
+ movel %d1, SICR // update clock settings in SICR
+
+ orw #STATUS_CABLE_DTR, csr_output(%d0) // DTR on
+ bsr check_csr // call with disabled timer interrupt
+
+// Setup TX descriptors
+ movel first_buffer(%d0), %d1 // D1 = starting buffer address
+ movel tx_first_bd(%d0), %a1 // A1 = starting TX BD address
+ movel #TX_BUFFERS - 2, %d2 // D2 = TX_BUFFERS - 1 counter
+ movel #0x18000000, %d3 // D3 = initial TX BD flags: Int + Last
+ cmpl #PARITY_NONE, STATUS_PARITY(%a0)
+ beq open_port_tx_loop
+ bsetl #26, %d3 // TX BD flag: Transmit CRC
+open_port_tx_loop:
+ movel %d3, (%a1)+ // TX flags + length
+ movel %d1, (%a1)+ // buffer address
+ addl #BUFFER_LENGTH, %d1
+ dbfw %d2, open_port_tx_loop
+
+ bsetl #29, %d3 // TX BD flag: Wrap (last BD)
+ movel %d3, (%a1)+ // Final TX flags + length
+ movel %d1, (%a1)+ // buffer address
+
+// Setup RX descriptors // A1 = starting RX BD address
+ movel #RX_BUFFERS - 2, %d2 // D2 = RX_BUFFERS - 1 counter
+open_port_rx_loop:
+ movel #0x90000000, (%a1)+ // RX flags + length
+ movel %d1, (%a1)+ // buffer address
+ addl #BUFFER_LENGTH, %d1
+ dbfw %d2, open_port_rx_loop
+
+ movel #0xB0000000, (%a1)+ // Final RX flags + length
+ movel %d1, (%a1)+ // buffer address
+
+// Setup port parameters
+ movel scc_base_addr(%d0), %a1 // A1 = SCC_BASE address
+ movel scc_reg_addr(%d0), %a2 // A2 = SCC_REGS address
+
+ movel #0xFFFF, SCC_SCCE(%a2) // clear status bits
+ movel #0x0000, SCC_SCCM(%a2) // interrupt mask
+
+ movel tx_first_bd(%d0), %d1
+ movew %d1, SCC_TBASE(%a1) // D1 = offset of first TxBD
+ addl #TX_BUFFERS * 8, %d1
+ movew %d1, SCC_RBASE(%a1) // D1 = offset of first RxBD
+ moveb #0x8, SCC_RFCR(%a1) // Intel mode, 1000
+ moveb #0x8, SCC_TFCR(%a1)
+
+// Parity settings
+ cmpl #PARITY_CRC16_PR1_CCITT, STATUS_PARITY(%a0)
+ bne open_port_parity_1
+ clrw SCC_PSMR(%a2) // CRC16-CCITT
+ movel #0xF0B8, SCC_C_MASK(%a1)
+ movel #0xFFFF, SCC_C_PRES(%a1)
+ movew #HDLC_MAX_MRU + 2, SCC_MFLR(%a1) // 2 bytes for CRC
+ movew #2, parity_bytes(%d0)
+ bra open_port_2
+
+open_port_parity_1:
+ cmpl #PARITY_CRC32_PR1_CCITT, STATUS_PARITY(%a0)
+ bne open_port_parity_2
+ movew #0x0800, SCC_PSMR(%a2) // CRC32-CCITT
+ movel #0xDEBB20E3, SCC_C_MASK(%a1)
+ movel #0xFFFFFFFF, SCC_C_PRES(%a1)
+ movew #HDLC_MAX_MRU + 4, SCC_MFLR(%a1) // 4 bytes for CRC
+ movew #4, parity_bytes(%d0)
+ bra open_port_2
+
+open_port_parity_2:
+ cmpl #PARITY_CRC16_PR0_CCITT, STATUS_PARITY(%a0)
+ bne open_port_parity_3
+ clrw SCC_PSMR(%a2) // CRC16-CCITT preset 0
+ movel #0xF0B8, SCC_C_MASK(%a1)
+ clrl SCC_C_PRES(%a1)
+ movew #HDLC_MAX_MRU + 2, SCC_MFLR(%a1) // 2 bytes for CRC
+ movew #2, parity_bytes(%d0)
+ bra open_port_2
+
+open_port_parity_3:
+ cmpl #PARITY_CRC32_PR0_CCITT, STATUS_PARITY(%a0)
+ bne open_port_parity_4
+ movew #0x0800, SCC_PSMR(%a2) // CRC32-CCITT preset 0
+ movel #0xDEBB20E3, SCC_C_MASK(%a1)
+ clrl SCC_C_PRES(%a1)
+ movew #HDLC_MAX_MRU + 4, SCC_MFLR(%a1) // 4 bytes for CRC
+ movew #4, parity_bytes(%d0)
+ bra open_port_2
+
+open_port_parity_4:
+ clrw SCC_PSMR(%a2) // no parity
+ movel #0xF0B8, SCC_C_MASK(%a1)
+ movel #0xFFFF, SCC_C_PRES(%a1)
+ movew #HDLC_MAX_MRU, SCC_MFLR(%a1) // 0 bytes for CRC
+ clrw parity_bytes(%d0)
+
+open_port_2:
+ movel #0x00000003, SCC_GSMR_H(%a2) // RTSM
+ cmpl #ENCODING_NRZI, STATUS_ENCODING(%a0)
+ bne open_port_nrz
+ movel #0x10040900, SCC_GSMR_L(%a2) // NRZI: TCI Tend RECN+TENC=1
+ bra open_port_3
+
+open_port_nrz:
+ movel #0x10040000, SCC_GSMR_L(%a2) // NRZ: TCI Tend RECN+TENC=0
+open_port_3:
+ movew #BUFFER_LENGTH, SCC_MRBLR(%a1)
+ movel %d0, %d1
+ lsll #4, %d1 // D1 bits 7 and 6 = port
+ orl #1, %d1
+ movew %d1, CR // Init SCC RX and TX params
+ wait_for_command
+
+ // TCI Tend ENR ENT
+ movew #0x001F, SCC_SCCM(%a2) // TXE RXF BSY TXB RXB interrupts
+ orl #0x00000030, SCC_GSMR_L(%a2) // enable SCC
+open_port_ret:
+ rts
+
+
+/****************************** close port ****************************/
+
+close_port: // D0 = 4 * port, D6 = doorbell to host
+ movel scc_reg_addr(%d0), %a0 // A0 = SCC_REGS address
+ clrw SCC_SCCM(%a0) // no SCC interrupts
+ andl #0xFFFFFFCF, SCC_GSMR_L(%a0) // Disable ENT and ENR
+
+ andw #~STATUS_CABLE_DTR, csr_output(%d0) // DTR off
+ bsr check_csr // call with disabled timer interrupt
+
+ movel ch_status_addr(%d0), %d1
+ clrl STATUS_OPEN(%d1) // confirm the port is closed
+ rts
+
+
+/****************************** transmit packet ***********************/
+// queue packets for transmission
+tx: // D0 = 4 * port, D6 = doorbell to host
+ cmpl #TX_BUFFERS, tx_count(%d0)
+ beq tx_ret // all DB's = descs in use
+
+ movel tx_out(%d0), %d1
+ movel %d1, %d2 // D1 = D2 = tx_out BD# = desc#
+ mulul #DESC_LENGTH, %d2 // D2 = TX desc offset
+ addl ch_status_addr(%d0), %d2
+ addl #STATUS_TX_DESCS, %d2 // D2 = TX desc address
+ cmpl #PACKET_FULL, (%d2) // desc status
+ bne tx_ret
+
+// queue it
+ movel 4(%d2), %a0 // PCI address
+ lsll #3, %d1 // BD is 8-bytes long
+ addl tx_first_bd(%d0), %d1 // D1 = current tx_out BD addr
+
+ movel 4(%d1), %a1 // A1 = dest address
+ movel 8(%d2), %d2 // D2 = length
+ movew %d2, 2(%d1) // length into BD
+ memcpy_from_pci %a0, %a1, %d2
+ bsetl #31, (%d1) // CP go ahead
+
+// update tx_out and tx_count
+ movel tx_out(%d0), %d1
+ addl #1, %d1
+ cmpl #TX_BUFFERS, %d1
+ bne tx_1
+ clrl %d1
+tx_1: movel %d1, tx_out(%d0)
+
+ addl #1, tx_count(%d0)
+ bra tx
+
+tx_ret: rts
+
+
+/****************************** packet received ***********************/
+
+// Service receive buffers // D0 = 4 * port, D6 = doorbell to host
+rx: movel rx_in(%d0), %d1 // D1 = rx_in BD#
+ lsll #3, %d1 // BD is 8-bytes long
+ addl rx_first_bd(%d0), %d1 // D1 = current rx_in BD address
+ movew (%d1), %d2 // D2 = RX BD flags
+ btstl #15, %d2
+ bne rx_ret // BD still empty
+
+ btstl #1, %d2
+ bne rx_overrun
+
+ tstw parity_bytes(%d0)
+ bne rx_parity
+ bclrl #2, %d2 // do not test for CRC errors
+rx_parity:
+ andw #0x0CBC, %d2 // mask status bits
+ cmpw #0x0C00, %d2 // correct frame
+ bne rx_bad_frame
+ clrl %d3
+ movew 2(%d1), %d3
+ subw parity_bytes(%d0), %d3 // D3 = packet length
+ cmpw #HDLC_MAX_MRU, %d3
+ bgt rx_bad_frame
+
+rx_good_frame:
+ movel rx_out, %d2
+ mulul #DESC_LENGTH, %d2
+ addl rx_descs_addr, %d2 // D2 = RX desc address
+ cmpl #PACKET_EMPTY, (%d2) // desc stat
+ bne rx_overrun
+
+ movel %d3, 8(%d2)
+ movel 4(%d1), %a0 // A0 = source address
+ movel 4(%d2), %a1
+ tstl %a1
+ beq rx_ignore_data
+ memcpy_to_pci %a0, %a1, %d3
+rx_ignore_data:
+ movel packet_full(%d0), (%d2) // update desc stat
+
+// update D6 and rx_out
+ bsetl #DOORBELL_FROM_CARD_RX, %d6 // signal host that RX completed
+ movel rx_out, %d2
+ addl #1, %d2
+ cmpl #RX_QUEUE_LENGTH, %d2
+ bne rx_1
+ clrl %d2
+rx_1: movel %d2, rx_out
+
+rx_free_bd:
+ andw #0xF000, (%d1) // clear CM and error bits
+ bsetl #31, (%d1) // free BD
+// update rx_in
+ movel rx_in(%d0), %d1
+ addl #1, %d1
+ cmpl #RX_BUFFERS, %d1
+ bne rx_2
+ clrl %d1
+rx_2: movel %d1, rx_in(%d0)
+ bra rx
+
+rx_overrun:
+ movel ch_status_addr(%d0), %d2
+ addl #1, STATUS_RX_OVERRUNS(%d2)
+ bra rx_free_bd
+
+rx_bad_frame:
+ movel ch_status_addr(%d0), %d2
+ addl #1, STATUS_RX_FRAME_ERRORS(%d2)
+ bra rx_free_bd
+
+rx_ret: rts
+
+
+/****************************** packet transmitted ********************/
+
+// Service transmit buffers // D0 = 4 * port, D6 = doorbell to host
+tx_end: tstl tx_count(%d0)
+ beq tx_end_ret // TX buffers already empty
+
+ movel tx_in(%d0), %d1
+ movel %d1, %d2 // D1 = D2 = tx_in BD# = desc#
+ lsll #3, %d1 // BD is 8-bytes long
+ addl tx_first_bd(%d0), %d1 // D1 = current tx_in BD address
+ movew (%d1), %d3 // D3 = TX BD flags
+ btstl #15, %d3
+ bne tx_end_ret // BD still being transmitted
+
+// update D6, tx_in and tx_count
+ orl bell_tx(%d0), %d6 // signal host that TX desc freed
+ subl #1, tx_count(%d0)
+ movel tx_in(%d0), %d1
+ addl #1, %d1
+ cmpl #TX_BUFFERS, %d1
+ bne tx_end_1
+ clrl %d1
+tx_end_1:
+ movel %d1, tx_in(%d0)
+
+// free host's descriptor
+ mulul #DESC_LENGTH, %d2 // D2 = TX desc offset
+ addl ch_status_addr(%d0), %d2
+ addl #STATUS_TX_DESCS, %d2 // D2 = TX desc address
+ btstl #1, %d3
+ bne tx_end_underrun
+ movel #PACKET_SENT, (%d2)
+ bra tx_end
+
+tx_end_underrun:
+ movel #PACKET_UNDERRUN, (%d2)
+ bra tx_end
+
+tx_end_ret: rts
+
+
+/****************************** PLX PCI9060 DMA memcpy ****************/
+
+#if QUICC_MEMCPY_USES_PLX
+// called with interrupts disabled
+memcpy_from_pci_run:
+ movel %d0, -(%sp)
+ movew %sr, -(%sp)
+memcpy_1:
+ movel PLX_DMA_CMD_STS, %d0 // do not btst PLX register directly
+ btstl #4, %d0 // transfer done?
+ bne memcpy_end
+ stop #0x2200 // enable PCI9060 interrupts
+ movew #0x2700, %sr // disable interrupts again
+ bra memcpy_1
+
+memcpy_to_pci_run:
+ movel %d0, -(%sp)
+ movew %sr, -(%sp)
+memcpy_2:
+ movel PLX_DMA_CMD_STS, %d0 // do not btst PLX register directly
+ btstl #12, %d0 // transfer done?
+ bne memcpy_end
+ stop #0x2200 // enable PCI9060 interrupts
+ movew #0x2700, %sr // disable interrupts again
+ bra memcpy_2
+
+memcpy_end:
+ movew (%sp)+, %sr
+ movel (%sp)+, %d0
+ rts
+#endif
+
+
+
+
+
+
+/****************************** PLX PCI9060 interrupt *****************/
+
+pci9060_interrupt:
+ movel %d0, -(%sp)
+
+ movel PLX_DOORBELL_TO_CARD, %d0
+ movel %d0, PLX_DOORBELL_TO_CARD // confirm all requests
+ orl %d0, channel_stats
+
+ movel #0x0909, PLX_DMA_CMD_STS // clear DMA ch #0 and #1 interrupts
+
+ movel (%sp)+, %d0
+ rte
+
+/****************************** SCC interrupts ************************/
+
+port_interrupt_1:
+ orl #0, SCC1_REGS + SCC_SCCE; // confirm SCC events
+ orl #1 << TASK_SCC_0, channel_stats
+ movel #0x40000000, CISR
+ rte
+
+port_interrupt_2:
+ orl #0, SCC2_REGS + SCC_SCCE; // confirm SCC events
+ orl #1 << TASK_SCC_1, channel_stats
+ movel #0x20000000, CISR
+ rte
+
+port_interrupt_3:
+ orl #0, SCC3_REGS + SCC_SCCE; // confirm SCC events
+ orl #1 << TASK_SCC_2, channel_stats
+ movel #0x10000000, CISR
+ rte
+
+port_interrupt_4:
+ orl #0, SCC4_REGS + SCC_SCCE; // confirm SCC events
+ orl #1 << TASK_SCC_3, channel_stats
+ movel #0x08000000, CISR
+ rte
+
+error_interrupt:
+ rte
+
+
+/****************************** cable and PM routine ******************/
+// modified registers: none
+check_csr:
+ movel %d0, -(%sp)
+ movel %d1, -(%sp)
+ movel %d2, -(%sp)
+ movel %a0, -(%sp)
+ movel %a1, -(%sp)
+
+ clrl %d0 // D0 = 4 * port
+ movel #CSRA, %a0 // A0 = CSR address
+
+check_csr_loop:
+ movew (%a0), %d1 // D1 = CSR input bits
+ andl #0xE7, %d1 // PM and cable sense bits (no DCE bit)
+ cmpw #STATUS_CABLE_V35 * (1 + 1 << STATUS_CABLE_PM_SHIFT), %d1
+ bne check_csr_1
+ movew #0x0E08, %d1
+ bra check_csr_valid
+
+check_csr_1:
+ cmpw #STATUS_CABLE_X21 * (1 + 1 << STATUS_CABLE_PM_SHIFT), %d1
+ bne check_csr_2
+ movew #0x0408, %d1
+ bra check_csr_valid
+
+check_csr_2:
+ cmpw #STATUS_CABLE_V24 * (1 + 1 << STATUS_CABLE_PM_SHIFT), %d1
+ bne check_csr_3
+ movew #0x0208, %d1
+ bra check_csr_valid
+
+check_csr_3:
+ cmpw #STATUS_CABLE_EIA530 * (1 + 1 << STATUS_CABLE_PM_SHIFT), %d1
+ bne check_csr_disable
+ movew #0x0D08, %d1
+ bra check_csr_valid
+
+check_csr_disable:
+ movew #0x0008, %d1 // D1 = disable everything
+ movew #0x80E7, %d2 // D2 = input mask: ignore DSR
+ bra check_csr_write
+
+check_csr_valid: // D1 = mode and IRQ bits
+ movew csr_output(%d0), %d2
+ andw #0x3000, %d2 // D2 = requested LL and DTR bits
+ orw %d2, %d1 // D1 = all requested output bits
+ movew #0x80FF, %d2 // D2 = input mask: include DSR
+
+check_csr_write:
+ cmpw old_csr_output(%d0), %d1
+ beq check_csr_input
+ movew %d1, old_csr_output(%d0)
+ movew %d1, (%a0) // Write CSR output bits
+
+check_csr_input:
+ movew (PCDAT), %d1
+ andw dcd_mask(%d0), %d1
+ beq check_csr_dcd_on // DCD and CTS signals are negated
+ movew (%a0), %d1 // D1 = CSR input bits
+ andw #~STATUS_CABLE_DCD, %d1 // DCD off
+ bra check_csr_previous
+
+check_csr_dcd_on:
+ movew (%a0), %d1 // D1 = CSR input bits
+ orw #STATUS_CABLE_DCD, %d1 // DCD on
+check_csr_previous:
+ andw %d2, %d1 // input mask
+ movel ch_status_addr(%d0), %a1
+ cmpl STATUS_CABLE(%a1), %d1 // check for change
+ beq check_csr_next
+ movel %d1, STATUS_CABLE(%a1) // update status
+ movel bell_cable(%d0), PLX_DOORBELL_FROM_CARD // signal the host
+
+check_csr_next:
+ addl #2, %a0 // next CSR register
+ addl #4, %d0 // D0 = 4 * next port
+ cmpl #4 * 4, %d0
+ bne check_csr_loop
+
+ movel (%sp)+, %a1
+ movel (%sp)+, %a0
+ movel (%sp)+, %d2
+ movel (%sp)+, %d1
+ movel (%sp)+, %d0
+ rts
+
+
+/****************************** timer interrupt ***********************/
+
+timer_interrupt:
+ bsr check_csr
+ rte
+
+
+/****************************** RAM sizing and test *******************/
+#if DETECT_RAM
+ram_test:
+ movel #0x12345678, %d1 // D1 = test value
+ movel %d1, (128 * 1024 - 4)
+ movel #128 * 1024, %d0 // D0 = RAM size tested
+ram_test_size:
+ cmpl #MAX_RAM_SIZE, %d0
+ beq ram_test_size_found
+ movel %d0, %a0
+ addl #128 * 1024 - 4, %a0
+ cmpl (%a0), %d1
+ beq ram_test_size_check
+ram_test_next_size:
+ lsll #1, %d0
+ bra ram_test_size
+
+ram_test_size_check:
+ eorl #0xFFFFFFFF, %d1
+ movel %d1, (128 * 1024 - 4)
+ cmpl (%a0), %d1
+ bne ram_test_next_size
+
+ram_test_size_found: // D0 = RAM size
+ movel %d0, %a0 // A0 = fill ptr
+ subl #firmware_end + 4, %d0
+ lsrl #2, %d0
+ movel %d0, %d1 // D1 = DBf counter
+ram_test_fill:
+ movel %a0, -(%a0)
+ dbfw %d1, ram_test_fill
+ subl #0x10000, %d1
+ cmpl #0xFFFFFFFF, %d1
+ bne ram_test_fill
+
+ram_test_loop: // D0 = DBf counter
+ cmpl (%a0)+, %a0
+ dbnew %d0, ram_test_loop
+ bne ram_test_found_bad
+ subl #0x10000, %d0
+ cmpl #0xFFFFFFFF, %d0
+ bne ram_test_loop
+ bra ram_test_all_ok
+
+ram_test_found_bad:
+ subl #4, %a0
+ram_test_all_ok:
+ movel %a0, PLX_MAILBOX_5
+ rts
+#endif
+
+
+/****************************** constants *****************************/
+
+scc_reg_addr:
+ .long SCC1_REGS, SCC2_REGS, SCC3_REGS, SCC4_REGS
+scc_base_addr:
+ .long SCC1_BASE, SCC2_BASE, SCC3_BASE, SCC4_BASE
+
+tx_first_bd:
+ .long DPRBASE
+ .long DPRBASE + (TX_BUFFERS + RX_BUFFERS) * 8
+ .long DPRBASE + (TX_BUFFERS + RX_BUFFERS) * 8 * 2
+ .long DPRBASE + (TX_BUFFERS + RX_BUFFERS) * 8 * 3
+
+rx_first_bd:
+ .long DPRBASE + TX_BUFFERS * 8
+ .long DPRBASE + TX_BUFFERS * 8 + (TX_BUFFERS + RX_BUFFERS) * 8
+ .long DPRBASE + TX_BUFFERS * 8 + (TX_BUFFERS + RX_BUFFERS) * 8 * 2
+ .long DPRBASE + TX_BUFFERS * 8 + (TX_BUFFERS + RX_BUFFERS) * 8 * 3
+
+first_buffer:
+ .long BUFFERS_ADDR
+ .long BUFFERS_ADDR + (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH
+ .long BUFFERS_ADDR + (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * 2
+ .long BUFFERS_ADDR + (TX_BUFFERS + RX_BUFFERS) * BUFFER_LENGTH * 3
+
+bell_tx:
+ .long 1 << DOORBELL_FROM_CARD_TX_0, 1 << DOORBELL_FROM_CARD_TX_1
+ .long 1 << DOORBELL_FROM_CARD_TX_2, 1 << DOORBELL_FROM_CARD_TX_3
+
+bell_cable:
+ .long 1 << DOORBELL_FROM_CARD_CABLE_0, 1 << DOORBELL_FROM_CARD_CABLE_1
+ .long 1 << DOORBELL_FROM_CARD_CABLE_2, 1 << DOORBELL_FROM_CARD_CABLE_3
+
+packet_full:
+ .long PACKET_FULL, PACKET_FULL + 1, PACKET_FULL + 2, PACKET_FULL + 3
+
+clocking_ext:
+ .long 0x0000002C, 0x00003E00, 0x002C0000, 0x3E000000
+clocking_txfromrx:
+ .long 0x0000002D, 0x00003F00, 0x002D0000, 0x3F000000
+clocking_mask:
+ .long 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000
+dcd_mask:
+ .word 0x020, 0, 0x080, 0, 0x200, 0, 0x800
+
+ .ascii "wanXL firmware\n"
+ .asciz "Copyright (C) 2003 Krzysztof Halasa <khc@pm.waw.pl>\n"
+
+
+/****************************** variables *****************************/
+
+ .align 4
+channel_stats: .long 0
+
+tx_in: .long 0, 0, 0, 0 // transmitted
+tx_out: .long 0, 0, 0, 0 // received from host for transmission
+tx_count: .long 0, 0, 0, 0 // currently in transmit queue
+
+rx_in: .long 0, 0, 0, 0 // received from port
+rx_out: .long 0 // transmitted to host
+parity_bytes: .word 0, 0, 0, 0, 0, 0, 0 // only 4 words are used
+
+csr_output: .word 0
+old_csr_output: .word 0, 0, 0, 0, 0, 0, 0
+ .align 4
+firmware_end: // must be dword-aligned
diff --git a/drivers/net/wan/wanxlfw.inc b/drivers/net/wan/wanxlfw.inc
new file mode 100644
index 000000000000..73da688f943b
--- /dev/null
+++ b/drivers/net/wan/wanxlfw.inc
@@ -0,0 +1,158 @@
+static u8 firmware[]={
+0x60,0x00,0x00,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xB9,0x40,0x00,0x00,0x00,0x00,0x00,
+0x10,0x14,0x42,0x80,0x4A,0xB0,0x09,0xB0,0x00,0x00,0x10,0x04,0x67,0x00,0x00,0x0E,
+0x06,0xB0,0x40,0x00,0x00,0x00,0x09,0xB0,0x00,0x00,0x10,0x04,0x58,0x80,0x0C,0x80,
+0x00,0x00,0x00,0x10,0x66,0x00,0xFF,0xDE,0x21,0xFC,0x00,0x00,0x16,0xBC,0x00,0x6C,
+0x21,0xFC,0x00,0x00,0x17,0x5E,0x01,0x00,0x21,0xFC,0x00,0x00,0x16,0xDE,0x01,0x78,
+0x21,0xFC,0x00,0x00,0x16,0xFE,0x01,0x74,0x21,0xFC,0x00,0x00,0x17,0x1E,0x01,0x70,
+0x21,0xFC,0x00,0x00,0x17,0x3E,0x01,0x6C,0x21,0xFC,0x00,0x00,0x18,0x4C,0x02,0x00,
+0x23,0xFC,0x78,0x00,0x00,0x00,0xFF,0xFC,0x15,0x48,0x33,0xFC,0x04,0x80,0xFF,0xFC,
+0x10,0x26,0x33,0xFC,0x01,0x10,0xFF,0xFC,0x10,0x2A,0x23,0xFC,0x00,0xD4,0x9F,0x40,
+0xFF,0xFC,0x15,0x40,0x23,0xFC,0x00,0x00,0x05,0x43,0xFF,0xF9,0x01,0x00,0x23,0xFC,
+0x00,0x00,0x05,0x43,0xFF,0xF9,0x01,0x14,0x23,0xFC,0x00,0x00,0x00,0x00,0xFF,0xF9,
+0x01,0x10,0x23,0xFC,0x00,0x00,0x00,0x08,0xFF,0xF9,0x01,0x24,0x23,0xFC,0x00,0x00,
+0x01,0x01,0xFF,0xF9,0x01,0x28,0x00,0xB9,0x00,0x0F,0x03,0x00,0xFF,0xF9,0x00,0xE8,
+0x23,0xFC,0x00,0x00,0x00,0x01,0xFF,0xF9,0x00,0xD4,0x61,0x00,0x06,0x74,0x33,0xFC,
+0xFF,0xFF,0xFF,0xFC,0x15,0x52,0x42,0x79,0xFF,0xFC,0x15,0x50,0x42,0x79,0xFF,0xFC,
+0x15,0x64,0x2E,0x3A,0x08,0x50,0x42,0xB9,0x00,0x00,0x19,0x54,0x4A,0x87,0x66,0x00,
+0x00,0x0E,0x4E,0x72,0x22,0x00,0x46,0xFC,0x27,0x00,0x60,0x00,0xFF,0xE6,0x42,0x80,
+0x42,0x86,0x08,0x07,0x00,0x04,0x67,0x00,0x00,0x0A,0x08,0x87,0x00,0x00,0x61,0x00,
+0x02,0xA0,0x08,0x07,0x00,0x00,0x67,0x00,0x00,0x06,0x61,0x00,0x00,0x36,0x08,0x07,
+0x00,0x08,0x67,0x00,0x00,0x06,0x61,0x00,0x02,0xB8,0x08,0x07,0x00,0x0C,0x67,0x00,
+0x00,0x0A,0x61,0x00,0x04,0x94,0x61,0x00,0x03,0x60,0xE2,0x8F,0x58,0x80,0x0C,0x80,
+0x00,0x00,0x00,0x10,0x66,0x00,0xFF,0xBC,0x23,0xC6,0xFF,0xF9,0x00,0xE4,0x60,0x00,
+0xFF,0x92,0x20,0x70,0x09,0xB0,0x00,0x00,0x10,0x04,0x4A,0xA8,0x00,0x00,0x66,0x00,
+0x02,0x4E,0x21,0x7C,0x00,0x00,0x00,0x01,0x00,0x00,0x42,0xB0,0x09,0xB0,0x00,0x00,
+0x19,0x58,0x42,0xB0,0x09,0xB0,0x00,0x00,0x19,0x68,0x42,0xB0,0x09,0xB0,0x00,0x00,
+0x19,0x78,0x42,0xB0,0x09,0xB0,0x00,0x00,0x19,0x88,0x22,0x39,0xFF,0xFC,0x16,0xEC,
+0xC2,0xB0,0x09,0xB0,0x00,0x00,0x18,0xF2,0x0C,0xA8,0x00,0x00,0x00,0x04,0x00,0x18,
+0x66,0x00,0x00,0x0E,0x82,0xB0,0x09,0xB0,0x00,0x00,0x18,0xE2,0x60,0x00,0x00,0x0A,
+0x82,0xB0,0x09,0xB0,0x00,0x00,0x18,0xD2,0x23,0xC1,0xFF,0xFC,0x16,0xEC,0x00,0x70,
+0x10,0x00,0x09,0xB0,0x00,0x00,0x19,0xAA,0x61,0x00,0x05,0x76,0x22,0x30,0x09,0xB0,
+0x00,0x00,0x18,0x92,0x22,0x70,0x09,0xB0,0x00,0x00,0x18,0x72,0x74,0x08,0x26,0x3C,
+0x18,0x00,0x00,0x00,0x0C,0xA8,0x00,0x00,0x00,0x01,0x00,0x10,0x67,0x00,0x00,0x06,
+0x08,0xC3,0x00,0x1A,0x22,0xC3,0x22,0xC1,0x06,0x81,0x00,0x00,0x05,0xFC,0x51,0xCA,
+0xFF,0xF4,0x08,0xC3,0x00,0x1D,0x22,0xC3,0x22,0xC1,0x74,0x1C,0x22,0xFC,0x90,0x00,
+0x00,0x00,0x22,0xC1,0x06,0x81,0x00,0x00,0x05,0xFC,0x51,0xCA,0xFF,0xF0,0x22,0xFC,
+0xB0,0x00,0x00,0x00,0x22,0xC1,0x22,0x70,0x09,0xB0,0x00,0x00,0x18,0x62,0x24,0x70,
+0x09,0xB0,0x00,0x00,0x18,0x52,0x25,0x7C,0x00,0x00,0xFF,0xFF,0x00,0x10,0x25,0x7C,
+0x00,0x00,0x00,0x00,0x00,0x14,0x22,0x30,0x09,0xB0,0x00,0x00,0x18,0x72,0x33,0x41,
+0x00,0x02,0x06,0x81,0x00,0x00,0x00,0x50,0x33,0x41,0x00,0x00,0x13,0x7C,0x00,0x08,
+0x00,0x04,0x13,0x7C,0x00,0x08,0x00,0x05,0x0C,0xA8,0x00,0x00,0x00,0x05,0x00,0x10,
+0x66,0x00,0x00,0x2A,0x42,0x6A,0x00,0x08,0x23,0x7C,0x00,0x00,0xF0,0xB8,0x00,0x34,
+0x23,0x7C,0x00,0x00,0xFF,0xFF,0x00,0x38,0x33,0x7C,0x05,0xFA,0x00,0x46,0x31,0xBC,
+0x00,0x02,0x09,0xB0,0x00,0x00,0x19,0x9C,0x60,0x00,0x00,0xBC,0x0C,0xA8,0x00,0x00,
+0x00,0x07,0x00,0x10,0x66,0x00,0x00,0x2C,0x35,0x7C,0x08,0x00,0x00,0x08,0x23,0x7C,
+0xDE,0xBB,0x20,0xE3,0x00,0x34,0x23,0x7C,0xFF,0xFF,0xFF,0xFF,0x00,0x38,0x33,0x7C,
+0x05,0xFC,0x00,0x46,0x31,0xBC,0x00,0x04,0x09,0xB0,0x00,0x00,0x19,0x9C,0x60,0x00,
+0x00,0x86,0x0C,0xA8,0x00,0x00,0x00,0x04,0x00,0x10,0x66,0x00,0x00,0x26,0x42,0x6A,
+0x00,0x08,0x23,0x7C,0x00,0x00,0xF0,0xB8,0x00,0x34,0x42,0xA9,0x00,0x38,0x33,0x7C,
+0x05,0xFA,0x00,0x46,0x31,0xBC,0x00,0x02,0x09,0xB0,0x00,0x00,0x19,0x9C,0x60,0x00,
+0x00,0x56,0x0C,0xA8,0x00,0x00,0x00,0x06,0x00,0x10,0x66,0x00,0x00,0x28,0x35,0x7C,
+0x08,0x00,0x00,0x08,0x23,0x7C,0xDE,0xBB,0x20,0xE3,0x00,0x34,0x42,0xA9,0x00,0x38,
+0x33,0x7C,0x05,0xFC,0x00,0x46,0x31,0xBC,0x00,0x04,0x09,0xB0,0x00,0x00,0x19,0x9C,
+0x60,0x00,0x00,0x24,0x42,0x6A,0x00,0x08,0x23,0x7C,0x00,0x00,0xF0,0xB8,0x00,0x34,
+0x23,0x7C,0x00,0x00,0xFF,0xFF,0x00,0x38,0x33,0x7C,0x05,0xF8,0x00,0x46,0x42,0x70,
+0x09,0xB0,0x00,0x00,0x19,0x9C,0x25,0x7C,0x00,0x00,0x00,0x03,0x00,0x04,0x0C,0xA8,
+0x00,0x00,0x00,0x02,0x00,0x14,0x66,0x00,0x00,0x0E,0x25,0x7C,0x10,0x04,0x09,0x00,
+0x00,0x00,0x60,0x00,0x00,0x0A,0x25,0x7C,0x10,0x04,0x00,0x00,0x00,0x00,0x33,0x7C,
+0x05,0xFC,0x00,0x06,0x22,0x00,0xE9,0x89,0x00,0x81,0x00,0x00,0x00,0x01,0x33,0xC1,
+0xFF,0xFC,0x15,0xC0,0x08,0x39,0x00,0x00,0xFF,0xFC,0x15,0xC0,0x66,0x00,0xFF,0xF6,
+0x35,0x7C,0x00,0x1F,0x00,0x14,0x00,0xAA,0x00,0x00,0x00,0x30,0x00,0x00,0x4E,0x75,
+0x20,0x70,0x09,0xB0,0x00,0x00,0x18,0x52,0x42,0x68,0x00,0x14,0x02,0xA8,0xFF,0xFF,
+0xFF,0xCF,0x00,0x00,0x02,0x70,0xEF,0xFF,0x09,0xB0,0x00,0x00,0x19,0xAA,0x61,0x00,
+0x03,0x70,0x22,0x30,0x09,0xB0,0x00,0x00,0x10,0x04,0x42,0xB0,0x19,0x90,0x4E,0x75,
+0x0C,0xB0,0x00,0x00,0x00,0x0A,0x09,0xB0,0x00,0x00,0x19,0x78,0x67,0x00,0x00,0xA8,
+0x22,0x30,0x09,0xB0,0x00,0x00,0x19,0x68,0x24,0x01,0x4C,0x3C,0x20,0x00,0x00,0x00,
+0x00,0x0C,0xD4,0xB0,0x09,0xB0,0x00,0x00,0x10,0x04,0x06,0x82,0x00,0x00,0x00,0x1C,
+0x0C,0xB0,0x00,0x00,0x00,0x10,0x29,0x90,0x66,0x00,0x00,0x7C,0x20,0x70,0x29,0xA0,
+0x00,0x04,0xE7,0x89,0xD2,0xB0,0x09,0xB0,0x00,0x00,0x18,0x72,0x22,0x70,0x19,0xA0,
+0x00,0x04,0x24,0x30,0x29,0xA0,0x00,0x08,0x31,0x82,0x19,0xA0,0x00,0x02,0x56,0x82,
+0x02,0x82,0xFF,0xFF,0xFF,0xFC,0x23,0xC8,0xFF,0xF9,0x01,0x04,0x23,0xC9,0xFF,0xF9,
+0x01,0x08,0x23,0xC2,0xFF,0xF9,0x01,0x0C,0x23,0xFC,0x00,0x00,0x01,0x03,0xFF,0xF9,
+0x01,0x28,0x61,0x00,0x01,0xF6,0x08,0xF0,0x00,0x1F,0x19,0x90,0x22,0x30,0x09,0xB0,
+0x00,0x00,0x19,0x68,0x52,0x81,0x0C,0x81,0x00,0x00,0x00,0x0A,0x66,0x00,0x00,0x04,
+0x42,0x81,0x21,0x81,0x09,0xB0,0x00,0x00,0x19,0x68,0x52,0xB0,0x09,0xB0,0x00,0x00,
+0x19,0x78,0x60,0x00,0xFF,0x4C,0x4E,0x75,0x22,0x30,0x09,0xB0,0x00,0x00,0x19,0x88,
+0xE7,0x89,0xD2,0xB0,0x09,0xB0,0x00,0x00,0x18,0x82,0x34,0x30,0x19,0x90,0x08,0x02,
+0x00,0x0F,0x66,0x00,0x01,0x12,0x08,0x02,0x00,0x01,0x66,0x00,0x00,0xE6,0x4A,0x70,
+0x09,0xB0,0x00,0x00,0x19,0x9C,0x66,0x00,0x00,0x06,0x08,0x82,0x00,0x02,0x02,0x42,
+0x0C,0xBC,0x0C,0x42,0x0C,0x00,0x66,0x00,0x00,0xDC,0x42,0x83,0x36,0x30,0x19,0xA0,
+0x00,0x02,0x96,0x70,0x09,0xB0,0x00,0x00,0x19,0x9C,0x0C,0x43,0x05,0xF8,0x6E,0x00,
+0x00,0xC4,0x24,0x3A,0x04,0x84,0x4C,0x3C,0x20,0x00,0x00,0x00,0x00,0x0C,0xD4,0xBA,
+0xFA,0xF4,0x0C,0xB0,0x00,0x00,0x00,0x00,0x29,0x90,0x66,0x00,0x00,0x96,0x21,0x83,
+0x29,0xA0,0x00,0x08,0x20,0x70,0x19,0xA0,0x00,0x04,0x22,0x70,0x29,0xA0,0x00,0x04,
+0x4A,0x89,0x67,0x00,0x00,0x2A,0x56,0x83,0x02,0x83,0xFF,0xFF,0xFF,0xFC,0x23,0xC8,
+0xFF,0xF9,0x01,0x1C,0x23,0xC9,0xFF,0xF9,0x01,0x18,0x23,0xC3,0xFF,0xF9,0x01,0x20,
+0x23,0xFC,0x00,0x00,0x03,0x01,0xFF,0xF9,0x01,0x28,0x61,0x00,0x01,0x2C,0x21,0xB0,
+0x09,0xB0,0x00,0x00,0x18,0xC2,0x29,0x90,0x08,0xC6,0x00,0x04,0x24,0x3A,0x04,0x1A,
+0x52,0x82,0x0C,0x82,0x00,0x00,0x00,0x28,0x66,0x00,0x00,0x04,0x42,0x82,0x23,0xC2,
+0x00,0x00,0x19,0x98,0x02,0x70,0xF0,0x00,0x19,0x90,0x08,0xF0,0x00,0x1F,0x19,0x90,
+0x22,0x30,0x09,0xB0,0x00,0x00,0x19,0x88,0x52,0x81,0x0C,0x81,0x00,0x00,0x00,0x1E,
+0x66,0x00,0x00,0x04,0x42,0x81,0x21,0x81,0x09,0xB0,0x00,0x00,0x19,0x88,0x60,0x00,
+0xFE,0xF8,0x24,0x30,0x09,0xB0,0x00,0x00,0x10,0x04,0x52,0xB0,0x29,0xA0,0x00,0x08,
+0x60,0x00,0xFF,0xC2,0x24,0x30,0x09,0xB0,0x00,0x00,0x10,0x04,0x52,0xB0,0x29,0xA0,
+0x00,0x0C,0x60,0x00,0xFF,0xB0,0x4E,0x75,0x4A,0xB0,0x09,0xB0,0x00,0x00,0x19,0x78,
+0x67,0x00,0x00,0x86,0x22,0x30,0x09,0xB0,0x00,0x00,0x19,0x58,0x24,0x01,0xE7,0x89,
+0xD2,0xB0,0x09,0xB0,0x00,0x00,0x18,0x72,0x36,0x30,0x19,0x90,0x08,0x03,0x00,0x0F,
+0x66,0x00,0x00,0x66,0x8C,0xB0,0x09,0xB0,0x00,0x00,0x18,0xA2,0x53,0xB0,0x09,0xB0,
+0x00,0x00,0x19,0x78,0x22,0x30,0x09,0xB0,0x00,0x00,0x19,0x58,0x52,0x81,0x0C,0x81,
+0x00,0x00,0x00,0x0A,0x66,0x00,0x00,0x04,0x42,0x81,0x21,0x81,0x09,0xB0,0x00,0x00,
+0x19,0x58,0x4C,0x3C,0x20,0x00,0x00,0x00,0x00,0x0C,0xD4,0xB0,0x09,0xB0,0x00,0x00,
+0x10,0x04,0x06,0x82,0x00,0x00,0x00,0x1C,0x08,0x03,0x00,0x01,0x66,0x00,0x00,0x0E,
+0x21,0xBC,0x00,0x00,0x00,0x20,0x29,0x90,0x60,0x00,0xFF,0x7E,0x21,0xBC,0x00,0x00,
+0x00,0x30,0x29,0x90,0x60,0x00,0xFF,0x72,0x4E,0x75,0x2F,0x00,0x40,0xE7,0x20,0x39,
+0xFF,0xF9,0x01,0x28,0x08,0x00,0x00,0x04,0x66,0x00,0x00,0x2C,0x4E,0x72,0x22,0x00,
+0x46,0xFC,0x27,0x00,0x60,0x00,0xFF,0xE8,0x2F,0x00,0x40,0xE7,0x20,0x39,0xFF,0xF9,
+0x01,0x28,0x08,0x00,0x00,0x0C,0x66,0x00,0x00,0x0E,0x4E,0x72,0x22,0x00,0x46,0xFC,
+0x27,0x00,0x60,0x00,0xFF,0xE8,0x46,0xDF,0x20,0x1F,0x4E,0x75,0x2F,0x00,0x20,0x39,
+0xFF,0xF9,0x00,0xE0,0x23,0xC0,0xFF,0xF9,0x00,0xE0,0x81,0xB9,0x00,0x00,0x19,0x54,
+0x23,0xFC,0x00,0x00,0x09,0x09,0xFF,0xF9,0x01,0x28,0x20,0x1F,0x4E,0x73,0x00,0xB9,
+0x00,0x00,0x00,0x00,0xFF,0xFC,0x16,0x10,0x00,0xB9,0x00,0x00,0x10,0x00,0x00,0x00,
+0x19,0x54,0x23,0xFC,0x40,0x00,0x00,0x00,0xFF,0xFC,0x15,0x4C,0x4E,0x73,0x00,0xB9,
+0x00,0x00,0x00,0x00,0xFF,0xFC,0x16,0x30,0x00,0xB9,0x00,0x00,0x20,0x00,0x00,0x00,
+0x19,0x54,0x23,0xFC,0x20,0x00,0x00,0x00,0xFF,0xFC,0x15,0x4C,0x4E,0x73,0x00,0xB9,
+0x00,0x00,0x00,0x00,0xFF,0xFC,0x16,0x50,0x00,0xB9,0x00,0x00,0x40,0x00,0x00,0x00,
+0x19,0x54,0x23,0xFC,0x10,0x00,0x00,0x00,0xFF,0xFC,0x15,0x4C,0x4E,0x73,0x00,0xB9,
+0x00,0x00,0x00,0x00,0xFF,0xFC,0x16,0x70,0x00,0xB9,0x00,0x00,0x80,0x00,0x00,0x00,
+0x19,0x54,0x23,0xFC,0x08,0x00,0x00,0x00,0xFF,0xFC,0x15,0x4C,0x4E,0x73,0x4E,0x73,
+0x2F,0x00,0x2F,0x01,0x2F,0x02,0x2F,0x08,0x2F,0x09,0x42,0x80,0x20,0x7C,0xFF,0xFB,
+0x00,0x00,0x32,0x10,0x02,0x81,0x00,0x00,0x00,0xE7,0x0C,0x41,0x00,0x42,0x66,0x00,
+0x00,0x0A,0x32,0x3C,0x0E,0x08,0x60,0x00,0x00,0x3E,0x0C,0x41,0x00,0x63,0x66,0x00,
+0x00,0x0A,0x32,0x3C,0x04,0x08,0x60,0x00,0x00,0x2E,0x0C,0x41,0x00,0x84,0x66,0x00,
+0x00,0x0A,0x32,0x3C,0x02,0x08,0x60,0x00,0x00,0x1E,0x0C,0x41,0x00,0xA5,0x66,0x00,
+0x00,0x0A,0x32,0x3C,0x0D,0x08,0x60,0x00,0x00,0x0E,0x32,0x3C,0x00,0x08,0x34,0x3C,
+0x80,0xE7,0x60,0x00,0x00,0x14,0x34,0x30,0x09,0xB0,0x00,0x00,0x19,0xAA,0x02,0x42,
+0x30,0x00,0x82,0x42,0x34,0x3C,0x80,0xFF,0xB2,0x70,0x09,0xB0,0x00,0x00,0x19,0xAC,
+0x67,0x00,0x00,0x0C,0x31,0x81,0x09,0xB0,0x00,0x00,0x19,0xAC,0x30,0x81,0x32,0x39,
+0xFF,0xFC,0x15,0x66,0xC2,0x70,0x09,0xB0,0x00,0x00,0x19,0x02,0x67,0x00,0x00,0x0C,
+0x32,0x10,0x02,0x41,0xFF,0xF7,0x60,0x00,0x00,0x08,0x32,0x10,0x00,0x41,0x00,0x08,
+0xC2,0x42,0x22,0x70,0x09,0xB0,0x00,0x00,0x10,0x04,0xB2,0xA9,0x00,0x04,0x67,0x00,
+0x00,0x12,0x23,0x41,0x00,0x04,0x23,0xF0,0x09,0xB0,0x00,0x00,0x18,0xB2,0xFF,0xF9,
+0x00,0xE4,0x54,0x88,0x58,0x80,0x0C,0x80,0x00,0x00,0x00,0x10,0x66,0x00,0xFF,0x34,
+0x22,0x5F,0x20,0x5F,0x24,0x1F,0x22,0x1F,0x20,0x1F,0x4E,0x75,0x61,0x00,0xFF,0x12,
+0x4E,0x73,0xFF,0xFC,0x16,0x00,0xFF,0xFC,0x16,0x20,0xFF,0xFC,0x16,0x40,0xFF,0xFC,
+0x16,0x60,0xFF,0xFC,0x0C,0x00,0xFF,0xFC,0x0D,0x00,0xFF,0xFC,0x0E,0x00,0xFF,0xFC,
+0x0F,0x00,0xFF,0xFC,0x00,0x00,0xFF,0xFC,0x01,0x40,0xFF,0xFC,0x02,0x80,0xFF,0xFC,
+0x03,0xC0,0xFF,0xFC,0x00,0x50,0xFF,0xFC,0x01,0x90,0xFF,0xFC,0x02,0xD0,0xFF,0xFC,
+0x04,0x10,0x00,0x00,0x40,0x00,0x00,0x01,0x2F,0x60,0x00,0x02,0x1E,0xC0,0x00,0x03,
+0x0E,0x20,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x04,0x00,0x00,
+0x00,0x08,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x80,0x00,0x00,
+0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x12,0x00,0x00,
+0x00,0x13,0x00,0x00,0x00,0x2C,0x00,0x00,0x3E,0x00,0x00,0x2C,0x00,0x00,0x3E,0x00,
+0x00,0x00,0x00,0x00,0x00,0x2D,0x00,0x00,0x3F,0x00,0x00,0x2D,0x00,0x00,0x3F,0x00,
+0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0xFF,0x00,0x00,0xFF,0x00,0x00,0xFF,0x00,
+0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x80,0x00,0x00,0x02,0x00,0x00,0x00,0x08,0x00,
+0x77,0x61,0x6E,0x58,0x4C,0x20,0x66,0x69,0x72,0x6D,0x77,0x61,0x72,0x65,0x0A,0x43,
+0x6F,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x43,0x29,0x20,0x32,0x30,0x30,
+0x33,0x20,0x4B,0x72,0x7A,0x79,0x73,0x7A,0x74,0x6F,0x66,0x20,0x48,0x61,0x6C,0x61,
+0x73,0x61,0x20,0x3C,0x6B,0x68,0x63,0x40,0x70,0x6D,0x2E,0x77,0x61,0x77,0x2E,0x70,
+0x6C,0x3E,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
diff --git a/drivers/net/wd.c b/drivers/net/wd.c
index 411a448d2f2f..cebcdbbfc7f6 100644
--- a/drivers/net/wd.c
+++ b/drivers/net/wd.c
@@ -235,7 +235,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
int reg4 = inb(ioaddr+4);
if (ancient || reg1 == 0xff) { /* Ack!! No way to read the IRQ! */
short nic_addr = ioaddr+WD_NIC_OFFSET;
- unsigned long irq_mask, delay;
+ unsigned long irq_mask;
/* We have an old-style ethercard that doesn't report its IRQ
line. Do autoirq to find the IRQ line. Note that this IS NOT
@@ -248,8 +248,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
outb_p(0x00, nic_addr + EN0_RCNTLO);
outb_p(0x00, nic_addr + EN0_RCNTHI);
outb(E8390_RREAD+E8390_START, nic_addr); /* Trigger it... */
- delay = jiffies + HZ/50;
- while (time_before(jiffies, delay)) ;
+ mdelay(20);
dev->irq = probe_irq_off(irq_mask);
outb_p(0x00, nic_addr+EN0_IMR); /* Mask all intrs. again. */
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 4b78dce165f5..41a35807b6cd 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -18,7 +18,6 @@
======================================================================*/
#include <linux/config.h>
-#include <linux/version.h>
#include <linux/init.h>
#include <linux/kernel.h>
@@ -42,7 +41,6 @@
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/ioport.h>
-#include <linux/config.h>
#include <linux/pci.h>
#include <asm/uaccess.h>
@@ -1435,7 +1433,7 @@ void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto
int i,j;
u32 counter;
- u8 *cipher;
+ u8 *cipher, plain[16];
struct scatterlist sg[1];
crypto_cipher_setkey(tfm, pkey, 16);
@@ -1446,8 +1444,9 @@ void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto
aes_counter[13] = (u8)(counter >> 16);
aes_counter[12] = (u8)(counter >> 24);
counter++;
- sg[0].page = virt_to_page(aes_counter);
- sg[0].offset = ((long) aes_counter & ~PAGE_MASK);
+ memcpy (plain, aes_counter, 16);
+ sg[0].page = virt_to_page(plain);
+ sg[0].offset = ((long) plain & ~PAGE_MASK);
sg[0].length = 16;
crypto_cipher_encrypt(tfm, sg, sg, 16);
cipher = kmap(sg[0].page) + sg[0].offset;
@@ -4624,7 +4623,7 @@ static int __devinit airo_pci_probe(struct pci_dev *pdev,
return -ENODEV;
pci_set_drvdata(pdev, dev);
- clear_bit (FLAG_PCI, &((struct airo_info *)dev->priv)->flags);
+ set_bit (FLAG_PCI, &((struct airo_info *)dev->priv)->flags);
return 0;
}
diff --git a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c
index ccd6e2ea3848..18f055132858 100644
--- a/drivers/net/wireless/arlan-proc.c
+++ b/drivers/net/wireless/arlan-proc.c
@@ -5,9 +5,6 @@
#ifdef CONFIG_PROC_FS
-
-#include <linux/version.h>
-
/* void enableReceive(struct net_device* dev);
*/
diff --git a/drivers/net/wireless/arlan.c b/drivers/net/wireless/arlan.c
index 0de038cd8275..4c72ab91fbd7 100644
--- a/drivers/net/wireless/arlan.c
+++ b/drivers/net/wireless/arlan.c
@@ -5,6 +5,7 @@
* This module provides support for the Arlan 655 card made by Aironet
*/
+#include <linux/version.h>
#include <linux/config.h>
#include "arlan.h"
diff --git a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h
index 3a6fe9c6b6ca..aacef0d77a56 100644
--- a/drivers/net/wireless/arlan.h
+++ b/drivers/net/wireless/arlan.h
@@ -3,7 +3,6 @@
* Copyright (C) 1998 Elmer.Joandi@ut.ee, +37-255-13500
* GNU General Public License applies
*/
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/config.h>
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index 7a49e54c2379..57463d81c457 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -83,7 +83,6 @@ static const char StripVersion[] = "1.3A-STUART.CHESHIRE";
#include <linux/config.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/init.h>
#include <asm/system.h>
#include <asm/uaccess.h>
diff --git a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
index de635a575b8f..23fbc8589385 100644
--- a/drivers/pcmcia/cs.c
+++ b/drivers/pcmcia/cs.c
@@ -281,72 +281,29 @@ int pcmcia_socket_dev_resume(struct device *dev)
EXPORT_SYMBOL(pcmcia_socket_dev_resume);
-static int pccardd(void *__skt);
-#define to_class_data(dev) dev->class_data
-
-static int pcmcia_add_socket(struct class_device *class_dev)
-{
- struct pcmcia_socket *socket = class_get_devdata(class_dev);
- int ret = 0;
-
- /* base address = 0, map = 0 */
- socket->cis_mem.flags = 0;
- socket->cis_mem.speed = cis_speed;
- socket->erase_busy.next = socket->erase_busy.prev = &socket->erase_busy;
- INIT_LIST_HEAD(&socket->cis_cache);
- spin_lock_init(&socket->lock);
-
- init_completion(&socket->thread_done);
- init_waitqueue_head(&socket->thread_wait);
- init_MUTEX(&socket->skt_sem);
- spin_lock_init(&socket->thread_lock);
-
- socket->socket = dead_socket;
- socket->ops->init(socket);
-
- ret = kernel_thread(pccardd, socket, CLONE_KERNEL);
- if (ret < 0)
- return ret;
-
- wait_for_completion(&socket->thread_done);
- BUG_ON(!socket->thread);
- pcmcia_parse_events(socket, SS_DETECT);
-
- return 0;
-}
-
-static void pcmcia_remove_socket(struct class_device *class_dev)
+static void pcmcia_release_socket(struct class_device *class_dev)
{
struct pcmcia_socket *socket = class_get_devdata(class_dev);
client_t *client;
- if (socket->thread) {
- init_completion(&socket->thread_done);
- socket->thread = NULL;
- wake_up(&socket->thread_wait);
- wait_for_completion(&socket->thread_done);
- }
- release_cis_mem(socket);
while (socket->clients) {
client = socket->clients;
socket->clients = socket->clients->next;
kfree(client);
}
- socket->ops = NULL;
-}
-static void pcmcia_release_socket(struct class_device *class_dev)
-{
- struct pcmcia_socket *socket = class_get_devdata(class_dev);
complete(&socket->socket_released);
}
+static int pccardd(void *__skt);
/**
* pcmcia_register_socket - add a new pcmcia socket device
*/
int pcmcia_register_socket(struct pcmcia_socket *socket)
{
+ int ret;
+
if (!socket || !socket->ops || !socket->dev.dev)
return -EINVAL;
@@ -381,15 +338,34 @@ int pcmcia_register_socket(struct pcmcia_socket *socket)
socket->dev.class = &pcmcia_socket_class;
snprintf(socket->dev.class_id, BUS_ID_SIZE, "pcmcia_socket%u", socket->sock);
- /* register with the device core */
- if (class_device_register(&socket->dev)) {
- down_write(&pcmcia_socket_list_rwsem);
- list_del(&socket->socket_list);
- up_write(&pcmcia_socket_list_rwsem);
- return -EINVAL;
- }
+ /* base address = 0, map = 0 */
+ socket->cis_mem.flags = 0;
+ socket->cis_mem.speed = cis_speed;
+ socket->erase_busy.next = socket->erase_busy.prev = &socket->erase_busy;
+ INIT_LIST_HEAD(&socket->cis_cache);
+ spin_lock_init(&socket->lock);
+
+ init_completion(&socket->socket_released);
+ init_completion(&socket->thread_done);
+ init_waitqueue_head(&socket->thread_wait);
+ init_MUTEX(&socket->skt_sem);
+ spin_lock_init(&socket->thread_lock);
+
+ ret = kernel_thread(pccardd, socket, CLONE_KERNEL);
+ if (ret < 0)
+ goto err;
+
+ wait_for_completion(&socket->thread_done);
+ BUG_ON(!socket->thread);
+ pcmcia_parse_events(socket, SS_DETECT);
return 0;
+
+ err:
+ down_write(&pcmcia_socket_list_rwsem);
+ list_del(&socket->socket_list);
+ up_write(&pcmcia_socket_list_rwsem);
+ return ret;
} /* pcmcia_register_socket */
EXPORT_SYMBOL(pcmcia_register_socket);
@@ -404,10 +380,13 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
DEBUG(0, "cs: pcmcia_unregister_socket(0x%p)\n", socket->ops);
- init_completion(&socket->socket_released);
-
- /* remove from the device core */
- class_device_unregister(&socket->dev);
+ if (socket->thread) {
+ init_completion(&socket->thread_done);
+ socket->thread = NULL;
+ wake_up(&socket->thread_wait);
+ wait_for_completion(&socket->thread_done);
+ }
+ release_cis_mem(socket);
/* remove from our own list */
down_write(&pcmcia_socket_list_rwsem);
@@ -783,11 +762,22 @@ static int pccardd(void *__skt)
{
struct pcmcia_socket *skt = __skt;
DECLARE_WAITQUEUE(wait, current);
+ int ret;
daemonize("pccardd");
skt->thread = current;
complete(&skt->thread_done);
+ skt->socket = dead_socket;
+ skt->ops->init(skt);
+
+ /* register with the device core */
+ ret = class_device_register(&skt->dev);
+ if (ret) {
+ printk(KERN_WARNING "PCMCIA: unable to register socket 0x%p\n",
+ skt);
+ }
+
add_wait_queue(&skt->thread_wait, &wait);
for (;;) {
unsigned long flags;
@@ -823,6 +813,9 @@ static int pccardd(void *__skt)
}
remove_wait_queue(&skt->thread_wait, &wait);
+ /* remove from the device core */
+ class_device_unregister(&skt->dev);
+
complete_and_exit(&skt->thread_done, 0);
}
@@ -2501,12 +2494,6 @@ struct class pcmcia_socket_class = {
};
EXPORT_SYMBOL(pcmcia_socket_class);
-static struct class_interface pcmcia_socket = {
- .class = &pcmcia_socket_class,
- .add = &pcmcia_add_socket,
- .remove = &pcmcia_remove_socket,
-};
-
static int __init init_pcmcia_cs(void)
{
@@ -2514,7 +2501,6 @@ static int __init init_pcmcia_cs(void)
printk(KERN_INFO " %s\n", options);
DEBUG(0, "%s\n", version);
class_register(&pcmcia_socket_class);
- class_interface_register(&pcmcia_socket);
return 0;
}
@@ -2523,7 +2509,6 @@ static void __exit exit_pcmcia_cs(void)
{
printk(KERN_INFO "unloading Kernel Card Services\n");
release_resource_db();
- class_interface_unregister(&pcmcia_socket);
class_unregister(&pcmcia_socket_class);
}
diff --git a/drivers/pcmcia/rsrc_mgr.c b/drivers/pcmcia/rsrc_mgr.c
index 6429b52d8649..b9cb632d8084 100644
--- a/drivers/pcmcia/rsrc_mgr.c
+++ b/drivers/pcmcia/rsrc_mgr.c
@@ -491,7 +491,7 @@ static u_long inv_probe(resource_map_t *m, struct pcmcia_socket *s)
void validate_mem(struct pcmcia_socket *s)
{
- resource_map_t *m, *n;
+ resource_map_t *m, mm;
static u_char order[] = { 0xd0, 0xe0, 0xc0, 0xf0 };
static int hi = 0, lo = 0;
u_long b, i, ok = 0;
@@ -510,18 +510,18 @@ void validate_mem(struct pcmcia_socket *s)
}
if (lo++)
goto out;
- for (m = mem_db.next; m != &mem_db; m = n) {
- n = m->next;
+ for (m = mem_db.next; m != &mem_db; m = mm.next) {
+ mm = *m;
/* Only probe < 1 MB */
- if (m->base >= 0x100000) continue;
- if ((m->base | m->num) & 0xffff) {
- ok += do_mem_probe(m->base, m->num, s);
+ if (mm.base >= 0x100000) continue;
+ if ((mm.base | mm.num) & 0xffff) {
+ ok += do_mem_probe(mm.base, mm.num, s);
continue;
}
/* Special probe for 64K-aligned block */
for (i = 0; i < 4; i++) {
b = order[i] << 12;
- if ((b >= m->base) && (b+0x10000 <= m->base+m->num)) {
+ if ((b >= mm.base) && (b+0x10000 <= mm.base+mm.num)) {
if (ok >= mem_limit)
sub_interval(&mem_db, b, 0x10000);
else
@@ -537,14 +537,14 @@ void validate_mem(struct pcmcia_socket *s)
void validate_mem(struct pcmcia_socket *s)
{
- resource_map_t *m, *n;
+ resource_map_t *m, mm;
static int done = 0;
if (probe_mem && done++ == 0) {
down(&rsrc_sem);
- for (m = mem_db.next; m != &mem_db; m = n) {
- n = m->next;
- if (do_mem_probe(m->base, m->num, s))
+ for (m = mem_db.next; m != &mem_db; m = mm.next) {
+ mm = *m;
+ if (do_mem_probe(mm.base, mm.num, s))
break;
}
up(&rsrc_sem);
diff --git a/drivers/pcmcia/sa1100_assabet.c b/drivers/pcmcia/sa1100_assabet.c
index e25e160d7e61..884a655efbfb 100644
--- a/drivers/pcmcia/sa1100_assabet.c
+++ b/drivers/pcmcia/sa1100_assabet.c
@@ -4,7 +4,6 @@
* PCMCIA implementation routines for Assabet
*
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index f72ebb3b1206..bc0788173daf 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -5,6 +5,7 @@
* basically means we handle everything except controlling the
* power. Power is machine specific...
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ioport.h>
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c
index 7ea94fc68c8d..4a0cff353c46 100644
--- a/drivers/pnp/card.c
+++ b/drivers/pnp/card.c
@@ -62,8 +62,14 @@ static int card_probe(struct pnp_card * card, struct pnp_card_driver * drv)
if (drv->probe) {
if (drv->probe(clink, id)>=0)
return 1;
- else
+ else {
+ struct pnp_dev * dev;
+ card_for_each_dev(card, dev) {
+ if (dev->card_link == clink)
+ pnp_release_card_device(dev);
+ }
kfree(clink);
+ }
} else
return 1;
}
diff --git a/drivers/pnp/isapnp/compat.c b/drivers/pnp/isapnp/compat.c
index 813a5b6486d2..3ff7e76b33bd 100644
--- a/drivers/pnp/isapnp/compat.c
+++ b/drivers/pnp/isapnp/compat.c
@@ -9,7 +9,6 @@
/* TODO: see if more isapnp functions are needed here */
#include <linux/config.h>
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/isapnp.h>
#include <linux/string.h>
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index acb3943281d7..b5e3e898f8e5 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -35,7 +35,6 @@
*/
#include <linux/config.h>
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -65,7 +64,6 @@ MODULE_PARM(isapnp_rdp, "i");
MODULE_PARM_DESC(isapnp_rdp, "ISA Plug & Play read data port");
MODULE_PARM(isapnp_reset, "i");
MODULE_PARM_DESC(isapnp_reset, "ISA Plug & Play reset all cards");
-MODULE_PARM(isapnp_allow_dma0, "i");
MODULE_PARM(isapnp_verbose, "i");
MODULE_PARM_DESC(isapnp_verbose, "ISA Plug & Play verbose mode");
MODULE_LICENSE("GPL");
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c
index 252ba4d03255..0a94ee9db072 100644
--- a/drivers/pnp/isapnp/proc.c
+++ b/drivers/pnp/isapnp/proc.c
@@ -20,7 +20,6 @@
*/
#include <linux/config.h>
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/isapnp.h>
#include <linux/proc_fs.h>
diff --git a/drivers/pnp/pnpbios/bioscalls.c b/drivers/pnp/pnpbios/bioscalls.c
index 58be336158ab..42e4280bd927 100644
--- a/drivers/pnp/pnpbios/bioscalls.c
+++ b/drivers/pnp/pnpbios/bioscalls.c
@@ -23,41 +23,7 @@
#include <asm/system.h>
#include <asm/byteorder.h>
-
-/* PnP BIOS signature: "$PnP" */
-#define PNP_SIGNATURE (('$' << 0) + ('P' << 8) + ('n' << 16) + ('P' << 24))
-
-#pragma pack(1)
-union pnp_bios_expansion_header {
- struct {
- u32 signature; /* "$PnP" */
- u8 version; /* in BCD */
- u8 length; /* length in bytes, currently 21h */
- u16 control; /* system capabilities */
- u8 checksum; /* all bytes must add up to 0 */
-
- u32 eventflag; /* phys. address of the event flag */
- u16 rmoffset; /* real mode entry point */
- u16 rmcseg;
- u16 pm16offset; /* 16 bit protected mode entry */
- u32 pm16cseg;
- u32 deviceID; /* EISA encoded system ID or 0 */
- u16 rmdseg; /* real mode data segment */
- u32 pm16dseg; /* 16 bit pm data segment base */
- } fields;
- char chars[0x21]; /* To calculate the checksum */
-};
-#pragma pack()
-
-static union pnp_bios_expansion_header * pnp_bios_hdr = NULL;
-
-/*
- * Call this only after init time
- */
-static int pnp_bios_present(void)
-{
- return (pnp_bios_hdr != NULL);
-}
+#include "pnpbios.h"
static struct {
u16 offset;
@@ -557,10 +523,10 @@ static int pnp_bios_write_escd(char *data, u32 nvram_base)
/*
- * Probing and Initialization
+ * Initialization
*/
-static void pnpbios_prepare_bios_calls(union pnp_bios_expansion_header *header)
+void pnpbios_calls_init(union pnp_bios_install_struct *header)
{
int i;
spin_lock_init(&pnp_bios_lock);
@@ -576,52 +542,3 @@ static void pnpbios_prepare_bios_calls(union pnp_bios_expansion_header *header)
Q_SET_SEL(i, PNP_DS, header->fields.pm16dseg, 64 * 1024);
}
}
-
-int pnpbios_probe_installation(void)
-{
- union pnp_bios_expansion_header *check;
- u8 sum;
- int length, i;
-
- printk(KERN_INFO "PnPBIOS: Scanning system for PnP BIOS support...\n");
-
- /*
- * Search the defined area (0xf0000-0xffff0) for a valid PnP BIOS
- * structure and, if one is found, sets up the selectors and
- * entry points
- */
- for (check = (union pnp_bios_expansion_header *) __va(0xf0000);
- check < (union pnp_bios_expansion_header *) __va(0xffff0);
- ((void *) (check)) += 16) {
- if (check->fields.signature != PNP_SIGNATURE)
- continue;
- printk(KERN_INFO "PnPBIOS: Found PnP BIOS installation structure at 0x%p\n", check);
- length = check->fields.length;
- if (!length) {
- printk(KERN_ERR "PnPBIOS: installation structure is invalid, skipping\n");
- continue;
- }
- for (sum = 0, i = 0; i < length; i++)
- sum += check->chars[i];
- if (sum) {
- printk(KERN_ERR "PnPBIOS: installation structure is corrupted, skipping\n");
- continue;
- }
- if (check->fields.version < 0x10) {
- printk(KERN_WARNING "PnPBIOS: PnP BIOS version %d.%d is not supported\n",
- check->fields.version >> 4,
- check->fields.version & 15);
- continue;
- }
- printk(KERN_INFO "PnPBIOS: PnP BIOS version %d.%d, entry 0x%x:0x%x, dseg 0x%x\n",
- check->fields.version >> 4, check->fields.version & 15,
- check->fields.pm16cseg, check->fields.pm16offset,
- check->fields.pm16dseg);
- pnp_bios_hdr = check;
- pnpbios_prepare_bios_calls(check);
- return 1;
- }
-
- printk(KERN_INFO "PnPBIOS: PnP BIOS support was not detected.\n");
- return 0;
-}
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index 8097ed9120e5..5385876b8cb6 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -74,6 +74,13 @@
*
*/
+static union pnp_bios_install_struct * pnp_bios_install = NULL;
+
+int pnp_bios_present(void)
+{
+ return (pnp_bios_install != NULL);
+}
+
struct pnp_dev_node_info node_info;
void *pnpbios_kmalloc(size_t size, int f)
@@ -410,7 +417,56 @@ static int __init pnpbios_setup(char *str)
__setup("pnpbios=", pnpbios_setup);
#endif
-subsys_initcall(pnpbios_init);
+/* PnP BIOS signature: "$PnP" */
+#define PNP_SIGNATURE (('$' << 0) + ('P' << 8) + ('n' << 16) + ('P' << 24))
+
+int __init pnpbios_probe_system(void)
+{
+ union pnp_bios_install_struct *check;
+ u8 sum;
+ int length, i;
+
+ printk(KERN_INFO "PnPBIOS: Scanning system for PnP BIOS support...\n");
+
+ /*
+ * Search the defined area (0xf0000-0xffff0) for a valid PnP BIOS
+ * structure and, if one is found, sets up the selectors and
+ * entry points
+ */
+ for (check = (union pnp_bios_install_struct *) __va(0xf0000);
+ check < (union pnp_bios_install_struct *) __va(0xffff0);
+ ((void *) (check)) += 16) {
+ if (check->fields.signature != PNP_SIGNATURE)
+ continue;
+ printk(KERN_INFO "PnPBIOS: Found PnP BIOS installation structure at 0x%p\n", check);
+ length = check->fields.length;
+ if (!length) {
+ printk(KERN_ERR "PnPBIOS: installation structure is invalid, skipping\n");
+ continue;
+ }
+ for (sum = 0, i = 0; i < length; i++)
+ sum += check->chars[i];
+ if (sum) {
+ printk(KERN_ERR "PnPBIOS: installation structure is corrupted, skipping\n");
+ continue;
+ }
+ if (check->fields.version < 0x10) {
+ printk(KERN_WARNING "PnPBIOS: PnP BIOS version %d.%d is not supported\n",
+ check->fields.version >> 4,
+ check->fields.version & 15);
+ continue;
+ }
+ printk(KERN_INFO "PnPBIOS: PnP BIOS version %d.%d, entry 0x%x:0x%x, dseg 0x%x\n",
+ check->fields.version >> 4, check->fields.version & 15,
+ check->fields.pm16cseg, check->fields.pm16offset,
+ check->fields.pm16dseg);
+ pnp_bios_install = check;
+ return 1;
+ }
+
+ printk(KERN_INFO "PnPBIOS: PnP BIOS support was not detected.\n");
+ return 0;
+}
int __init pnpbios_init(void)
{
@@ -421,24 +477,30 @@ int __init pnpbios_init(void)
}
/* scan the system for pnpbios support */
- if (!pnpbios_probe_installation())
+ if (!pnpbios_probe_system())
return -ENODEV;
+ /* make preparations for bios calls */
+ pnpbios_calls_init(pnp_bios_install);
+
/* read the node info */
- if (pnp_bios_dev_node_info(&node_info)) {
+ ret = pnp_bios_dev_node_info(&node_info);
+ if (ret) {
printk(KERN_ERR "PnPBIOS: Unable to get node info. Aborting.\n");
- return -EIO;
+ return ret;
}
/* register with the pnp layer */
- pnp_register_protocol(&pnpbios_protocol);
+ ret = pnp_register_protocol(&pnpbios_protocol);
+ if (ret) {
+ printk(KERN_ERR "PnPBIOS: Unable to register driver. Aborting.\n");
+ return ret;
+ }
-#ifdef CONFIG_PROC_FS
/* start the proc interface */
ret = pnpbios_proc_init();
if (ret)
- return ret;
-#endif
+ printk(KERN_ERR "PnPBIOS: Failed to create proc interface.\n");
/* scan for pnpbios devices */
build_devlist();
@@ -446,6 +508,8 @@ int __init pnpbios_init(void)
return 0;
}
+subsys_initcall(pnpbios_init);
+
static int __init pnpbios_thread_init(void)
{
#ifdef CONFIG_HOTPLUG
diff --git a/drivers/pnp/pnpbios/pnpbios.h b/drivers/pnp/pnpbios/pnpbios.h
index 419eca1bf398..9287ffa46800 100644
--- a/drivers/pnp/pnpbios/pnpbios.h
+++ b/drivers/pnp/pnpbios/pnpbios.h
@@ -1,11 +1,47 @@
/*
- * pnpbios.h - contains definitions for functions used only locally.
+ * pnpbios.h - contains local definitions
*/
+#pragma pack(1)
+union pnp_bios_install_struct {
+ struct {
+ u32 signature; /* "$PnP" */
+ u8 version; /* in BCD */
+ u8 length; /* length in bytes, currently 21h */
+ u16 control; /* system capabilities */
+ u8 checksum; /* all bytes must add up to 0 */
+
+ u32 eventflag; /* phys. address of the event flag */
+ u16 rmoffset; /* real mode entry point */
+ u16 rmcseg;
+ u16 pm16offset; /* 16 bit protected mode entry */
+ u32 pm16cseg;
+ u32 deviceID; /* EISA encoded system ID or 0 */
+ u16 rmdseg; /* real mode data segment */
+ u32 pm16dseg; /* 16 bit pm data segment base */
+ } fields;
+ char chars[0x21]; /* To calculate the checksum */
+};
+#pragma pack()
+
+extern int pnp_bios_present(void);
+extern int pnpbios_dont_use_current_config;
+extern void *pnpbios_kmalloc(size_t size, int f);
+
extern int pnpbios_parse_data_stream(struct pnp_dev *dev, struct pnp_bios_node * node);
extern int pnpbios_read_resources_from_node(struct pnp_resource_table *res, struct pnp_bios_node * node);
extern int pnpbios_write_resources_to_node(struct pnp_resource_table *res, struct pnp_bios_node * node);
extern void pnpid32_to_pnpid(u32 id, char *str);
extern void pnpbios_print_status(const char * module, u16 status);
-extern int pnpbios_probe_installation(void);
+extern void pnpbios_calls_init(union pnp_bios_install_struct * header);
+
+#ifdef CONFIG_PROC_FS
+extern int pnpbios_interface_attach_device(struct pnp_bios_node * node);
+extern int pnpbios_proc_init (void);
+extern void pnpbios_proc_exit (void);
+#else
+static inline int pnpbios_interface_attach_device(struct pnp_bios_node * node) { return 0; }
+static inline int pnpbios_proc_init (void) { return 0; }
+static inline void pnpbios_proc_exit (void) { ; }
+#endif /* CONFIG_PROC */
diff --git a/drivers/pnp/pnpbios/proc.c b/drivers/pnp/pnpbios/proc.c
index a42fd2081012..14eeff632c7e 100644
--- a/drivers/pnp/pnpbios/proc.c
+++ b/drivers/pnp/pnpbios/proc.c
@@ -31,6 +31,8 @@
#include <asm/uaccess.h>
+#include "pnpbios.h"
+
static struct proc_dir_entry *proc_pnp = NULL;
static struct proc_dir_entry *proc_pnp_boot = NULL;
@@ -213,6 +215,9 @@ int pnpbios_interface_attach_device(struct pnp_bios_node * node)
struct proc_dir_entry *ent;
sprintf(name, "%02x", node->handle);
+
+ if (!proc_pnp)
+ return -EIO;
if ( !pnpbios_dont_use_current_config ) {
ent = create_proc_entry(name, 0, proc_pnp);
if (ent) {
@@ -221,6 +226,9 @@ int pnpbios_interface_attach_device(struct pnp_bios_node * node)
ent->data = (void *)(long)(node->handle);
}
}
+
+ if (!proc_pnp_boot)
+ return -EIO;
ent = create_proc_entry(name, 0, proc_pnp_boot);
if (ent) {
ent->read_proc = proc_read_node;
@@ -228,6 +236,7 @@ int pnpbios_interface_attach_device(struct pnp_bios_node * node)
ent->data = (void *)(long)(node->handle+0x100);
return 0;
}
+
return -EIO;
}
@@ -257,8 +266,9 @@ void __exit pnpbios_proc_exit(void)
{
int i;
char name[3];
-
- if (!proc_pnp) return;
+
+ if (!proc_pnp)
+ return;
for (i=0; i<0xff; i++) {
sprintf(name, "%02x", i);
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 883f845a8d11..74eecb245bd5 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -111,28 +111,6 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev)
return;
}
-extern int pnp_allow_dma0;
-static void quirk_opl3sax_resources(struct pnp_dev *dev)
-{
- /* This really isn't a device quirk but isapnp core code
- * doesn't allow a DMA channel of 0, afflicted card is an
- * OPL3Sax where x=4.
- */
- struct pnp_option *res;
- int max;
- res = dev->dependent;
- max = 0;
- for (; res; res = res->next) {
- if (res->dma->map > max)
- max = res->dma->map;
- }
- if (max == 1 && pnp_allow_dma0 == -1) {
- printk(KERN_INFO "pnp: opl3sa4 quirk: Allowing dma 0.\n");
- pnp_allow_dma0 = 1;
- }
- return;
-}
-
/*
* PnP Quirks
* Cards or devices that need some tweaking due to incomplete resource info
@@ -153,7 +131,6 @@ static struct pnp_fixup pnp_fixups[] = {
{ "CTL0043", quirk_sb16audio_resources },
{ "CTL0044", quirk_sb16audio_resources },
{ "CTL0045", quirk_sb16audio_resources },
- { "YMH0021", quirk_opl3sax_resources },
{ "" }
};
@@ -170,4 +147,3 @@ void pnp_fixup_device(struct pnp_dev *dev)
i++;
}
}
-
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c
index ffd4211da434..dfe565a82ea8 100644
--- a/drivers/pnp/resource.c
+++ b/drivers/pnp/resource.c
@@ -21,8 +21,6 @@
#include <linux/pnp.h>
#include "base.h"
-int pnp_allow_dma0 = -1; /* allow dma 0 during auto activation:
- * -1=off (:default), 0=off (set by user), 1=on */
int pnp_skip_pci_scan; /* skip PCI resource scanning */
int pnp_reserve_irq[16] = { [0 ... 15] = -1 }; /* reserve (don't use) some IRQ */
int pnp_reserve_dma[8] = { [0 ... 7] = -1 }; /* reserve (don't use) some DMA */
@@ -426,7 +424,7 @@ int pnp_check_irq(struct pnp_dev * dev, int idx)
int pnp_check_dma(struct pnp_dev * dev, int idx)
{
- int tmp, mindma = 1;
+ int tmp;
struct pnp_dev *tdev;
unsigned long * dma = &dev->res.dma_resource[idx].start;
@@ -435,9 +433,7 @@ int pnp_check_dma(struct pnp_dev * dev, int idx)
return 1;
/* check if the resource is valid */
- if (pnp_allow_dma0 == 1)
- mindma = 0;
- if (*dma < mindma || *dma == 4 || *dma > 7)
+ if (*dma < 0 || *dma == 4 || *dma > 7)
return 0;
/* check if the resource is reserved */
@@ -488,16 +484,6 @@ EXPORT_SYMBOL(pnp_register_port_resource);
EXPORT_SYMBOL(pnp_register_mem_resource);
-/* format is: allowdma0 */
-
-static int __init pnp_allowdma0(char *str)
-{
- pnp_allow_dma0 = 1;
- return 1;
-}
-
-__setup("allowdma0", pnp_allowdma0);
-
/* format is: pnp_reserve_irq=irq1[,irq2] .... */
static int __init pnp_setup_reserve_irq(char *str)
diff --git a/drivers/sbus/char/bpp.c b/drivers/sbus/char/bpp.c
index ab7cc1b2f72f..daf16c9cc8db 100644
--- a/drivers/sbus/char/bpp.c
+++ b/drivers/sbus/char/bpp.c
@@ -12,7 +12,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/fs.h>
#include <linux/errno.h>
#include <linux/sched.h>
diff --git a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c
index 4a99ad0c5e32..51e4ada8a6a0 100644
--- a/drivers/sbus/char/cpwatchdog.c
+++ b/drivers/sbus/char/cpwatchdog.c
@@ -17,7 +17,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/fs.h>
#include <linux/errno.h>
#include <linux/major.h>
diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
index a35e60ee1f87..8d1a1e1b95b7 100644
--- a/drivers/sbus/char/display7seg.c
+++ b/drivers/sbus/char/display7seg.c
@@ -9,7 +9,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/fs.h>
#include <linux/errno.h>
#include <linux/major.h>
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 7262cca5529e..ff77a2887b8f 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -372,7 +372,7 @@ static int NCR5380_poll_politely(struct Scsi_Host *instance, int reg, int bit, i
{
r = NCR5380_read(reg);
if((r & bit) == val)
- return r;
+ return 0;
cpu_relax();
}
@@ -381,7 +381,7 @@ static int NCR5380_poll_politely(struct Scsi_Host *instance, int reg, int bit, i
{
r = NCR5380_read(reg);
if((r & bit) == val)
- return r;
+ return 0;
if(!in_interrupt())
yield();
else
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index f4badc2e4045..8d09cccc1430 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -33,10 +33,8 @@ config USB
It doesn't normally hurt to select them all if you are not certain.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called usbcore. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called usbcore.
source "drivers/usb/core/Kconfig"
@@ -82,10 +80,8 @@ config USB_USS720
Say Y here if you own an USS-720 USB->Parport cable and intend to
connect anything other than a printer to it.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called uss720. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called uss720.
source "drivers/usb/serial/Kconfig"
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 9cb8863fe8f9..d74caea0357b 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -159,7 +159,10 @@ static void usblp_dump(struct usblp *usblp) {
dbg("usblp=0x%p", usblp);
dbg("dev=0x%p", usblp->dev);
dbg("present=%d", usblp->present);
- dbg("buf=0x%p", usblp->buf);
+ dbg("readbuf=0x%p", usblp->readbuf);
+ dbg("writebuf=0x%p", usblp->writebuf);
+ dbg("readurb=0x%p", usblp->readurb);
+ dbg("writeurb=0x%p", usblp->writeurb);
dbg("readcount=%d", usblp->readcount);
dbg("ifnum=%d", usblp->ifnum);
for (p = USBLP_FIRST_PROTOCOL; p <= USBLP_LAST_PROTOCOL; p++) {
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 3d81628ac355..00a63ae9b7da 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -10,364 +10,329 @@
/* these maximums are arbitrary */
#define USB_MAXCONFIG 8
-#define USB_ALTSETTINGALLOC 4
#define USB_MAXINTERFACES 32
static int usb_parse_endpoint(struct usb_host_endpoint *endpoint, unsigned char *buffer, int size)
{
+ unsigned char *buffer0 = buffer;
struct usb_descriptor_header *header;
unsigned char *begin;
- int parsed = 0, len, numskipped;
+ int numskipped;
header = (struct usb_descriptor_header *)buffer;
-
- /* Everything should be fine being passed into here, but we sanity */
- /* check JIC */
- if (header->bLength > size) {
- err("ran out of descriptors parsing");
- return -1;
- }
-
if (header->bDescriptorType != USB_DT_ENDPOINT) {
warn("unexpected descriptor 0x%X, expecting endpoint, 0x%X",
header->bDescriptorType, USB_DT_ENDPOINT);
- return parsed;
+ return -EINVAL;
}
- if (header->bLength == USB_DT_ENDPOINT_AUDIO_SIZE)
+ if (header->bLength >= USB_DT_ENDPOINT_AUDIO_SIZE)
memcpy(&endpoint->desc, buffer, USB_DT_ENDPOINT_AUDIO_SIZE);
- else
+ else if (header->bLength >= USB_DT_ENDPOINT_SIZE)
memcpy(&endpoint->desc, buffer, USB_DT_ENDPOINT_SIZE);
-
+ else {
+ warn("invalid endpoint descriptor");
+ return -EINVAL;
+ }
+
+ if ((endpoint->desc.bEndpointAddress & ~USB_ENDPOINT_DIR_MASK) >= 16) {
+ warn("invalid endpoint address 0x%X",
+ endpoint->desc.bEndpointAddress);
+ return -EINVAL;
+ }
+
le16_to_cpus(&endpoint->desc.wMaxPacketSize);
buffer += header->bLength;
size -= header->bLength;
- parsed += header->bLength;
- /* Skip over the rest of the Class Specific or Vendor Specific */
- /* descriptors */
+ /* Skip over any Class Specific or Vendor Specific descriptors */
begin = buffer;
numskipped = 0;
while (size >= sizeof(struct usb_descriptor_header)) {
header = (struct usb_descriptor_header *)buffer;
- if (header->bLength < 2) {
- err("invalid descriptor length of %d", header->bLength);
- return -1;
- }
-
/* If we find another "proper" descriptor then we're done */
if ((header->bDescriptorType == USB_DT_ENDPOINT) ||
- (header->bDescriptorType == USB_DT_INTERFACE) ||
- (header->bDescriptorType == USB_DT_CONFIG) ||
- (header->bDescriptorType == USB_DT_DEVICE))
+ (header->bDescriptorType == USB_DT_INTERFACE))
break;
- dbg("skipping descriptor 0x%X",
- header->bDescriptorType);
+ dbg("skipping descriptor 0x%X", header->bDescriptorType);
numskipped++;
buffer += header->bLength;
size -= header->bLength;
- parsed += header->bLength;
}
- if (numskipped)
+ if (numskipped) {
dbg("skipped %d class/vendor specific endpoint descriptors", numskipped);
-
- /* Copy any unknown descriptors into a storage area for drivers */
- /* to later parse */
- len = (int)(buffer - begin);
- if (!len) {
- endpoint->extra = NULL;
- endpoint->extralen = 0;
- return parsed;
+ endpoint->extra = begin;
+ endpoint->extralen = buffer - begin;
}
- endpoint->extra = kmalloc(len, GFP_KERNEL);
-
- if (!endpoint->extra) {
- err("couldn't allocate memory for endpoint extra descriptors");
- endpoint->extralen = 0;
- return parsed;
- }
-
- memcpy(endpoint->extra, begin, len);
- endpoint->extralen = len;
-
- return parsed;
+ return buffer - buffer0;
}
static void usb_release_intf(struct device *dev)
{
struct usb_interface *intf;
int j;
- int k;
intf = to_usb_interface(dev);
if (intf->altsetting) {
for (j = 0; j < intf->num_altsetting; j++) {
struct usb_host_interface *as = &intf->altsetting[j];
- if (as->extra)
- kfree(as->extra);
-
- if (as->endpoint) {
- for (k = 0; k < as->desc.bNumEndpoints; k++)
- if (as->endpoint[k].extra)
- kfree(as->endpoint[k].extra);
- kfree(as->endpoint);
- }
+
+ kfree(as->endpoint);
}
kfree(intf->altsetting);
}
kfree(intf);
}
-static int usb_parse_interface(struct usb_interface *interface, unsigned char *buffer, int size)
+static int usb_parse_interface(struct usb_host_config *config, unsigned char *buffer, int size)
{
- int i, len, numskipped, retval, parsed = 0;
- struct usb_descriptor_header *header;
+ unsigned char *buffer0 = buffer;
+ struct usb_interface_descriptor *d;
+ int inum, asnum;
+ struct usb_interface *interface;
struct usb_host_interface *ifp;
+ int len, numskipped;
+ struct usb_descriptor_header *header;
unsigned char *begin;
+ int i, retval;
- interface->act_altsetting = 0;
- interface->num_altsetting = 0;
- interface->max_altsetting = USB_ALTSETTINGALLOC;
- device_initialize(&interface->dev);
- interface->dev.release = usb_release_intf;
-
- /* put happens in usb_destroy_configuration */
- get_device(&interface->dev);
-
- interface->altsetting = kmalloc(sizeof(*interface->altsetting) * interface->max_altsetting,
- GFP_KERNEL);
-
- if (!interface->altsetting) {
- err("couldn't kmalloc interface->altsetting");
- return -1;
- }
-
- while (size > 0) {
- struct usb_interface_descriptor *d;
-
- if (interface->num_altsetting >= interface->max_altsetting) {
- struct usb_host_interface *ptr;
- int oldmas;
-
- oldmas = interface->max_altsetting;
- interface->max_altsetting += USB_ALTSETTINGALLOC;
- if (interface->max_altsetting > USB_MAXALTSETTING) {
- warn("too many alternate settings (incr %d max %d)\n",
- USB_ALTSETTINGALLOC, USB_MAXALTSETTING);
- return -1;
- }
-
- ptr = kmalloc(sizeof(*ptr) * interface->max_altsetting, GFP_KERNEL);
- if (ptr == NULL) {
- err("couldn't kmalloc interface->altsetting");
- return -1;
- }
- memcpy(ptr, interface->altsetting, sizeof(*interface->altsetting) * oldmas);
- kfree(interface->altsetting);
- interface->altsetting = ptr;
- }
-
- ifp = interface->altsetting + interface->num_altsetting;
- ifp->endpoint = NULL;
- ifp->extra = NULL;
- ifp->extralen = 0;
- interface->num_altsetting++;
-
- memcpy(ifp, buffer, USB_DT_INTERFACE_SIZE);
-
- /* Skip over the interface */
- buffer += ifp->desc.bLength;
- parsed += ifp->desc.bLength;
- size -= ifp->desc.bLength;
+ d = (struct usb_interface_descriptor *) buffer;
+ if (d->bDescriptorType != USB_DT_INTERFACE) {
+ warn("unexpected descriptor 0x%X, expecting interface, 0x%X",
+ d->bDescriptorType, USB_DT_INTERFACE);
+ return -EINVAL;
+ }
- begin = buffer;
- numskipped = 0;
+ inum = d->bInterfaceNumber;
+ if (inum >= config->desc.bNumInterfaces) {
- /* Skip over any interface, class or vendor descriptors */
+ /* Skip to the next interface descriptor */
+ buffer += d->bLength;
+ size -= d->bLength;
while (size >= sizeof(struct usb_descriptor_header)) {
- header = (struct usb_descriptor_header *)buffer;
-
- if (header->bLength < 2) {
- err("invalid descriptor length of %d", header->bLength);
- return -1;
- }
+ header = (struct usb_descriptor_header *) buffer;
- /* If we find another "proper" descriptor then we're done */
- if ((header->bDescriptorType == USB_DT_INTERFACE) ||
- (header->bDescriptorType == USB_DT_ENDPOINT) ||
- (header->bDescriptorType == USB_DT_CONFIG) ||
- (header->bDescriptorType == USB_DT_DEVICE))
+ if (header->bDescriptorType == USB_DT_INTERFACE)
break;
-
- numskipped++;
-
buffer += header->bLength;
- parsed += header->bLength;
size -= header->bLength;
}
+ return buffer - buffer0;
+ }
- if (numskipped)
- dbg("skipped %d class/vendor specific interface descriptors", numskipped);
+ interface = config->interface[inum];
+ asnum = d->bAlternateSetting;
+ if (asnum >= interface->num_altsetting) {
+ warn("invalid alternate setting %d for interface %d",
+ asnum, inum);
+ return -EINVAL;
+ }
- /* Copy any unknown descriptors into a storage area for */
- /* drivers to later parse */
- len = (int)(buffer - begin);
- if (len) {
- ifp->extra = kmalloc(len, GFP_KERNEL);
+ ifp = &interface->altsetting[asnum];
+ if (ifp->desc.bLength) {
+ warn("duplicate descriptor for interface %d altsetting %d",
+ inum, asnum);
+ return -EINVAL;
+ }
+ memcpy(&ifp->desc, buffer, USB_DT_INTERFACE_SIZE);
- if (!ifp->extra) {
- err("couldn't allocate memory for interface extra descriptors");
- ifp->extralen = 0;
- return -1;
- }
- memcpy(ifp->extra, begin, len);
- ifp->extralen = len;
- }
+ buffer += d->bLength;
+ size -= d->bLength;
- /* Did we hit an unexpected descriptor? */
+ /* Skip over any Class Specific or Vendor Specific descriptors */
+ begin = buffer;
+ numskipped = 0;
+ while (size >= sizeof(struct usb_descriptor_header)) {
header = (struct usb_descriptor_header *)buffer;
- if ((size >= sizeof(struct usb_descriptor_header)) &&
- ((header->bDescriptorType == USB_DT_CONFIG) ||
- (header->bDescriptorType == USB_DT_DEVICE)))
- return parsed;
-
- if (ifp->desc.bNumEndpoints > USB_MAXENDPOINTS) {
- warn("too many endpoints");
- return -1;
- }
- ifp->endpoint = (struct usb_host_endpoint *)
- kmalloc(ifp->desc.bNumEndpoints *
- sizeof(struct usb_host_endpoint), GFP_KERNEL);
- if (!ifp->endpoint) {
- err("out of memory");
- return -1;
- }
+ /* If we find another "proper" descriptor then we're done */
+ if ((header->bDescriptorType == USB_DT_INTERFACE) ||
+ (header->bDescriptorType == USB_DT_ENDPOINT))
+ break;
- memset(ifp->endpoint, 0, ifp->desc.bNumEndpoints *
- sizeof(struct usb_host_endpoint));
-
- for (i = 0; i < ifp->desc.bNumEndpoints; i++) {
- header = (struct usb_descriptor_header *)buffer;
+ dbg("skipping descriptor 0x%X", header->bDescriptorType);
+ numskipped++;
- if (header->bLength > size) {
- err("ran out of descriptors parsing");
- return -1;
- }
-
- retval = usb_parse_endpoint(ifp->endpoint + i, buffer, size);
- if (retval < 0)
- return retval;
-
- buffer += retval;
- parsed += retval;
- size -= retval;
+ buffer += header->bLength;
+ size -= header->bLength;
+ }
+ if (numskipped) {
+ dbg("skipped %d class/vendor specific interface descriptors", numskipped);
+ ifp->extra = begin;
+ ifp->extralen = buffer - begin;
+ }
+
+ if (ifp->desc.bNumEndpoints > USB_MAXENDPOINTS) {
+ warn("too many endpoints for interface %d altsetting %d",
+ inum, asnum);
+ return -EINVAL;
+ }
+
+ len = ifp->desc.bNumEndpoints * sizeof(struct usb_host_endpoint);
+ ifp->endpoint = kmalloc(len, GFP_KERNEL);
+ if (!ifp->endpoint) {
+ err("out of memory");
+ return -ENOMEM;
+ }
+ memset(ifp->endpoint, 0, len);
+
+ for (i = 0; i < ifp->desc.bNumEndpoints; i++) {
+ if (size < USB_DT_ENDPOINT_SIZE) {
+ warn("ran out of descriptors while parsing endpoints");
+ return -EINVAL;
}
- /* We check to see if it's an alternate to this one */
- d = (struct usb_interface_descriptor *)buffer;
- if (size < USB_DT_INTERFACE_SIZE
- || d->bDescriptorType != USB_DT_INTERFACE
- || !d->bAlternateSetting)
- return parsed;
+ retval = usb_parse_endpoint(ifp->endpoint + i, buffer, size);
+ if (retval < 0)
+ return retval;
+
+ buffer += retval;
+ size -= retval;
}
- return parsed;
+ return buffer - buffer0;
}
-int usb_parse_configuration(struct usb_host_config *config, char *buffer)
+int usb_parse_configuration(struct usb_host_config *config, char *buffer, int size)
{
- int i, size;
- int retval = -EINVAL;
+ int nintf, nintf_orig;
+ int i, j;
+ struct usb_interface *interface;
+ char *buffer2;
+ int size2;
struct usb_descriptor_header *header;
+ int numskipped, len;
+ char *begin;
+ int retval;
memcpy(&config->desc, buffer, USB_DT_CONFIG_SIZE);
- le16_to_cpus(&config->desc.wTotalLength);
- size = config->desc.wTotalLength;
-
- for (i = 0; i < USB_MAXINTERFACES; ++i)
- config->interface[i] = NULL;
+ if (config->desc.bDescriptorType != USB_DT_CONFIG ||
+ config->desc.bLength < USB_DT_CONFIG_SIZE) {
+ warn("invalid configuration descriptor");
+ return -EINVAL;
+ }
+ config->desc.wTotalLength = size;
- if (config->desc.bNumInterfaces > USB_MAXINTERFACES) {
- warn("too many interfaces");
- goto error;
+ nintf = nintf_orig = config->desc.bNumInterfaces;
+ if (nintf > USB_MAXINTERFACES) {
+ warn("too many interfaces (%d max %d)",
+ nintf, USB_MAXINTERFACES);
+ config->desc.bNumInterfaces = nintf = USB_MAXINTERFACES;
}
- for (i = 0; i < config->desc.bNumInterfaces; ++i) {
- config->interface[i] = kmalloc(sizeof(struct usb_interface), GFP_KERNEL);
- dbg("kmalloc IF %p, numif %i", config->interface[i], i);
- if (!config->interface[i]) {
+ for (i = 0; i < nintf; ++i) {
+ interface = config->interface[i] =
+ kmalloc(sizeof(struct usb_interface), GFP_KERNEL);
+ dbg("kmalloc IF %p, numif %i", interface, i);
+ if (!interface) {
err("out of memory");
- retval = -ENOMEM;
- goto error;
+ return -ENOMEM;
}
- memset(config->interface[i], 0x00, sizeof(struct usb_interface));
+ memset(interface, 0, sizeof(struct usb_interface));
+ interface->dev.release = usb_release_intf;
+ device_initialize(&interface->dev);
+
+ /* put happens in usb_destroy_configuration */
+ get_device(&interface->dev);
}
- buffer += config->desc.bLength;
- size -= config->desc.bLength;
-
- config->extra = NULL;
- config->extralen = 0;
-
- for (i = 0; i < config->desc.bNumInterfaces; i++) {
- int numskipped, len;
- char *begin;
-
- /* Skip over the rest of the Class Specific or Vendor */
- /* Specific descriptors */
- begin = buffer;
- numskipped = 0;
- while (size >= sizeof(struct usb_descriptor_header)) {
- header = (struct usb_descriptor_header *)buffer;
+ /* Go through the descriptors, checking their length and counting the
+ * number of altsettings for each interface */
+ buffer2 = buffer;
+ size2 = size;
+ j = 0;
+ while (size2 >= sizeof(struct usb_descriptor_header)) {
+ header = (struct usb_descriptor_header *) buffer2;
+ if ((header->bLength > size2) || (header->bLength < 2)) {
+ warn("invalid descriptor of length %d", header->bLength);
+ return -EINVAL;
+ }
- if ((header->bLength > size) || (header->bLength < 2)) {
- err("invalid descriptor length of %d", header->bLength);
- return -1;
+ if (header->bDescriptorType == USB_DT_INTERFACE) {
+ struct usb_interface_descriptor *d;
+
+ if (header->bLength < USB_DT_INTERFACE_SIZE) {
+ warn("invalid interface descriptor");
+ return -EINVAL;
+ }
+ d = (struct usb_interface_descriptor *) header;
+ i = d->bInterfaceNumber;
+ if (i >= nintf_orig) {
+ warn("invalid interface number (%d/%d)",
+ i, nintf_orig);
+ return -EINVAL;
}
+ if (i < nintf)
+ ++config->interface[i]->num_altsetting;
- /* If we find another "proper" descriptor then we're done */
- if ((header->bDescriptorType == USB_DT_ENDPOINT) ||
- (header->bDescriptorType == USB_DT_INTERFACE) ||
- (header->bDescriptorType == USB_DT_CONFIG) ||
- (header->bDescriptorType == USB_DT_DEVICE))
- break;
+ } else if ((header->bDescriptorType == USB_DT_DEVICE ||
+ header->bDescriptorType == USB_DT_CONFIG) && j) {
+ warn("unexpected descriptor type 0x%X", header->bDescriptorType);
+ return -EINVAL;
+ }
- dbg("skipping descriptor 0x%X", header->bDescriptorType);
- numskipped++;
+ j = 1;
+ buffer2 += header->bLength;
+ size2 -= header->bLength;
+ }
- buffer += header->bLength;
- size -= header->bLength;
+ /* Allocate the altsetting arrays */
+ for (i = 0; i < config->desc.bNumInterfaces; ++i) {
+ interface = config->interface[i];
+ if (interface->num_altsetting > USB_MAXALTSETTING) {
+ warn("too many alternate settings for interface %d (%d max %d)\n",
+ i, interface->num_altsetting, USB_MAXALTSETTING);
+ return -EINVAL;
}
- if (numskipped)
- dbg("skipped %d class/vendor specific endpoint descriptors", numskipped);
-
- /* Copy any unknown descriptors into a storage area for */
- /* drivers to later parse */
- len = (int)(buffer - begin);
- if (len) {
- if (config->extralen) {
- warn("extra config descriptor");
- } else {
- config->extra = kmalloc(len, GFP_KERNEL);
- if (!config->extra) {
- err("couldn't allocate memory for config extra descriptors");
- config->extralen = 0;
- return -1;
- }
-
- memcpy(config->extra, begin, len);
- config->extralen = len;
- }
+ if (interface->num_altsetting == 0) {
+ warn("no alternate settings for interface %d", i);
+ return -EINVAL;
+ }
+
+ len = sizeof(*interface->altsetting) * interface->num_altsetting;
+ interface->altsetting = kmalloc(len, GFP_KERNEL);
+ if (!interface->altsetting) {
+ err("couldn't kmalloc interface->altsetting");
+ return -ENOMEM;
}
+ memset(interface->altsetting, 0, len);
+ }
+
+ buffer += config->desc.bLength;
+ size -= config->desc.bLength;
- retval = usb_parse_interface(config->interface[i], buffer, size);
+ /* Skip over any Class Specific or Vendor Specific descriptors */
+ begin = buffer;
+ numskipped = 0;
+ while (size >= sizeof(struct usb_descriptor_header)) {
+ header = (struct usb_descriptor_header *)buffer;
+
+ /* If we find another "proper" descriptor then we're done */
+ if ((header->bDescriptorType == USB_DT_ENDPOINT) ||
+ (header->bDescriptorType == USB_DT_INTERFACE))
+ break;
+
+ dbg("skipping descriptor 0x%X", header->bDescriptorType);
+ numskipped++;
+
+ buffer += header->bLength;
+ size -= header->bLength;
+ }
+ if (numskipped) {
+ dbg("skipped %d class/vendor specific configuration descriptors", numskipped);
+ config->extra = begin;
+ config->extralen = buffer - begin;
+ }
+
+ /* Parse all the interface/altsetting descriptors */
+ while (size >= sizeof(struct usb_descriptor_header)) {
+ retval = usb_parse_interface(config, buffer, size);
if (retval < 0)
return retval;
@@ -375,11 +340,18 @@ int usb_parse_configuration(struct usb_host_config *config, char *buffer)
size -= retval;
}
+ /* Check for missing altsettings */
+ for (i = 0; i < nintf; ++i) {
+ interface = config->interface[i];
+ for (j = 0; j < interface->num_altsetting; ++j) {
+ if (!interface->altsetting[j].desc.bLength) {
+ warn("missing altsetting %d for interface %d", j, i);
+ return -EINVAL;
+ }
+ }
+ }
+
return size;
-error:
- for (i = 0; i < USB_MAXINTERFACES; ++i)
- kfree(config->interface[i]);
- return retval;
}
// hub-only!! ... and only exported for reset/reinit path.
@@ -387,7 +359,7 @@ error:
void usb_destroy_configuration(struct usb_device *dev)
{
int c, i;
-
+
if (!dev->config)
return;
@@ -401,12 +373,11 @@ void usb_destroy_configuration(struct usb_device *dev)
for (c = 0; c < dev->descriptor.bNumConfigurations; c++) {
struct usb_host_config *cf = &dev->config[c];
- if (!cf->interface)
- break;
-
for (i = 0; i < cf->desc.bNumInterfaces; i++) {
struct usb_interface *ifp = cf->interface[i];
- put_device(&ifp->dev);
+
+ if (ifp)
+ put_device(&ifp->dev);
}
}
kfree(dev->config);
@@ -417,38 +388,39 @@ void usb_destroy_configuration(struct usb_device *dev)
// (used by real hubs and virtual root hubs)
int usb_get_configuration(struct usb_device *dev)
{
+ int ncfg = dev->descriptor.bNumConfigurations;
int result;
unsigned int cfgno, length;
unsigned char *buffer;
unsigned char *bigbuffer;
struct usb_config_descriptor *desc;
- if (dev->descriptor.bNumConfigurations > USB_MAXCONFIG) {
- warn("too many configurations");
- return -EINVAL;
+ if (ncfg > USB_MAXCONFIG) {
+ warn("too many configurations (%d max %d)",
+ ncfg, USB_MAXCONFIG);
+ dev->descriptor.bNumConfigurations = ncfg = USB_MAXCONFIG;
}
- if (dev->descriptor.bNumConfigurations < 1) {
- warn("not enough configurations");
+ if (ncfg < 1) {
+ warn("no configurations");
return -EINVAL;
}
- dev->config = (struct usb_host_config *)
- kmalloc(dev->descriptor.bNumConfigurations *
- sizeof(struct usb_host_config), GFP_KERNEL);
+ length = ncfg * sizeof(struct usb_host_config);
+ dev->config = kmalloc(length, GFP_KERNEL);
if (!dev->config) {
err("out of memory");
- return -ENOMEM;
+ return -ENOMEM;
}
- memset(dev->config, 0, dev->descriptor.bNumConfigurations *
- sizeof(struct usb_host_config));
+ memset(dev->config, 0, length);
- dev->rawdescriptors = (char **)kmalloc(sizeof(char *) *
- dev->descriptor.bNumConfigurations, GFP_KERNEL);
+ length = ncfg * sizeof(char *);
+ dev->rawdescriptors = kmalloc(length, GFP_KERNEL);
if (!dev->rawdescriptors) {
err("out of memory");
return -ENOMEM;
}
+ memset(dev->rawdescriptors, 0, length);
buffer = kmalloc(8, GFP_KERNEL);
if (!buffer) {
@@ -457,7 +429,7 @@ int usb_get_configuration(struct usb_device *dev)
}
desc = (struct usb_config_descriptor *)buffer;
- for (cfgno = 0; cfgno < dev->descriptor.bNumConfigurations; cfgno++) {
+ for (cfgno = 0; cfgno < ncfg; cfgno++) {
/* We grab the first 8 bytes so we know how long the whole */
/* configuration is */
result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, buffer, 8);
@@ -465,14 +437,14 @@ int usb_get_configuration(struct usb_device *dev)
if (result < 0)
err("unable to get descriptor");
else {
- err("config descriptor too short (expected %i, got %i)", 8, result);
+ warn("config descriptor too short (expected %i, got %i)", 8, result);
result = -EINVAL;
}
goto err;
}
/* Get the full buffer */
- length = le16_to_cpu(desc->wTotalLength);
+ length = max((int) le16_to_cpu(desc->wTotalLength), USB_DT_CONFIG_SIZE);
bigbuffer = kmalloc(length, GFP_KERNEL);
if (!bigbuffer) {
@@ -487,8 +459,8 @@ int usb_get_configuration(struct usb_device *dev)
err("couldn't get all of config descriptors");
kfree(bigbuffer);
goto err;
- }
-
+ }
+
if (result < length) {
err("config descriptor too short (expected %i, got %i)", length, result);
result = -EINVAL;
@@ -498,11 +470,11 @@ int usb_get_configuration(struct usb_device *dev)
dev->rawdescriptors[cfgno] = bigbuffer;
- result = usb_parse_configuration(&dev->config[cfgno], bigbuffer);
+ result = usb_parse_configuration(&dev->config[cfgno], bigbuffer, length);
if (result > 0)
dbg("descriptor data left");
else if (result < 0) {
- result = -EINVAL;
+ ++cfgno;
goto err;
}
}
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 8810d34795c7..dc12ba0c9722 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -859,8 +859,7 @@ static int hub_port_debounce(struct usb_device *hub, int port)
}
}
- /* XXX Replace this with dbg() when 2.6 is about to ship. */
- dev_info (hubdev (hub),
+ dev_dbg (hubdev (hub),
"debounce: port %d: delay %dms stable %d status 0x%x\n",
port + 1, delay_time, stable_count, portstatus);
@@ -1183,8 +1182,7 @@ int usb_hub_init(void)
return -1;
}
- pid = kernel_thread(hub_thread, NULL,
- CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ pid = kernel_thread(hub_thread, NULL, CLONE_KERNEL);
if (pid >= 0) {
khubd_pid = pid;
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index a04c9d607523..8717775dc0b1 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -1424,14 +1424,15 @@ static int usb_device_suspend(struct device *dev, u32 state)
struct usb_interface *intf;
struct usb_driver *driver;
- if ((dev->driver == &usb_generic_driver) ||
+ if ((dev->driver == NULL) ||
+ (dev->driver == &usb_generic_driver) ||
(dev->driver_data == &usb_generic_driver_data))
return 0;
intf = to_usb_interface(dev);
driver = to_usb_driver(dev->driver);
- if (driver && driver->suspend)
+ if (driver->suspend)
return driver->suspend(intf, state);
return 0;
}
@@ -1441,14 +1442,15 @@ static int usb_device_resume(struct device *dev)
struct usb_interface *intf;
struct usb_driver *driver;
- if ((dev->driver == &usb_generic_driver) ||
+ if ((dev->driver == NULL) ||
+ (dev->driver == &usb_generic_driver) ||
(dev->driver_data == &usb_generic_driver_data))
return 0;
intf = to_usb_interface(dev);
driver = to_usb_driver(dev->driver);
- if (driver && driver->resume)
+ if (driver->resume)
return driver->resume(intf);
return 0;
}
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 2ff0d802f196..68260751ffd6 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -68,7 +68,7 @@ choice
config USB_ZERO
tristate "Gadget Zero (DEVELOPMENT)"
- depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA250 || USB_SA1100)
+ depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA2XX || USB_SA1100)
help
Gadget Zero is a two-configuration device. It either sinks and
sources bulk data; or it loops back a configurable number of
@@ -97,9 +97,9 @@ config USB_ZERO_NET2280
depends on USB_ZERO && (USB_NET2280 || USB_DUMMY_HCD)
default y
-config USB_ZERO_PXA250
+config USB_ZERO_PXA2XX
bool
- depends on USB_ZERO && USB_PXA250
+ depends on USB_ZERO && USB_PXA2XX
default y
config USB_ZERO_SA1100
@@ -110,22 +110,28 @@ config USB_ZERO_SA1100
config USB_ETH
tristate "Ethernet Gadget"
- depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA250 || USB_SA1100)
+ depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA2XX || USB_SA1100)
help
- This driver implements the "Communication Device Class" (CDC)
- Ethernet Control Model. That protocol is often avoided with pure
- Ethernet adapters, in favor of simpler vendor-specific hardware,
- but is widely supported by firmware for smart network devices.
+ This driver implements Ethernet style communication, in either
+ of two ways:
+
+ - The "Communication Device Class" (CDC) Ethernet Control Model.
+ That protocol is often avoided with pure Ethernet adapters, in
+ favor of simpler vendor-specific hardware, but is widely
+ supported by firmware for smart network devices.
+
+ - On hardware can't implement that protocol, a simpler approach
+ is used, placing fewer demands on USB.
Within the USB device, this gadget driver exposes a network device
"usbX", where X depends on what other networking devices you have.
Treat it like a two-node Ethernet link: host, and gadget.
The Linux-USB host-side "usbnet" driver interoperates with this
- driver, so that deep I/O queues can be supported. (On 2.4 kernels,
- use "CDCEther" instead.) Deep queues are especially important with
- high speed devices. It should also interoperate with standard CDC
- Ethernet class drivers on other host operating systems.
+ driver, so that deep I/O queues can be supported. On 2.4 kernels,
+ use "CDCEther" instead, if you're using the CDC option. That CDC
+ mode should also interoperate with standard CDC Ethernet class
+ drivers on other host operating systems.
Say "y" to link the driver statically, or "m" to build a
dynamically linked module called "g_ether".
@@ -137,9 +143,9 @@ config USB_ETH_NET2280
depends on USB_ETH && (USB_NET2280 || USB_DUMMY_HCD)
default y
-config USB_ETH_PXA250
+config USB_ETH_PXA2XX
bool
- depends on USB_ETH && USB_PXA250
+ depends on USB_ETH && USB_PXA2XX
default y
config USB_ETH_SA1100
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index da20dde89a97..64fef4a8580e 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -28,7 +28,6 @@
#include <linux/fs.h>
#include <linux/pagemap.h>
#include <linux/uts.h>
-#include <linux/version.h>
#include <linux/wait.h>
#include <linux/compiler.h>
#include <asm/uaccess.h>
diff --git a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig
index 81db18b30fa6..8e53c0a85271 100644
--- a/drivers/usb/input/Kconfig
+++ b/drivers/usb/input/Kconfig
@@ -20,10 +20,8 @@ config USB_HID
If unsure, say Y.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called hid. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called hid.
comment "Input core support is needed for USB HID input layer or HIDBP support"
depends on USB && INPUT=n
@@ -104,10 +102,8 @@ config USB_KBD
This is almost certainly not what you want. This is mostly
useful for embedded applications or simple keyboards.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called usbkbd. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called usbkbd.
If even remotely unsure, say N.
@@ -122,10 +118,8 @@ config USB_MOUSE
This is almost certainly not what you want. This is mostly
useful for embedded applications or simple mice.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called usbmouse. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called usbmouse.
If even remotely unsure, say N.
@@ -140,10 +134,8 @@ config USB_AIPTEK
(CONFIG_INPUT_MOUSEDEV) and/or "Event interface support"
(CONFIG_INPUT_EVDEV) as well.
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called aiptek. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called aiptek.
config USB_WACOM
tristate "Wacom Intuos/Graphire tablet support"
@@ -154,10 +146,8 @@ config USB_WACOM
(CONFIG_INPUT_MOUSEDEV) and/or "Event interface support"
(CONFIG_INPUT_EVDEV) as well.
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called wacom. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called wacom.
config USB_KBTAB
tristate "KB Gear JamStudio tablet support"
@@ -168,10 +158,8 @@ config USB_KBTAB
(CONFIG_INPUT_MOUSEDEV) and/or "Event interface support"
(CONFIG_INPUT_EVDEV) as well.
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called kbtab.o. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called kbtab.
config USB_POWERMATE
tristate "Griffin PowerMate and Contour Jog support"
@@ -184,10 +172,8 @@ config USB_POWERMATE
You can download userspace tools from http://sowerbutts.com/powermate/
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called powermate. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called powermate.
config USB_XPAD
tristate "X-Box gamepad support"
@@ -200,8 +186,6 @@ config USB_XPAD
For information about how to connect the X-Box pad to USB, see
Documentation/input/xpad.txt.
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called xpad. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called xpad.
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
index 4205682ea286..aa28a157ba32 100644
--- a/drivers/usb/input/hiddev.c
+++ b/drivers/usb/input/hiddev.c
@@ -727,6 +727,7 @@ int hiddev_connect(struct hid_device *hid)
retval = usb_register_dev(&hiddev->intf, &hiddev_class);
if (retval) {
err("Not able to get a minor for this device.");
+ kfree(hiddev);
return -1;
}
diff --git a/drivers/usb/media/Kconfig b/drivers/usb/media/Kconfig
index 681e1b35c391..89099fe26a3b 100644
--- a/drivers/usb/media/Kconfig
+++ b/drivers/usb/media/Kconfig
@@ -14,10 +14,8 @@ config USB_DABUSB
isochronous transactions. URB's are explained in
<file:Documentation/usb/URB.txt>.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called dabusb. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called dabusb.
comment "Video4Linux support is needed for USB Multimedia device support"
depends on USB && VIDEO_DEV=n
@@ -33,10 +31,8 @@ config USB_VICAM
Information on this API and pointers to "v4l" programs may be found
on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called vicam. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called vicam.
config USB_DSBR
tristate "D-Link USB FM radio support (EXPERIMENTAL)"
@@ -53,10 +49,8 @@ config USB_DSBR
"v4l" programs may be found on the WWW at
<http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called dsbr100. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called dsbr100.
config USB_IBMCAM
tristate "USB IBM (Xirlink) C-it Camera support"
@@ -72,13 +66,12 @@ config USB_IBMCAM
"v4l" programs may be found on the WWW at
<http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called ibmcam. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>. This
- camera has several configuration options which can be specified when
- you load the module. Read <file:Documentation/usb/ibmcam.txt> to
- learn more.
+ To compile this driver as a module, say M here: the
+ module will be called ibmcam.
+
+ This camera has several configuration options which
+ can be specified when you load the module. Read
+ <file:Documentation/usb/ibmcam.txt> to learn more.
config USB_KONICAWC
tristate "USB Konica Webcam support"
@@ -93,10 +86,8 @@ config USB_KONICAWC
"v4l" programs may be found on the WWW at
<http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called konicawc. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called konicawc.
config USB_OV511
tristate "USB OV511 Camera support"
@@ -111,10 +102,8 @@ config USB_OV511
Information on this API and pointers to "v4l" programs may be found
on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called ov511. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called ov511.
config USB_PWC
tristate "USB Philips Cameras"
@@ -152,10 +141,8 @@ config USB_PWC
Information on this API and pointers to "v4l" programs may be found
on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called pwc. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called pwc.
config USB_SE401
tristate "USB SE401 Camera support"
@@ -170,10 +157,8 @@ config USB_SE401
Information on this API and pointers to "v4l" programs may be found
on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called se401. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called se401.
config USB_STV680
tristate "USB STV680 (Pencam) Camera support"
@@ -189,8 +174,6 @@ config USB_STV680
Information on this API and pointers to "v4l" programs may be found
on the WWW at <http://roadrunner.swansea.uk.linux.org/v4l.shtml>.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called stv680. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called stv680.
diff --git a/drivers/usb/media/dabusb.c b/drivers/usb/media/dabusb.c
index 140beb0f180f..cce0dbb55b7d 100644
--- a/drivers/usb/media/dabusb.c
+++ b/drivers/usb/media/dabusb.c
@@ -89,7 +89,6 @@ static int dabusb_add_buf_tail (pdabusb_t s, struct list_head *dst, struct list_
static void dump_urb (struct urb *urb)
{
dbg("urb :%p", urb);
- dbg("next :%p", urb->next);
dbg("dev :%p", urb->dev);
dbg("pipe :%08X", urb->pipe);
dbg("status :%d", urb->status);
@@ -728,7 +727,7 @@ static int dabusb_probe (struct usb_interface *intf,
pdabusb_t s;
dbg("dabusb: probe: vendor id 0x%x, device id 0x%x ifnum:%d",
- usbdev->descriptor.idVendor, usbdev->descriptor.idProduct, ifnum);
+ usbdev->descriptor.idVendor, usbdev->descriptor.idProduct, intf->altsetting->desc.bInterfaceNumber);
/* We don't handle multiple configurations */
if (usbdev->descriptor.bNumConfigurations != 1)
@@ -762,7 +761,7 @@ static int dabusb_probe (struct usb_interface *intf,
goto reject;
}
}
- dbg("bound to interface: %d", ifnum);
+ dbg("bound to interface: %d", intf->altsetting->desc.bInterfaceNumber);
usb_set_intfdata (intf, s);
up (&s->mutex);
diff --git a/drivers/usb/media/usbvideo.c b/drivers/usb/media/usbvideo.c
index d74858de9ce2..178a7b839593 100644
--- a/drivers/usb/media/usbvideo.c
+++ b/drivers/usb/media/usbvideo.c
@@ -24,7 +24,6 @@
#include <linux/vmalloc.h>
#include <linux/init.h>
#include <linux/spinlock.h>
-#include <linux/mm.h>
#include <asm/io.h>
diff --git a/drivers/usb/media/vicam.c b/drivers/usb/media/vicam.c
index eb3394eec2b1..d67881bde5f8 100644
--- a/drivers/usb/media/vicam.c
+++ b/drivers/usb/media/vicam.c
@@ -1292,7 +1292,7 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
interface = &intf->altsetting[0];
DBG(KERN_DEBUG "Interface %d. has %u. endpoints!\n",
- ifnum, (unsigned) (interface->desc.bNumEndpoints));
+ interface->desc.bInterfaceNumber, (unsigned) (interface->desc.bNumEndpoints));
endpoint = &interface->endpoint[0].desc;
if ((endpoint->bEndpointAddress & 0x80) &&
diff --git a/drivers/usb/misc/speedtch.c b/drivers/usb/misc/speedtch.c
index 131bc1f2b96f..ada3e2d97545 100644
--- a/drivers/usb/misc/speedtch.c
+++ b/drivers/usb/misc/speedtch.c
@@ -21,7 +21,9 @@
******************************************************************************/
/*
- * Written by Johan Verrept, maintained by Duncan Sands (duncan.sands@wanadoo.fr)
+ * Written by Johan Verrept, maintained by Duncan Sands (duncan.sands@free.fr)
+ *
+ * 1.7+: - See the check-in logs
*
* 1.6: - No longer opens a connection if the firmware is not loaded
* - Added support for the speedtouch 330
@@ -84,6 +86,11 @@
#include <linux/usb.h>
+#ifdef DEBUG
+#define DEBUG_ON(x) BUG_ON(x)
+#else
+#define DEBUG_ON(x) do { if (x); } while (0)
+#endif
#ifdef VERBOSE_DEBUG
static int udsl_print_packet (const unsigned char *data, int len);
@@ -94,9 +101,9 @@ static int udsl_print_packet (const unsigned char *data, int len);
#define vdbg(arg...)
#endif
-#define DRIVER_AUTHOR "Johan Verrept, Duncan Sands <duncan.sands@wanadoo.fr>"
+#define DRIVER_AUTHOR "Johan Verrept, Duncan Sands <duncan.sands@free.fr>"
#define DRIVER_DESC "Alcatel SpeedTouch USB driver"
-#define DRIVER_VERSION "1.6"
+#define DRIVER_VERSION "1.7"
static const char udsl_driver_name [] = "speedtch";
@@ -109,10 +116,10 @@ static const char udsl_driver_name [] = "speedtch";
#define UDSL_MAX_SND_BUFS 8
#define UDSL_MAX_RCV_BUF_SIZE 1024 /* ATM cells */
#define UDSL_MAX_SND_BUF_SIZE 1024 /* ATM cells */
-#define UDSL_DEFAULT_RCV_URBS 1
-#define UDSL_DEFAULT_SND_URBS 1
-#define UDSL_DEFAULT_RCV_BUFS 2
-#define UDSL_DEFAULT_SND_BUFS 2
+#define UDSL_DEFAULT_RCV_URBS 2
+#define UDSL_DEFAULT_SND_URBS 2
+#define UDSL_DEFAULT_RCV_BUFS 4
+#define UDSL_DEFAULT_SND_BUFS 4
#define UDSL_DEFAULT_RCV_BUF_SIZE 64 /* ATM cells */
#define UDSL_DEFAULT_SND_BUF_SIZE 64 /* ATM cells */
@@ -351,7 +358,7 @@ static void udsl_extract_cells (struct udsl_instance_data *instance, unsigned ch
dbg ("udsl_extract_cells: buffer overrun (max_pdu: %u, skb->len %u, vcc: 0x%p)", vcc_data->max_pdu, skb->len, vcc);
/* discard cells already received */
skb_trim (skb, 0);
- BUG_ON (vcc_data->max_pdu < ATM_CELL_PAYLOAD);
+ DEBUG_ON (vcc_data->max_pdu < ATM_CELL_PAYLOAD);
}
memcpy (skb->tail, source + ATM_CELL_HEADER, ATM_CELL_PAYLOAD);
@@ -498,7 +505,7 @@ static unsigned int udsl_write_cells (unsigned int howmany, struct sk_buff *skb,
memset (target, 0, ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER);
target += ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER;
- BUG_ON (--ctrl->num_cells);
+ DEBUG_ON (--ctrl->num_cells);
}
memcpy (target, ctrl->aal5_trailer, ATM_AAL5_TRAILER);
@@ -535,7 +542,7 @@ static void udsl_complete_receive (struct urb *urb, struct pt_regs *regs)
vdbg ("udsl_complete_receive: urb 0x%p, status %d, actual_length %d, filled_cells %u, rcv 0x%p, buf 0x%p", urb, urb->status, urb->actual_length, buf->filled_cells, rcv, buf);
- BUG_ON (buf->filled_cells > rcv_buf_size);
+ DEBUG_ON (buf->filled_cells > rcv_buf_size);
/* may not be in_interrupt() */
spin_lock_irqsave (&instance->receive_lock, flags);
@@ -1216,8 +1223,7 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
count = 0;
spin_lock_irq (&instance->receive_lock);
list_for_each (pos, &instance->spare_receivers)
- if (++count > num_rcv_urbs)
- panic (__FILE__ ": memory corruption detected at line %d!\n", __LINE__);
+ DEBUG_ON (++count > num_rcv_urbs);
spin_unlock_irq (&instance->receive_lock);
dbg ("udsl_usb_disconnect: found %u spare receivers", count);
@@ -1253,8 +1259,7 @@ static void udsl_usb_disconnect (struct usb_interface *intf)
count = 0;
spin_lock_irq (&instance->send_lock);
list_for_each (pos, &instance->spare_senders)
- if (++count > num_snd_urbs)
- panic (__FILE__ ": memory corruption detected at line %d!\n", __LINE__);
+ DEBUG_ON (++count > num_snd_urbs);
spin_unlock_irq (&instance->send_lock);
dbg ("udsl_usb_disconnect: found %u spare senders", count);
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 82e90c3614e9..fe3a6dc24db4 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -87,7 +87,7 @@ get_endpoints (struct usbtest_dev *dev, struct usb_interface *intf)
struct usb_host_endpoint *in, *out;
struct usb_device *udev;
- for (tmp = 0; tmp < intf->max_altsetting; tmp++) {
+ for (tmp = 0; tmp < intf->num_altsetting; tmp++) {
unsigned ep;
in = out = 0;
diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
index ed8dac545173..a8b0e8d03220 100644
--- a/drivers/usb/net/usbnet.c
+++ b/drivers/usb/net/usbnet.c
@@ -252,6 +252,8 @@ struct driver_info {
/* for new devices, use the descriptor-reading code instead */
int in; /* rx endpoint */
int out; /* tx endpoint */
+
+ unsigned long data; /* Misc driver specific data */
};
// we record the state for each of our queued skbs
@@ -298,6 +300,9 @@ MODULE_PARM_DESC (msg_level, "Initial message level (default = 1)");
/*-------------------------------------------------------------------------*/
+static struct ethtool_ops usbnet_ethtool_ops;
+static void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *);
+
/* mostly for PDA style devices, which are always connected if present */
static int always_connected (struct usbnet *dev)
{
@@ -312,7 +317,7 @@ get_endpoints (struct usbnet *dev, struct usb_interface *intf)
struct usb_host_interface *alt;
struct usb_host_endpoint *in, *out;
- for (tmp = 0; tmp < intf->max_altsetting; tmp++) {
+ for (tmp = 0; tmp < intf->num_altsetting; tmp++) {
unsigned ep;
in = out = 0;
@@ -383,10 +388,10 @@ static const struct driver_info an2720_info = {
#ifdef CONFIG_USB_AX8817X
-#define NEED_MII
/* ASIX AX8817X based USB 2.0 Ethernet Devices */
#define HAVE_HARDWARE
+#define NEED_MII
#include <linux/crc32.h>
@@ -394,6 +399,8 @@ static const struct driver_info an2720_info = {
#define AX_CMD_READ_MII_REG 0x07
#define AX_CMD_WRITE_MII_REG 0x08
#define AX_CMD_SET_HW_MII 0x0a
+#define AX_CMD_READ_EEPROM 0x0b
+#define AX_CMD_WRITE_EEPROM 0x0c
#define AX_CMD_WRITE_RX_CTL 0x10
#define AX_CMD_READ_IPG012 0x11
#define AX_CMD_WRITE_IPG0 0x12
@@ -403,8 +410,15 @@ static const struct driver_info an2720_info = {
#define AX_CMD_READ_NODE_ID 0x17
#define AX_CMD_READ_PHY_ID 0x19
#define AX_CMD_WRITE_MEDIUM_MODE 0x1b
+#define AX_CMD_READ_MONITOR_MODE 0x1c
+#define AX_CMD_WRITE_MONITOR_MODE 0x1d
#define AX_CMD_WRITE_GPIOS 0x1f
+#define AX_MONITOR_MODE 0x01
+#define AX_MONITOR_LINK 0x02
+#define AX_MONITOR_MAGIC 0x04
+#define AX_MONITOR_HSFS 0x10
+
#define AX_MCAST_FILTER_SIZE 8
#define AX_MAX_MCAST 64
@@ -441,11 +455,11 @@ static int ax8817x_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
static void ax8817x_async_cmd_callback(struct urb *urb, struct pt_regs *regs)
{
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
-
+
if (urb->status < 0)
printk(KERN_DEBUG "ax8817x_async_cmd_callback() failed with %d",
urb->status);
-
+
kfree(req);
usb_free_urb(urb);
}
@@ -456,12 +470,12 @@ static void ax8817x_write_cmd_async(struct usbnet *dev, u8 cmd, u16 value, u16 i
struct usb_ctrlrequest *req;
int status;
struct urb *urb;
-
+
if ((urb = usb_alloc_urb(0, GFP_ATOMIC)) == NULL) {
devdbg(dev, "Error allocating URB in write_cmd_async!");
return;
}
-
+
if ((req = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC)) == NULL) {
deverr(dev, "Failed to allocate memory for control request");
usb_free_urb(urb);
@@ -496,34 +510,31 @@ static void ax8817x_set_multicast(struct net_device *net)
} else if (net->mc_count == 0) {
/* just broadcast and directed */
} else {
+ /* We use the 20 byte dev->data
+ * for our 8 byte filter buffer
+ * to avoid allocating memory that
+ * is tricky to free later */
+ u8 *multi_filter = (u8 *)dev->data;
struct dev_mc_list *mc_list = net->mc_list;
- u8 *multi_filter;
u32 crc_bits;
int i;
- multi_filter = kmalloc(AX_MCAST_FILTER_SIZE, GFP_ATOMIC);
- if (multi_filter == NULL) {
- /* Oops, couldn't allocate a buffer for setting the multicast
- filter. Try all multi mode. */
- rx_ctl |= 0x02;
- } else {
- memset(multi_filter, 0, AX_MCAST_FILTER_SIZE);
-
- /* Build the multicast hash filter. */
- for (i = 0; i < net->mc_count; i++) {
- crc_bits =
- ether_crc(ETH_ALEN,
- mc_list->dmi_addr) >> 26;
- multi_filter[crc_bits >> 3] |=
- 1 << (crc_bits & 7);
- mc_list = mc_list->next;
- }
-
- ax8817x_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0,
- AX_MCAST_FILTER_SIZE, multi_filter);
+ memset(multi_filter, 0, AX_MCAST_FILTER_SIZE);
- rx_ctl |= 0x10;
+ /* Build the multicast hash filter. */
+ for (i = 0; i < net->mc_count; i++) {
+ crc_bits =
+ ether_crc(ETH_ALEN,
+ mc_list->dmi_addr) >> 26;
+ multi_filter[crc_bits >> 3] |=
+ 1 << (crc_bits & 7);
+ mc_list = mc_list->next;
}
+
+ ax8817x_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0,
+ AX_MCAST_FILTER_SIZE, multi_filter);
+
+ rx_ctl |= 0x10;
}
ax8817x_write_cmd_async(dev, AX_CMD_WRITE_RX_CTL, rx_ctl, 0, 0, NULL);
@@ -533,7 +544,7 @@ static int ax8817x_mdio_read(struct net_device *netdev, int phy_id, int loc)
{
struct usbnet *dev = netdev->priv;
u16 res;
- u8 buf[4];
+ u8 buf[1];
ax8817x_write_cmd(dev, AX_CMD_SET_SW_MII, 0, 0, 0, &buf);
ax8817x_read_cmd(dev, AX_CMD_READ_MII_REG, phy_id, (__u16)loc, 2, (u16 *)&res);
@@ -546,23 +557,103 @@ static void ax8817x_mdio_write(struct net_device *netdev, int phy_id, int loc, i
{
struct usbnet *dev = netdev->priv;
u16 res = val;
- u8 buf[4];
+ u8 buf[1];
ax8817x_write_cmd(dev, AX_CMD_SET_SW_MII, 0, 0, 0, &buf);
ax8817x_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id, (__u16)loc, 2, (u16 *)&res);
ax8817x_write_cmd(dev, AX_CMD_SET_HW_MII, 0, 0, 0, &buf);
}
+void ax8817x_get_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
+{
+ struct usbnet *dev = (struct usbnet *)net->priv;
+ u8 opt;
+
+ if (ax8817x_read_cmd(dev, AX_CMD_READ_MONITOR_MODE, 0, 0, 1, &opt) < 0) {
+ wolinfo->supported = 0;
+ wolinfo->wolopts = 0;
+ return;
+ }
+ wolinfo->supported = WAKE_PHY | WAKE_MAGIC;
+ wolinfo->wolopts = 0;
+ if (opt & AX_MONITOR_MODE) {
+ if (opt & AX_MONITOR_LINK)
+ wolinfo->wolopts |= WAKE_PHY;
+ if (opt & AX_MONITOR_MAGIC)
+ wolinfo->wolopts |= WAKE_MAGIC;
+ }
+}
+
+int ax8817x_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
+{
+ struct usbnet *dev = (struct usbnet *)net->priv;
+ u8 opt = 0;
+ u8 buf[1];
+
+ if (wolinfo->wolopts & WAKE_PHY)
+ opt |= AX_MONITOR_LINK;
+ if (wolinfo->wolopts & WAKE_MAGIC)
+ opt |= AX_MONITOR_MAGIC;
+ if (opt != 0)
+ opt |= AX_MONITOR_MODE;
+
+ if (ax8817x_write_cmd(dev, AX_CMD_WRITE_MONITOR_MODE,
+ opt, 0, 0, &buf) < 0)
+ return -EINVAL;
+
+ return 0;
+}
+
+int ax8817x_get_eeprom(struct net_device *net,
+ struct ethtool_eeprom *eeprom, u8 *data)
+{
+ struct usbnet *dev = (struct usbnet *)net->priv;
+ u16 *ebuf = (u16 *)data;
+ int i;
+
+ /* Crude hack to ensure that we don't overwrite memory
+ * if an odd length is supplied
+ */
+ if (eeprom->len % 2)
+ return -EINVAL;
+
+ /* ax8817x returns 2 bytes from eeprom on read */
+ for (i=0; i < eeprom->len / 2; i++) {
+ if (ax8817x_read_cmd(dev, AX_CMD_READ_EEPROM,
+ eeprom->offset + i, 0, 2, &ebuf[i]) < 0)
+ return -EINVAL;
+ }
+ return i * 2;
+}
+
+static void ax8817x_get_drvinfo (struct net_device *net,
+ struct ethtool_drvinfo *info)
+{
+ /* Inherit standard device info */
+ usbnet_get_drvinfo(net, info);
+ info->eedump_len = 0x3e;
+}
+
static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf)
{
int ret;
u8 buf[6];
u16 *buf16 = (u16 *) buf;
int i;
+ unsigned long gpio_bits = dev->driver_info->data;
dev->in = usb_rcvbulkpipe(dev->udev, 3);
dev->out = usb_sndbulkpipe(dev->udev, 2);
+ /* Toggle the GPIOs in a manufacturer/model specific way */
+ for (i = 2; i >= 0; i--) {
+ if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_GPIOS,
+ (gpio_bits >> (i * 8)) & 0xff, 0, 0,
+ buf)) < 0)
+ return ret;
+ wait_ms(5);
+ }
+
if ((ret = ax8817x_write_cmd(dev, AX_CMD_WRITE_RX_CTL, 0x80, 0, 0, buf)) < 0) {
dbg("send AX_CMD_WRITE_RX_CTL failed: %d", ret);
return ret;
@@ -640,6 +731,11 @@ static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf)
dev->net->set_multicast_list = ax8817x_set_multicast;
+ usbnet_ethtool_ops.get_drvinfo = &ax8817x_get_drvinfo;
+ usbnet_ethtool_ops.get_wol = &ax8817x_get_wol;
+ usbnet_ethtool_ops.set_wol = &ax8817x_set_wol;
+ usbnet_ethtool_ops.get_eeprom = &ax8817x_get_eeprom;
+
return 0;
}
@@ -647,7 +743,30 @@ static const struct driver_info ax8817x_info = {
.description = "ASIX AX8817x USB 2.0 Ethernet",
.bind = ax8817x_bind,
.flags = FLAG_ETHER,
+ .data = 0x00130103,
+};
+
+static const struct driver_info dlink_dub_e100_info = {
+ .description = "DLink DUB-E100 USB Ethernet",
+ .bind = ax8817x_bind,
+ .flags = FLAG_ETHER,
+ .data = 0x009f9d9f,
+};
+
+static const struct driver_info netgear_fa120_info = {
+ .description = "Netgear FA-120 USB Ethernet",
+ .bind = ax8817x_bind,
+ .flags = FLAG_ETHER,
+ .data = 0x00130103,
};
+
+static const struct driver_info hawking_uf200_info = {
+ .description = "Hawking UF200 USB Ethernet",
+ .bind = ax8817x_bind,
+ .flags = FLAG_ETHER,
+ .data = 0x001f1d1f,
+};
+
#endif /* CONFIG_USB_AX8817X */
@@ -2415,72 +2534,45 @@ done:
/*-------------------------------------------------------------------------*/
-static inline int
-usbnet_ethtool_ioctl (struct net_device *net, void __user *useraddr)
+static void usbnet_get_drvinfo (struct net_device *net, struct ethtool_drvinfo *info)
{
- struct usbnet *dev = (struct usbnet *) net->priv;
- u32 cmd;
-
- if (get_user (cmd, (u32 *)useraddr))
- return -EFAULT;
- switch (cmd) {
-
- case ETHTOOL_GDRVINFO: { /* get driver info */
- struct ethtool_drvinfo info;
-
- memset (&info, 0, sizeof info);
- info.cmd = ETHTOOL_GDRVINFO;
- strncpy (info.driver, driver_name, sizeof info.driver);
- strncpy (info.version, DRIVER_VERSION, sizeof info.version);
- strncpy (info.fw_version, dev->driver_info->description,
- sizeof info.fw_version);
- usb_make_path (dev->udev, info.bus_info, sizeof info.bus_info);
- if (copy_to_user (useraddr, &info, sizeof (info)))
- return -EFAULT;
- return 0;
- }
+ struct usbnet *dev = net->priv;
- case ETHTOOL_GLINK: /* get link status */
- if (dev->driver_info->check_connect) {
- struct ethtool_value edata = { ETHTOOL_GLINK };
+ strncpy (info->driver, driver_name, sizeof info->driver);
+ strncpy (info->version, DRIVER_VERSION, sizeof info->version);
+ strncpy (info->fw_version, dev->driver_info->description,
+ sizeof info->fw_version);
+ usb_make_path (dev->udev, info->bus_info, sizeof info->bus_info);
+}
- edata.data = dev->driver_info->check_connect (dev) == 0;
- if (copy_to_user (useraddr, &edata, sizeof (edata)))
- return -EFAULT;
- return 0;
- }
- break;
+static u32 usbnet_get_link (struct net_device *net)
+{
+ struct usbnet *dev = net->priv;
- case ETHTOOL_GMSGLVL: { /* get message-level */
- struct ethtool_value edata = {ETHTOOL_GMSGLVL};
+ /* If a check_connect is defined, return it's results */
+ if (dev->driver_info->check_connect)
+ return dev->driver_info->check_connect (dev) == 0;
- edata.data = dev->msg_level;
- if (copy_to_user (useraddr, &edata, sizeof (edata)))
- return -EFAULT;
- return 0;
- }
+ /* Otherwise, we're up to avoid breaking scripts */
+ return 1;
+}
- case ETHTOOL_SMSGLVL: { /* set message-level */
- struct ethtool_value edata;
+static u32 usbnet_get_msglevel (struct net_device *net)
+{
+ struct usbnet *dev = net->priv;
- if (copy_from_user (&edata, useraddr, sizeof (edata)))
- return -EFAULT;
- dev->msg_level = edata.data;
- return 0;
- }
-
- /* could also map RINGPARAM to RX/TX QLEN */
+ return dev->msg_level;
+}
- }
- /* Note that the ethtool user space code requires EOPNOTSUPP */
- return -EOPNOTSUPP;
+static void usbnet_set_msglevel (struct net_device *net, u32 level)
+{
+ struct usbnet *dev = net->priv;
+
+ dev->msg_level = level;
}
static int usbnet_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
{
- if (cmd == SIOCETHTOOL)
- return usbnet_ethtool_ioctl (net, (void __user *)rq->ifr_data);
-
#ifdef NEED_MII
{
struct usbnet *dev = (struct usbnet *)net->priv;
@@ -2889,6 +2981,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
net->watchdog_timeo = TX_TIMEOUT_JIFFIES;
net->tx_timeout = usbnet_tx_timeout;
net->do_ioctl = usbnet_ioctl;
+ net->ethtool_ops = &usbnet_ethtool_ops;
// allow device-specific bind/init procedures
// NOTE net->name still not usable ...
@@ -2991,19 +3084,19 @@ static const struct usb_device_id products [] = {
}, {
// Netgear FA120
USB_DEVICE (0x0846, 0x1040),
- .driver_info = (unsigned long) &ax8817x_info,
+ .driver_info = (unsigned long) &netgear_fa120_info,
}, {
// DLink DUB-E100
USB_DEVICE (0x2001, 0x1a00),
- .driver_info = (unsigned long) &ax8817x_info,
+ .driver_info = (unsigned long) &dlink_dub_e100_info,
}, {
// Intellinet, ST Lab USB Ethernet
USB_DEVICE (0x0b95, 0x1720),
- .driver_info = (unsigned long) &ax8817x_info,
+ .driver_info = (unsigned long) &ax8817x_info,
}, {
// Hawking UF200, TrendNet TU2-ET100
USB_DEVICE (0x07b8, 0x420a),
- .driver_info = (unsigned long) &ax8817x_info,
+ .driver_info = (unsigned long) &hawking_uf200_info,
},
#endif
@@ -3167,6 +3260,14 @@ static struct usb_driver usbnet_driver = {
.disconnect = usbnet_disconnect,
};
+/* Default ethtool_ops assigned. Devices can override in their bind() routine */
+static struct ethtool_ops usbnet_ethtool_ops = {
+ .get_drvinfo = usbnet_get_drvinfo,
+ .get_link = usbnet_get_link,
+ .get_msglevel = usbnet_get_msglevel,
+ .set_msglevel = usbnet_set_msglevel,
+};
+
/*-------------------------------------------------------------------------*/
static int __init usbnet_init (void)
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
index 856d3e1dbf1f..b1d109c8c133 100644
--- a/drivers/usb/serial/Kconfig
+++ b/drivers/usb/serial/Kconfig
@@ -17,10 +17,8 @@ config USB_SERIAL
information on the specifics of the different devices that are
supported, and on how to use them.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called usbserial. If you want to compile it
- as a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called usbserial.
config USB_SERIAL_DEBUG
bool "USB Serial Converter verbose debug"
@@ -70,10 +68,8 @@ config USB_SERIAL_BELKIN
adaptor (F5U103 is one of the model numbers) or the Peracom single
port USB to serial adapter.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called belkin_sa. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called belkin_sa.
config USB_SERIAL_WHITEHEAT
tristate "USB ConnectTech WhiteHEAT Serial Driver"
@@ -82,10 +78,8 @@ config USB_SERIAL_WHITEHEAT
Say Y here if you want to use a ConnectTech WhiteHEAT 4 port
USB to serial converter device.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called whiteheat. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called whiteheat.
config USB_SERIAL_DIGI_ACCELEPORT
tristate "USB Digi International AccelePort USB Serial Driver"
@@ -99,11 +93,8 @@ config USB_SERIAL_DIGI_ACCELEPORT
This driver works under SMP with the usb-uhci driver. It does not
work under SMP with the uhci driver.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called digi_acceleport. If you want to compile
- it as a module, say M here and read
- <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called digi_acceleport.
config USB_SERIAL_EMPEG
tristate "USB Empeg empeg-car Mark I/II Driver"
@@ -114,10 +105,8 @@ config USB_SERIAL_EMPEG
device node. See <file:Documentation/usb/usb-serial.txt> for more
tidbits of information.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called empeg. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called empeg.
config USB_SERIAL_FTDI_SIO
tristate "USB FTDI Single Port Serial Driver (EXPERIMENTAL)"
@@ -130,10 +119,8 @@ config USB_SERIAL_FTDI_SIO
See <http://ftdi-usb-sio.sourceforge.net/> for more
information on this driver and the device.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called ftdi_sio. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called ftdi_sio.
config USB_SERIAL_VISOR
tristate "USB Handspring Visor / Palm m50x / Sony Clie Driver"
@@ -144,10 +131,8 @@ config USB_SERIAL_VISOR
<http://usbvisor.sourceforge.net/> for more information on using this
driver.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called visor. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called visor.
config USB_SERIAL_IPAQ
tristate "USB PocketPC PDA Driver"
@@ -158,10 +143,8 @@ config USB_SERIAL_IPAQ
using a USB cradle/cable. For information on using the driver,
read <file:Documentation/usb/usb-serial.txt>.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called ipaq. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called ipaq.
config USB_SERIAL_IR
tristate "USB IR Dongle Serial Driver (EXPERIMENTAL)"
@@ -171,10 +154,8 @@ config USB_SERIAL_IR
devices. This is useful if you do not want to use the full IrDA
stack.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called ir-usb. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called ir-usb.
config USB_SERIAL_EDGEPORT
tristate "USB Inside Out Edgeport Serial Driver"
@@ -199,10 +180,8 @@ config USB_SERIAL_EDGEPORT
Edgeport/4 DIN
Edgeport/16 Dual
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called io_edgeport. If you want to compile it
- as a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called io_edgeport.
config USB_SERIAL_EDGEPORT_TI
tristate "USB Inside Out Edgeport Serial Driver (TI devices)"
@@ -212,10 +191,8 @@ config USB_SERIAL_EDGEPORT_TI
Networks (Digi) that are not supported by the io_edgeport driver.
This includes the Edgeport/1 device.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called io_ti. If you want to compile it
- as a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called io_ti.
config USB_SERIAL_KEYSPAN_PDA
tristate "USB Keyspan PDA Single Port Serial Driver"
@@ -225,10 +202,8 @@ config USB_SERIAL_KEYSPAN_PDA
serial converter device. This driver makes use of firmware
developed from scratch by Brian Warner.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called keyspan_pda. If you want to compile it
- as a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called keyspan_pda.
config USB_SERIAL_KEYSPAN
tristate "USB Keyspan USA-xxx Serial Driver"
@@ -241,10 +216,8 @@ config USB_SERIAL_KEYSPAN
See <http://misc.nu/hugh/keyspan.html> for more information.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called keyspan. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called keyspan.
config USB_SERIAL_KEYSPAN_MPR
bool "USB Keyspan MPR Firmware"
@@ -337,10 +310,8 @@ config USB_SERIAL_KLSI
Please read <file:Documentation/usb/usb-serial.txt> for more
information.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called kl5kusb105. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called kl5kusb105.
config USB_SERIAL_KOBIL_SCT
tristate "USB KOBIL chipcard reader (EXPERIMENTAL)"
@@ -357,10 +328,8 @@ config USB_SERIAL_KOBIL_SCT
- KAAN Professional
Note that you need a current CT-API.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called kobil_sct. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called kobil_sct.
config USB_SERIAL_MCT_U232
tristate "USB MCT Single Port Serial Driver"
@@ -372,10 +341,8 @@ config USB_SERIAL_MCT_U232
This driver also works with Sitecom U232-P25 and D-Link DU-H3SP USB
BAY devices.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called mct_u232. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called mct_u232.
config USB_SERIAL_PL2303
tristate "USB Prolific 2303 Single Port Serial Driver"
@@ -384,10 +351,8 @@ config USB_SERIAL_PL2303
Say Y here if you want to use the PL2303 USB Serial single port
adapter from Prolific.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called pl2303. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called pl2303.
config USB_SERIAL_SAFE
tristate "USB Safe Serial (Encapsulated) Driver (EXPERIMENTAL)"
@@ -405,10 +370,8 @@ config USB_SERIAL_CYBERJACK
reader. This is an interface to ISO 7816 compatible contactbased
chipcards, e.g. GSM SIMs.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called cyberjack. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called cyberjack.
If unsure, say N.
@@ -420,10 +383,8 @@ config USB_SERIAL_XIRCOM
serial converter device. This driver makes use of firmware
developed from scratch by Brian Warner.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called keyspan_pda. If you want to compile it
- as a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called keyspan_pda.
config USB_SERIAL_OMNINET
tristate "USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)"
@@ -431,10 +392,8 @@ config USB_SERIAL_OMNINET
help
Say Y here if you want to use a ZyXEL omni.net LCD ISDN TA.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called omninet. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called omninet.
config USB_EZUSB
bool
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index 62eec9f28d18..3798e3ca5bbb 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -341,7 +341,7 @@ static void ipaq_read_bulk_callback(struct urb *urb, struct pt_regs *regs)
usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
tty = port->tty;
- if (urb->actual_length) {
+ if (tty && urb->actual_length) {
for (i = 0; i < urb->actual_length ; ++i) {
/* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */
if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 37554c1ea836..e9a4282d89c7 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -871,8 +871,10 @@ static void destroy_serial (struct kobject *kobj)
/* the ports are cleaned up and released in port_release() */
for (i = 0; i < serial->num_ports; ++i)
- if (serial->port[i]->dev.parent != NULL)
+ if (serial->port[i]->dev.parent != NULL) {
device_unregister(&serial->port[i]->dev);
+ serial->port[i] = NULL;
+ }
/* If this is a "fake" port, we have to clean it up here, as it will
* not get cleaned up in port_release() as it was never registered with
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
index 7d923c562806..1ab4b8ed0d0c 100644
--- a/drivers/usb/storage/Kconfig
+++ b/drivers/usb/storage/Kconfig
@@ -15,10 +15,8 @@ config USB_STORAGE
similar devices. This driver may also be used for some cameras and
card readers.
- This code is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called usb-storage. If you want to compile it
- as a module, say M here and read <file:Documentation/modules.txt>.
+ To compile this driver as a module, say M here: the
+ module will be called usb-storage.
config USB_STORAGE_DEBUG
bool "USB Mass Storage verbose debug"
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index aa277cd405c6..ba13c10de4b5 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -289,7 +289,7 @@ UNUSUAL_DEV( 0x054c, 0x006d, 0x0000, 0x9999,
UNUSUAL_DEV( 0x057b, 0x0000, 0x0000, 0x0299,
"Y-E Data",
"Flashbuster-U",
- US_SC_UFI, US_PR_CB, NULL,
+ US_SC_DEVICE, US_PR_CB, NULL,
US_FL_SINGLE_LUN),
UNUSUAL_DEV( 0x057b, 0x0000, 0x0300, 0x9999,
diff --git a/fs/autofs/autofs_i.h b/fs/autofs/autofs_i.h
index 412e4dcb9e40..6171431272dc 100644
--- a/fs/autofs/autofs_i.h
+++ b/fs/autofs/autofs_i.h
@@ -123,7 +123,7 @@ static inline struct autofs_sb_info *autofs_sbi(struct super_block *sb)
filesystem without "magic".) */
static inline int autofs_oz_mode(struct autofs_sb_info *sbi) {
- return sbi->catatonic || current->pgrp == sbi->oz_pgrp;
+ return sbi->catatonic || process_group(current) == sbi->oz_pgrp;
}
/* Hash operations */
diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c
index 76bb0d61dd91..398cade9442d 100644
--- a/fs/autofs/inode.c
+++ b/fs/autofs/inode.c
@@ -51,7 +51,7 @@ static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid, pid
*uid = current->uid;
*gid = current->gid;
- *pgrp = current->pgrp;
+ *pgrp = process_group(current);
*minproto = *maxproto = AUTOFS_PROTO_VERSION;
@@ -129,7 +129,7 @@ int autofs_fill_super(struct super_block *s, void *data, int silent)
sbi->magic = AUTOFS_SBI_MAGIC;
sbi->catatonic = 0;
sbi->exp_timeout = 0;
- sbi->oz_pgrp = current->pgrp;
+ sbi->oz_pgrp = process_group(current);
autofs_initialize_hash(&sbi->dirhash);
sbi->queues = NULL;
memset(sbi->symlink_bitmap, 0, sizeof(long)*AUTOFS_SYMLINK_BITMAP_LEN);
diff --git a/fs/autofs/root.c b/fs/autofs/root.c
index 546ac2f9af87..74ad37a84efc 100644
--- a/fs/autofs/root.c
+++ b/fs/autofs/root.c
@@ -213,7 +213,7 @@ static struct dentry *autofs_root_lookup(struct inode *dir, struct dentry *dentr
oz_mode = autofs_oz_mode(sbi);
DPRINTK(("autofs_lookup: pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d\n",
- current->pid, current->pgrp, sbi->catatonic, oz_mode));
+ current->pid, process_group(current), sbi->catatonic, oz_mode));
/*
* Mark the dentry incomplete, but add it. This is needed so
@@ -527,7 +527,7 @@ static int autofs_root_ioctl(struct inode *inode, struct file *filp,
{
struct autofs_sb_info *sbi = autofs_sbi(inode->i_sb);
- DPRINTK(("autofs_ioctl: cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",cmd,arg,sbi,current->pgrp));
+ DPRINTK(("autofs_ioctl: cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",cmd,arg,sbi,process_group(current)));
if ( _IOC_TYPE(cmd) != _IOC_TYPE(AUTOFS_IOC_FIRST) ||
_IOC_NR(cmd) - _IOC_NR(AUTOFS_IOC_FIRST) >= AUTOFS_IOC_COUNT )
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index 16a3ab2f6d05..0a4b95417122 100644
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -113,7 +113,7 @@ static inline struct autofs_info *autofs4_dentry_ino(struct dentry *dentry)
filesystem without "magic".) */
static inline int autofs4_oz_mode(struct autofs_sb_info *sbi) {
- return sbi->catatonic || current->pgrp == sbi->oz_pgrp;
+ return sbi->catatonic || process_group(current) == sbi->oz_pgrp;
}
/* Does a dentry have some pending activity? */
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 35647d8eca94..f7cb9de42d95 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -101,7 +101,7 @@ static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid,
*uid = current->uid;
*gid = current->gid;
- *pgrp = current->pgrp;
+ *pgrp = process_group(current);
*minproto = AUTOFS_MIN_PROTO_VERSION;
*maxproto = AUTOFS_MAX_PROTO_VERSION;
@@ -192,7 +192,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
sbi->magic = AUTOFS_SBI_MAGIC;
sbi->catatonic = 0;
sbi->exp_timeout = 0;
- sbi->oz_pgrp = current->pgrp;
+ sbi->oz_pgrp = process_group(current);
sbi->sb = s;
sbi->version = 0;
sbi->queues = NULL;
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 49f9f4d3b406..971dfa29b387 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -255,7 +255,7 @@ static struct dentry *autofs4_root_lookup(struct inode *dir, struct dentry *dent
lock_kernel();
oz_mode = autofs4_oz_mode(sbi);
DPRINTK(("autofs_lookup: pid = %u, pgrp = %u, catatonic = %d, oz_mode = %d\n",
- current->pid, current->pgrp, sbi->catatonic, oz_mode));
+ current->pid, process_group(current), sbi->catatonic, oz_mode));
/*
* Mark the dentry incomplete, but add it. This is needed so
@@ -518,7 +518,7 @@ static int autofs4_root_ioctl(struct inode *inode, struct file *filp,
struct autofs_sb_info *sbi = autofs4_sbi(inode->i_sb);
DPRINTK(("autofs_ioctl: cmd = 0x%08x, arg = 0x%08lx, sbi = %p, pgrp = %u\n",
- cmd,arg,sbi,current->pgrp));
+ cmd,arg,sbi,process_group(current)));
if ( _IOC_TYPE(cmd) != _IOC_TYPE(AUTOFS_IOC_FIRST) ||
_IOC_NR(cmd) - _IOC_NR(AUTOFS_IOC_FIRST) >= AUTOFS_IOC_COUNT )
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index ffcef47900fd..dfdead4fcb63 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1077,7 +1077,7 @@ static void fill_prstatus(struct elf_prstatus *prstatus,
prstatus->pr_sighold = p->blocked.sig[0];
prstatus->pr_pid = p->pid;
prstatus->pr_ppid = p->parent->pid;
- prstatus->pr_pgrp = p->pgrp;
+ prstatus->pr_pgrp = process_group(p);
prstatus->pr_sid = p->session;
jiffies_to_timeval(p->utime, &prstatus->pr_utime);
jiffies_to_timeval(p->stime, &prstatus->pr_stime);
@@ -1105,7 +1105,7 @@ static void fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
psinfo->pr_pid = p->pid;
psinfo->pr_ppid = p->parent->pid;
- psinfo->pr_pgrp = p->pgrp;
+ psinfo->pr_pgrp = process_group(p);
psinfo->pr_sid = p->session;
i = p->state ? ffz(~p->state) + 1 : 0;
diff --git a/fs/bio.c b/fs/bio.c
index b02019be4668..2463163c6eeb 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -532,6 +532,12 @@ void bio_unmap_user(struct bio *bio, int write_to_vm)
* check that the pages are still dirty. If so, fine. If not, redirty them
* in process context.
*
+ * We special-case compound pages here: normally this means reads into hugetlb
+ * pages. The logic in here doesn't really work right for compound pages
+ * because the VM does not uniformly chase down the head page in all cases.
+ * But dirtiness of compound pages is pretty meaningless anyway: the VM doesn't
+ * handle them at all. So we skip compound pages here at an early stage.
+ *
* Note that this code is very hard to test under normal circumstances because
* direct-io pins the pages with get_user_pages(). This makes
* is_page_cache_freeable return false, and the VM will not clean the pages.
@@ -553,8 +559,21 @@ void bio_set_pages_dirty(struct bio *bio)
for (i = 0; i < bio->bi_vcnt; i++) {
struct page *page = bvec[i].bv_page;
+ if (page && !PageCompound(page))
+ set_page_dirty_lock(page);
+ }
+}
+
+void bio_release_pages(struct bio *bio)
+{
+ struct bio_vec *bvec = bio->bi_io_vec;
+ int i;
+
+ for (i = 0; i < bio->bi_vcnt; i++) {
+ struct page *page = bvec[i].bv_page;
+
if (page)
- set_page_dirty_lock(bvec[i].bv_page);
+ put_page(page);
}
}
@@ -592,6 +611,7 @@ static void bio_dirty_fn(void *data)
struct bio *next = bio->bi_private;
bio_set_pages_dirty(bio);
+ bio_release_pages(bio);
bio_put(bio);
bio = next;
}
@@ -606,7 +626,7 @@ void bio_check_pages_dirty(struct bio *bio)
for (i = 0; i < bio->bi_vcnt; i++) {
struct page *page = bvec[i].bv_page;
- if (PageDirty(page)) {
+ if (PageDirty(page) || PageCompound(page)) {
page_cache_release(page);
bvec[i].bv_page = NULL;
} else {
diff --git a/fs/char_dev.c b/fs/char_dev.c
index 44303f85e624..48f5a6791bec 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -445,3 +445,18 @@ void __init chrdev_init(void)
kset_register(&kset_dynamic);
cdev_map = kobj_map_init(base_probe, &cdev_subsys);
}
+
+
+/* Let modules do char dev stuff */
+EXPORT_SYMBOL(register_chrdev_region);
+EXPORT_SYMBOL(unregister_chrdev_region);
+EXPORT_SYMBOL(alloc_chrdev_region);
+EXPORT_SYMBOL(cdev_init);
+EXPORT_SYMBOL(cdev_alloc);
+EXPORT_SYMBOL(cdev_get);
+EXPORT_SYMBOL(cdev_put);
+EXPORT_SYMBOL(cdev_del);
+EXPORT_SYMBOL(cdev_add);
+EXPORT_SYMBOL(cdev_unmap);
+EXPORT_SYMBOL(register_chrdev);
+EXPORT_SYMBOL(unregister_chrdev);
diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c
index a513a4b823a9..5bce9b860d52 100644
--- a/fs/coda/upcall.c
+++ b/fs/coda/upcall.c
@@ -54,7 +54,7 @@ static void *alloc_upcall(int opcode, int size)
inp->ih.opcode = opcode;
inp->ih.pid = current->pid;
- inp->ih.pgid = current->pgrp;
+ inp->ih.pgid = process_group(current);
#ifdef CODA_FS_OLD_API
memset(&inp->ih.cred, 0, sizeof(struct coda_cred));
inp->ih.cred.cr_fsuid = current->fsuid;
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index dd03e0397cc2..73894d9af19c 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -1334,7 +1334,7 @@ static int is_devfsd_or_child (struct fs_info *fs_info)
struct task_struct *p = current;
if (p == fs_info->devfsd_task) return (TRUE);
- if (p->pgrp == fs_info->devfsd_pgrp) return (TRUE);
+ if (process_group(p) == fs_info->devfsd_pgrp) return (TRUE);
read_lock(&tasklist_lock);
for ( ; p != &init_task; p = p->real_parent)
{
@@ -2744,8 +2744,8 @@ static int devfsd_ioctl (struct inode *inode, struct file *file,
}
fs_info->devfsd_task = current;
spin_unlock (&lock);
- fs_info->devfsd_pgrp = (current->pgrp == current->pid) ?
- current->pgrp : 0;
+ fs_info->devfsd_pgrp = (process_group(current) == current->pid) ?
+ process_group(current) : 0;
fs_info->devfsd_file = file;
fs_info->devfsd_info = kmalloc (sizeof *fs_info->devfsd_info,
GFP_KERNEL);
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index cf9edd99e492..c19edbc42457 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -1932,9 +1932,6 @@ void __journal_file_buffer(struct journal_head *jh,
J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh));
assert_spin_locked(&transaction->t_journal->j_list_lock);
-#ifdef __SMP__
- J_ASSERT (current->lock_depth >= 0);
-#endif
J_ASSERT_JH(jh, jh->b_jlist < BJ_Types);
J_ASSERT_JH(jh, jh->b_transaction == transaction ||
jh->b_transaction == 0);
diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c
index b8a284f1bee3..9ad5717a5690 100644
--- a/fs/jffs/inode-v23.c
+++ b/fs/jffs/inode-v23.c
@@ -139,7 +139,7 @@ static int jffs_fill_super(struct super_block *sb, void *data, int silent)
c->thread_pid = kernel_thread (jffs_garbage_collect_thread,
(void *) c,
- CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ CLONE_KERNEL);
D1(printk(KERN_NOTICE "JFFS: GC thread pid=%d.\n", (int) c->thread_pid));
D1(printk(KERN_NOTICE "JFFS: Successfully mounted device %s.\n",
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index ccb2a613da96..0167601c03d3 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -501,24 +501,21 @@ static int __init init_jfs_fs(void)
/*
* I/O completion thread (endio)
*/
- jfsIOthread = kernel_thread(jfsIOWait, 0,
- CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ jfsIOthread = kernel_thread(jfsIOWait, 0, CLONE_KERNEL);
if (jfsIOthread < 0) {
jfs_err("init_jfs_fs: fork failed w/rc = %d", jfsIOthread);
goto end_txmngr;
}
wait_for_completion(&jfsIOwait); /* Wait until thread starts */
- jfsCommitThread = kernel_thread(jfs_lazycommit, 0,
- CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ jfsCommitThread = kernel_thread(jfs_lazycommit, 0, CLONE_KERNEL);
if (jfsCommitThread < 0) {
jfs_err("init_jfs_fs: fork failed w/rc = %d", jfsCommitThread);
goto kill_iotask;
}
wait_for_completion(&jfsIOwait); /* Wait until thread starts */
- jfsSyncThread = kernel_thread(jfs_sync, 0,
- CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ jfsSyncThread = kernel_thread(jfs_sync, 0, CLONE_KERNEL);
if (jfsSyncThread < 0) {
jfs_err("init_jfs_fs: fork failed w/rc = %d", jfsSyncThread);
goto kill_committask;
diff --git a/fs/locks.c b/fs/locks.c
index 023a510e5676..d7a2688c8e5c 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -221,7 +221,7 @@ void locks_copy_lock(struct file_lock *new, struct file_lock *fl)
static inline int flock_translate_cmd(int cmd) {
if (cmd & LOCK_MAND)
return cmd & (LOCK_MAND | LOCK_RW);
- switch (cmd &~ LOCK_NB) {
+ switch (cmd) {
case LOCK_SH:
return F_RDLCK;
case LOCK_EX:
@@ -233,8 +233,8 @@ static inline int flock_translate_cmd(int cmd) {
}
/* Fill in a file_lock structure with an appropriate FLOCK lock. */
-static int flock_make_lock(struct file *filp,
- struct file_lock **lock, unsigned int cmd)
+static int flock_make_lock(struct file *filp, struct file_lock **lock,
+ unsigned int cmd)
{
struct file_lock *fl;
int type = flock_translate_cmd(cmd);
@@ -247,7 +247,7 @@ static int flock_make_lock(struct file *filp,
fl->fl_file = filp;
fl->fl_pid = current->tgid;
- fl->fl_flags = (cmd & LOCK_NB) ? FL_FLOCK : FL_FLOCK | FL_SLEEP;
+ fl->fl_flags = FL_FLOCK;
fl->fl_type = type;
fl->fl_end = OFFSET_MAX;
@@ -1265,9 +1265,8 @@ int fcntl_setlease(unsigned int fd, struct file *filp, long arg)
locks_free_lock(fl);
goto out_unlock;
}
- fl->fl_next = *before;
- *before = fl;
- list_add(&fl->fl_link, &file_lock_list);
+
+ locks_insert_lock(before, fl);
error = f_setown(filp, current->tgid, 1);
out_unlock:
@@ -1298,6 +1297,7 @@ asmlinkage long sys_flock(unsigned int fd, unsigned int cmd)
{
struct file *filp;
struct file_lock *lock;
+ int can_sleep, unlock;
int error;
error = -EBADF;
@@ -1305,12 +1305,18 @@ asmlinkage long sys_flock(unsigned int fd, unsigned int cmd)
if (!filp)
goto out;
- if ((cmd != LOCK_UN) && !(cmd & LOCK_MAND) && !(filp->f_mode & 3))
+ can_sleep = !(cmd & LOCK_NB);
+ cmd &= ~LOCK_NB;
+ unlock = (cmd == LOCK_UN);
+
+ if (!unlock && !(cmd & LOCK_MAND) && !(filp->f_mode & 3))
goto out_putf;
error = flock_make_lock(filp, &lock, cmd);
if (error)
goto out_putf;
+ if (can_sleep)
+ lock->fl_flags |= FL_SLEEP;
error = security_file_lock(filp, cmd);
if (error)
@@ -1318,7 +1324,7 @@ asmlinkage long sys_flock(unsigned int fd, unsigned int cmd)
for (;;) {
error = flock_lock_file(filp, lock);
- if ((error != -EAGAIN) || (cmd & LOCK_NB))
+ if ((error != -EAGAIN) || !can_sleep)
break;
error = wait_event_interruptible(lock->fl_wait, !lock->fl_next);
if (!error)
@@ -1329,7 +1335,7 @@ asmlinkage long sys_flock(unsigned int fd, unsigned int cmd)
}
out_free:
- if (error) {
+ if (list_empty(&lock->fl_link)) {
locks_free_lock(lock);
}
diff --git a/fs/nls/Makefile b/fs/nls/Makefile
index f56c8d4ce844..4548f2940327 100644
--- a/fs/nls/Makefile
+++ b/fs/nls/Makefile
@@ -19,14 +19,13 @@ obj-$(CONFIG_NLS_CODEPAGE_864) += nls_cp864.o
obj-$(CONFIG_NLS_CODEPAGE_865) += nls_cp865.o
obj-$(CONFIG_NLS_CODEPAGE_866) += nls_cp866.o
obj-$(CONFIG_NLS_CODEPAGE_869) += nls_cp869.o
-obj-$(CONFIG_NLS_CODEPAGE_874) += nls_cp874.o nls_tis-620.o
-obj-$(CONFIG_NLS_CODEPAGE_932) += nls_cp932.o nls_sjis.o nls_euc-jp.o
-obj-$(CONFIG_NLS_CODEPAGE_936) += nls_cp936.o nls_gb2312.o
-obj-$(CONFIG_NLS_CODEPAGE_949) += nls_cp949.o nls_euc-kr.o
-obj-$(CONFIG_NLS_CODEPAGE_950) += nls_cp950.o nls_big5.o
+obj-$(CONFIG_NLS_CODEPAGE_874) += nls_cp874.o
+obj-$(CONFIG_NLS_CODEPAGE_932) += nls_cp932.o nls_euc-jp.o
+obj-$(CONFIG_NLS_CODEPAGE_936) += nls_cp936.o
+obj-$(CONFIG_NLS_CODEPAGE_949) += nls_cp949.o
+obj-$(CONFIG_NLS_CODEPAGE_950) += nls_cp950.o
obj-$(CONFIG_NLS_CODEPAGE_1250) += nls_cp1250.o
obj-$(CONFIG_NLS_CODEPAGE_1251) += nls_cp1251.o
-obj-$(CONFIG_NLS_CODEPAGE_1255) += nls_cp1255.o
obj-$(CONFIG_NLS_ISO8859_1) += nls_iso8859-1.o
obj-$(CONFIG_NLS_ISO8859_2) += nls_iso8859-2.o
obj-$(CONFIG_NLS_ISO8859_3) += nls_iso8859-3.o
@@ -34,7 +33,7 @@ obj-$(CONFIG_NLS_ISO8859_4) += nls_iso8859-4.o
obj-$(CONFIG_NLS_ISO8859_5) += nls_iso8859-5.o
obj-$(CONFIG_NLS_ISO8859_6) += nls_iso8859-6.o
obj-$(CONFIG_NLS_ISO8859_7) += nls_iso8859-7.o
-obj-$(CONFIG_NLS_ISO8859_8) += nls_cp1255.o nls_iso8859-8.o
+obj-$(CONFIG_NLS_ISO8859_8) += nls_cp1255.o
obj-$(CONFIG_NLS_ISO8859_9) += nls_iso8859-9.o
obj-$(CONFIG_NLS_ISO8859_10) += nls_iso8859-10.o
obj-$(CONFIG_NLS_ISO8859_13) += nls_iso8859-13.o
diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c
index 972e46073072..d0904e1c94b2 100644
--- a/fs/nls/nls_base.c
+++ b/fs/nls/nls_base.c
@@ -203,9 +203,12 @@ static struct nls_table *find_nls(char *charset)
{
struct nls_table *nls;
spin_lock(&nls_lock);
- for (nls = tables; nls; nls = nls->next)
+ for (nls = tables; nls; nls = nls->next) {
if (!strcmp(nls->charset, charset))
break;
+ if (nls->alias && !strcmp(nls->alias, charset))
+ break;
+ }
if (nls && !try_module_get(nls->owner))
nls = NULL;
spin_unlock(&nls_lock);
diff --git a/fs/nls/nls_big5.c b/fs/nls/nls_big5.c
deleted file mode 100644
index ce8792b4bb3e..000000000000
--- a/fs/nls/nls_big5.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * linux/fs/nls_big5.c
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/nls.h>
-#include <linux/errno.h>
-
-static struct nls_table *p_nls;
-
-static struct nls_table table = {
- .charset = "big5",
- .owner = THIS_MODULE,
-};
-
-static int __init init_nls_big5(void)
-{
- p_nls = load_nls("cp950");
-
- if (p_nls) {
- table.uni2char = p_nls->uni2char;
- table.char2uni = p_nls->char2uni;
- table.charset2upper = p_nls->charset2upper;
- table.charset2lower = p_nls->charset2lower;
- return register_nls(&table);
- }
-
- return -EINVAL;
-}
-
-static void __exit exit_nls_big5(void)
-{
- unregister_nls(&table);
- unload_nls(p_nls);
-}
-
-module_init(init_nls_big5)
-module_exit(exit_nls_big5)
-MODULE_LICENSE("Dual BSD/GPL");
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- *
----------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
diff --git a/fs/nls/nls_cp1250.c b/fs/nls/nls_cp1250.c
index 982dc66a5227..32e78cf95180 100644
--- a/fs/nls/nls_cp1250.c
+++ b/fs/nls/nls_cp1250.c
@@ -345,21 +345,3 @@ module_init(init_nls_cp1250)
module_exit(exit_nls_cp1250)
MODULE_LICENSE("Dual BSD/GPL");
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
-
diff --git a/fs/nls/nls_cp1251.c b/fs/nls/nls_cp1251.c
index 3200c874a8a0..cb41c8ae4486 100644
--- a/fs/nls/nls_cp1251.c
+++ b/fs/nls/nls_cp1251.c
@@ -299,20 +299,4 @@ static void __exit exit_nls_cp1251(void)
module_init(init_nls_cp1251)
module_exit(exit_nls_cp1251)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp1255.c b/fs/nls/nls_cp1255.c
index 479ef421f738..efdeefee5346 100644
--- a/fs/nls/nls_cp1255.c
+++ b/fs/nls/nls_cp1255.c
@@ -360,6 +360,7 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
static struct nls_table table = {
.charset = "cp1255",
+ .alias = "iso8859-8",
.uni2char = uni2char,
.char2uni = char2uni,
.charset2lower = charset2lower,
@@ -380,20 +381,5 @@ static void __exit exit_nls_cp1255(void)
module_init(init_nls_cp1255)
module_exit(exit_nls_cp1255)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS_NLS(iso8859-8);
diff --git a/fs/nls/nls_cp437.c b/fs/nls/nls_cp437.c
index e54aae3db06b..5c4a1cd685dd 100644
--- a/fs/nls/nls_cp437.c
+++ b/fs/nls/nls_cp437.c
@@ -385,20 +385,4 @@ static void __exit exit_nls_cp437(void)
module_init(init_nls_cp437)
module_exit(exit_nls_cp437)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp737.c b/fs/nls/nls_cp737.c
index 043ffde515fa..e8b3ca8462e7 100644
--- a/fs/nls/nls_cp737.c
+++ b/fs/nls/nls_cp737.c
@@ -348,20 +348,4 @@ static void __exit exit_nls_cp737(void)
module_init(init_nls_cp737)
module_exit(exit_nls_cp737)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp775.c b/fs/nls/nls_cp775.c
index 3af27ba5483e..bdb290ea523a 100644
--- a/fs/nls/nls_cp775.c
+++ b/fs/nls/nls_cp775.c
@@ -317,20 +317,4 @@ static void __exit exit_nls_cp775(void)
module_init(init_nls_cp775)
module_exit(exit_nls_cp775)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp850.c b/fs/nls/nls_cp850.c
index 1799c1b04fb8..25deaa4c8648 100644
--- a/fs/nls/nls_cp850.c
+++ b/fs/nls/nls_cp850.c
@@ -313,20 +313,4 @@ static void __exit exit_nls_cp850(void)
module_init(init_nls_cp850)
module_exit(exit_nls_cp850)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp852.c b/fs/nls/nls_cp852.c
index 8e06b85a8d3a..b822a7b6b970 100644
--- a/fs/nls/nls_cp852.c
+++ b/fs/nls/nls_cp852.c
@@ -335,20 +335,4 @@ static void __exit exit_nls_cp852(void)
module_init(init_nls_cp852)
module_exit(exit_nls_cp852)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp855.c b/fs/nls/nls_cp855.c
index bf322f283300..e8641b7a8b27 100644
--- a/fs/nls/nls_cp855.c
+++ b/fs/nls/nls_cp855.c
@@ -297,20 +297,4 @@ static void __exit exit_nls_cp855(void)
module_init(init_nls_cp855)
module_exit(exit_nls_cp855)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp857.c b/fs/nls/nls_cp857.c
index 5296a7d33582..7ba589ef8cc0 100644
--- a/fs/nls/nls_cp857.c
+++ b/fs/nls/nls_cp857.c
@@ -299,20 +299,4 @@ static void __exit exit_nls_cp857(void)
module_init(init_nls_cp857)
module_exit(exit_nls_cp857)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp860.c b/fs/nls/nls_cp860.c
index 5b43e726778b..3b9e49ce8c80 100644
--- a/fs/nls/nls_cp860.c
+++ b/fs/nls/nls_cp860.c
@@ -362,20 +362,4 @@ static void __exit exit_nls_cp860(void)
module_init(init_nls_cp860)
module_exit(exit_nls_cp860)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp861.c b/fs/nls/nls_cp861.c
index 1beafa8cf364..959ff64ee971 100644
--- a/fs/nls/nls_cp861.c
+++ b/fs/nls/nls_cp861.c
@@ -385,20 +385,4 @@ static void __exit exit_nls_cp861(void)
module_init(init_nls_cp861)
module_exit(exit_nls_cp861)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp862.c b/fs/nls/nls_cp862.c
index e5e6254a85de..b96928f5a023 100644
--- a/fs/nls/nls_cp862.c
+++ b/fs/nls/nls_cp862.c
@@ -419,20 +419,4 @@ static void __exit exit_nls_cp862(void)
module_init(init_nls_cp862)
module_exit(exit_nls_cp862)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp863.c b/fs/nls/nls_cp863.c
index 2878908fdce5..baa6e0eab1d6 100644
--- a/fs/nls/nls_cp863.c
+++ b/fs/nls/nls_cp863.c
@@ -379,20 +379,4 @@ static void __exit exit_nls_cp863(void)
module_init(init_nls_cp863)
module_exit(exit_nls_cp863)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp864.c b/fs/nls/nls_cp864.c
index 84353d50a774..f4dabb037dfe 100644
--- a/fs/nls/nls_cp864.c
+++ b/fs/nls/nls_cp864.c
@@ -405,20 +405,4 @@ static void __exit exit_nls_cp864(void)
module_init(init_nls_cp864)
module_exit(exit_nls_cp864)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp865.c b/fs/nls/nls_cp865.c
index be670ae14250..4caeafae32c2 100644
--- a/fs/nls/nls_cp865.c
+++ b/fs/nls/nls_cp865.c
@@ -385,20 +385,4 @@ static void __exit exit_nls_cp865(void)
module_init(init_nls_cp865)
module_exit(exit_nls_cp865)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp866.c b/fs/nls/nls_cp866.c
index 66319e6cb8d7..f2b4a9a293fb 100644
--- a/fs/nls/nls_cp866.c
+++ b/fs/nls/nls_cp866.c
@@ -303,20 +303,4 @@ static void __exit exit_nls_cp866(void)
module_init(init_nls_cp866)
module_exit(exit_nls_cp866)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp869.c b/fs/nls/nls_cp869.c
index 13718f32eba1..12b436f4eca1 100644
--- a/fs/nls/nls_cp869.c
+++ b/fs/nls/nls_cp869.c
@@ -313,20 +313,4 @@ static void __exit exit_nls_cp869(void)
module_init(init_nls_cp869)
module_exit(exit_nls_cp869)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_cp874.c b/fs/nls/nls_cp874.c
index 34ae4cf7979c..b5766a01703a 100644
--- a/fs/nls/nls_cp874.c
+++ b/fs/nls/nls_cp874.c
@@ -251,6 +251,7 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
static struct nls_table table = {
.charset = "cp874",
+ .alias = "tis-620",
.uni2char = uni2char,
.char2uni = char2uni,
.charset2lower = charset2lower,
@@ -271,20 +272,5 @@ static void __exit exit_nls_cp874(void)
module_init(init_nls_cp874)
module_exit(exit_nls_cp874)
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS_NLS(tis-620);
diff --git a/fs/nls/nls_cp932.c b/fs/nls/nls_cp932.c
index a30961bccc34..af796a76315f 100644
--- a/fs/nls/nls_cp932.c
+++ b/fs/nls/nls_cp932.c
@@ -7885,6 +7885,7 @@ static int char2uni(const unsigned char *rawstring, int boundlen,
static struct nls_table table = {
.charset = "cp932",
+ .alias = "sjis",
.uni2char = uni2char,
.char2uni = char2uni,
.charset2lower = charset2lower,
@@ -7904,22 +7905,6 @@ static void __exit exit_nls_cp932(void)
module_init(init_nls_cp932)
module_exit(exit_nls_cp932)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- *
----------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS_NLS(sjis);
diff --git a/fs/nls/nls_cp936.c b/fs/nls/nls_cp936.c
index 06a4dee6372d..33e57a387a33 100644
--- a/fs/nls/nls_cp936.c
+++ b/fs/nls/nls_cp936.c
@@ -11005,6 +11005,7 @@ static int char2uni(const unsigned char *rawstring, int boundlen,
static struct nls_table table = {
.charset = "cp936",
+ .alias = "gb2312",
.uni2char = uni2char,
.char2uni = char2uni,
.charset2lower = charset2lower,
@@ -11024,22 +11025,6 @@ static void __exit exit_nls_cp936(void)
module_init(init_nls_cp936)
module_exit(exit_nls_cp936)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- *
----------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS_NLS(gb2312);
diff --git a/fs/nls/nls_cp949.c b/fs/nls/nls_cp949.c
index e1e4e9062b77..b21d56aba6b4 100644
--- a/fs/nls/nls_cp949.c
+++ b/fs/nls/nls_cp949.c
@@ -13922,6 +13922,7 @@ static int char2uni(const unsigned char *rawstring, int boundlen,
static struct nls_table table = {
.charset = "cp949",
+ .alias = "euc-kr",
.uni2char = uni2char,
.char2uni = char2uni,
.charset2lower = charset2lower,
@@ -13941,22 +13942,6 @@ static void __exit exit_nls_cp949(void)
module_init(init_nls_cp949)
module_exit(exit_nls_cp949)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- *
----------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS_NLS(euc-kr);
diff --git a/fs/nls/nls_cp950.c b/fs/nls/nls_cp950.c
index 604fd4874be6..3a478e547ef6 100644
--- a/fs/nls/nls_cp950.c
+++ b/fs/nls/nls_cp950.c
@@ -9461,6 +9461,7 @@ static int char2uni(const unsigned char *rawstring, int boundlen,
static struct nls_table table = {
.charset = "cp950",
+ .alias = "big5",
.uni2char = uni2char,
.char2uni = char2uni,
.charset2lower = charset2lower,
@@ -9480,22 +9481,6 @@ static void __exit exit_nls_cp950(void)
module_init(init_nls_cp950)
module_exit(exit_nls_cp950)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- *
----------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_ALIAS_NLS(big5);
diff --git a/fs/nls/nls_euc-jp.c b/fs/nls/nls_euc-jp.c
index 258f91942db0..80f108ae6661 100644
--- a/fs/nls/nls_euc-jp.c
+++ b/fs/nls/nls_euc-jp.c
@@ -579,22 +579,5 @@ static void __exit exit_nls_euc_jp(void)
module_init(init_nls_euc_jp)
module_exit(exit_nls_euc_jp)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- *
----------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_euc-kr.c b/fs/nls/nls_euc-kr.c
deleted file mode 100644
index adbf5ffa3496..000000000000
--- a/fs/nls/nls_euc-kr.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * linux/fs/nls_euc-kr.c
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/nls.h>
-#include <linux/errno.h>
-
-static struct nls_table *p_nls;
-
-static struct nls_table table = {
- .charset = "euc-kr",
- .owner = THIS_MODULE,
-};
-
-static int __init init_nls_euc_kr(void)
-{
- p_nls = load_nls("cp949");
-
- if (p_nls) {
- table.uni2char = p_nls->uni2char;
- table.char2uni = p_nls->char2uni;
- table.charset2upper = p_nls->charset2upper;
- table.charset2lower = p_nls->charset2lower;
- return register_nls(&table);
- }
-
- return -EINVAL;
-}
-
-static void __exit exit_nls_euc_kr(void)
-{
- unregister_nls(&table);
- unload_nls(p_nls);
-}
-
-module_init(init_nls_euc_kr)
-module_exit(exit_nls_euc_kr)
-MODULE_LICENSE("Dual BSD/GPL");
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- *
----------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
diff --git a/fs/nls/nls_gb2312.c b/fs/nls/nls_gb2312.c
deleted file mode 100644
index 7d92be88c05c..000000000000
--- a/fs/nls/nls_gb2312.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * linux/fs/nls_gb2312.c
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/nls.h>
-#include <linux/errno.h>
-
-static struct nls_table *p_nls;
-
-static struct nls_table table = {
- .charset = "gb2312",
- .owner = THIS_MODULE,
-};
-
-static int __init init_nls_gb2312(void)
-{
- p_nls = load_nls("cp936");
-
- if (p_nls) {
- table.uni2char = p_nls->uni2char;
- table.char2uni = p_nls->char2uni;
- table.charset2upper = p_nls->charset2upper;
- table.charset2lower = p_nls->charset2lower;
- return register_nls(&table);
- }
-
- return -EINVAL;
-}
-
-static void __exit exit_nls_gb2312(void)
-{
- unregister_nls(&table);
- unload_nls(p_nls);
-}
-
-module_init(init_nls_gb2312)
-module_exit(exit_nls_gb2312)
-MODULE_LICENSE("Dual BSD/GPL");
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- *
----------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
diff --git a/fs/nls/nls_iso8859-1.c b/fs/nls/nls_iso8859-1.c
index e10a982e2af4..70a2c1956723 100644
--- a/fs/nls/nls_iso8859-1.c
+++ b/fs/nls/nls_iso8859-1.c
@@ -254,21 +254,5 @@ static void __exit exit_nls_iso8859_1(void)
module_init(init_nls_iso8859_1)
module_exit(exit_nls_iso8859_1)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_iso8859-13.c b/fs/nls/nls_iso8859-13.c
index 7cd4bd876c1c..4547035f21a3 100644
--- a/fs/nls/nls_iso8859-13.c
+++ b/fs/nls/nls_iso8859-13.c
@@ -282,21 +282,5 @@ static void __exit exit_nls_iso8859_13(void)
module_init(init_nls_iso8859_13)
module_exit(exit_nls_iso8859_13)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_iso8859-14.c b/fs/nls/nls_iso8859-14.c
index 46dcc6b4cdc5..13628d0dd3a9 100644
--- a/fs/nls/nls_iso8859-14.c
+++ b/fs/nls/nls_iso8859-14.c
@@ -338,21 +338,5 @@ static void __exit exit_nls_iso8859_14(void)
module_init(init_nls_iso8859_14)
module_exit(exit_nls_iso8859_14)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_iso8859-15.c b/fs/nls/nls_iso8859-15.c
index 285065950c3a..88b924bf7e18 100644
--- a/fs/nls/nls_iso8859-15.c
+++ b/fs/nls/nls_iso8859-15.c
@@ -304,21 +304,5 @@ static void __exit exit_nls_iso8859_15(void)
module_init(init_nls_iso8859_15)
module_exit(exit_nls_iso8859_15)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_iso8859-2.c b/fs/nls/nls_iso8859-2.c
index fb2ff3d5d83e..372528a6c40c 100644
--- a/fs/nls/nls_iso8859-2.c
+++ b/fs/nls/nls_iso8859-2.c
@@ -305,21 +305,5 @@ static void __exit exit_nls_iso8859_2(void)
module_init(init_nls_iso8859_2)
module_exit(exit_nls_iso8859_2)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_iso8859-3.c b/fs/nls/nls_iso8859-3.c
index 3ecde03594ee..81b45a234369 100644
--- a/fs/nls/nls_iso8859-3.c
+++ b/fs/nls/nls_iso8859-3.c
@@ -305,21 +305,5 @@ static void __exit exit_nls_iso8859_3(void)
module_init(init_nls_iso8859_3)
module_exit(exit_nls_iso8859_3)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_iso8859-4.c b/fs/nls/nls_iso8859-4.c
index 901d3f2eb854..101b87f5a49b 100644
--- a/fs/nls/nls_iso8859-4.c
+++ b/fs/nls/nls_iso8859-4.c
@@ -305,21 +305,5 @@ static void __exit exit_nls_iso8859_4(void)
module_init(init_nls_iso8859_4)
module_exit(exit_nls_iso8859_4)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_iso8859-5.c b/fs/nls/nls_iso8859-5.c
index bb654b74db5e..83b0084de5eb 100644
--- a/fs/nls/nls_iso8859-5.c
+++ b/fs/nls/nls_iso8859-5.c
@@ -269,21 +269,5 @@ static void __exit exit_nls_iso8859_5(void)
module_init(init_nls_iso8859_5)
module_exit(exit_nls_iso8859_5)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_iso8859-6.c b/fs/nls/nls_iso8859-6.c
index 248c50a557ae..0c519d65f55b 100644
--- a/fs/nls/nls_iso8859-6.c
+++ b/fs/nls/nls_iso8859-6.c
@@ -260,21 +260,5 @@ static void __exit exit_nls_iso8859_6(void)
module_init(init_nls_iso8859_6)
module_exit(exit_nls_iso8859_6)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_iso8859-7.c b/fs/nls/nls_iso8859-7.c
index 49a63e989f9a..bd0854625acf 100644
--- a/fs/nls/nls_iso8859-7.c
+++ b/fs/nls/nls_iso8859-7.c
@@ -314,21 +314,5 @@ static void __exit exit_nls_iso8859_7(void)
module_init(init_nls_iso8859_7)
module_exit(exit_nls_iso8859_7)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_iso8859-8.c b/fs/nls/nls_iso8859-8.c
deleted file mode 100644
index 5f368b14066a..000000000000
--- a/fs/nls/nls_iso8859-8.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * linux/fs/nls_iso8859-8.c
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/nls.h>
-#include <linux/errno.h>
-
-static struct nls_table *p_nls;
-
-static struct nls_table table = {
- .charset = "iso8859-8",
- .owner = THIS_MODULE,
-};
-
-static int __init init_nls_iso8859_8(void)
-{
- p_nls = load_nls("cp1255");
-
- if (p_nls) {
- table.uni2char = p_nls->uni2char;
- table.char2uni = p_nls->char2uni;
- table.charset2upper = p_nls->charset2upper;
- table.charset2lower = p_nls->charset2lower;
- return register_nls(&table);
- }
-
- return -EINVAL;
-}
-
-static void __exit exit_nls_iso8859_8(void)
-{
- unregister_nls(&table);
- unload_nls(p_nls);
-}
-
-module_init(init_nls_iso8859_8)
-module_exit(exit_nls_iso8859_8)
-MODULE_LICENSE("Dual BSD/GPL");
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- *
----------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
diff --git a/fs/nls/nls_iso8859-9.c b/fs/nls/nls_iso8859-9.c
index d47908043afe..988eff791c06 100644
--- a/fs/nls/nls_iso8859-9.c
+++ b/fs/nls/nls_iso8859-9.c
@@ -269,21 +269,5 @@ static void __exit exit_nls_iso8859_9(void)
module_init(init_nls_iso8859_9)
module_exit(exit_nls_iso8859_9)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_koi8-r.c b/fs/nls/nls_koi8-r.c
index 446a9a8015f2..0ad22c249796 100644
--- a/fs/nls/nls_koi8-r.c
+++ b/fs/nls/nls_koi8-r.c
@@ -320,21 +320,5 @@ static void __exit exit_nls_koi8_r(void)
module_init(init_nls_koi8_r)
module_exit(exit_nls_koi8_r)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_koi8-ru.c b/fs/nls/nls_koi8-ru.c
index ff73403b3407..5db83efe27c6 100644
--- a/fs/nls/nls_koi8-ru.c
+++ b/fs/nls/nls_koi8-ru.c
@@ -79,21 +79,5 @@ static void __exit exit_nls_koi8_ru(void)
module_init(init_nls_koi8_ru)
module_exit(exit_nls_koi8_ru)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_koi8-u.c b/fs/nls/nls_koi8-u.c
index e9b4d3742241..9d30fd61cf46 100644
--- a/fs/nls/nls_koi8-u.c
+++ b/fs/nls/nls_koi8-u.c
@@ -327,21 +327,5 @@ static void __exit exit_nls_koi8_u(void)
module_init(init_nls_koi8_u)
module_exit(exit_nls_koi8_u)
-MODULE_LICENSE("Dual BSD/GPL");
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/fs/nls/nls_sjis.c b/fs/nls/nls_sjis.c
deleted file mode 100644
index d70a5305a87a..000000000000
--- a/fs/nls/nls_sjis.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * linux/fs/nls_sjis.c
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/nls.h>
-#include <linux/errno.h>
-
-static struct nls_table *p_nls;
-
-static struct nls_table table = {
- .charset = "sjis",
- .owner = THIS_MODULE,
-};
-
-static int __init init_nls_sjis(void)
-{
- p_nls = load_nls("cp932");
-
- if (p_nls) {
- table.uni2char = p_nls->uni2char;
- table.char2uni = p_nls->char2uni;
- table.charset2upper = p_nls->charset2upper;
- table.charset2lower = p_nls->charset2lower;
- return register_nls(&table);
- }
-
- return -EINVAL;
-}
-
-static void __exit exit_nls_sjis(void)
-{
- unregister_nls(&table);
- unload_nls(p_nls);
-}
-
-module_init(init_nls_sjis)
-module_exit(exit_nls_sjis)
-MODULE_LICENSE("Dual BSD/GPL");
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- *
----------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
diff --git a/fs/nls/nls_tis-620.c b/fs/nls/nls_tis-620.c
deleted file mode 100644
index 4fcea5e4dd36..000000000000
--- a/fs/nls/nls_tis-620.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * linux/fs/nls_tis-620.c
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/nls.h>
-#include <linux/errno.h>
-
-static struct nls_table *p_nls;
-
-static struct nls_table table = {
- .charset = "tis-620",
- .owner = THIS_MODULE,
-};
-
-static int __init init_nls_tis_620(void)
-{
- p_nls = load_nls("cp874");
-
- if (p_nls) {
- table.uni2char = p_nls->uni2char;
- table.char2uni = p_nls->char2uni;
- table.charset2upper = p_nls->charset2upper;
- table.charset2lower = p_nls->charset2lower;
- return register_nls(&table);
- }
-
- return -EINVAL;
-}
-
-static void __exit exit_nls_tis_620(void)
-{
- unregister_nls(&table);
- unload_nls(p_nls);
-}
-
-module_init(init_nls_tis_620)
-module_exit(exit_nls_tis_620)
-MODULE_LICENSE("Dual BSD/GPL");
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- *
----------------------------------------------------------------------------
- * Local variables:
- * c-indent-level: 8
- * c-brace-imaginary-offset: 0
- * c-brace-offset: -8
- * c-argdecl-indent: 8
- * c-label-offset: -8
- * c-continued-statement-offset: 8
- * c-continued-brace-offset: 0
- * End:
- */
diff --git a/fs/proc/array.c b/fs/proc/array.c
index a7a3bdaac4ec..bf39eb5013b0 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -154,13 +154,16 @@ static inline char * task_state(struct task_struct *p, char *buffer)
read_lock(&tasklist_lock);
buffer += sprintf(buffer,
"State:\t%s\n"
+ "SleepAVG:\t%lu%%\n"
"Tgid:\t%d\n"
"Pid:\t%d\n"
"PPid:\t%d\n"
"TracerPid:\t%d\n"
"Uid:\t%d\t%d\t%d\t%d\n"
"Gid:\t%d\t%d\t%d\t%d\n",
- get_task_state(p), p->tgid,
+ get_task_state(p),
+ (p->sleep_avg/1024)*100/(1000000000/1024),
+ p->tgid,
p->pid, p->pid ? p->real_parent->pid : 0,
p->pid && p->ptrace ? p->parent->pid : 0,
p->uid, p->euid, p->suid, p->fsuid,
@@ -341,7 +344,7 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
task->comm,
state,
ppid,
- task->pgrp,
+ process_group(task),
task->session,
tty_nr,
tty_pgrp,
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 407e008006f8..640cddefdb78 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -44,28 +44,51 @@
#define fake_ino(pid,ino) (((pid)<<16)|(ino))
enum pid_directory_inos {
- PROC_PID_INO = 2,
- PROC_PID_STATUS,
- PROC_PID_MEM,
- PROC_PID_CWD,
- PROC_PID_ROOT,
- PROC_PID_EXE,
- PROC_PID_FD,
- PROC_PID_ENVIRON,
- PROC_PID_CMDLINE,
- PROC_PID_STAT,
- PROC_PID_STATM,
- PROC_PID_MAPS,
- PROC_PID_MOUNTS,
- PROC_PID_WCHAN,
+ PROC_TGID_INO = 2,
+ PROC_TGID_TASK,
+ PROC_TGID_STATUS,
+ PROC_TGID_MEM,
+ PROC_TGID_CWD,
+ PROC_TGID_ROOT,
+ PROC_TGID_EXE,
+ PROC_TGID_FD,
+ PROC_TGID_ENVIRON,
+ PROC_TGID_CMDLINE,
+ PROC_TGID_STAT,
+ PROC_TGID_STATM,
+ PROC_TGID_MAPS,
+ PROC_TGID_MOUNTS,
+ PROC_TGID_WCHAN,
#ifdef CONFIG_SECURITY
- PROC_PID_ATTR,
- PROC_PID_ATTR_CURRENT,
- PROC_PID_ATTR_PREV,
- PROC_PID_ATTR_EXEC,
- PROC_PID_ATTR_FSCREATE,
+ PROC_TGID_ATTR,
+ PROC_TGID_ATTR_CURRENT,
+ PROC_TGID_ATTR_PREV,
+ PROC_TGID_ATTR_EXEC,
+ PROC_TGID_ATTR_FSCREATE,
#endif
- PROC_PID_FD_DIR = 0x8000, /* 0x8000-0xffff */
+ PROC_TGID_FD_DIR,
+ PROC_TID_INO,
+ PROC_TID_STATUS,
+ PROC_TID_MEM,
+ PROC_TID_CWD,
+ PROC_TID_ROOT,
+ PROC_TID_EXE,
+ PROC_TID_FD,
+ PROC_TID_ENVIRON,
+ PROC_TID_CMDLINE,
+ PROC_TID_STAT,
+ PROC_TID_STATM,
+ PROC_TID_MAPS,
+ PROC_TID_MOUNTS,
+ PROC_TID_WCHAN,
+#ifdef CONFIG_SECURITY
+ PROC_TID_ATTR,
+ PROC_TID_ATTR_CURRENT,
+ PROC_TID_ATTR_PREV,
+ PROC_TID_ATTR_EXEC,
+ PROC_TID_ATTR_FSCREATE,
+#endif
+ PROC_TID_FD_DIR = 0x8000, /* 0x8000-0xffff */
};
struct pid_entry {
@@ -76,36 +99,68 @@ struct pid_entry {
};
#define E(type,name,mode) {(type),sizeof(name)-1,(name),(mode)}
-static struct pid_entry base_stuff[] = {
- E(PROC_PID_FD, "fd", S_IFDIR|S_IRUSR|S_IXUSR),
- E(PROC_PID_ENVIRON, "environ", S_IFREG|S_IRUSR),
- E(PROC_PID_STATUS, "status", S_IFREG|S_IRUGO),
- E(PROC_PID_CMDLINE, "cmdline", S_IFREG|S_IRUGO),
- E(PROC_PID_STAT, "stat", S_IFREG|S_IRUGO),
- E(PROC_PID_STATM, "statm", S_IFREG|S_IRUGO),
- E(PROC_PID_MAPS, "maps", S_IFREG|S_IRUGO),
- E(PROC_PID_MEM, "mem", S_IFREG|S_IRUSR|S_IWUSR),
- E(PROC_PID_CWD, "cwd", S_IFLNK|S_IRWXUGO),
- E(PROC_PID_ROOT, "root", S_IFLNK|S_IRWXUGO),
- E(PROC_PID_EXE, "exe", S_IFLNK|S_IRWXUGO),
- E(PROC_PID_MOUNTS, "mounts", S_IFREG|S_IRUGO),
+
+static struct pid_entry tgid_base_stuff[] = {
+ E(PROC_TGID_TASK, "task", S_IFDIR|S_IRUGO|S_IXUGO),
+ E(PROC_TGID_FD, "fd", S_IFDIR|S_IRUSR|S_IXUSR),
+ E(PROC_TGID_ENVIRON, "environ", S_IFREG|S_IRUSR),
+ E(PROC_TGID_STATUS, "status", S_IFREG|S_IRUGO),
+ E(PROC_TGID_CMDLINE, "cmdline", S_IFREG|S_IRUGO),
+ E(PROC_TGID_STAT, "stat", S_IFREG|S_IRUGO),
+ E(PROC_TGID_STATM, "statm", S_IFREG|S_IRUGO),
+ E(PROC_TGID_MAPS, "maps", S_IFREG|S_IRUGO),
+ E(PROC_TGID_MEM, "mem", S_IFREG|S_IRUSR|S_IWUSR),
+ E(PROC_TGID_CWD, "cwd", S_IFLNK|S_IRWXUGO),
+ E(PROC_TGID_ROOT, "root", S_IFLNK|S_IRWXUGO),
+ E(PROC_TGID_EXE, "exe", S_IFLNK|S_IRWXUGO),
+ E(PROC_TGID_MOUNTS, "mounts", S_IFREG|S_IRUGO),
#ifdef CONFIG_SECURITY
- E(PROC_PID_ATTR, "attr", S_IFDIR|S_IRUGO|S_IXUGO),
+ E(PROC_TGID_ATTR, "attr", S_IFDIR|S_IRUGO|S_IXUGO),
#endif
#ifdef CONFIG_KALLSYMS
- E(PROC_PID_WCHAN, "wchan", S_IFREG|S_IRUGO),
+ E(PROC_TGID_WCHAN, "wchan", S_IFREG|S_IRUGO),
#endif
- {0,0,NULL,0}
+ {0,0,NULL,0}
};
+static struct pid_entry tid_base_stuff[] = {
+ E(PROC_TID_FD, "fd", S_IFDIR|S_IRUSR|S_IXUSR),
+ E(PROC_TID_ENVIRON, "environ", S_IFREG|S_IRUSR),
+ E(PROC_TID_STATUS, "status", S_IFREG|S_IRUGO),
+ E(PROC_TID_CMDLINE, "cmdline", S_IFREG|S_IRUGO),
+ E(PROC_TID_STAT, "stat", S_IFREG|S_IRUGO),
+ E(PROC_TID_STATM, "statm", S_IFREG|S_IRUGO),
+ E(PROC_TID_MAPS, "maps", S_IFREG|S_IRUGO),
+ E(PROC_TID_MEM, "mem", S_IFREG|S_IRUSR|S_IWUSR),
+ E(PROC_TID_CWD, "cwd", S_IFLNK|S_IRWXUGO),
+ E(PROC_TID_ROOT, "root", S_IFLNK|S_IRWXUGO),
+ E(PROC_TID_EXE, "exe", S_IFLNK|S_IRWXUGO),
+ E(PROC_TID_MOUNTS, "mounts", S_IFREG|S_IRUGO),
+#ifdef CONFIG_SECURITY
+ E(PROC_TID_ATTR, "attr", S_IFDIR|S_IRUGO|S_IXUGO),
+#endif
+#ifdef CONFIG_KALLSYMS
+ E(PROC_TID_WCHAN, "wchan", S_IFREG|S_IRUGO),
+#endif
+ {0,0,NULL,0}
+};
+
#ifdef CONFIG_SECURITY
-static struct pid_entry attr_stuff[] = {
- E(PROC_PID_ATTR_CURRENT, "current", S_IFREG|S_IRUGO|S_IWUGO),
- E(PROC_PID_ATTR_PREV, "prev", S_IFREG|S_IRUGO),
- E(PROC_PID_ATTR_EXEC, "exec", S_IFREG|S_IRUGO|S_IWUGO),
- E(PROC_PID_ATTR_FSCREATE, "fscreate", S_IFREG|S_IRUGO|S_IWUGO),
- {0,0,NULL,0}
+static struct pid_entry tgid_attr_stuff[] = {
+ E(PROC_TGID_ATTR_CURRENT, "current", S_IFREG|S_IRUGO|S_IWUGO),
+ E(PROC_TGID_ATTR_PREV, "prev", S_IFREG|S_IRUGO),
+ E(PROC_TGID_ATTR_EXEC, "exec", S_IFREG|S_IRUGO|S_IWUGO),
+ E(PROC_TGID_ATTR_FSCREATE, "fscreate", S_IFREG|S_IRUGO|S_IWUGO),
+ {0,0,NULL,0}
+};
+static struct pid_entry tid_attr_stuff[] = {
+ E(PROC_TID_ATTR_CURRENT, "current", S_IFREG|S_IRUGO|S_IWUGO),
+ E(PROC_TID_ATTR_PREV, "prev", S_IFREG|S_IRUGO),
+ E(PROC_TID_ATTR_EXEC, "exec", S_IFREG|S_IRUGO|S_IWUGO),
+ E(PROC_TID_ATTR_FSCREATE, "fscreate", S_IFREG|S_IRUGO|S_IWUGO),
+ {0,0,NULL,0}
};
#endif
+
#undef E
static inline struct task_struct *proc_task(struct inode *inode)
@@ -128,7 +183,7 @@ static int proc_fd_link(struct inode *inode, struct dentry **dentry, struct vfsm
struct task_struct *task = proc_task(inode);
struct files_struct *files;
struct file *file;
- int fd = proc_type(inode) - PROC_PID_FD_DIR;
+ int fd = proc_type(inode) - PROC_TID_FD_DIR;
task_lock(task);
files = task->files;
@@ -675,7 +730,7 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
{
struct inode *inode = filp->f_dentry->d_inode;
struct task_struct *p = proc_task(inode);
- unsigned int fd, pid, ino;
+ unsigned int fd, tid, ino;
int retval;
char buf[NUMBUF];
struct files_struct * files;
@@ -684,7 +739,7 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
if (!pid_alive(p))
goto out;
retval = 0;
- pid = p->pid;
+ tid = p->pid;
fd = filp->f_pos;
switch (fd) {
@@ -693,7 +748,7 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
goto out;
filp->f_pos++;
case 1:
- ino = fake_ino(pid, PROC_PID_INO);
+ ino = fake_ino(tid, PROC_TID_INO);
if (filldir(dirent, "..", 2, 1, ino, DT_DIR) < 0)
goto out;
filp->f_pos++;
@@ -723,7 +778,7 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir)
i /= 10;
} while (i);
- ino = fake_ino(pid, PROC_PID_FD_DIR + fd);
+ ino = fake_ino(tid, PROC_TID_FD_DIR + fd);
if (filldir(dirent, buf+j, NUMBUF-j, fd+2, ino, DT_LNK) < 0) {
spin_lock(&files->file_lock);
break;
@@ -792,11 +847,18 @@ out:
return ret;
}
-static int proc_base_readdir(struct file * filp,
+static int proc_tgid_base_readdir(struct file * filp,
+ void * dirent, filldir_t filldir)
+{
+ return proc_pident_readdir(filp,dirent,filldir,
+ tgid_base_stuff,ARRAY_SIZE(tgid_base_stuff));
+}
+
+static int proc_tid_base_readdir(struct file * filp,
void * dirent, filldir_t filldir)
{
return proc_pident_readdir(filp,dirent,filldir,
- base_stuff,ARRAY_SIZE(base_stuff));
+ tid_base_stuff,ARRAY_SIZE(tid_base_stuff));
}
/* building an inode */
@@ -843,7 +905,7 @@ static struct inode *proc_pid_make_inode(struct super_block * sb, struct task_st
ei->type = ino;
inode->i_uid = 0;
inode->i_gid = 0;
- if (ino == PROC_PID_INO || task_dumpable(task)) {
+ if (ino == PROC_TGID_INO || ino == PROC_TID_INO || task_dumpable(task)) {
inode->i_uid = task->euid;
inode->i_gid = task->egid;
}
@@ -873,7 +935,7 @@ static int pid_revalidate(struct dentry *dentry, struct nameidata *nd)
struct inode *inode = dentry->d_inode;
struct task_struct *task = proc_task(inode);
if (pid_alive(task)) {
- if (proc_type(inode) == PROC_PID_INO || task_dumpable(task)) {
+ if (proc_type(inode) == PROC_TGID_INO || proc_type(inode) == PROC_TID_INO || task_dumpable(task)) {
inode->i_uid = task->euid;
inode->i_gid = task->egid;
} else {
@@ -887,11 +949,11 @@ static int pid_revalidate(struct dentry *dentry, struct nameidata *nd)
return 0;
}
-static int pid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
+static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
{
struct inode *inode = dentry->d_inode;
struct task_struct *task = proc_task(inode);
- int fd = proc_type(inode) - PROC_PID_FD_DIR;
+ int fd = proc_type(inode) - PROC_TID_FD_DIR;
struct files_struct *files;
task_lock(task);
@@ -940,10 +1002,9 @@ static int pid_delete_dentry(struct dentry * dentry)
return !pid_alive(proc_task(dentry->d_inode));
}
-
-static struct dentry_operations pid_fd_dentry_operations =
+static struct dentry_operations tid_fd_dentry_operations =
{
- .d_revalidate = pid_fd_revalidate,
+ .d_revalidate = tid_fd_revalidate,
.d_delete = pid_delete_dentry,
};
@@ -999,7 +1060,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry,
if (!pid_alive(task))
goto out;
- inode = proc_pid_make_inode(dir->i_sb, task, PROC_PID_FD_DIR+fd);
+ inode = proc_pid_make_inode(dir->i_sb, task, PROC_TID_FD_DIR+fd);
if (!inode)
goto out;
ei = PROC_I(inode);
@@ -1024,7 +1085,7 @@ static struct dentry *proc_lookupfd(struct inode * dir, struct dentry * dentry,
inode->i_op = &proc_pid_link_inode_operations;
inode->i_size = 64;
ei->op.proc_get_link = proc_fd_link;
- dentry->d_op = &pid_fd_dentry_operations;
+ dentry->d_op = &tid_fd_dentry_operations;
d_add(dentry, inode);
return NULL;
@@ -1037,11 +1098,19 @@ out:
return ERR_PTR(-ENOENT);
}
+static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldir);
+static struct dentry *proc_task_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd);
+
static struct file_operations proc_fd_operations = {
.read = generic_read_dir,
.readdir = proc_readfd,
};
+static struct file_operations proc_task_operations = {
+ .read = generic_read_dir,
+ .readdir = proc_task_readdir,
+};
+
/*
* proc directories can do almost nothing..
*/
@@ -1050,6 +1119,11 @@ static struct inode_operations proc_fd_inode_operations = {
.permission = proc_permission,
};
+static struct inode_operations proc_task_inode_operations = {
+ .lookup = proc_task_lookup,
+ .permission = proc_permission,
+};
+
#ifdef CONFIG_SECURITY
static ssize_t proc_pid_attr_read(struct file * file, char * buf,
size_t count, loff_t *ppos)
@@ -1122,8 +1196,10 @@ static struct file_operations proc_pid_attr_operations = {
.write = proc_pid_attr_write,
};
-static struct file_operations proc_attr_operations;
-static struct inode_operations proc_attr_inode_operations;
+static struct file_operations proc_tid_attr_operations;
+static struct inode_operations proc_tid_attr_inode_operations;
+static struct file_operations proc_tgid_attr_operations;
+static struct inode_operations proc_tgid_attr_inode_operations;
#endif
/* SMP-safe */
@@ -1161,71 +1237,98 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
inode->i_mode = p->mode;
/*
* Yes, it does not scale. And it should not. Don't add
- * new entries into /proc/<pid>/ without very good reasons.
+ * new entries into /proc/<tgid>/ without very good reasons.
*/
switch(p->type) {
- case PROC_PID_FD:
+ case PROC_TGID_TASK:
+ inode->i_nlink = 3;
+ inode->i_op = &proc_task_inode_operations;
+ inode->i_fop = &proc_task_operations;
+ break;
+ case PROC_TID_FD:
+ case PROC_TGID_FD:
inode->i_nlink = 2;
inode->i_op = &proc_fd_inode_operations;
inode->i_fop = &proc_fd_operations;
break;
- case PROC_PID_EXE:
+ case PROC_TID_EXE:
+ case PROC_TGID_EXE:
inode->i_op = &proc_pid_link_inode_operations;
ei->op.proc_get_link = proc_exe_link;
break;
- case PROC_PID_CWD:
+ case PROC_TID_CWD:
+ case PROC_TGID_CWD:
inode->i_op = &proc_pid_link_inode_operations;
ei->op.proc_get_link = proc_cwd_link;
break;
- case PROC_PID_ROOT:
+ case PROC_TID_ROOT:
+ case PROC_TGID_ROOT:
inode->i_op = &proc_pid_link_inode_operations;
ei->op.proc_get_link = proc_root_link;
break;
- case PROC_PID_ENVIRON:
+ case PROC_TID_ENVIRON:
+ case PROC_TGID_ENVIRON:
inode->i_fop = &proc_info_file_operations;
ei->op.proc_read = proc_pid_environ;
break;
- case PROC_PID_STATUS:
+ case PROC_TID_STATUS:
+ case PROC_TGID_STATUS:
inode->i_fop = &proc_info_file_operations;
ei->op.proc_read = proc_pid_status;
break;
- case PROC_PID_STAT:
+ case PROC_TID_STAT:
+ case PROC_TGID_STAT:
inode->i_fop = &proc_info_file_operations;
ei->op.proc_read = proc_pid_stat;
break;
- case PROC_PID_CMDLINE:
+ case PROC_TID_CMDLINE:
+ case PROC_TGID_CMDLINE:
inode->i_fop = &proc_info_file_operations;
ei->op.proc_read = proc_pid_cmdline;
break;
- case PROC_PID_STATM:
+ case PROC_TID_STATM:
+ case PROC_TGID_STATM:
inode->i_fop = &proc_info_file_operations;
ei->op.proc_read = proc_pid_statm;
break;
- case PROC_PID_MAPS:
+ case PROC_TID_MAPS:
+ case PROC_TGID_MAPS:
inode->i_fop = &proc_maps_operations;
break;
- case PROC_PID_MEM:
+ case PROC_TID_MEM:
+ case PROC_TGID_MEM:
inode->i_op = &proc_mem_inode_operations;
inode->i_fop = &proc_mem_operations;
break;
- case PROC_PID_MOUNTS:
+ case PROC_TID_MOUNTS:
+ case PROC_TGID_MOUNTS:
inode->i_fop = &proc_mounts_operations;
break;
#ifdef CONFIG_SECURITY
- case PROC_PID_ATTR:
+ case PROC_TID_ATTR:
inode->i_nlink = 2;
- inode->i_op = &proc_attr_inode_operations;
- inode->i_fop = &proc_attr_operations;
+ inode->i_op = &proc_tid_attr_inode_operations;
+ inode->i_fop = &proc_tid_attr_operations;
break;
- case PROC_PID_ATTR_CURRENT:
- case PROC_PID_ATTR_PREV:
- case PROC_PID_ATTR_EXEC:
- case PROC_PID_ATTR_FSCREATE:
+ case PROC_TGID_ATTR:
+ inode->i_nlink = 2;
+ inode->i_op = &proc_tgid_attr_inode_operations;
+ inode->i_fop = &proc_tgid_attr_operations;
+ break;
+ case PROC_TID_ATTR_CURRENT:
+ case PROC_TGID_ATTR_CURRENT:
+ case PROC_TID_ATTR_PREV:
+ case PROC_TGID_ATTR_PREV:
+ case PROC_TID_ATTR_EXEC:
+ case PROC_TGID_ATTR_EXEC:
+ case PROC_TID_ATTR_FSCREATE:
+ case PROC_TGID_ATTR_FSCREATE:
inode->i_fop = &proc_pid_attr_operations;
break;
#endif
#ifdef CONFIG_KALLSYMS
- case PROC_PID_WCHAN:
+ case PROC_TID_WCHAN:
+ case PROC_TGID_WCHAN:
inode->i_fop = &proc_info_file_operations;
ei->op.proc_read = proc_pid_wchan;
break;
@@ -1243,40 +1346,75 @@ out:
return ERR_PTR(error);
}
-static struct dentry *proc_base_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd){
- return proc_pident_lookup(dir, dentry, base_stuff);
+static struct dentry *proc_tgid_base_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd){
+ return proc_pident_lookup(dir, dentry, tgid_base_stuff);
+}
+
+static struct dentry *proc_tid_base_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd){
+ return proc_pident_lookup(dir, dentry, tid_base_stuff);
}
-static struct file_operations proc_base_operations = {
+static struct file_operations proc_tgid_base_operations = {
.read = generic_read_dir,
- .readdir = proc_base_readdir,
+ .readdir = proc_tgid_base_readdir,
};
-static struct inode_operations proc_base_inode_operations = {
- .lookup = proc_base_lookup,
+static struct file_operations proc_tid_base_operations = {
+ .read = generic_read_dir,
+ .readdir = proc_tid_base_readdir,
+};
+
+static struct inode_operations proc_tgid_base_inode_operations = {
+ .lookup = proc_tgid_base_lookup,
+};
+
+static struct inode_operations proc_tid_base_inode_operations = {
+ .lookup = proc_tid_base_lookup,
};
#ifdef CONFIG_SECURITY
-static int proc_attr_readdir(struct file * filp,
+static int proc_tgid_attr_readdir(struct file * filp,
+ void * dirent, filldir_t filldir)
+{
+ return proc_pident_readdir(filp,dirent,filldir,
+ tgid_attr_stuff,ARRAY_SIZE(tgid_attr_stuff));
+}
+
+static int proc_tid_attr_readdir(struct file * filp,
void * dirent, filldir_t filldir)
{
return proc_pident_readdir(filp,dirent,filldir,
- attr_stuff,ARRAY_SIZE(attr_stuff));
+ tid_attr_stuff,ARRAY_SIZE(tid_attr_stuff));
}
-static struct file_operations proc_attr_operations = {
+static struct file_operations proc_tgid_attr_operations = {
+ .read = generic_read_dir,
+ .readdir = proc_tgid_attr_readdir,
+};
+
+static struct file_operations proc_tid_attr_operations = {
.read = generic_read_dir,
- .readdir = proc_attr_readdir,
+ .readdir = proc_tid_attr_readdir,
};
-static struct dentry *proc_attr_lookup(struct inode *dir,
+static struct dentry *proc_tgid_attr_lookup(struct inode *dir,
+ struct dentry *dentry, struct nameidata *nd)
+{
+ return proc_pident_lookup(dir, dentry, tgid_attr_stuff);
+}
+
+static struct dentry *proc_tid_attr_lookup(struct inode *dir,
struct dentry *dentry, struct nameidata *nd)
{
- return proc_pident_lookup(dir, dentry, attr_stuff);
+ return proc_pident_lookup(dir, dentry, tid_attr_stuff);
}
-static struct inode_operations proc_attr_inode_operations = {
- .lookup = proc_attr_lookup,
+static struct inode_operations proc_tgid_attr_inode_operations = {
+ .lookup = proc_tgid_attr_lookup,
+};
+
+static struct inode_operations proc_tid_attr_inode_operations = {
+ .lookup = proc_tid_attr_lookup,
};
#endif
@@ -1286,14 +1424,14 @@ static struct inode_operations proc_attr_inode_operations = {
static int proc_self_readlink(struct dentry *dentry, char *buffer, int buflen)
{
char tmp[30];
- sprintf(tmp, "%d", current->pid);
+ sprintf(tmp, "%d", current->tgid);
return vfs_readlink(dentry,buffer,buflen,tmp);
}
static int proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
{
char tmp[30];
- sprintf(tmp, "%d", current->pid);
+ sprintf(tmp, "%d", current->tgid);
return vfs_follow_link(nd,tmp);
}
@@ -1357,7 +1495,7 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct
struct task_struct *task;
struct inode *inode;
struct proc_inode *ei;
- unsigned pid;
+ unsigned tgid;
if (dentry->d_name.len == 4 && !memcmp(dentry->d_name.name,"self",4)) {
inode = new_inode(dir->i_sb);
@@ -1365,7 +1503,7 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct
return ERR_PTR(-ENOMEM);
ei = PROC_I(inode);
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
- inode->i_ino = fake_ino(0, PROC_PID_INO);
+ inode->i_ino = fake_ino(0, PROC_TGID_INO);
ei->pde = NULL;
inode->i_mode = S_IFLNK|S_IRWXUGO;
inode->i_uid = inode->i_gid = 0;
@@ -1374,19 +1512,64 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct
d_add(dentry, inode);
return NULL;
}
- pid = name_to_int(dentry);
- if (pid == ~0U)
+ tgid = name_to_int(dentry);
+ if (tgid == ~0U)
+ goto out;
+
+ read_lock(&tasklist_lock);
+ task = find_task_by_pid(tgid);
+ if (task)
+ get_task_struct(task);
+ read_unlock(&tasklist_lock);
+ if (!task)
+ goto out;
+
+ inode = proc_pid_make_inode(dir->i_sb, task, PROC_TGID_INO);
+
+
+ if (!inode) {
+ put_task_struct(task);
+ goto out;
+ }
+ inode->i_mode = S_IFDIR|S_IRUGO|S_IXUGO;
+ inode->i_op = &proc_tgid_base_inode_operations;
+ inode->i_fop = &proc_tgid_base_operations;
+ inode->i_nlink = 3;
+ inode->i_flags|=S_IMMUTABLE;
+
+ dentry->d_op = &pid_base_dentry_operations;
+
+ spin_lock(&task->proc_lock);
+ task->proc_dentry = dentry;
+ d_add(dentry, inode);
+ spin_unlock(&task->proc_lock);
+
+ put_task_struct(task);
+ return NULL;
+out:
+ return ERR_PTR(-ENOENT);
+}
+
+/* SMP-safe */
+static struct dentry *proc_task_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
+{
+ struct task_struct *task;
+ struct inode *inode;
+ unsigned tid;
+
+ tid = name_to_int(dentry);
+ if (tid == ~0U)
goto out;
read_lock(&tasklist_lock);
- task = find_task_by_pid(pid);
+ task = find_task_by_pid(tid);
if (task)
get_task_struct(task);
read_unlock(&tasklist_lock);
if (!task)
goto out;
- inode = proc_pid_make_inode(dir->i_sb, task, PROC_PID_INO);
+ inode = proc_pid_make_inode(dir->i_sb, task, PROC_TID_INO);
if (!inode) {
@@ -1394,8 +1577,8 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct
goto out;
}
inode->i_mode = S_IFDIR|S_IRUGO|S_IXUGO;
- inode->i_op = &proc_base_inode_operations;
- inode->i_fop = &proc_base_operations;
+ inode->i_op = &proc_tid_base_inode_operations;
+ inode->i_fop = &proc_tid_base_operations;
inode->i_nlink = 3;
inode->i_flags|=S_IMMUTABLE;
@@ -1416,55 +1599,84 @@ out:
#define PROC_MAXPIDS 20
/*
- * Get a few pid's to return for filldir - we need to hold the
+ * Get a few tgid's to return for filldir - we need to hold the
* tasklist lock while doing this, and we must release it before
* we actually do the filldir itself, so we use a temp buffer..
*/
-static int get_pid_list(int index, unsigned int *pids)
+static int get_tgid_list(int index, unsigned int *tgids)
{
struct task_struct *p;
- int nr_pids = 0;
+ int nr_tgids = 0;
index--;
read_lock(&tasklist_lock);
for_each_process(p) {
- int pid = p->pid;
+ int tgid = p->pid;
if (!pid_alive(p))
continue;
if (--index >= 0)
continue;
- pids[nr_pids] = pid;
- nr_pids++;
- if (nr_pids >= PROC_MAXPIDS)
+ tgids[nr_tgids] = tgid;
+ nr_tgids++;
+ if (nr_tgids >= PROC_MAXPIDS)
break;
}
read_unlock(&tasklist_lock);
- return nr_pids;
+ return nr_tgids;
}
+/*
+ * Get a few tid's to return for filldir - we need to hold the
+ * tasklist lock while doing this, and we must release it before
+ * we actually do the filldir itself, so we use a temp buffer..
+ */
+static int get_tid_list(int index, unsigned int *tids, struct inode *dir)
+{
+ struct task_struct *leader_task = proc_task(dir);
+ struct task_struct *task = leader_task;
+ int nr_tids = 0;
+
+ index -= 2;
+ read_lock(&tasklist_lock);
+ do {
+ int tid = task->pid;
+ if (!pid_alive(task))
+ continue;
+ if (--index >= 0)
+ continue;
+ tids[nr_tids] = tid;
+ nr_tids++;
+ if (nr_tids >= PROC_MAXPIDS)
+ break;
+ } while ((task = next_thread(task)) != leader_task);
+ read_unlock(&tasklist_lock);
+ return nr_tids;
+}
+
+/* for the /proc/ directory itself, after non-process stuff has been done */
int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
{
- unsigned int pid_array[PROC_MAXPIDS];
+ unsigned int tgid_array[PROC_MAXPIDS];
char buf[PROC_NUMBUF];
unsigned int nr = filp->f_pos - FIRST_PROCESS_ENTRY;
- unsigned int nr_pids, i;
+ unsigned int nr_tgids, i;
if (!nr) {
- ino_t ino = fake_ino(0,PROC_PID_INO);
+ ino_t ino = fake_ino(0,PROC_TGID_INO);
if (filldir(dirent, "self", 4, filp->f_pos, ino, DT_LNK) < 0)
return 0;
filp->f_pos++;
nr++;
}
- nr_pids = get_pid_list(nr, pid_array);
+ nr_tgids = get_tgid_list(nr, tgid_array);
- for (i = 0; i < nr_pids; i++) {
- int pid = pid_array[i];
- ino_t ino = fake_ino(pid,PROC_PID_INO);
+ for (i = 0; i < nr_tgids; i++) {
+ int tgid = tgid_array[i];
+ ino_t ino = fake_ino(tgid,PROC_TGID_INO);
unsigned long j = PROC_NUMBUF;
- do buf[--j] = '0' + (pid % 10); while (pid/=10);
+ do buf[--j] = '0' + (tgid % 10); while (tgid/=10);
if (filldir(dirent, buf+j, PROC_NUMBUF-j, filp->f_pos, ino, DT_DIR) < 0)
break;
@@ -1472,3 +1684,55 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir)
}
return 0;
}
+
+/* for the /proc/TGID/task/ directories */
+static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldir)
+{
+ unsigned int tid_array[PROC_MAXPIDS];
+ char buf[PROC_NUMBUF];
+ unsigned int nr_tids, i;
+ struct dentry *dentry = filp->f_dentry;
+ struct inode *inode = dentry->d_inode;
+ int retval = -ENOENT;
+ ino_t ino;
+ unsigned long pos = filp->f_pos; /* avoiding "long long" filp->f_pos */
+
+ if (!pid_alive(proc_task(inode)))
+ goto out;
+ retval = 0;
+
+ switch (pos) {
+ case 0:
+ ino = inode->i_ino;
+ if (filldir(dirent, ".", 1, pos, ino, DT_DIR) < 0)
+ goto out;
+ pos++;
+ /* fall through */
+ case 1:
+ ino = parent_ino(dentry);
+ if (filldir(dirent, "..", 2, pos, ino, DT_DIR) < 0)
+ goto out;
+ pos++;
+ /* fall through */
+ }
+
+ nr_tids = get_tid_list(pos, tid_array, inode);
+
+ for (i = 0; i < nr_tids; i++) {
+ unsigned long j = PROC_NUMBUF;
+ int tid = tid_array[i];
+
+ ino = fake_ino(tid,PROC_TID_INO);
+
+ do
+ buf[--j] = '0' + (tid % 10);
+ while (tid /= 10);
+
+ if (filldir(dirent, buf+j, PROC_NUMBUF-j, pos, ino, DT_DIR) < 0)
+ break;
+ pos++;
+ }
+out:
+ filp->f_pos = pos;
+ return retval;
+}
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index ff2e4ff85540..02d21630d495 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -784,7 +784,7 @@ int reiserfs_prepare_file_region_for_write(
/* Now if all the write area lies past the file end, no point in
maping blocks, since there is none, so we just zero out remaining
parts of first and last pages in write area (if needed) */
- if ( (pos & ~(PAGE_CACHE_SIZE - 1)) > inode->i_size ) {
+ if ( (pos & ~((loff_t)PAGE_CACHE_SIZE - 1)) > inode->i_size ) {
if ( from != 0 ) {/* First page needs to be partially zeroed */
char *kaddr = kmap_atomic(prepared_pages[0], KM_USER0);
memset(kaddr, 0, from);
@@ -806,9 +806,9 @@ int reiserfs_prepare_file_region_for_write(
we need to allocate (calculated above) */
/* Mask write position to start on blocksize, we do it out of the
loop for performance reasons */
- pos &= ~(inode->i_sb->s_blocksize - 1);
+ pos &= ~((loff_t) inode->i_sb->s_blocksize - 1);
/* Set cpu key to the starting position in a file (on left block boundary)*/
- make_cpu_key (&key, inode, 1 + ((pos) & ~(inode->i_sb->s_blocksize - 1)), TYPE_ANY, 3/*key length*/);
+ make_cpu_key (&key, inode, 1 + ((pos) & ~((loff_t) inode->i_sb->s_blocksize - 1)), TYPE_ANY, 3/*key length*/);
reiserfs_write_lock(inode->i_sb); // We need that for at least search_by_key()
for ( i = 0; i < num_pages ; i++ ) {
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 803d414747e3..8950c7fb0209 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -1406,6 +1406,10 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb, struct buffe
*newest_mount_id) ;
return -1 ;
}
+ if ( get_desc_trans_len(desc) > SB_JOURNAL_TRANS_MAX(p_s_sb) ) {
+ reiserfs_warning("journal-2018: Bad transaction length %d encountered, ignoring transaction\n", get_desc_trans_len(desc));
+ return -1 ;
+ }
offset = d_bh->b_blocknr - SB_ONDISK_JOURNAL_1st_BLOCK(p_s_sb) ;
/* ok, we have a journal description block, lets see if the transaction was valid */
@@ -1422,11 +1426,12 @@ static int journal_transaction_is_valid(struct super_block *p_s_sb, struct buffe
get_commit_trans_id (commit),
get_commit_trans_len(commit));
brelse(c_bh) ;
- if (oldest_invalid_trans_id)
- *oldest_invalid_trans_id = get_desc_trans_id(desc) ;
+ if (oldest_invalid_trans_id) {
+ *oldest_invalid_trans_id = get_desc_trans_id(desc) ;
reiserfs_debug(p_s_sb, REISERFS_DEBUG_CODE, "journal-1004: "
"transaction_is_valid setting oldest invalid trans_id "
"to %d\n", get_desc_trans_id(desc)) ;
+ }
return -1;
}
brelse(c_bh) ;
@@ -1527,9 +1532,14 @@ static int journal_read_transaction(struct super_block *p_s_sb, unsigned long cu
} else {
real_blocks[i] = sb_getblk(p_s_sb, le32_to_cpu(commit->j_realblock[i - trans_half])) ;
}
+ if ( real_blocks[i]->b_blocknr > SB_BLOCK_COUNT(p_s_sb) ) {
+ reiserfs_warning("journal-1207: REPLAY FAILURE fsck required! Block to replay is outside of filesystem\n");
+ goto abort_replay;
+ }
/* make sure we don't try to replay onto log or reserved area */
if (is_block_in_log_or_reserved_area(p_s_sb, real_blocks[i]->b_blocknr)) {
reiserfs_warning("journal-1204: REPLAY FAILURE fsck required! Trying to replay onto a log block\n") ;
+abort_replay:
brelse_array(log_blocks, i) ;
brelse_array(real_blocks, i) ;
brelse(c_bh) ;
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 64892e35c677..fd4ca1a92836 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1264,6 +1264,18 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
printk("sh-2021: reiserfs_fill_super: can not find reiserfs on %s\n", reiserfs_bdevname (s));
goto error;
}
+
+ rs = SB_DISK_SUPER_BLOCK (s);
+ /* Let's do basic sanity check to verify that underlying device is not
+ smaller than the filesystem. If the check fails then abort and scream,
+ because bad stuff will happen otherwise. */
+ if ( s->s_bdev && s->s_bdev->bd_inode && i_size_read(s->s_bdev->bd_inode) < sb_block_count(rs)*sb_blocksize(rs) ) {
+ printk("Filesystem on %s cannot be mounted because it is bigger than the device\n", reiserfs_bdevname(s));
+ printk("You may need to run fsck or increase size of your LVM partition\n");
+ printk("Or may be you forgot to reboot after fdisk when it told you to\n");
+ goto error;
+ }
+
sbi->s_mount_state = SB_REISERFS_STATE(s);
sbi->s_mount_state = REISERFS_VALID_FS ;
@@ -1324,7 +1336,6 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
goto error ;
}
- rs = SB_DISK_SUPER_BLOCK (s);
if (is_reiserfs_3_5 (rs) || (is_reiserfs_jr (rs) && SB_VERSION (s) == REISERFS_VERSION_1))
set_bit(REISERFS_3_5, &(sbi->s_properties));
else
diff --git a/fs/xfs/linux/xfs_sysctl.c b/fs/xfs/linux/xfs_sysctl.c
index 48d58aec008f..076d966c2149 100644
--- a/fs/xfs/linux/xfs_sysctl.c
+++ b/fs/xfs/linux/xfs_sysctl.c
@@ -68,54 +68,54 @@ xfs_stats_clear_proc_handler(
STATIC ctl_table xfs_table[] = {
{XFS_RESTRICT_CHOWN, "restrict_chown", &xfs_params.restrict_chown.val,
- sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
+ sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.restrict_chown.min, &xfs_params.restrict_chown.max},
{XFS_SGID_INHERIT, "irix_sgid_inherit", &xfs_params.sgid_inherit.val,
- sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
+ sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.sgid_inherit.min, &xfs_params.sgid_inherit.max},
{XFS_SYMLINK_MODE, "irix_symlink_mode", &xfs_params.symlink_mode.val,
- sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
+ sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.symlink_mode.min, &xfs_params.symlink_mode.max},
{XFS_PANIC_MASK, "panic_mask", &xfs_params.panic_mask.val,
- sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
+ sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.panic_mask.min, &xfs_params.panic_mask.max},
{XFS_ERRLEVEL, "error_level", &xfs_params.error_level.val,
- sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
+ sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.error_level.min, &xfs_params.error_level.max},
{XFS_SYNC_INTERVAL, "sync_interval", &xfs_params.sync_interval.val,
- sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
+ sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.sync_interval.min, &xfs_params.sync_interval.max},
{XFS_INHERIT_SYNC, "inherit_sync", &xfs_params.inherit_sync.val,
- sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
+ sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.inherit_sync.min, &xfs_params.inherit_sync.max},
{XFS_INHERIT_NODUMP, "inherit_nodump", &xfs_params.inherit_nodump.val,
- sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
+ sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.inherit_nodump.min, &xfs_params.inherit_nodump.max},
{XFS_INHERIT_NOATIME, "inherit_noatime", &xfs_params.inherit_noatim.val,
- sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
+ sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&xfs_params.inherit_noatim.min, &xfs_params.inherit_noatim.max},
/* please keep this the last entry */
#ifdef CONFIG_PROC_FS
{XFS_STATS_CLEAR, "stats_clear", &xfs_params.stats_clear.val,
- sizeof(ulong), 0644, NULL, &xfs_stats_clear_proc_handler,
+ sizeof(int), 0644, NULL, &xfs_stats_clear_proc_handler,
&sysctl_intvec, NULL,
&xfs_params.stats_clear.min, &xfs_params.stats_clear.max},
#endif /* CONFIG_PROC_FS */
diff --git a/fs/xfs/linux/xfs_sysctl.h b/fs/xfs/linux/xfs_sysctl.h
index 35faa5ec0019..c08d419b1856 100644
--- a/fs/xfs/linux/xfs_sysctl.h
+++ b/fs/xfs/linux/xfs_sysctl.h
@@ -40,9 +40,9 @@
*/
typedef struct xfs_sysctl_val {
- ulong min;
- ulong val;
- ulong max;
+ int min;
+ int val;
+ int max;
} xfs_sysctl_val_t;
typedef struct xfs_param {
diff --git a/fs/xfs/linux/xfs_vnode.c b/fs/xfs/linux/xfs_vnode.c
index 7ee5693fccfe..c62f7ce95bf2 100644
--- a/fs/xfs/linux/xfs_vnode.c
+++ b/fs/xfs/linux/xfs_vnode.c
@@ -200,7 +200,7 @@ vn_revalidate(
vn_trace_entry(vp, "vn_revalidate", (inst_t *)__return_address);
ASSERT(vp->v_fbhv != NULL);
- va.va_mask = XFS_AT_STAT;
+ va.va_mask = XFS_AT_STAT|XFS_AT_GENCOUNT;
VOP_GETATTR(vp, &va, 0, NULL, error);
if (!error) {
inode = LINVFS_GET_IP(vp);
diff --git a/fs/xfs/pagebuf/page_buf.c b/fs/xfs/pagebuf/page_buf.c
index c7415e512d58..0f05f580fa18 100644
--- a/fs/xfs/pagebuf/page_buf.c
+++ b/fs/xfs/pagebuf/page_buf.c
@@ -1867,23 +1867,23 @@ STATIC struct ctl_table_header *pagebuf_table_header;
STATIC ctl_table pagebuf_table[] = {
{PB_FLUSH_INT, "flush_int", &pb_params.flush_interval.val,
- sizeof(ulong), 0644, NULL, &proc_doulongvec_ms_jiffies_minmax,
+ sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&pb_params.flush_interval.min, &pb_params.flush_interval.max},
{PB_FLUSH_AGE, "flush_age", &pb_params.age_buffer.val,
- sizeof(ulong), 0644, NULL, &proc_doulongvec_ms_jiffies_minmax,
+ sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&pb_params.age_buffer.min, &pb_params.age_buffer.max},
{PB_STATS_CLEAR, "stats_clear", &pb_params.stats_clear.val,
- sizeof(ulong), 0644, NULL, &pb_stats_clear_handler,
+ sizeof(int), 0644, NULL, &pb_stats_clear_handler,
&sysctl_intvec, NULL,
&pb_params.stats_clear.min, &pb_params.stats_clear.max},
#ifdef PAGEBUF_TRACE
{PB_DEBUG, "debug", &pb_params.debug.val,
- sizeof(ulong), 0644, NULL, &proc_doulongvec_minmax,
+ sizeof(int), 0644, NULL, &proc_dointvec_minmax,
&sysctl_intvec, NULL,
&pb_params.debug.min, &pb_params.debug.max},
#endif
diff --git a/fs/xfs/pagebuf/page_buf_internal.h b/fs/xfs/pagebuf/page_buf_internal.h
index 1e9b2c4befc4..5c79c10d6732 100644
--- a/fs/xfs/pagebuf/page_buf_internal.h
+++ b/fs/xfs/pagebuf/page_buf_internal.h
@@ -81,9 +81,9 @@ struct pagebuf_trace_buf {
*/
typedef struct pb_sysctl_val {
- ulong min;
- ulong val;
- ulong max;
+ int min;
+ int val;
+ int max;
} pb_sysctl_val_t;
typedef struct pagebuf_param {
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index a4b330ce5e0c..5cfefde3ac53 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -2166,9 +2166,9 @@ xfs_da_do_buf(
if (xfs_error_level >= XFS_ERRLEVEL_LOW) {
int i;
cmn_err(CE_ALERT, "xfs_da_do_buf: bno %lld\n",
- bno);
+ (long long)bno);
cmn_err(CE_ALERT, "dir: inode %lld\n",
- dp->i_ino);
+ (long long)dp->i_ino);
for (i = 0; i < nmap; i++) {
cmn_err(CE_ALERT,
"[%02d] br_startoff %lld br_startblock %lld br_blockcount %lld br_state %d\n",
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
index 6a2fd41178d7..26da19df7b94 100644
--- a/fs/xfs/xfs_dir2_node.c
+++ b/fs/xfs/xfs_dir2_node.c
@@ -1612,7 +1612,8 @@ xfs_dir2_node_addname_int(
if (XFS_DIR2_DB_TO_FDB(mp, dbno) != fbno) {
cmn_err(CE_ALERT,
"xfs_dir2_node_addname_int: needed block %lld, got %lld\n",
- XFS_DIR2_DB_TO_FDB(mp, dbno), fbno);
+ (long long)XFS_DIR2_DB_TO_FDB(mp, dbno),
+ (long long)fbno);
XFS_ERROR_REPORT("xfs_dir2_node_addname_int",
XFS_ERRLEVEL_LOW, mp);
return XFS_ERROR(EFSCORRUPTED);
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index bb31038a7c41..b15bc252d237 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -238,7 +238,7 @@ xfs_fs_cmn_err(int level, xfs_mount_t *mp, char *fmt, ...)
}
void
-xfs_cmn_err(uint64_t panic_tag, int level, xfs_mount_t *mp, char *fmt, ...)
+xfs_cmn_err(int panic_tag, int level, xfs_mount_t *mp, char *fmt, ...)
{
va_list ap;
diff --git a/fs/xfs/xfs_error.h b/fs/xfs/xfs_error.h
index 4d96abd0846a..f9c54f93776c 100644
--- a/fs/xfs/xfs_error.h
+++ b/fs/xfs/xfs_error.h
@@ -177,18 +177,18 @@ int xfs_errortag_clearall_umount(int64_t fsid, char *fsname,
* sysctl. update xfs_max[XFS_PARAM] if
* more are added.
*/
-#define XFS_NO_PTAG 0LL
-#define XFS_PTAG_IFLUSH 0x0000000000000001LL
-#define XFS_PTAG_LOGRES 0x0000000000000002LL
-#define XFS_PTAG_AILDELETE 0x0000000000000004LL
-#define XFS_PTAG_ERROR_REPORT 0x0000000000000008LL
-#define XFS_PTAG_SHUTDOWN_CORRUPT 0x0000000000000010LL
-#define XFS_PTAG_SHUTDOWN_IOERROR 0x0000000000000020LL
-#define XFS_PTAG_SHUTDOWN_LOGERROR 0x0000000000000040LL
+#define XFS_NO_PTAG 0
+#define XFS_PTAG_IFLUSH 0x00000001
+#define XFS_PTAG_LOGRES 0x00000002
+#define XFS_PTAG_AILDELETE 0x00000004
+#define XFS_PTAG_ERROR_REPORT 0x00000008
+#define XFS_PTAG_SHUTDOWN_CORRUPT 0x00000010
+#define XFS_PTAG_SHUTDOWN_IOERROR 0x00000020
+#define XFS_PTAG_SHUTDOWN_LOGERROR 0x00000040
struct xfs_mount;
/* PRINTFLIKE4 */
-void xfs_cmn_err(uint64_t panic_tag, int level, struct xfs_mount *mp,
+void xfs_cmn_err(int panic_tag, int level, struct xfs_mount *mp,
char *fmt, ...);
/* PRINTFLIKE3 */
void xfs_fs_cmn_err(int level, struct xfs_mount *mp, char *fmt, ...);
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index e5f071245869..beadcaeb6299 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -3672,7 +3672,7 @@ xfs_ichgtime(xfs_inode_t *ip,
SYNCHRONIZE();
ip->i_update_core = 1;
if (!(inode->i_state & I_LOCK))
- mark_inode_dirty(inode);
+ mark_inode_dirty_sync(inode);
}
#ifdef XFS_ILOCK_TRACE
diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h
index 830d6f73bea1..fe03e7309686 100644
--- a/include/asm-alpha/processor.h
+++ b/include/asm-alpha/processor.h
@@ -29,7 +29,6 @@
/*
* Bus types
*/
-#define EISA_bus 1
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-alpha/signal.h b/include/asm-alpha/signal.h
index 27282f335de4..e24248f01340 100644
--- a/include/asm-alpha/signal.h
+++ b/include/asm-alpha/signal.h
@@ -71,7 +71,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-arm/arch-iop3xx/iop321-irqs.h b/include/asm-arm/arch-iop3xx/iop321-irqs.h
index 6e757b819105..9d5518da56fc 100644
--- a/include/asm-arm/arch-iop3xx/iop321-irqs.h
+++ b/include/asm-arm/arch-iop3xx/iop321-irqs.h
@@ -10,6 +10,7 @@
*
*/
+#include <linux/config.h>
/*
* IOP80321 chipset interrupts
diff --git a/include/asm-arm/arch-iop3xx/irqs.h b/include/asm-arm/arch-iop3xx/irqs.h
index 7468fab71d94..1df33024c8ea 100644
--- a/include/asm-arm/arch-iop3xx/irqs.h
+++ b/include/asm-arm/arch-iop3xx/irqs.h
@@ -10,6 +10,8 @@
*
*/
+#include <linux/config.h>
+
/*
* Whic iop3xx implementation is this?
*/
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h
index 9faf4e77b305..638bd35d7964 100644
--- a/include/asm-arm/arch-pxa/hardware.h
+++ b/include/asm-arm/arch-pxa/hardware.h
@@ -13,7 +13,6 @@
#ifndef __ASM_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H
-#include <linux/config.h>
#include <asm/mach-types.h>
diff --git a/include/asm-arm/arch-pxa/ide.h b/include/asm-arm/arch-pxa/ide.h
index 926797e14a06..71a2e11b0206 100644
--- a/include/asm-arm/arch-pxa/ide.h
+++ b/include/asm-arm/arch-pxa/ide.h
@@ -14,7 +14,6 @@
*
*/
-#include <linux/config.h>
#include <asm/irq.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
diff --git a/include/asm-arm/arch-pxa/idp.h b/include/asm-arm/arch-pxa/idp.h
index 63932060242e..e496ed7f496a 100644
--- a/include/asm-arm/arch-pxa/idp.h
+++ b/include/asm-arm/arch-pxa/idp.h
@@ -12,6 +12,7 @@
*
*/
+#include <linux/config.h>
/*
* Note: this file must be safe to include in assembly files
diff --git a/include/asm-arm/arch-pxa/irqs.h b/include/asm-arm/arch-pxa/irqs.h
index 6d452434eabc..ba16af5ee41a 100644
--- a/include/asm-arm/arch-pxa/irqs.h
+++ b/include/asm-arm/arch-pxa/irqs.h
@@ -10,6 +10,8 @@
* published by the Free Software Foundation.
*/
+#include <linux/config.h>
+
#define PXA_IRQ_SKIP 7 /* The first 7 IRQs are not yet used */
#define PXA_IRQ(x) ((x) - PXA_IRQ_SKIP)
diff --git a/include/asm-arm/arch-pxa/keyboard.h b/include/asm-arm/arch-pxa/keyboard.h
index 8cd10f1aa231..7bec3179b189 100644
--- a/include/asm-arm/arch-pxa/keyboard.h
+++ b/include/asm-arm/arch-pxa/keyboard.h
@@ -7,7 +7,6 @@
#ifndef _PXA_KEYBOARD_H
#define _PXA_KEYBOARD_H
-#include <linux/config.h>
#include <asm/mach-types.h>
#include <asm/hardware.h>
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index 1823479b1057..15b8ddd50065 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -10,6 +10,7 @@
* published by the Free Software Foundation.
*/
+#include <linux/config.h>
// FIXME hack so that SA-1111.h will work [cb]
diff --git a/include/asm-arm/arch-sa1100/serial.h b/include/asm-arm/arch-sa1100/serial.h
index 74ebcd5c669c..a6a2267a2dfa 100644
--- a/include/asm-arm/arch-sa1100/serial.h
+++ b/include/asm-arm/arch-sa1100/serial.h
@@ -7,6 +7,8 @@
* This is included by serial.c -- serial_sa1100.c makes no use of it.
*/
+#include <linux/config.h>
+
/* Standard COM flags */
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
diff --git a/include/asm-arm/arch-sa1100/trizeps.h b/include/asm-arm/arch-sa1100/trizeps.h
index b9cc02bac5d9..1802947011be 100644
--- a/include/asm-arm/arch-sa1100/trizeps.h
+++ b/include/asm-arm/arch-sa1100/trizeps.h
@@ -13,6 +13,8 @@
#ifndef _ASM_ARCH_TRIZEPS_H_
#define _ASM_ARCH_TRIZEPS_H_
+#include <linux/config.h>
+
#ifdef CONFIG_TRIZEPS_MFTB2
#include "mftb2.h"
#endif
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h
index 30a47cba4d4b..cff6d6f05913 100644
--- a/include/asm-arm/cacheflush.h
+++ b/include/asm-arm/cacheflush.h
@@ -10,6 +10,7 @@
#ifndef _ASMARM_CACHEFLUSH_H
#define _ASMARM_CACHEFLUSH_H
+#include <linux/config.h>
#include <linux/sched.h>
#include <linux/mm.h>
diff --git a/include/asm-arm/glue.h b/include/asm-arm/glue.h
index 932f523d92dd..d211a21213ce 100644
--- a/include/asm-arm/glue.h
+++ b/include/asm-arm/glue.h
@@ -90,7 +90,7 @@
# endif
#endif
-#ifdef CONFIG_CPU_ABORT_EV5T
+#ifdef CONFIG_CPU_ABRT_EV5T
# ifdef CPU_ABORT_HANDLER
# define MULTI_ABORT 1
# else
diff --git a/include/asm-arm/mmu.h b/include/asm-arm/mmu.h
index c33797d6cc7b..a457cb71984f 100644
--- a/include/asm-arm/mmu.h
+++ b/include/asm-arm/mmu.h
@@ -1,8 +1,6 @@
#ifndef __ARM_MMU_H
#define __ARM_MMU_H
-#include <linux/config.h>
-
typedef struct {
#if __LINUX_ARM_ARCH__ >= 6
unsigned int id;
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index 5b23a0a59778..9a09fb19258b 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -10,7 +10,6 @@
#ifndef _ASMARM_PGTABLE_H
#define _ASMARM_PGTABLE_H
-#include <linux/config.h>
#include <asm/memory.h>
#include <asm/proc-fns.h>
#include <asm/arch/vmalloc.h>
diff --git a/include/asm-arm/processor.h b/include/asm-arm/processor.h
index 31c888ba601c..3890d6038355 100644
--- a/include/asm-arm/processor.h
+++ b/include/asm-arm/processor.h
@@ -19,7 +19,6 @@
#ifdef __KERNEL__
-#define EISA_bus 0
#define MCA_bus 0
#define MCA_bus__is_a_macro
diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h
index eb59aa539b9c..6d623e24c0fb 100644
--- a/include/asm-arm/signal.h
+++ b/include/asm-arm/signal.h
@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
#define SIGSWI 32
diff --git a/include/asm-arm26/processor.h b/include/asm-arm26/processor.h
index 8f9f6ad53474..9e0d90433795 100644
--- a/include/asm-arm26/processor.h
+++ b/include/asm-arm26/processor.h
@@ -20,7 +20,6 @@
#ifdef __KERNEL__
-#define EISA_bus 0
#define MCA_bus 0
#define MCA_bus__is_a_macro
diff --git a/include/asm-arm26/signal.h b/include/asm-arm26/signal.h
index e166988dbd5c..6f62e51a2e5a 100644
--- a/include/asm-arm26/signal.h
+++ b/include/asm-arm26/signal.h
@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
#define SIGSWI 32
diff --git a/include/asm-cris/signal.h b/include/asm-cris/signal.h
index 1335bf27d8e2..3f187ec4800a 100644
--- a/include/asm-cris/signal.h
+++ b/include/asm-cris/signal.h
@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-generic/cpumask_arith.h b/include/asm-generic/cpumask_arith.h
index bd8712d38fee..c19a0a6e45f0 100644
--- a/include/asm-generic/cpumask_arith.h
+++ b/include/asm-generic/cpumask_arith.h
@@ -27,7 +27,12 @@
#define cpus_shift_right(dst, src, n) do { dst = (src) >> (n); } while (0)
#define cpus_shift_left(dst, src, n) do { dst = (src) << (n); } while (0)
-#define any_online_cpu(map) ({ (map) ? first_cpu(map) : NR_CPUS; })
+#define any_online_cpu(map) \
+({ \
+ cpumask_t __tmp__; \
+ cpus_and(__tmp__, map, cpu_online_map); \
+ __tmp__ ? first_cpu(__tmp__) : NR_CPUS; \
+})
#define CPU_MASK_ALL (~((cpumask_t)0) >> (8*sizeof(cpumask_t) - NR_CPUS))
#define CPU_MASK_NONE ((cpumask_t)0)
diff --git a/include/asm-generic/cpumask_array.h b/include/asm-generic/cpumask_array.h
index 991a04bf7062..60c955d823b7 100644
--- a/include/asm-generic/cpumask_array.h
+++ b/include/asm-generic/cpumask_array.h
@@ -36,7 +36,13 @@
cpu_set(cpu, __cpu_mask); \
__cpu_mask; \
})
-#define any_online_cpu(map) find_first_bit((map).mask, NR_CPUS)
+#define any_online_cpu(map) \
+({ \
+ cpumask_t __tmp__; \
+ cpus_and(__tmp__, map, cpu_online_map); \
+ find_first_bit(__tmp__.mask, NR_CPUS); \
+})
+
/*
* um, these need to be usable as static initializers
diff --git a/include/asm-h8300/processor.h b/include/asm-h8300/processor.h
index 819c9b34e152..a0bc63dd8b2b 100644
--- a/include/asm-h8300/processor.h
+++ b/include/asm-h8300/processor.h
@@ -48,7 +48,6 @@ extern inline void wrusp(unsigned long usp) {
/*
* Bus types
*/
-#define EISA_bus 0
#define MCA_bus 0
struct thread_struct {
diff --git a/include/asm-h8300/signal.h b/include/asm-h8300/signal.h
index 460d8a6f69f4..6612725c2297 100644
--- a/include/asm-h8300/signal.h
+++ b/include/asm-h8300/signal.h
@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-i386/genapic.h b/include/asm-i386/genapic.h
index cd4b708133c3..76465ccbbdf8 100644
--- a/include/asm-i386/genapic.h
+++ b/include/asm-i386/genapic.h
@@ -30,6 +30,7 @@ struct genapic {
unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
unsigned long (*check_apicid_present)(int apicid);
int no_balance_irq;
+ int no_ioapic_check;
void (*init_apic_ldr)(void);
physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
@@ -77,6 +78,7 @@ struct genapic {
.int_dest_mode = INT_DEST_MODE, \
.apic_broadcast_id = APIC_BROADCAST_ID, \
.no_balance_irq = NO_BALANCE_IRQ, \
+ .no_ioapic_check = NO_IOAPIC_CHECK, \
APICFUNC(apic_id_registered), \
APICFUNC(target_cpus), \
APICFUNC(check_apicid_used), \
diff --git a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-i386/mach-bigsmp/mach_apic.h
index dab6aa34c6fa..0e9855144660 100644
--- a/include/asm-i386/mach-bigsmp/mach_apic.h
+++ b/include/asm-i386/mach-bigsmp/mach_apic.h
@@ -14,6 +14,8 @@
#define NO_BALANCE_IRQ (1)
#define esr_disable (1)
+#define NO_IOAPIC_CHECK (0)
+
static inline int apic_id_registered(void)
{
return (1);
diff --git a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h
index a96477cf10a0..8875f34285bd 100644
--- a/include/asm-i386/mach-default/mach_apic.h
+++ b/include/asm-i386/mach-default/mach_apic.h
@@ -18,6 +18,8 @@ static inline cpumask_t target_cpus(void)
#define NO_BALANCE_IRQ (0)
#define esr_disable (0)
+#define NO_IOAPIC_CHECK (0)
+
#define INT_DELIVERY_MODE dest_LowestPrio
#define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */
diff --git a/include/asm-i386/mach-generic/mach_apic.h b/include/asm-i386/mach-generic/mach_apic.h
index 71b4849614bc..21f0e75f1b25 100644
--- a/include/asm-i386/mach-generic/mach_apic.h
+++ b/include/asm-i386/mach-generic/mach_apic.h
@@ -5,6 +5,7 @@
#define esr_disable (genapic->esr_disable)
#define NO_BALANCE_IRQ (genapic->no_balance_irq)
+#define NO_IOAPIC_CHECK (genapic->no_ioapic_check)
#define APIC_BROADCAST_ID (genapic->apic_broadcast_id)
#define INT_DELIVERY_MODE (genapic->int_delivery_mode)
#define INT_DEST_MODE (genapic->int_dest_mode)
diff --git a/include/asm-i386/mach-numaq/mach_apic.h b/include/asm-i386/mach-numaq/mach_apic.h
index 98b4e5921aa8..814ee9aa2521 100644
--- a/include/asm-i386/mach-numaq/mach_apic.h
+++ b/include/asm-i386/mach-numaq/mach_apic.h
@@ -17,6 +17,8 @@ static inline cpumask_t target_cpus(void)
#define NO_BALANCE_IRQ (1)
#define esr_disable (1)
+#define NO_IOAPIC_CHECK (0)
+
#define INT_DELIVERY_MODE dest_LowestPrio
#define INT_DEST_MODE 0 /* physical delivery on LOCAL quad */
diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
index 73a4a1077e85..a10b4591737e 100644
--- a/include/asm-i386/mach-summit/mach_apic.h
+++ b/include/asm-i386/mach-summit/mach_apic.h
@@ -7,14 +7,13 @@
#define esr_disable (1)
#define NO_BALANCE_IRQ (0)
-#define XAPIC_DEST_CPUS_MASK 0x0Fu
-#define XAPIC_DEST_CLUSTER_MASK 0xF0u
+#define NO_IOAPIC_CHECK (1) /* Don't check I/O APIC ID for xAPIC */
-static inline unsigned long xapic_phys_to_log_apicid(int phys_apic)
-{
- return ( (1ul << ((phys_apic) & 0x3)) |
- ((phys_apic) & XAPIC_DEST_CLUSTER_MASK) );
-}
+/* In clustered mode, the high nibble of APIC ID is a cluster number.
+ * The low nibble is a 4-bit bitmap. */
+#define XAPIC_DEST_CPUS_SHIFT 4
+#define XAPIC_DEST_CPUS_MASK ((1u << XAPIC_DEST_CPUS_SHIFT) - 1)
+#define XAPIC_DEST_CLUSTER_MASK (XAPIC_DEST_CPUS_MASK << XAPIC_DEST_CPUS_SHIFT)
#define APIC_DFR_VALUE (APIC_DFR_CLUSTER)
@@ -40,15 +39,29 @@ static inline unsigned long check_apicid_present(int bit)
return 1;
}
-#define apicid_cluster(apicid) (apicid & 0xF0)
+#define apicid_cluster(apicid) ((apicid) & XAPIC_DEST_CLUSTER_MASK)
extern u8 bios_cpu_apicid[];
+extern u8 cpu_2_logical_apicid[];
static inline void init_apic_ldr(void)
{
unsigned long val, id;
-
- id = xapic_phys_to_log_apicid(hard_smp_processor_id());
+ int i, count;
+ u8 lid;
+ u8 my_id = (u8)hard_smp_processor_id();
+ u8 my_cluster = (u8)apicid_cluster(my_id);
+
+ /* Create logical APIC IDs by counting CPUs already in cluster. */
+ for (count = 0, i = NR_CPUS; --i >= 0; ) {
+ lid = cpu_2_logical_apicid[i];
+ if (lid != BAD_APICID && apicid_cluster(lid) == my_cluster)
+ ++count;
+ }
+ /* We only have a 4 wide bitmap in cluster mode. If a deranged
+ * BIOS puts 5 CPUs in one APIC cluster, we're hosed. */
+ BUG_ON(count >= XAPIC_DEST_CPUS_SHIFT);
+ id = my_cluster | (1UL << count);
apic_write_around(APIC_DFR, APIC_DFR_VALUE);
val = apic_read(APIC_LDR) & ~APIC_LDR_MASK;
val |= SET_APIC_LOGICAL_ID(id);
@@ -77,7 +90,6 @@ static inline int apicid_to_node(int logical_apicid)
}
/* Mapping from cpu number to logical apicid */
-extern u8 cpu_2_logical_apicid[];
static inline int cpu_to_logical_apicid(int cpu)
{
if (cpu >= NR_CPUS)
diff --git a/include/asm-i386/mach-visws/mach_apic.h b/include/asm-i386/mach-visws/mach_apic.h
index ab40e5c0f3e5..9a0208496458 100644
--- a/include/asm-i386/mach-visws/mach_apic.h
+++ b/include/asm-i386/mach-visws/mach_apic.h
@@ -8,6 +8,8 @@
#define no_balance_irq (0)
#define esr_disable (0)
+#define NO_IOAPIC_CHECK (0)
+
#define INT_DELIVERY_MODE dest_LowestPrio
#define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */
diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h
index cdae0e44df92..8587d7e3a2ae 100644
--- a/include/asm-i386/mmzone.h
+++ b/include/asm-i386/mmzone.h
@@ -122,11 +122,29 @@ static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn)
#elif CONFIG_ACPI_SRAT
#include <asm/srat.h>
#elif CONFIG_X86_PC
-#define get_memcfg_numa get_memcfg_numa_flat
#define get_zholes_size(n) (0)
#else
#define pfn_to_nid(pfn) (0)
#endif /* CONFIG_X86_NUMAQ */
+extern int get_memcfg_numa_flat(void );
+/*
+ * This allows any one NUMA architecture to be compiled
+ * for, and still fall back to the flat function if it
+ * fails.
+ */
+static inline void get_memcfg_numa(void)
+{
+#ifdef CONFIG_X86_NUMAQ
+ if (get_memcfg_numaq())
+ return;
+#elif CONFIG_ACPI_SRAT
+ if (get_memcfg_from_srat())
+ return;
+#endif
+
+ get_memcfg_numa_flat();
+}
+
#endif /* CONFIG_DISCONTIGMEM */
#endif /* _ASM_MMZONE_H_ */
diff --git a/include/asm-i386/numaq.h b/include/asm-i386/numaq.h
index de52624c6e0b..13eb04501378 100644
--- a/include/asm-i386/numaq.h
+++ b/include/asm-i386/numaq.h
@@ -29,8 +29,7 @@
#ifdef CONFIG_X86_NUMAQ
#define MAX_NUMNODES 16
-extern void get_memcfg_numaq(void);
-#define get_memcfg_numa() get_memcfg_numaq()
+extern int get_memcfg_numaq(void);
/*
* SYS_CFG_DATA_PRIV_ADDR, struct eachquadmem, and struct sys_cfg_data are the
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 9eb3f78ffd51..7a65d14b1dca 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -260,11 +260,6 @@ static inline void clear_in_cr4 (unsigned long mask)
* Bus types (default is ISA, but people can check others with these..)
* pc98 indicates PC98 systems (CBUS)
*/
-#ifdef CONFIG_EISA
-extern int EISA_bus;
-#else
-#define EISA_bus (0)
-#endif
extern int MCA_bus;
#ifdef CONFIG_X86_PC9800
#define pc98 1
diff --git a/include/asm-i386/signal.h b/include/asm-i386/signal.h
index 80b7d5fdef9b..e3397cd6f77b 100644
--- a/include/asm-i386/signal.h
+++ b/include/asm-i386/signal.h
@@ -70,7 +70,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-i386/srat.h b/include/asm-i386/srat.h
index b71cca0553c3..13563f45870e 100644
--- a/include/asm-i386/srat.h
+++ b/include/asm-i386/srat.h
@@ -32,8 +32,7 @@
#endif
#define MAX_NUMNODES 8
-extern void get_memcfg_from_srat(void);
+extern int get_memcfg_from_srat(void);
extern unsigned long *get_zholes_size(int);
-#define get_memcfg_numa() get_memcfg_from_srat()
#endif /* _ASM_SRAT_H_ */
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index d3eabf5b95c7..8042de63aa55 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -80,7 +80,7 @@ extern struct movsl_mask {
* checks that the pointer is in the user space range - after calling
* this function, memory access functions may still return -EFAULT.
*/
-#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
+#define access_ok(type,addr,size) (likely(__range_ok(addr,size) == 0))
/**
* verify_area: - Obsolete, use access_ok()
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
index 51d587edf419..66d1a35f2de0 100644
--- a/include/asm-ia64/acpi.h
+++ b/include/asm-ia64/acpi.h
@@ -30,6 +30,8 @@
#ifdef __KERNEL__
+#include <asm/system.h>
+
#define COMPILER_DEPENDENT_INT64 long
#define COMPILER_DEPENDENT_UINT64 unsigned long
diff --git a/include/asm-ia64/numa.h b/include/asm-ia64/numa.h
index a6a87c92689f..c3a26e12cd07 100644
--- a/include/asm-ia64/numa.h
+++ b/include/asm-ia64/numa.h
@@ -23,7 +23,7 @@
#include <linux/cache.h>
extern volatile char cpu_to_node_map[NR_CPUS] __cacheline_aligned;
-extern volatile unsigned long node_to_cpu_mask[NR_NODES] __cacheline_aligned;
+extern volatile cpumask_t node_to_cpu_mask[NR_NODES] __cacheline_aligned;
/* Stuff below this line could be architecture independent */
diff --git a/include/asm-ia64/param.h b/include/asm-ia64/param.h
index eaee5da9a787..f39d939ebb80 100644
--- a/include/asm-ia64/param.h
+++ b/include/asm-ia64/param.h
@@ -4,22 +4,10 @@
/*
* Fundamental kernel parameters.
*
- * Copyright (C) 1998, 1999, 2002 Hewlett-Packard Co
+ * Copyright (C) 1998, 1999, 2002-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
-#include <linux/config.h>
-
-#ifdef CONFIG_IA64_HP_SIM
-/*
- * Yeah, simulating stuff is slow, so let us catch some breath between
- * timer interrupts...
- */
-# define HZ 32
-#else
-# define HZ 1024
-#endif
-
#define EXEC_PAGESIZE 65536
#ifndef NGROUPS
@@ -33,8 +21,24 @@
#define MAXHOSTNAMELEN 64 /* max length of hostname */
#ifdef __KERNEL__
+# include <linux/config.h> /* mustn't include <linux/config.h> outside of #ifdef __KERNEL__ */
+# ifdef CONFIG_IA64_HP_SIM
+ /*
+ * Yeah, simulating stuff is slow, so let us catch some breath between
+ * timer interrupts...
+ */
+# define HZ 32
+# else
+# define HZ 1024
+# endif
# define USER_HZ HZ
# define CLOCKS_PER_SEC HZ /* frequency at which times() counts */
+#else
+ /*
+ * Technically, this is wrong, but some old apps still refer to it. The proper way to
+ * get the HZ value is via sysconf(_SC_CLK_TCK).
+ */
+# define HZ 1024
#endif
#endif /* _ASM_IA64_PARAM_H */
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index c6b4af2b3643..ed83487c5dc1 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -56,7 +56,6 @@
/*
* Bus types
*/
-#define EISA_bus 0
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-ia64/signal.h b/include/asm-ia64/signal.h
index f98d3bb65a92..5744b56571ba 100644
--- a/include/asm-ia64/signal.h
+++ b/include/asm-ia64/signal.h
@@ -50,7 +50,7 @@
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-ia64/sn/ksys/elsc.h b/include/asm-ia64/sn/ksys/elsc.h
index aa8272ad8580..987cc1b17e7e 100644
--- a/include/asm-ia64/sn/ksys/elsc.h
+++ b/include/asm-ia64/sn/ksys/elsc.h
@@ -9,9 +9,6 @@
#ifndef _ASM_SN_KSYS_ELSC_H
#define _ASM_SN_KSYS_ELSC_H
-#include <linux/config.h>
-#include <asm/sn/ksys/l1.h>
-
/*
* Error codes
*
diff --git a/include/asm-ia64/sn/ksys/l1.h b/include/asm-ia64/sn/ksys/l1.h
index beb89ad4cd1a..b7386fdbe50f 100644
--- a/include/asm-ia64/sn/ksys/l1.h
+++ b/include/asm-ia64/sn/ksys/l1.h
@@ -10,10 +10,7 @@
#ifndef _ASM_SN_KSYS_L1_H
#define _ASM_SN_KSYS_L1_H
-#include <linux/config.h>
-#include <asm/sn/vector.h>
-#include <asm/sn/addrs.h>
-#include <asm/atomic.h>
+#include <asm/sn/types.h>
/* L1 Target Addresses */
/*
@@ -39,18 +36,6 @@
#define L1_ADDR_TASK_BEDROCK 0x05 /* bedrock */
#define L1_ADDR_TASK_GENERAL 0x06 /* general requests */
-#define L1_ADDR_LOCAL \
- (L1_ADDR_TYPE_L1 << L1_ADDR_TYPE_SHFT) | \
- (L1_ADDR_RACK_LOCAL << L1_ADDR_RACK_SHFT) | \
- (L1_ADDR_BAY_LOCAL << L1_ADDR_BAY_SHFT)
-
-#define L1_ADDR_LOCALIO \
- (L1_ADDR_TYPE_IOBRICK << L1_ADDR_TYPE_SHFT) | \
- (L1_ADDR_RACK_LOCAL << L1_ADDR_RACK_SHFT) | \
- (L1_ADDR_BAY_LOCAL << L1_ADDR_BAY_SHFT)
-
-#define L1_ADDR_LOCAL_SHFT L1_ADDR_BAY_SHFT
-
/* response argument types */
#define L1_ARG_INT 0x00 /* 4-byte integer (big-endian) */
#define L1_ARG_ASCII 0x01 /* null-terminated ASCII string */
@@ -133,18 +118,6 @@
#define L1_EEP_IUSE 3 /* internal use area */
#define L1_EEP_SPD 4 /* serial presence detect record */
-typedef uint32_t l1addr_t;
-
-#define L1_BUILD_ADDR(addr,at,r,s,t) \
- (*(l1addr_t *)(addr) = ((l1addr_t)(at) << L1_ADDR_TYPE_SHFT) | \
- ((l1addr_t)(r) << L1_ADDR_RACK_SHFT) | \
- ((l1addr_t)(s) << L1_ADDR_BAY_SHFT) | \
- ((l1addr_t)(t) << L1_ADDR_TASK_SHFT))
-
-#define L1_ADDRESS_TO_TASK(addr,trb,tsk) \
- (*(l1addr_t *)(addr) = (l1addr_t)(trb) | \
- ((l1addr_t)(tsk) << L1_ADDR_TASK_SHFT))
-
#define L1_DISPLAY_LINE_LENGTH 12 /* L1 display characters/line */
#ifdef L1_DISP_2LINES
@@ -154,11 +127,9 @@ typedef uint32_t l1addr_t;
* to system software */
#endif
-#define bzero(d, n) memset((d), 0, (n))
-
int elsc_display_line(nasid_t nasid, char *line, int lnum);
-int iobrick_rack_bay_type_get( nasid_t nasid, uint *rack,
- uint *bay, uint *brick_type );
+int iobrick_rack_bay_type_get( nasid_t nasid, unsigned int *rack,
+ unsigned int *bay, unsigned int *brick_type );
int iobrick_module_get( nasid_t nasid );
diff --git a/include/asm-ia64/sn/nodepda.h b/include/asm-ia64/sn/nodepda.h
index b2ed848afa38..edf269398884 100644
--- a/include/asm-ia64/sn/nodepda.h
+++ b/include/asm-ia64/sn/nodepda.h
@@ -128,7 +128,7 @@ typedef struct irqpda_s irqpda_t;
* Check if given a compact node id the corresponding node has all the
* cpus disabled.
*/
-#define is_headless_node(cnode) (!node_to_cpumask(cnode))
+#define is_headless_node(cnode) (!any_online_cpu(node_to_cpumask(cnode)))
/*
* Check if given a node vertex handle the corresponding node has all the
diff --git a/include/asm-ia64/sn/pci/pcibr_private.h b/include/asm-ia64/sn/pci/pcibr_private.h
index 6e1cfde2c993..6c120927249c 100644
--- a/include/asm-ia64/sn/pci/pcibr_private.h
+++ b/include/asm-ia64/sn/pci/pcibr_private.h
@@ -15,11 +15,9 @@
* should ever peek into this file.
*/
-#include <linux/config.h>
#include <linux/pci.h>
#include <asm/sn/pci/pcibr.h>
#include <asm/sn/pci/pciio_private.h>
-#include <asm/sn/ksys/l1.h>
/*
* convenience typedefs
diff --git a/include/asm-ia64/sn/router.h b/include/asm-ia64/sn/router.h
index 1c280988539f..bbd7ba62a733 100644
--- a/include/asm-ia64/sn/router.h
+++ b/include/asm-ia64/sn/router.h
@@ -1,5 +1,4 @@
-
-/* $Id$
+/* $id$
*
* 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
@@ -19,7 +18,6 @@
#ifndef __ASSEMBLY__
-#include <linux/devfs_fs_kernel.h>
#include <asm/sn/vector.h>
#include <asm/sn/slotnum.h>
#include <asm/sn/arch.h>
@@ -31,23 +29,19 @@ typedef uint64_t router_reg_t;
#define MAX_ROUTER_PATH 80
#define ROUTER_REG_CAST (volatile router_reg_t *)
-#define PS_UINT_CAST (__psunsigned_t)
-#define UINT64_CAST (uint64_t)
typedef signed char port_no_t; /* Type for router port number */
#else
#define ROUTERREG_CAST
-#define PS_UINT_CAST
-#define UINT64_CAST
#endif /* __ASSEMBLY__ */
-#define MAX_ROUTER_PORTS (8) /* Max. number of ports on a router */
+#define MAX_ROUTER_PORTS 8 /* Max. number of ports on a router */
#define ALL_PORTS ((1 << MAX_ROUTER_PORTS) - 1) /* for 0 based references */
-#define PORT_INVALID (-1) /* Invalid port number */
+#define PORT_INVALID -1 /* Invalid port number */
#define IS_META(_rp) ((_rp)->flags & PCFG_ROUTER_META)
@@ -126,24 +120,24 @@ typedef signed char port_no_t; /* Type for router port number */
*/
#define RSRI_INPORT_SHFT 52
-#define RSRI_INPORT_MASK (UINT64_CAST 0xf << 52)
+#define RSRI_INPORT_MASK (0xfUL << 52)
#define RSRI_LINKWORKING_BIT(_L) (35 + 2 * (_L))
-#define RSRI_LINKWORKING(_L) (UINT64_CAST 1 << (35 + 2 * (_L)))
-#define RSRI_LINKRESETFAIL(_L) (UINT64_CAST 1 << (34 + 2 * (_L)))
+#define RSRI_LINKWORKING(_L) (1UL << (35 + 2 * (_L)))
+#define RSRI_LINKRESETFAIL(_L) (1UL << (34 + 2 * (_L)))
#define RSRI_LSTAT_SHFT(_L) (34 + 2 * (_L))
-#define RSRI_LSTAT_MASK(_L) (UINT64_CAST 0x3 << 34 + 2 * (_L))
-#define RSRI_LOCALSBERROR (UINT64_CAST 1 << 35)
-#define RSRI_LOCALSTUCK (UINT64_CAST 1 << 34)
-#define RSRI_LOCALBADVEC (UINT64_CAST 1 << 33)
-#define RSRI_LOCALTAILERR (UINT64_CAST 1 << 32)
+#define RSRI_LSTAT_MASK(_L) (0x3UL << 34 + 2 * (_L))
+#define RSRI_LOCALSBERROR (1UL << 35)
+#define RSRI_LOCALSTUCK (1UL << 34)
+#define RSRI_LOCALBADVEC (1UL << 33)
+#define RSRI_LOCALTAILERR (1UL << 32)
#define RSRI_LOCAL_SHFT 32
-#define RSRI_LOCAL_MASK (UINT64_CAST 0xf << 32)
+#define RSRI_LOCAL_MASK (0xfUL << 32)
#define RSRI_CHIPREV_SHFT 28
-#define RSRI_CHIPREV_MASK (UINT64_CAST 0xf << 28)
+#define RSRI_CHIPREV_MASK (0xfUL << 28)
#define RSRI_CHIPID_SHFT 12
-#define RSRI_CHIPID_MASK (UINT64_CAST 0xffff << 12)
+#define RSRI_CHIPID_MASK (0xffffUL << 12)
#define RSRI_MFGID_SHFT 1
-#define RSRI_MFGID_MASK (UINT64_CAST 0x7ff << 1)
+#define RSRI_MFGID_MASK (0x7ffUL << 1)
#define RSRI_LSTAT_WENTDOWN 0
#define RSRI_LSTAT_RESETFAIL 1
@@ -154,38 +148,38 @@ typedef signed char port_no_t; /* Type for router port number */
* RR_PORT_RESET mask definitions
*/
-#define RPRESET_WARM (UINT64_CAST 1 << 9)
-#define RPRESET_LINK(_L) (UINT64_CAST 1 << (_L))
-#define RPRESET_LOCAL (UINT64_CAST 1)
+#define RPRESET_WARM (1UL << 9)
+#define RPRESET_LINK(_L) (1UL << (_L))
+#define RPRESET_LOCAL 1UL
/*
* RR_PROT_CONF mask and shift definitions
*/
#define RPCONF_DIRCMPDIS_SHFT 13
-#define RPCONF_DIRCMPDIS_MASK (UINT64_CAST 1 << 13)
-#define RPCONF_FORCELOCAL (UINT64_CAST 1 << 12)
+#define RPCONF_DIRCMPDIS_MASK (1UL << 13)
+#define RPCONF_FORCELOCAL (1UL << 12)
#define RPCONF_FLOCAL_SHFT 12
#define RPCONF_METAID_SHFT 8
-#define RPCONF_METAID_MASK (UINT64_CAST 0xf << 8)
-#define RPCONF_RESETOK(_L) (UINT64_CAST 1 << ((_L) - 1))
+#define RPCONF_METAID_MASK (0xfUL << 8)
+#define RPCONF_RESETOK(_L) (1UL << ((_L) - 1))
/*
* RR_GLOBAL_PORT_DEF mask and shift definitions
*/
#define RGPD_MGLBLNHBR_ID_SHFT 12 /* -global neighbor ID */
-#define RGPD_MGLBLNHBR_ID_MASK (UINT64_CAST 0xf << 12)
+#define RGPD_MGLBLNHBR_ID_MASK (0xfUL << 12)
#define RGPD_MGLBLNHBR_VLD_SHFT 11 /* -global neighbor Valid */
-#define RGPD_MGLBLNHBR_VLD_MASK (UINT64_CAST 0x1 << 11)
+#define RGPD_MGLBLNHBR_VLD_MASK (0x1UL << 11)
#define RGPD_MGLBLPORT_SHFT 8 /* -global neighbor Port */
-#define RGPD_MGLBLPORT_MASK (UINT64_CAST 0x7 << 8)
+#define RGPD_MGLBLPORT_MASK (0x7UL << 8)
#define RGPD_PGLBLNHBR_ID_SHFT 4 /* +global neighbor ID */
-#define RGPD_PGLBLNHBR_ID_MASK (UINT64_CAST 0xf << 4)
+#define RGPD_PGLBLNHBR_ID_MASK (0xfUL << 4)
#define RGPD_PGLBLNHBR_VLD_SHFT 3 /* +global neighbor Valid */
-#define RGPD_PGLBLNHBR_VLD_MASK (UINT64_CAST 0x1 << 3)
+#define RGPD_PGLBLNHBR_VLD_MASK (0x1UL << 3)
#define RGPD_PGLBLPORT_SHFT 0 /* +global neighbor Port */
-#define RGPD_PGLBLPORT_MASK (UINT64_CAST 0x7 << 0)
+#define RGPD_PGLBLPORT_MASK (0x7UL << 0)
#define GLBL_PARMS_REGS 2 /* Two Global Parms registers */
@@ -194,95 +188,95 @@ typedef signed char port_no_t; /* Type for router port number */
*/
#define RGPARM0_ARB_VALUE_SHFT 54 /* Local Block Arbitration State */
-#define RGPARM0_ARB_VALUE_MASK (UINT64_CAST 0x7 << 54)
+#define RGPARM0_ARB_VALUE_MASK (0x7UL << 54)
#define RGPARM0_ROTATEARB_SHFT 53 /* Rotate Local Block Arbitration */
-#define RGPARM0_ROTATEARB_MASK (UINT64_CAST 0x1 << 53)
+#define RGPARM0_ROTATEARB_MASK (1UL << 53)
#define RGPARM0_FAIREN_SHFT 52 /* Fairness logic Enable */
-#define RGPARM0_FAIREN_MASK (UINT64_CAST 0x1 << 52)
+#define RGPARM0_FAIREN_MASK (1UL << 52)
#define RGPARM0_LOCGNTTO_SHFT 40 /* Local grant timeout */
-#define RGPARM0_LOCGNTTO_MASK (UINT64_CAST 0xfff << 40)
+#define RGPARM0_LOCGNTTO_MASK (0xfffUL << 40)
#define RGPARM0_DATELINE_SHFT 38 /* Dateline crossing router */
-#define RGPARM0_DATELINE_MASK (UINT64_CAST 0x1 << 38)
+#define RGPARM0_DATELINE_MASK (1UL << 38)
#define RGPARM0_MAXRETRY_SHFT 28 /* Max retry count */
-#define RGPARM0_MAXRETRY_MASK (UINT64_CAST 0x3ff << 28)
+#define RGPARM0_MAXRETRY_MASK (0x3ffUL << 28)
#define RGPARM0_URGWRAP_SHFT 20 /* Urgent wrap */
-#define RGPARM0_URGWRAP_MASK (UINT64_CAST 0xff << 20)
+#define RGPARM0_URGWRAP_MASK (0xffUL << 20)
#define RGPARM0_DEADLKTO_SHFT 16 /* Deadlock timeout */
-#define RGPARM0_DEADLKTO_MASK (UINT64_CAST 0xf << 16)
+#define RGPARM0_DEADLKTO_MASK (0xfUL << 16)
#define RGPARM0_URGVAL_SHFT 12 /* Urgent value */
-#define RGPARM0_URGVAL_MASK (UINT64_CAST 0xf << 12)
+#define RGPARM0_URGVAL_MASK (0xfUL << 12)
#define RGPARM0_VCHSELEN_SHFT 11 /* VCH_SEL_EN */
-#define RGPARM0_VCHSELEN_MASK (UINT64_CAST 0x1 << 11)
+#define RGPARM0_VCHSELEN_MASK (1UL << 11)
#define RGPARM0_LOCURGTO_SHFT 9 /* Local urgent timeout */
-#define RGPARM0_LOCURGTO_MASK (UINT64_CAST 0x3 << 9)
+#define RGPARM0_LOCURGTO_MASK (0x3UL << 9)
#define RGPARM0_TAILVAL_SHFT 5 /* Tail value */
-#define RGPARM0_TAILVAL_MASK (UINT64_CAST 0xf << 5)
+#define RGPARM0_TAILVAL_MASK (0xfUL << 5)
#define RGPARM0_CLOCK_SHFT 1 /* Global clock select */
-#define RGPARM0_CLOCK_MASK (UINT64_CAST 0xf << 1)
+#define RGPARM0_CLOCK_MASK (0xfUL << 1)
#define RGPARM0_BYPEN_SHFT 0
-#define RGPARM0_BYPEN_MASK (UINT64_CAST 1) /* Bypass enable */
+#define RGPARM0_BYPEN_MASK 1UL /* Bypass enable */
/*
* RR_GLOBAL_PARMS1 shift and mask definitions
*/
#define RGPARM1_TTOWRAP_SHFT 12 /* Tail timeout wrap */
-#define RGPARM1_TTOWRAP_MASK (UINT64_CAST 0xfffff << 12)
+#define RGPARM1_TTOWRAP_MASK (0xfffffUL << 12)
#define RGPARM1_AGERATE_SHFT 8 /* Age rate */
-#define RGPARM1_AGERATE_MASK (UINT64_CAST 0xf << 8)
+#define RGPARM1_AGERATE_MASK (0xfUL << 8)
#define RGPARM1_JSWSTAT_SHFT 0 /* JTAG Sw Register bits */
-#define RGPARM1_JSWSTAT_MASK (UINT64_CAST 0xff << 0)
+#define RGPARM1_JSWSTAT_MASK (0xffUL << 0)
/*
* RR_DIAG_PARMS mask and shift definitions
*/
-#define RDPARM_ABSHISTOGRAM (UINT64_CAST 1 << 17) /* Absolute histgrm */
-#define RDPARM_DEADLOCKRESET (UINT64_CAST 1 << 16) /* Reset on deadlck */
-#define RDPARM_DISABLE(_L) (UINT64_CAST 1 << ((_L) + 7))
-#define RDPARM_SENDERROR(_L) (UINT64_CAST 1 << ((_L) - 1))
+#define RDPARM_ABSHISTOGRAM (1UL << 17) /* Absolute histgrm */
+#define RDPARM_DEADLOCKRESET (1UL << 16) /* Reset on deadlck */
+#define RDPARM_DISABLE(_L) (1UL << ((_L) + 7))
+#define RDPARM_SENDERROR(_L) (1UL << ((_L) - 1))
/*
* RR_DEBUG_ADDR mask and shift definitions
*/
#define RDA_DATA_SHFT 10 /* Observed debug data */
-#define RDA_DATA_MASK (UINT64_CAST 0xffff << 10)
+#define RDA_DATA_MASK (0xffffUL << 10)
#define RDA_ADDR_SHFT 0 /* debug address for data */
-#define RDA_ADDR_MASK (UINT64_CAST 0x3ff << 0)
+#define RDA_ADDR_MASK (0x3ffUL << 0)
/*
* RR_LB_TO_L2 mask and shift definitions
*/
#define RLBTOL2_DATA_VLD_SHFT 32 /* data is valid for JTAG controller */
-#define RLBTOL2_DATA_VLD_MASK (UINT64_CAST 0x1 << 32)
+#define RLBTOL2_DATA_VLD_MASK (1UL << 32)
#define RLBTOL2_DATA_SHFT 0 /* data bits for JTAG controller */
-#define RLBTOL2_DATA_MASK (UINT64_CAST 0xffffffff)
+#define RLBTOL2_DATA_MASK 0xffffffffUL
/*
* RR_L2_TO_LB mask and shift definitions
*/
#define RL2TOLB_DATA_VLD_SHFT 33 /* data is valid from JTAG controller */
-#define RL2TOLB_DATA_VLD_MASK (UINT64_CAST 0x1 << 33)
+#define RL2TOLB_DATA_VLD_MASK (1UL << 33)
#define RL2TOLB_PARITY_SHFT 32 /* sw implemented parity for data */
-#define RL2TOLB_PARITY_MASK (UINT64_CAST 0x1 << 32)
+#define RL2TOLB_PARITY_MASK (1UL << 32)
#define RL2TOLB_DATA_SHFT 0 /* data bits from JTAG controller */
-#define RL2TOLB_DATA_MASK (UINT64_CAST 0xffffffff)
+#define RL2TOLB_DATA_MASK 0xffffffffUL
/*
* RR_JBUS_CONTROL mask and shift definitions
*/
#define RJC_POS_BITS_SHFT 20 /* Router position bits */
-#define RJC_POS_BITS_MASK (UINT64_CAST 0xf << 20)
+#define RJC_POS_BITS_MASK (0xfUL << 20)
#define RJC_RD_DATA_STROBE_SHFT 16 /* count when read data is strobed in */
-#define RJC_RD_DATA_STROBE_MASK (UINT64_CAST 0xf << 16)
+#define RJC_RD_DATA_STROBE_MASK (0xfUL << 16)
#define RJC_WE_OE_HOLD_SHFT 8 /* time OE or WE is held */
-#define RJC_WE_OE_HOLD_MASK (UINT64_CAST 0xff << 8)
+#define RJC_WE_OE_HOLD_MASK (0xffUL << 8)
#define RJC_ADDR_SET_HLD_SHFT 0 /* time address driven around OE/WE */
-#define RJC_ADDR_SET_HLD_MASK (UINT64_CAST 0xff)
+#define RJC_ADDR_SET_HLD_MASK 0xffUL
/*
* RR_SCRATCH_REGx mask and shift definitions
@@ -291,58 +285,58 @@ typedef signed char port_no_t; /* Type for router port number */
*/
#define RSCR0_BOOTED_SHFT 63
-#define RSCR0_BOOTED_MASK (UINT64_CAST 0x1 << RSCR0_BOOTED_SHFT)
+#define RSCR0_BOOTED_MASK (0x1UL << RSCR0_BOOTED_SHFT)
#define RSCR0_LOCALID_SHFT 56
-#define RSCR0_LOCALID_MASK (UINT64_CAST 0x7f << RSCR0_LOCALID_SHFT)
+#define RSCR0_LOCALID_MASK (0x7fUL << RSCR0_LOCALID_SHFT)
#define RSCR0_UNUSED_SHFT 48
-#define RSCR0_UNUSED_MASK (UINT64_CAST 0xff << RSCR0_UNUSED_SHFT)
+#define RSCR0_UNUSED_MASK (0xffUL << RSCR0_UNUSED_SHFT)
#define RSCR0_NIC_SHFT 0
-#define RSCR0_NIC_MASK (UINT64_CAST 0xffffffffffff)
+#define RSCR0_NIC_MASK 0xffffffffffffUL
#define RSCR1_MODID_SHFT 0
-#define RSCR1_MODID_MASK (UINT64_CAST 0xffff)
+#define RSCR1_MODID_MASK 0xffffUL
/*
* RR_VECTOR_HW_BAR mask and shift definitions
*/
#define BAR_TX_SHFT 27 /* Barrier in trans(m)it when read */
-#define BAR_TX_MASK (UINT64_CAST 1 << BAR_TX_SHFT)
+#define BAR_TX_MASK (1UL << BAR_TX_SHFT)
#define BAR_VLD_SHFT 26 /* Valid Configuration */
-#define BAR_VLD_MASK (UINT64_CAST 1 << BAR_VLD_SHFT)
+#define BAR_VLD_MASK (1UL << BAR_VLD_SHFT)
#define BAR_SEQ_SHFT 24 /* Sequence number */
-#define BAR_SEQ_MASK (UINT64_CAST 3 << BAR_SEQ_SHFT)
+#define BAR_SEQ_MASK (3UL << BAR_SEQ_SHFT)
#define BAR_LEAFSTATE_SHFT 18 /* Leaf State */
-#define BAR_LEAFSTATE_MASK (UINT64_CAST 0x3f << BAR_LEAFSTATE_SHFT)
+#define BAR_LEAFSTATE_MASK (0x3fUL << BAR_LEAFSTATE_SHFT)
#define BAR_PARENT_SHFT 14 /* Parent Port */
-#define BAR_PARENT_MASK (UINT64_CAST 0xf << BAR_PARENT_SHFT)
+#define BAR_PARENT_MASK (0xfUL << BAR_PARENT_SHFT)
#define BAR_CHILDREN_SHFT 6 /* Child Select port bits */
-#define BAR_CHILDREN_MASK (UINT64_CAST 0xff << BAR_CHILDREN_SHFT)
+#define BAR_CHILDREN_MASK (0xffUL << BAR_CHILDREN_SHFT)
#define BAR_LEAFCOUNT_SHFT 0 /* Leaf Count to trigger parent */
-#define BAR_LEAFCOUNT_MASK (UINT64_CAST 0x3f)
+#define BAR_LEAFCOUNT_MASK 0x3fUL
/*
* RR_PORT_PARMS(_L) mask and shift definitions
*/
#define RPPARM_MIPRESETEN_SHFT 29 /* Message In Progress reset enable */
-#define RPPARM_MIPRESETEN_MASK (UINT64_CAST 0x1 << 29)
+#define RPPARM_MIPRESETEN_MASK (0x1UL << 29)
#define RPPARM_UBAREN_SHFT 28 /* Enable user barrier requests */
-#define RPPARM_UBAREN_MASK (UINT64_CAST 0x1 << 28)
+#define RPPARM_UBAREN_MASK (0x1UL << 28)
#define RPPARM_OUTPDTO_SHFT 24 /* Output Port Deadlock TO value */
-#define RPPARM_OUTPDTO_MASK (UINT64_CAST 0xf << 24)
+#define RPPARM_OUTPDTO_MASK (0xfUL << 24)
#define RPPARM_PORTMATE_SHFT 21 /* Port Mate for the port */
-#define RPPARM_PORTMATE_MASK (UINT64_CAST 0x7 << 21)
+#define RPPARM_PORTMATE_MASK (0x7UL << 21)
#define RPPARM_HISTEN_SHFT 20 /* Histogram counter enable */
-#define RPPARM_HISTEN_MASK (UINT64_CAST 0x1 << 20)
+#define RPPARM_HISTEN_MASK (0x1UL << 20)
#define RPPARM_HISTSEL_SHFT 18
-#define RPPARM_HISTSEL_MASK (UINT64_CAST 0x3 << 18)
+#define RPPARM_HISTSEL_MASK (0x3UL << 18)
#define RPPARM_DAMQHS_SHFT 16
-#define RPPARM_DAMQHS_MASK (UINT64_CAST 0x3 << 16)
+#define RPPARM_DAMQHS_MASK (0x3UL << 16)
#define RPPARM_NULLTO_SHFT 10
-#define RPPARM_NULLTO_MASK (UINT64_CAST 0x3f << 10)
+#define RPPARM_NULLTO_MASK (0x3fUL << 10)
#define RPPARM_MAXBURST_SHFT 0
-#define RPPARM_MAXBURST_MASK (UINT64_CAST 0x3ff)
+#define RPPARM_MAXBURST_MASK 0x3ffUL
/*
* NOTE: Normally the kernel tracks only UTILIZATION statistics.
@@ -356,23 +350,23 @@ typedef signed char port_no_t; /* Type for router port number */
/*
* RR_STATUS_ERROR(_L) and RR_ERROR_CLEAR(_L) mask and shift definitions
*/
-#define RSERR_POWERNOK (UINT64_CAST 1 << 38)
-#define RSERR_PORT_DEADLOCK (UINT64_CAST 1 << 37)
-#define RSERR_WARMRESET (UINT64_CAST 1 << 36)
-#define RSERR_LINKRESET (UINT64_CAST 1 << 35)
-#define RSERR_RETRYTIMEOUT (UINT64_CAST 1 << 34)
-#define RSERR_FIFOOVERFLOW (UINT64_CAST 1 << 33)
-#define RSERR_ILLEGALPORT (UINT64_CAST 1 << 32)
+#define RSERR_POWERNOK (1UL << 38)
+#define RSERR_PORT_DEADLOCK (1UL << 37)
+#define RSERR_WARMRESET (1UL << 36)
+#define RSERR_LINKRESET (1UL << 35)
+#define RSERR_RETRYTIMEOUT (1UL << 34)
+#define RSERR_FIFOOVERFLOW (1UL << 33)
+#define RSERR_ILLEGALPORT (1UL << 32)
#define RSERR_DEADLOCKTO_SHFT 28
-#define RSERR_DEADLOCKTO_MASK (UINT64_CAST 0xf << 28)
+#define RSERR_DEADLOCKTO_MASK (0xfUL << 28)
#define RSERR_RECVTAILTO_SHFT 24
-#define RSERR_RECVTAILTO_MASK (UINT64_CAST 0xf << 24)
+#define RSERR_RECVTAILTO_MASK (0xfUL << 24)
#define RSERR_RETRYCNT_SHFT 16
-#define RSERR_RETRYCNT_MASK (UINT64_CAST 0xff << 16)
+#define RSERR_RETRYCNT_MASK (0xffUL << 16)
#define RSERR_CBERRCNT_SHFT 8
-#define RSERR_CBERRCNT_MASK (UINT64_CAST 0xff << 8)
+#define RSERR_CBERRCNT_MASK (0xffUL << 8)
#define RSERR_SNERRCNT_SHFT 0
-#define RSERR_SNERRCNT_MASK (UINT64_CAST 0xff << 0)
+#define RSERR_SNERRCNT_MASK (0xffUL << 0)
#define PORT_STATUS_UP (1 << 0) /* Router link up */
@@ -393,10 +387,10 @@ typedef signed char port_no_t; /* Type for router port number */
* why the router link
* went down
*/
-#define PROBE_RESULT_BAD (-1) /* Set if any of the router
+#define PROBE_RESULT_BAD -1 /* Set if any of the router
* links failed after reset
*/
-#define PROBE_RESULT_GOOD (0) /* Set if all the router links
+#define PROBE_RESULT_GOOD 0 /* Set if all the router links
* which came out of reset
* are up
*/
@@ -528,23 +522,6 @@ typedef struct router_info_s {
#define RIP_PROMLOG 2 /* Router info in promlog */
#define RIP_CONSOLE 4 /* Router info on console */
-#define ROUTER_INFO_PRINT(_rip,_where) (_rip->ri_print |= _where)
- /* Set the field used to check if a
- * router info can be printed
- */
-#define IS_ROUTER_INFO_PRINTED(_rip,_where) \
- (_rip->ri_print & _where)
- /* Was the router info printed to
- * the given location (_where) ?
- * Mainly used to prevent duplicate
- * router error states.
- */
-#define ROUTER_INFO_LOCK(_rip,_s) _s = mutex_spinlock(&(_rip->ri_lock))
- /* Take the lock on router info
- * to gain exclusive access
- */
-#define ROUTER_INFO_UNLOCK(_rip,_s) mutex_spinunlock(&(_rip->ri_lock),_s)
- /* Release the lock on router info */
/*
* Router info hanging in the nodepda
*/
@@ -623,7 +600,7 @@ typedef struct router_queue_s {
*/
#define RHIST_BUCKET_SHFT(_x) (32 * ((_x) & 0x1))
-#define RHIST_BUCKET_MASK(_x) (UINT64_CAST 0xffffffff << RHIST_BUCKET_SHFT((_x) & 0x1))
+#define RHIST_BUCKET_MASK(_x) (0xffffffffUL << RHIST_BUCKET_SHFT((_x) & 0x1))
#define RHIST_GET_BUCKET(_x, _reg) \
((RHIST_BUCKET_MASK(_x) & ((_reg)[(_x) >> 1])) >> RHIST_BUCKET_SHFT(_x))
@@ -631,7 +608,7 @@ typedef struct router_queue_s {
* RR_RESET_MASK(_L) mask and shift definitions
*/
-#define RRM_RESETOK(_L) (UINT64_CAST 1 << ((_L) - 1))
+#define RRM_RESETOK(_L) (1UL << ((_L) - 1))
#define RRM_RESETOK_ALL ALL_PORTS
/*
@@ -639,7 +616,7 @@ typedef struct router_queue_s {
*/
#define RTABLE_SHFT(_L) (4 * ((_L) - 1))
-#define RTABLE_MASK(_L) (UINT64_CAST 0x7 << RTABLE_SHFT(_L))
+#define RTABLE_MASK(_L) (0x7UL << RTABLE_SHFT(_L))
#define ROUTERINFO_STKSZ 4096
diff --git a/include/asm-ia64/sn/sn2/shub.h b/include/asm-ia64/sn/sn2/shub.h
index 4547ff440550..7b094da0e2a0 100644
--- a/include/asm-ia64/sn/sn2/shub.h
+++ b/include/asm-ia64/sn/sn2/shub.h
@@ -11,13 +11,6 @@
#ifndef _ASM_IA64_SN_SN2_SHUB_H
#define _ASM_IA64_SN_SN2_SHUB_H
-#include <asm/sn/sn2/shub_mmr.h> /* shub mmr addresses and formats */
-#include <asm/sn/sn2/shub_md.h>
-#include <asm/sn/sn2/shubio.h>
-#ifndef __ASSEMBLY__
-#include <asm/sn/sn2/shub_mmr_t.h> /* shub mmr struct defines */
-#endif
-
/*
* Junk Bus Address Space
* The junk bus is used to access the PROM, LED's, and UART. It's
diff --git a/include/asm-ia64/sn/sn2/shub_mmr_t.h b/include/asm-ia64/sn/sn2/shub_mmr_t.h
index f0397c400750..5e74a7e1c8b5 100644
--- a/include/asm-ia64/sn/sn2/shub_mmr_t.h
+++ b/include/asm-ia64/sn/sn2/shub_mmr_t.h
@@ -7,8 +7,6 @@
* Copyright (c) 2001-2003 Silicon Graphics, Inc. All rights reserved.
*/
-
-
#ifndef _ASM_IA64_SN_SN2_SHUB_MMR_T_H
#define _ASM_IA64_SN_SN2_SHUB_MMR_T_H
@@ -19,7 +17,6 @@
/* FSB BINIT# Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_fsb_binit_control_u {
mmr_t sh_fsb_binit_control_regval;
struct {
@@ -27,22 +24,12 @@ typedef union sh_fsb_binit_control_u {
mmr_t reserved_0 : 63;
} sh_fsb_binit_control_s;
} sh_fsb_binit_control_u_t;
-#else
-typedef union sh_fsb_binit_control_u {
- mmr_t sh_fsb_binit_control_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t binit : 1;
- } sh_fsb_binit_control_s;
-} sh_fsb_binit_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_FSB_RESET_CONTROL" */
/* FSB Reset Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_fsb_reset_control_u {
mmr_t sh_fsb_reset_control_regval;
struct {
@@ -50,22 +37,12 @@ typedef union sh_fsb_reset_control_u {
mmr_t reserved_0 : 63;
} sh_fsb_reset_control_s;
} sh_fsb_reset_control_u_t;
-#else
-typedef union sh_fsb_reset_control_u {
- mmr_t sh_fsb_reset_control_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t reset : 1;
- } sh_fsb_reset_control_s;
-} sh_fsb_reset_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_FSB_SYSTEM_AGENT_CONFIG" */
/* FSB System Agent Configuration */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_fsb_system_agent_config_u {
mmr_t sh_fsb_system_agent_config_regval;
struct {
@@ -88,37 +65,12 @@ typedef union sh_fsb_system_agent_config_u {
mmr_t reserved_3 : 18;
} sh_fsb_system_agent_config_s;
} sh_fsb_system_agent_config_u_t;
-#else
-typedef union sh_fsb_system_agent_config_u {
- mmr_t sh_fsb_system_agent_config_regval;
- struct {
- mmr_t reserved_3 : 18;
- mmr_t binit_event_enables : 14;
- mmr_t reserved_2 : 7;
- mmr_t serialize_fsb_en : 1;
- mmr_t tdot : 1;
- mmr_t reserved_1 : 4;
- mmr_t inta_trans_rsp : 1;
- mmr_t xtpr_trans_rsp : 1;
- mmr_t io_trans_rsp : 1;
- mmr_t inta_rsp_data : 8;
- mmr_t short_hang_en : 1;
- mmr_t bnr_throttling_en : 1;
- mmr_t binit_assert_en : 1;
- mmr_t berr_sampling_en : 1;
- mmr_t berr_assert_en : 1;
- mmr_t reserved_0 : 2;
- mmr_t rcnt_scnt_en : 1;
- } sh_fsb_system_agent_config_s;
-} sh_fsb_system_agent_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_FSB_VGA_REMAP" */
/* FSB VGA Address Space Remap */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_fsb_vga_remap_u {
mmr_t sh_fsb_vga_remap_regval;
struct {
@@ -131,27 +83,12 @@ typedef union sh_fsb_vga_remap_u {
mmr_t reserved_2 : 1;
} sh_fsb_vga_remap_s;
} sh_fsb_vga_remap_u_t;
-#else
-typedef union sh_fsb_vga_remap_u {
- mmr_t sh_fsb_vga_remap_regval;
- struct {
- mmr_t reserved_2 : 1;
- mmr_t vga_remapping_enabled : 1;
- mmr_t reserved_1 : 13;
- mmr_t nid : 11;
- mmr_t asid : 2;
- mmr_t offset : 19;
- mmr_t reserved_0 : 17;
- } sh_fsb_vga_remap_s;
-} sh_fsb_vga_remap_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_FSB_RESET_STATUS" */
/* FSB Reset Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_fsb_reset_status_u {
mmr_t sh_fsb_reset_status_regval;
struct {
@@ -159,22 +96,12 @@ typedef union sh_fsb_reset_status_u {
mmr_t reserved_0 : 63;
} sh_fsb_reset_status_s;
} sh_fsb_reset_status_u_t;
-#else
-typedef union sh_fsb_reset_status_u {
- mmr_t sh_fsb_reset_status_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t reset_in_progress : 1;
- } sh_fsb_reset_status_s;
-} sh_fsb_reset_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_FSB_SYMMETRIC_AGENT_STATUS" */
/* FSB Symmetric Agent Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_fsb_symmetric_agent_status_u {
mmr_t sh_fsb_symmetric_agent_status_regval;
struct {
@@ -184,24 +111,12 @@ typedef union sh_fsb_symmetric_agent_status_u {
mmr_t reserved_0 : 61;
} sh_fsb_symmetric_agent_status_s;
} sh_fsb_symmetric_agent_status_u_t;
-#else
-typedef union sh_fsb_symmetric_agent_status_u {
- mmr_t sh_fsb_symmetric_agent_status_regval;
- struct {
- mmr_t reserved_0 : 61;
- mmr_t cpus_ready : 1;
- mmr_t cpu_1_active : 1;
- mmr_t cpu_0_active : 1;
- } sh_fsb_symmetric_agent_status_s;
-} sh_fsb_symmetric_agent_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_CREDIT_COUNT_0" */
/* Graphics-write Credit Count for CPU 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_credit_count_0_u {
mmr_t sh_gfx_credit_count_0_regval;
struct {
@@ -210,23 +125,12 @@ typedef union sh_gfx_credit_count_0_u {
mmr_t reset_gfx_state : 1;
} sh_gfx_credit_count_0_s;
} sh_gfx_credit_count_0_u_t;
-#else
-typedef union sh_gfx_credit_count_0_u {
- mmr_t sh_gfx_credit_count_0_regval;
- struct {
- mmr_t reset_gfx_state : 1;
- mmr_t reserved_0 : 43;
- mmr_t count : 20;
- } sh_gfx_credit_count_0_s;
-} sh_gfx_credit_count_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_CREDIT_COUNT_1" */
/* Graphics-write Credit Count for CPU 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_credit_count_1_u {
mmr_t sh_gfx_credit_count_1_regval;
struct {
@@ -235,23 +139,12 @@ typedef union sh_gfx_credit_count_1_u {
mmr_t reset_gfx_state : 1;
} sh_gfx_credit_count_1_s;
} sh_gfx_credit_count_1_u_t;
-#else
-typedef union sh_gfx_credit_count_1_u {
- mmr_t sh_gfx_credit_count_1_regval;
- struct {
- mmr_t reset_gfx_state : 1;
- mmr_t reserved_0 : 43;
- mmr_t count : 20;
- } sh_gfx_credit_count_1_s;
-} sh_gfx_credit_count_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_MODE_CNTRL_0" */
/* Graphics credit mode amd message ordering for CPU 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_mode_cntrl_0_u {
mmr_t sh_gfx_mode_cntrl_0_regval;
struct {
@@ -261,24 +154,12 @@ typedef union sh_gfx_mode_cntrl_0_u {
mmr_t reserved_0 : 61;
} sh_gfx_mode_cntrl_0_s;
} sh_gfx_mode_cntrl_0_u_t;
-#else
-typedef union sh_gfx_mode_cntrl_0_u {
- mmr_t sh_gfx_mode_cntrl_0_regval;
- struct {
- mmr_t reserved_0 : 61;
- mmr_t relaxed_ordering : 1;
- mmr_t mixed_mode_credits : 1;
- mmr_t dword_credits : 1;
- } sh_gfx_mode_cntrl_0_s;
-} sh_gfx_mode_cntrl_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_MODE_CNTRL_1" */
/* Graphics credit mode amd message ordering for CPU 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_mode_cntrl_1_u {
mmr_t sh_gfx_mode_cntrl_1_regval;
struct {
@@ -288,24 +169,12 @@ typedef union sh_gfx_mode_cntrl_1_u {
mmr_t reserved_0 : 61;
} sh_gfx_mode_cntrl_1_s;
} sh_gfx_mode_cntrl_1_u_t;
-#else
-typedef union sh_gfx_mode_cntrl_1_u {
- mmr_t sh_gfx_mode_cntrl_1_regval;
- struct {
- mmr_t reserved_0 : 61;
- mmr_t relaxed_ordering : 1;
- mmr_t mixed_mode_credits : 1;
- mmr_t dword_credits : 1;
- } sh_gfx_mode_cntrl_1_s;
-} sh_gfx_mode_cntrl_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_SKID_CREDIT_COUNT_0" */
/* Graphics-write Skid Credit Count for CPU 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_skid_credit_count_0_u {
mmr_t sh_gfx_skid_credit_count_0_regval;
struct {
@@ -313,22 +182,12 @@ typedef union sh_gfx_skid_credit_count_0_u {
mmr_t reserved_0 : 44;
} sh_gfx_skid_credit_count_0_s;
} sh_gfx_skid_credit_count_0_u_t;
-#else
-typedef union sh_gfx_skid_credit_count_0_u {
- mmr_t sh_gfx_skid_credit_count_0_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t skid : 20;
- } sh_gfx_skid_credit_count_0_s;
-} sh_gfx_skid_credit_count_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_SKID_CREDIT_COUNT_1" */
/* Graphics-write Skid Credit Count for CPU 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_skid_credit_count_1_u {
mmr_t sh_gfx_skid_credit_count_1_regval;
struct {
@@ -336,22 +195,12 @@ typedef union sh_gfx_skid_credit_count_1_u {
mmr_t reserved_0 : 44;
} sh_gfx_skid_credit_count_1_s;
} sh_gfx_skid_credit_count_1_u_t;
-#else
-typedef union sh_gfx_skid_credit_count_1_u {
- mmr_t sh_gfx_skid_credit_count_1_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t skid : 20;
- } sh_gfx_skid_credit_count_1_s;
-} sh_gfx_skid_credit_count_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_STALL_LIMIT_0" */
/* Graphics-write Stall Limit for CPU 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_stall_limit_0_u {
mmr_t sh_gfx_stall_limit_0_regval;
struct {
@@ -359,22 +208,12 @@ typedef union sh_gfx_stall_limit_0_u {
mmr_t reserved_0 : 38;
} sh_gfx_stall_limit_0_s;
} sh_gfx_stall_limit_0_u_t;
-#else
-typedef union sh_gfx_stall_limit_0_u {
- mmr_t sh_gfx_stall_limit_0_regval;
- struct {
- mmr_t reserved_0 : 38;
- mmr_t limit : 26;
- } sh_gfx_stall_limit_0_s;
-} sh_gfx_stall_limit_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_STALL_LIMIT_1" */
/* Graphics-write Stall Limit for CPU 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_stall_limit_1_u {
mmr_t sh_gfx_stall_limit_1_regval;
struct {
@@ -382,22 +221,12 @@ typedef union sh_gfx_stall_limit_1_u {
mmr_t reserved_0 : 38;
} sh_gfx_stall_limit_1_s;
} sh_gfx_stall_limit_1_u_t;
-#else
-typedef union sh_gfx_stall_limit_1_u {
- mmr_t sh_gfx_stall_limit_1_regval;
- struct {
- mmr_t reserved_0 : 38;
- mmr_t limit : 26;
- } sh_gfx_stall_limit_1_s;
-} sh_gfx_stall_limit_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_STALL_TIMER_0" */
/* Graphics-write Stall Timer for CPU 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_stall_timer_0_u {
mmr_t sh_gfx_stall_timer_0_regval;
struct {
@@ -405,22 +234,12 @@ typedef union sh_gfx_stall_timer_0_u {
mmr_t reserved_0 : 38;
} sh_gfx_stall_timer_0_s;
} sh_gfx_stall_timer_0_u_t;
-#else
-typedef union sh_gfx_stall_timer_0_u {
- mmr_t sh_gfx_stall_timer_0_regval;
- struct {
- mmr_t reserved_0 : 38;
- mmr_t timer_value : 26;
- } sh_gfx_stall_timer_0_s;
-} sh_gfx_stall_timer_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_STALL_TIMER_1" */
/* Graphics-write Stall Timer for CPU 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_stall_timer_1_u {
mmr_t sh_gfx_stall_timer_1_regval;
struct {
@@ -428,22 +247,12 @@ typedef union sh_gfx_stall_timer_1_u {
mmr_t reserved_0 : 38;
} sh_gfx_stall_timer_1_s;
} sh_gfx_stall_timer_1_u_t;
-#else
-typedef union sh_gfx_stall_timer_1_u {
- mmr_t sh_gfx_stall_timer_1_regval;
- struct {
- mmr_t reserved_0 : 38;
- mmr_t timer_value : 26;
- } sh_gfx_stall_timer_1_s;
-} sh_gfx_stall_timer_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_WINDOW_0" */
/* Graphics-write Window for CPU 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_window_0_u {
mmr_t sh_gfx_window_0_regval;
struct {
@@ -453,24 +262,12 @@ typedef union sh_gfx_window_0_u {
mmr_t gfx_window_en : 1;
} sh_gfx_window_0_s;
} sh_gfx_window_0_u_t;
-#else
-typedef union sh_gfx_window_0_u {
- mmr_t sh_gfx_window_0_regval;
- struct {
- mmr_t gfx_window_en : 1;
- mmr_t reserved_1 : 27;
- mmr_t base_addr : 12;
- mmr_t reserved_0 : 24;
- } sh_gfx_window_0_s;
-} sh_gfx_window_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_WINDOW_1" */
/* Graphics-write Window for CPU 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_window_1_u {
mmr_t sh_gfx_window_1_regval;
struct {
@@ -480,24 +277,12 @@ typedef union sh_gfx_window_1_u {
mmr_t gfx_window_en : 1;
} sh_gfx_window_1_s;
} sh_gfx_window_1_u_t;
-#else
-typedef union sh_gfx_window_1_u {
- mmr_t sh_gfx_window_1_regval;
- struct {
- mmr_t gfx_window_en : 1;
- mmr_t reserved_1 : 27;
- mmr_t base_addr : 12;
- mmr_t reserved_0 : 24;
- } sh_gfx_window_1_s;
-} sh_gfx_window_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_INTERRUPT_TIMER_LIMIT_0" */
/* Graphics-write Interrupt Limit for CPU 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_interrupt_timer_limit_0_u {
mmr_t sh_gfx_interrupt_timer_limit_0_regval;
struct {
@@ -505,22 +290,12 @@ typedef union sh_gfx_interrupt_timer_limit_0_u {
mmr_t reserved_0 : 56;
} sh_gfx_interrupt_timer_limit_0_s;
} sh_gfx_interrupt_timer_limit_0_u_t;
-#else
-typedef union sh_gfx_interrupt_timer_limit_0_u {
- mmr_t sh_gfx_interrupt_timer_limit_0_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t interrupt_timer_limit : 8;
- } sh_gfx_interrupt_timer_limit_0_s;
-} sh_gfx_interrupt_timer_limit_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_INTERRUPT_TIMER_LIMIT_1" */
/* Graphics-write Interrupt Limit for CPU 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_interrupt_timer_limit_1_u {
mmr_t sh_gfx_interrupt_timer_limit_1_regval;
struct {
@@ -528,22 +303,12 @@ typedef union sh_gfx_interrupt_timer_limit_1_u {
mmr_t reserved_0 : 56;
} sh_gfx_interrupt_timer_limit_1_s;
} sh_gfx_interrupt_timer_limit_1_u_t;
-#else
-typedef union sh_gfx_interrupt_timer_limit_1_u {
- mmr_t sh_gfx_interrupt_timer_limit_1_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t interrupt_timer_limit : 8;
- } sh_gfx_interrupt_timer_limit_1_s;
-} sh_gfx_interrupt_timer_limit_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_WRITE_STATUS_0" */
/* Graphics Write Status for CPU 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_write_status_0_u {
mmr_t sh_gfx_write_status_0_regval;
struct {
@@ -552,23 +317,12 @@ typedef union sh_gfx_write_status_0_u {
mmr_t re_enable_gfx_stall : 1;
} sh_gfx_write_status_0_s;
} sh_gfx_write_status_0_u_t;
-#else
-typedef union sh_gfx_write_status_0_u {
- mmr_t sh_gfx_write_status_0_regval;
- struct {
- mmr_t re_enable_gfx_stall : 1;
- mmr_t reserved_0 : 62;
- mmr_t busy : 1;
- } sh_gfx_write_status_0_s;
-} sh_gfx_write_status_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GFX_WRITE_STATUS_1" */
/* Graphics Write Status for CPU 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gfx_write_status_1_u {
mmr_t sh_gfx_write_status_1_regval;
struct {
@@ -577,23 +331,12 @@ typedef union sh_gfx_write_status_1_u {
mmr_t re_enable_gfx_stall : 1;
} sh_gfx_write_status_1_s;
} sh_gfx_write_status_1_u_t;
-#else
-typedef union sh_gfx_write_status_1_u {
- mmr_t sh_gfx_write_status_1_regval;
- struct {
- mmr_t re_enable_gfx_stall : 1;
- mmr_t reserved_0 : 62;
- mmr_t busy : 1;
- } sh_gfx_write_status_1_s;
-} sh_gfx_write_status_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_II_INT0" */
/* SHub II Interrupt 0 Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ii_int0_u {
mmr_t sh_ii_int0_regval;
struct {
@@ -602,23 +345,12 @@ typedef union sh_ii_int0_u {
mmr_t reserved_0 : 55;
} sh_ii_int0_s;
} sh_ii_int0_u_t;
-#else
-typedef union sh_ii_int0_u {
- mmr_t sh_ii_int0_regval;
- struct {
- mmr_t reserved_0 : 55;
- mmr_t send : 1;
- mmr_t idx : 8;
- } sh_ii_int0_s;
-} sh_ii_int0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_II_INT0_CONFIG" */
/* SHub II Interrupt 0 Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ii_int0_config_u {
mmr_t sh_ii_int0_config_regval;
struct {
@@ -630,26 +362,12 @@ typedef union sh_ii_int0_config_u {
mmr_t reserved_1 : 14;
} sh_ii_int0_config_s;
} sh_ii_int0_config_u_t;
-#else
-typedef union sh_ii_int0_config_u {
- mmr_t sh_ii_int0_config_regval;
- struct {
- mmr_t reserved_1 : 14;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_ii_int0_config_s;
-} sh_ii_int0_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_II_INT0_ENABLE" */
/* SHub II Interrupt 0 Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ii_int0_enable_u {
mmr_t sh_ii_int0_enable_regval;
struct {
@@ -657,22 +375,12 @@ typedef union sh_ii_int0_enable_u {
mmr_t reserved_0 : 63;
} sh_ii_int0_enable_s;
} sh_ii_int0_enable_u_t;
-#else
-typedef union sh_ii_int0_enable_u {
- mmr_t sh_ii_int0_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t ii_enable : 1;
- } sh_ii_int0_enable_s;
-} sh_ii_int0_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_II_INT1" */
/* SHub II Interrupt 1 Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ii_int1_u {
mmr_t sh_ii_int1_regval;
struct {
@@ -681,23 +389,12 @@ typedef union sh_ii_int1_u {
mmr_t reserved_0 : 55;
} sh_ii_int1_s;
} sh_ii_int1_u_t;
-#else
-typedef union sh_ii_int1_u {
- mmr_t sh_ii_int1_regval;
- struct {
- mmr_t reserved_0 : 55;
- mmr_t send : 1;
- mmr_t idx : 8;
- } sh_ii_int1_s;
-} sh_ii_int1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_II_INT1_CONFIG" */
/* SHub II Interrupt 1 Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ii_int1_config_u {
mmr_t sh_ii_int1_config_regval;
struct {
@@ -709,26 +406,12 @@ typedef union sh_ii_int1_config_u {
mmr_t reserved_1 : 14;
} sh_ii_int1_config_s;
} sh_ii_int1_config_u_t;
-#else
-typedef union sh_ii_int1_config_u {
- mmr_t sh_ii_int1_config_regval;
- struct {
- mmr_t reserved_1 : 14;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_ii_int1_config_s;
-} sh_ii_int1_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_II_INT1_ENABLE" */
/* SHub II Interrupt 1 Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ii_int1_enable_u {
mmr_t sh_ii_int1_enable_regval;
struct {
@@ -736,22 +419,12 @@ typedef union sh_ii_int1_enable_u {
mmr_t reserved_0 : 63;
} sh_ii_int1_enable_s;
} sh_ii_int1_enable_u_t;
-#else
-typedef union sh_ii_int1_enable_u {
- mmr_t sh_ii_int1_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t ii_enable : 1;
- } sh_ii_int1_enable_s;
-} sh_ii_int1_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_INT_NODE_ID_CONFIG" */
/* SHub Interrupt Node ID Configuration */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_int_node_id_config_u {
mmr_t sh_int_node_id_config_regval;
struct {
@@ -760,23 +433,12 @@ typedef union sh_int_node_id_config_u {
mmr_t reserved_0 : 52;
} sh_int_node_id_config_s;
} sh_int_node_id_config_u_t;
-#else
-typedef union sh_int_node_id_config_u {
- mmr_t sh_int_node_id_config_regval;
- struct {
- mmr_t reserved_0 : 52;
- mmr_t id_sel : 1;
- mmr_t node_id : 11;
- } sh_int_node_id_config_s;
-} sh_int_node_id_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_IPI_INT" */
/* SHub Inter-Processor Interrupt Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ipi_int_u {
mmr_t sh_ipi_int_regval;
struct {
@@ -791,29 +453,12 @@ typedef union sh_ipi_int_u {
mmr_t send : 1;
} sh_ipi_int_s;
} sh_ipi_int_u_t;
-#else
-typedef union sh_ipi_int_u {
- mmr_t sh_ipi_int_regval;
- struct {
- mmr_t send : 1;
- mmr_t reserved_2 : 3;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_ipi_int_s;
-} sh_ipi_int_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_IPI_INT_ENABLE" */
/* SHub Inter-Processor Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ipi_int_enable_u {
mmr_t sh_ipi_int_enable_regval;
struct {
@@ -821,22 +466,12 @@ typedef union sh_ipi_int_enable_u {
mmr_t reserved_0 : 63;
} sh_ipi_int_enable_s;
} sh_ipi_int_enable_u_t;
-#else
-typedef union sh_ipi_int_enable_u {
- mmr_t sh_ipi_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t pio_enable : 1;
- } sh_ipi_int_enable_s;
-} sh_ipi_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LOCAL_INT0_CONFIG" */
/* SHub Local Interrupt 0 Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_local_int0_config_u {
mmr_t sh_local_int0_config_regval;
struct {
@@ -850,28 +485,12 @@ typedef union sh_local_int0_config_u {
mmr_t reserved_2 : 4;
} sh_local_int0_config_s;
} sh_local_int0_config_u_t;
-#else
-typedef union sh_local_int0_config_u {
- mmr_t sh_local_int0_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_local_int0_config_s;
-} sh_local_int0_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LOCAL_INT0_ENABLE" */
/* SHub Local Interrupt 0 Enable */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_local_int0_enable_u {
mmr_t sh_local_int0_enable_regval;
struct {
@@ -894,37 +513,12 @@ typedef union sh_local_int0_enable_u {
mmr_t reserved_1 : 48;
} sh_local_int0_enable_s;
} sh_local_int0_enable_u_t;
-#else
-typedef union sh_local_int0_enable_u {
- mmr_t sh_local_int0_enable_regval;
- struct {
- mmr_t reserved_1 : 48;
- mmr_t stop_clock : 1;
- mmr_t l1_nmi_int : 1;
- mmr_t uart_int : 1;
- mmr_t system_shutdown_int : 1;
- mmr_t reserved_0 : 1;
- mmr_t xn_uce_int : 1;
- mmr_t md_uce_int : 1;
- mmr_t pi_uce_int : 1;
- mmr_t xn_ce_int : 1;
- mmr_t md_ce_int : 1;
- mmr_t pi_ce_int : 1;
- mmr_t ii_hw_int : 1;
- mmr_t lb_hw_int : 1;
- mmr_t xn_hw_int : 1;
- mmr_t md_hw_int : 1;
- mmr_t pi_hw_int : 1;
- } sh_local_int0_enable_s;
-} sh_local_int0_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LOCAL_INT1_CONFIG" */
/* SHub Local Interrupt 1 Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_local_int1_config_u {
mmr_t sh_local_int1_config_regval;
struct {
@@ -938,28 +532,12 @@ typedef union sh_local_int1_config_u {
mmr_t reserved_2 : 4;
} sh_local_int1_config_s;
} sh_local_int1_config_u_t;
-#else
-typedef union sh_local_int1_config_u {
- mmr_t sh_local_int1_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_local_int1_config_s;
-} sh_local_int1_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LOCAL_INT1_ENABLE" */
/* SHub Local Interrupt 1 Enable */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_local_int1_enable_u {
mmr_t sh_local_int1_enable_regval;
struct {
@@ -982,37 +560,12 @@ typedef union sh_local_int1_enable_u {
mmr_t reserved_1 : 48;
} sh_local_int1_enable_s;
} sh_local_int1_enable_u_t;
-#else
-typedef union sh_local_int1_enable_u {
- mmr_t sh_local_int1_enable_regval;
- struct {
- mmr_t reserved_1 : 48;
- mmr_t stop_clock : 1;
- mmr_t l1_nmi_int : 1;
- mmr_t uart_int : 1;
- mmr_t system_shutdown_int : 1;
- mmr_t reserved_0 : 1;
- mmr_t xn_uce_int : 1;
- mmr_t md_uce_int : 1;
- mmr_t pi_uce_int : 1;
- mmr_t xn_ce_int : 1;
- mmr_t md_ce_int : 1;
- mmr_t pi_ce_int : 1;
- mmr_t ii_hw_int : 1;
- mmr_t lb_hw_int : 1;
- mmr_t xn_hw_int : 1;
- mmr_t md_hw_int : 1;
- mmr_t pi_hw_int : 1;
- } sh_local_int1_enable_s;
-} sh_local_int1_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LOCAL_INT2_CONFIG" */
/* SHub Local Interrupt 2 Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_local_int2_config_u {
mmr_t sh_local_int2_config_regval;
struct {
@@ -1026,28 +579,12 @@ typedef union sh_local_int2_config_u {
mmr_t reserved_2 : 4;
} sh_local_int2_config_s;
} sh_local_int2_config_u_t;
-#else
-typedef union sh_local_int2_config_u {
- mmr_t sh_local_int2_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_local_int2_config_s;
-} sh_local_int2_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LOCAL_INT2_ENABLE" */
/* SHub Local Interrupt 2 Enable */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_local_int2_enable_u {
mmr_t sh_local_int2_enable_regval;
struct {
@@ -1070,37 +607,12 @@ typedef union sh_local_int2_enable_u {
mmr_t reserved_1 : 48;
} sh_local_int2_enable_s;
} sh_local_int2_enable_u_t;
-#else
-typedef union sh_local_int2_enable_u {
- mmr_t sh_local_int2_enable_regval;
- struct {
- mmr_t reserved_1 : 48;
- mmr_t stop_clock : 1;
- mmr_t l1_nmi_int : 1;
- mmr_t uart_int : 1;
- mmr_t system_shutdown_int : 1;
- mmr_t reserved_0 : 1;
- mmr_t xn_uce_int : 1;
- mmr_t md_uce_int : 1;
- mmr_t pi_uce_int : 1;
- mmr_t xn_ce_int : 1;
- mmr_t md_ce_int : 1;
- mmr_t pi_ce_int : 1;
- mmr_t ii_hw_int : 1;
- mmr_t lb_hw_int : 1;
- mmr_t xn_hw_int : 1;
- mmr_t md_hw_int : 1;
- mmr_t pi_hw_int : 1;
- } sh_local_int2_enable_s;
-} sh_local_int2_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LOCAL_INT3_CONFIG" */
/* SHub Local Interrupt 3 Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_local_int3_config_u {
mmr_t sh_local_int3_config_regval;
struct {
@@ -1114,28 +626,12 @@ typedef union sh_local_int3_config_u {
mmr_t reserved_2 : 4;
} sh_local_int3_config_s;
} sh_local_int3_config_u_t;
-#else
-typedef union sh_local_int3_config_u {
- mmr_t sh_local_int3_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_local_int3_config_s;
-} sh_local_int3_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LOCAL_INT3_ENABLE" */
/* SHub Local Interrupt 3 Enable */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_local_int3_enable_u {
mmr_t sh_local_int3_enable_regval;
struct {
@@ -1158,37 +654,12 @@ typedef union sh_local_int3_enable_u {
mmr_t reserved_1 : 48;
} sh_local_int3_enable_s;
} sh_local_int3_enable_u_t;
-#else
-typedef union sh_local_int3_enable_u {
- mmr_t sh_local_int3_enable_regval;
- struct {
- mmr_t reserved_1 : 48;
- mmr_t stop_clock : 1;
- mmr_t l1_nmi_int : 1;
- mmr_t uart_int : 1;
- mmr_t system_shutdown_int : 1;
- mmr_t reserved_0 : 1;
- mmr_t xn_uce_int : 1;
- mmr_t md_uce_int : 1;
- mmr_t pi_uce_int : 1;
- mmr_t xn_ce_int : 1;
- mmr_t md_ce_int : 1;
- mmr_t pi_ce_int : 1;
- mmr_t ii_hw_int : 1;
- mmr_t lb_hw_int : 1;
- mmr_t xn_hw_int : 1;
- mmr_t md_hw_int : 1;
- mmr_t pi_hw_int : 1;
- } sh_local_int3_enable_s;
-} sh_local_int3_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LOCAL_INT4_CONFIG" */
/* SHub Local Interrupt 4 Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_local_int4_config_u {
mmr_t sh_local_int4_config_regval;
struct {
@@ -1202,28 +673,12 @@ typedef union sh_local_int4_config_u {
mmr_t reserved_2 : 4;
} sh_local_int4_config_s;
} sh_local_int4_config_u_t;
-#else
-typedef union sh_local_int4_config_u {
- mmr_t sh_local_int4_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_local_int4_config_s;
-} sh_local_int4_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LOCAL_INT4_ENABLE" */
/* SHub Local Interrupt 4 Enable */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_local_int4_enable_u {
mmr_t sh_local_int4_enable_regval;
struct {
@@ -1246,37 +701,12 @@ typedef union sh_local_int4_enable_u {
mmr_t reserved_1 : 48;
} sh_local_int4_enable_s;
} sh_local_int4_enable_u_t;
-#else
-typedef union sh_local_int4_enable_u {
- mmr_t sh_local_int4_enable_regval;
- struct {
- mmr_t reserved_1 : 48;
- mmr_t stop_clock : 1;
- mmr_t l1_nmi_int : 1;
- mmr_t uart_int : 1;
- mmr_t system_shutdown_int : 1;
- mmr_t reserved_0 : 1;
- mmr_t xn_uce_int : 1;
- mmr_t md_uce_int : 1;
- mmr_t pi_uce_int : 1;
- mmr_t xn_ce_int : 1;
- mmr_t md_ce_int : 1;
- mmr_t pi_ce_int : 1;
- mmr_t ii_hw_int : 1;
- mmr_t lb_hw_int : 1;
- mmr_t xn_hw_int : 1;
- mmr_t md_hw_int : 1;
- mmr_t pi_hw_int : 1;
- } sh_local_int4_enable_s;
-} sh_local_int4_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LOCAL_INT5_CONFIG" */
/* SHub Local Interrupt 5 Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_local_int5_config_u {
mmr_t sh_local_int5_config_regval;
struct {
@@ -1290,28 +720,12 @@ typedef union sh_local_int5_config_u {
mmr_t reserved_2 : 4;
} sh_local_int5_config_s;
} sh_local_int5_config_u_t;
-#else
-typedef union sh_local_int5_config_u {
- mmr_t sh_local_int5_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_local_int5_config_s;
-} sh_local_int5_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LOCAL_INT5_ENABLE" */
/* SHub Local Interrupt 5 Enable */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_local_int5_enable_u {
mmr_t sh_local_int5_enable_regval;
struct {
@@ -1334,37 +748,12 @@ typedef union sh_local_int5_enable_u {
mmr_t reserved_1 : 48;
} sh_local_int5_enable_s;
} sh_local_int5_enable_u_t;
-#else
-typedef union sh_local_int5_enable_u {
- mmr_t sh_local_int5_enable_regval;
- struct {
- mmr_t reserved_1 : 48;
- mmr_t stop_clock : 1;
- mmr_t l1_nmi_int : 1;
- mmr_t uart_int : 1;
- mmr_t system_shutdown_int : 1;
- mmr_t reserved_0 : 1;
- mmr_t xn_uce_int : 1;
- mmr_t md_uce_int : 1;
- mmr_t pi_uce_int : 1;
- mmr_t xn_ce_int : 1;
- mmr_t md_ce_int : 1;
- mmr_t pi_ce_int : 1;
- mmr_t ii_hw_int : 1;
- mmr_t lb_hw_int : 1;
- mmr_t xn_hw_int : 1;
- mmr_t md_hw_int : 1;
- mmr_t pi_hw_int : 1;
- } sh_local_int5_enable_s;
-} sh_local_int5_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC0_ERR_INT_CONFIG" */
/* SHub Processor 0 Error Interrupt Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc0_err_int_config_u {
mmr_t sh_proc0_err_int_config_regval;
struct {
@@ -1378,28 +767,12 @@ typedef union sh_proc0_err_int_config_u {
mmr_t reserved_2 : 4;
} sh_proc0_err_int_config_s;
} sh_proc0_err_int_config_u_t;
-#else
-typedef union sh_proc0_err_int_config_u {
- mmr_t sh_proc0_err_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_proc0_err_int_config_s;
-} sh_proc0_err_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC1_ERR_INT_CONFIG" */
/* SHub Processor 1 Error Interrupt Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc1_err_int_config_u {
mmr_t sh_proc1_err_int_config_regval;
struct {
@@ -1413,28 +786,12 @@ typedef union sh_proc1_err_int_config_u {
mmr_t reserved_2 : 4;
} sh_proc1_err_int_config_s;
} sh_proc1_err_int_config_u_t;
-#else
-typedef union sh_proc1_err_int_config_u {
- mmr_t sh_proc1_err_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_proc1_err_int_config_s;
-} sh_proc1_err_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC2_ERR_INT_CONFIG" */
/* SHub Processor 2 Error Interrupt Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc2_err_int_config_u {
mmr_t sh_proc2_err_int_config_regval;
struct {
@@ -1448,28 +805,12 @@ typedef union sh_proc2_err_int_config_u {
mmr_t reserved_2 : 4;
} sh_proc2_err_int_config_s;
} sh_proc2_err_int_config_u_t;
-#else
-typedef union sh_proc2_err_int_config_u {
- mmr_t sh_proc2_err_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_proc2_err_int_config_s;
-} sh_proc2_err_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC3_ERR_INT_CONFIG" */
/* SHub Processor 3 Error Interrupt Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc3_err_int_config_u {
mmr_t sh_proc3_err_int_config_regval;
struct {
@@ -1483,28 +824,12 @@ typedef union sh_proc3_err_int_config_u {
mmr_t reserved_2 : 4;
} sh_proc3_err_int_config_s;
} sh_proc3_err_int_config_u_t;
-#else
-typedef union sh_proc3_err_int_config_u {
- mmr_t sh_proc3_err_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_proc3_err_int_config_s;
-} sh_proc3_err_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC0_ADV_INT_CONFIG" */
/* SHub Processor 0 Advisory Interrupt Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc0_adv_int_config_u {
mmr_t sh_proc0_adv_int_config_regval;
struct {
@@ -1518,28 +843,12 @@ typedef union sh_proc0_adv_int_config_u {
mmr_t reserved_2 : 4;
} sh_proc0_adv_int_config_s;
} sh_proc0_adv_int_config_u_t;
-#else
-typedef union sh_proc0_adv_int_config_u {
- mmr_t sh_proc0_adv_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_proc0_adv_int_config_s;
-} sh_proc0_adv_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC1_ADV_INT_CONFIG" */
/* SHub Processor 1 Advisory Interrupt Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc1_adv_int_config_u {
mmr_t sh_proc1_adv_int_config_regval;
struct {
@@ -1553,28 +862,12 @@ typedef union sh_proc1_adv_int_config_u {
mmr_t reserved_2 : 4;
} sh_proc1_adv_int_config_s;
} sh_proc1_adv_int_config_u_t;
-#else
-typedef union sh_proc1_adv_int_config_u {
- mmr_t sh_proc1_adv_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_proc1_adv_int_config_s;
-} sh_proc1_adv_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC2_ADV_INT_CONFIG" */
/* SHub Processor 2 Advisory Interrupt Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc2_adv_int_config_u {
mmr_t sh_proc2_adv_int_config_regval;
struct {
@@ -1588,28 +881,12 @@ typedef union sh_proc2_adv_int_config_u {
mmr_t reserved_2 : 4;
} sh_proc2_adv_int_config_s;
} sh_proc2_adv_int_config_u_t;
-#else
-typedef union sh_proc2_adv_int_config_u {
- mmr_t sh_proc2_adv_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_proc2_adv_int_config_s;
-} sh_proc2_adv_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC3_ADV_INT_CONFIG" */
/* SHub Processor 3 Advisory Interrupt Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc3_adv_int_config_u {
mmr_t sh_proc3_adv_int_config_regval;
struct {
@@ -1623,28 +900,12 @@ typedef union sh_proc3_adv_int_config_u {
mmr_t reserved_2 : 4;
} sh_proc3_adv_int_config_s;
} sh_proc3_adv_int_config_u_t;
-#else
-typedef union sh_proc3_adv_int_config_u {
- mmr_t sh_proc3_adv_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_proc3_adv_int_config_s;
-} sh_proc3_adv_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC0_ERR_INT_ENABLE" */
/* SHub Processor 0 Error Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc0_err_int_enable_u {
mmr_t sh_proc0_err_int_enable_regval;
struct {
@@ -1652,22 +913,12 @@ typedef union sh_proc0_err_int_enable_u {
mmr_t reserved_0 : 63;
} sh_proc0_err_int_enable_s;
} sh_proc0_err_int_enable_u_t;
-#else
-typedef union sh_proc0_err_int_enable_u {
- mmr_t sh_proc0_err_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t proc0_err_enable : 1;
- } sh_proc0_err_int_enable_s;
-} sh_proc0_err_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC1_ERR_INT_ENABLE" */
/* SHub Processor 1 Error Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc1_err_int_enable_u {
mmr_t sh_proc1_err_int_enable_regval;
struct {
@@ -1675,22 +926,12 @@ typedef union sh_proc1_err_int_enable_u {
mmr_t reserved_0 : 63;
} sh_proc1_err_int_enable_s;
} sh_proc1_err_int_enable_u_t;
-#else
-typedef union sh_proc1_err_int_enable_u {
- mmr_t sh_proc1_err_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t proc1_err_enable : 1;
- } sh_proc1_err_int_enable_s;
-} sh_proc1_err_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC2_ERR_INT_ENABLE" */
/* SHub Processor 2 Error Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc2_err_int_enable_u {
mmr_t sh_proc2_err_int_enable_regval;
struct {
@@ -1698,22 +939,12 @@ typedef union sh_proc2_err_int_enable_u {
mmr_t reserved_0 : 63;
} sh_proc2_err_int_enable_s;
} sh_proc2_err_int_enable_u_t;
-#else
-typedef union sh_proc2_err_int_enable_u {
- mmr_t sh_proc2_err_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t proc2_err_enable : 1;
- } sh_proc2_err_int_enable_s;
-} sh_proc2_err_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC3_ERR_INT_ENABLE" */
/* SHub Processor 3 Error Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc3_err_int_enable_u {
mmr_t sh_proc3_err_int_enable_regval;
struct {
@@ -1721,22 +952,12 @@ typedef union sh_proc3_err_int_enable_u {
mmr_t reserved_0 : 63;
} sh_proc3_err_int_enable_s;
} sh_proc3_err_int_enable_u_t;
-#else
-typedef union sh_proc3_err_int_enable_u {
- mmr_t sh_proc3_err_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t proc3_err_enable : 1;
- } sh_proc3_err_int_enable_s;
-} sh_proc3_err_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC0_ADV_INT_ENABLE" */
/* SHub Processor 0 Advisory Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc0_adv_int_enable_u {
mmr_t sh_proc0_adv_int_enable_regval;
struct {
@@ -1744,22 +965,12 @@ typedef union sh_proc0_adv_int_enable_u {
mmr_t reserved_0 : 63;
} sh_proc0_adv_int_enable_s;
} sh_proc0_adv_int_enable_u_t;
-#else
-typedef union sh_proc0_adv_int_enable_u {
- mmr_t sh_proc0_adv_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t proc0_adv_enable : 1;
- } sh_proc0_adv_int_enable_s;
-} sh_proc0_adv_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC1_ADV_INT_ENABLE" */
/* SHub Processor 1 Advisory Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc1_adv_int_enable_u {
mmr_t sh_proc1_adv_int_enable_regval;
struct {
@@ -1767,22 +978,12 @@ typedef union sh_proc1_adv_int_enable_u {
mmr_t reserved_0 : 63;
} sh_proc1_adv_int_enable_s;
} sh_proc1_adv_int_enable_u_t;
-#else
-typedef union sh_proc1_adv_int_enable_u {
- mmr_t sh_proc1_adv_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t proc1_adv_enable : 1;
- } sh_proc1_adv_int_enable_s;
-} sh_proc1_adv_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC2_ADV_INT_ENABLE" */
/* SHub Processor 2 Advisory Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc2_adv_int_enable_u {
mmr_t sh_proc2_adv_int_enable_regval;
struct {
@@ -1790,22 +991,12 @@ typedef union sh_proc2_adv_int_enable_u {
mmr_t reserved_0 : 63;
} sh_proc2_adv_int_enable_s;
} sh_proc2_adv_int_enable_u_t;
-#else
-typedef union sh_proc2_adv_int_enable_u {
- mmr_t sh_proc2_adv_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t proc2_adv_enable : 1;
- } sh_proc2_adv_int_enable_s;
-} sh_proc2_adv_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC3_ADV_INT_ENABLE" */
/* SHub Processor 3 Advisory Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc3_adv_int_enable_u {
mmr_t sh_proc3_adv_int_enable_regval;
struct {
@@ -1813,22 +1004,12 @@ typedef union sh_proc3_adv_int_enable_u {
mmr_t reserved_0 : 63;
} sh_proc3_adv_int_enable_s;
} sh_proc3_adv_int_enable_u_t;
-#else
-typedef union sh_proc3_adv_int_enable_u {
- mmr_t sh_proc3_adv_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t proc3_adv_enable : 1;
- } sh_proc3_adv_int_enable_s;
-} sh_proc3_adv_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROFILE_INT_CONFIG" */
/* SHub Profile Interrupt Configuration Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_profile_int_config_u {
mmr_t sh_profile_int_config_regval;
struct {
@@ -1842,28 +1023,12 @@ typedef union sh_profile_int_config_u {
mmr_t reserved_2 : 4;
} sh_profile_int_config_s;
} sh_profile_int_config_u_t;
-#else
-typedef union sh_profile_int_config_u {
- mmr_t sh_profile_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_profile_int_config_s;
-} sh_profile_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROFILE_INT_ENABLE" */
/* SHub Profile Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_profile_int_enable_u {
mmr_t sh_profile_int_enable_regval;
struct {
@@ -1871,22 +1036,12 @@ typedef union sh_profile_int_enable_u {
mmr_t reserved_0 : 63;
} sh_profile_int_enable_s;
} sh_profile_int_enable_u_t;
-#else
-typedef union sh_profile_int_enable_u {
- mmr_t sh_profile_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t profile_enable : 1;
- } sh_profile_int_enable_s;
-} sh_profile_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_RTC0_INT_CONFIG" */
/* SHub RTC 0 Interrupt Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_rtc0_int_config_u {
mmr_t sh_rtc0_int_config_regval;
struct {
@@ -1900,28 +1055,12 @@ typedef union sh_rtc0_int_config_u {
mmr_t reserved_2 : 4;
} sh_rtc0_int_config_s;
} sh_rtc0_int_config_u_t;
-#else
-typedef union sh_rtc0_int_config_u {
- mmr_t sh_rtc0_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_rtc0_int_config_s;
-} sh_rtc0_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_RTC0_INT_ENABLE" */
/* SHub RTC 0 Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_rtc0_int_enable_u {
mmr_t sh_rtc0_int_enable_regval;
struct {
@@ -1929,22 +1068,12 @@ typedef union sh_rtc0_int_enable_u {
mmr_t reserved_0 : 63;
} sh_rtc0_int_enable_s;
} sh_rtc0_int_enable_u_t;
-#else
-typedef union sh_rtc0_int_enable_u {
- mmr_t sh_rtc0_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t rtc0_enable : 1;
- } sh_rtc0_int_enable_s;
-} sh_rtc0_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_RTC1_INT_CONFIG" */
/* SHub RTC 1 Interrupt Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_rtc1_int_config_u {
mmr_t sh_rtc1_int_config_regval;
struct {
@@ -1958,28 +1087,12 @@ typedef union sh_rtc1_int_config_u {
mmr_t reserved_2 : 4;
} sh_rtc1_int_config_s;
} sh_rtc1_int_config_u_t;
-#else
-typedef union sh_rtc1_int_config_u {
- mmr_t sh_rtc1_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_rtc1_int_config_s;
-} sh_rtc1_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_RTC1_INT_ENABLE" */
/* SHub RTC 1 Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_rtc1_int_enable_u {
mmr_t sh_rtc1_int_enable_regval;
struct {
@@ -1987,22 +1100,12 @@ typedef union sh_rtc1_int_enable_u {
mmr_t reserved_0 : 63;
} sh_rtc1_int_enable_s;
} sh_rtc1_int_enable_u_t;
-#else
-typedef union sh_rtc1_int_enable_u {
- mmr_t sh_rtc1_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t rtc1_enable : 1;
- } sh_rtc1_int_enable_s;
-} sh_rtc1_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_RTC2_INT_CONFIG" */
/* SHub RTC 2 Interrupt Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_rtc2_int_config_u {
mmr_t sh_rtc2_int_config_regval;
struct {
@@ -2016,28 +1119,12 @@ typedef union sh_rtc2_int_config_u {
mmr_t reserved_2 : 4;
} sh_rtc2_int_config_s;
} sh_rtc2_int_config_u_t;
-#else
-typedef union sh_rtc2_int_config_u {
- mmr_t sh_rtc2_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_rtc2_int_config_s;
-} sh_rtc2_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_RTC2_INT_ENABLE" */
/* SHub RTC 2 Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_rtc2_int_enable_u {
mmr_t sh_rtc2_int_enable_regval;
struct {
@@ -2045,22 +1132,12 @@ typedef union sh_rtc2_int_enable_u {
mmr_t reserved_0 : 63;
} sh_rtc2_int_enable_s;
} sh_rtc2_int_enable_u_t;
-#else
-typedef union sh_rtc2_int_enable_u {
- mmr_t sh_rtc2_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t rtc2_enable : 1;
- } sh_rtc2_int_enable_s;
-} sh_rtc2_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_RTC3_INT_CONFIG" */
/* SHub RTC 3 Interrupt Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_rtc3_int_config_u {
mmr_t sh_rtc3_int_config_regval;
struct {
@@ -2074,28 +1151,12 @@ typedef union sh_rtc3_int_config_u {
mmr_t reserved_2 : 4;
} sh_rtc3_int_config_s;
} sh_rtc3_int_config_u_t;
-#else
-typedef union sh_rtc3_int_config_u {
- mmr_t sh_rtc3_int_config_regval;
- struct {
- mmr_t reserved_2 : 4;
- mmr_t idx : 8;
- mmr_t reserved_1 : 2;
- mmr_t base : 29;
- mmr_t reserved_0 : 1;
- mmr_t pid : 16;
- mmr_t agt : 1;
- mmr_t type : 3;
- } sh_rtc3_int_config_s;
-} sh_rtc3_int_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_RTC3_INT_ENABLE" */
/* SHub RTC 3 Interrupt Enable Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_rtc3_int_enable_u {
mmr_t sh_rtc3_int_enable_regval;
struct {
@@ -2103,22 +1164,12 @@ typedef union sh_rtc3_int_enable_u {
mmr_t reserved_0 : 63;
} sh_rtc3_int_enable_s;
} sh_rtc3_int_enable_u_t;
-#else
-typedef union sh_rtc3_int_enable_u {
- mmr_t sh_rtc3_int_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t rtc3_enable : 1;
- } sh_rtc3_int_enable_s;
-} sh_rtc3_int_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_EVENT_OCCURRED" */
/* SHub Interrupt Event Occurred */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_event_occurred_u {
mmr_t sh_event_occurred_regval;
struct {
@@ -2156,52 +1207,12 @@ typedef union sh_event_occurred_u {
mmr_t reserved_0 : 33;
} sh_event_occurred_s;
} sh_event_occurred_u_t;
-#else
-typedef union sh_event_occurred_u {
- mmr_t sh_event_occurred_regval;
- struct {
- mmr_t reserved_0 : 33;
- mmr_t ii_int1 : 1;
- mmr_t ii_int0 : 1;
- mmr_t ipi_int : 1;
- mmr_t profile_int : 1;
- mmr_t rtc3_int : 1;
- mmr_t rtc2_int : 1;
- mmr_t rtc1_int : 1;
- mmr_t rtc0_int : 1;
- mmr_t stop_clock : 1;
- mmr_t l1_nmi_int : 1;
- mmr_t uart_int : 1;
- mmr_t system_shutdown_int : 1;
- mmr_t proc3_err_int : 1;
- mmr_t proc2_err_int : 1;
- mmr_t proc1_err_int : 1;
- mmr_t proc0_err_int : 1;
- mmr_t proc3_adv_int : 1;
- mmr_t proc2_adv_int : 1;
- mmr_t proc1_adv_int : 1;
- mmr_t proc0_adv_int : 1;
- mmr_t xn_uce_int : 1;
- mmr_t md_uce_int : 1;
- mmr_t pi_uce_int : 1;
- mmr_t xn_ce_int : 1;
- mmr_t md_ce_int : 1;
- mmr_t pi_ce_int : 1;
- mmr_t ii_hw_int : 1;
- mmr_t lb_hw_int : 1;
- mmr_t xn_hw_int : 1;
- mmr_t md_hw_int : 1;
- mmr_t pi_hw_int : 1;
- } sh_event_occurred_s;
-} sh_event_occurred_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_EVENT_OVERFLOW" */
/* SHub Interrupt Event Occurred Overflow */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_event_overflow_u {
mmr_t sh_event_overflow_regval;
struct {
@@ -2236,49 +1247,12 @@ typedef union sh_event_overflow_u {
mmr_t reserved_0 : 36;
} sh_event_overflow_s;
} sh_event_overflow_u_t;
-#else
-typedef union sh_event_overflow_u {
- mmr_t sh_event_overflow_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t profile_int : 1;
- mmr_t rtc3_int : 1;
- mmr_t rtc2_int : 1;
- mmr_t rtc1_int : 1;
- mmr_t rtc0_int : 1;
- mmr_t stop_clock : 1;
- mmr_t l1_nmi_int : 1;
- mmr_t uart_int : 1;
- mmr_t system_shutdown_int : 1;
- mmr_t proc3_err_int : 1;
- mmr_t proc2_err_int : 1;
- mmr_t proc1_err_int : 1;
- mmr_t proc0_err_int : 1;
- mmr_t proc3_adv_int : 1;
- mmr_t proc2_adv_int : 1;
- mmr_t proc1_adv_int : 1;
- mmr_t proc0_adv_int : 1;
- mmr_t xn_uce_int : 1;
- mmr_t md_uce_int : 1;
- mmr_t pi_uce_int : 1;
- mmr_t xn_ce_int : 1;
- mmr_t md_ce_int : 1;
- mmr_t pi_ce_int : 1;
- mmr_t ii_hw_int : 1;
- mmr_t lb_hw_int : 1;
- mmr_t xn_hw_int : 1;
- mmr_t md_hw_int : 1;
- mmr_t pi_hw_int : 1;
- } sh_event_overflow_s;
-} sh_event_overflow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_JUNK_BUS_TIME" */
/* Junk Bus Timing */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_junk_bus_time_u {
mmr_t sh_junk_bus_time_regval;
struct {
@@ -2289,25 +1263,12 @@ typedef union sh_junk_bus_time_u {
mmr_t reserved_0 : 32;
} sh_junk_bus_time_s;
} sh_junk_bus_time_u_t;
-#else
-typedef union sh_junk_bus_time_u {
- mmr_t sh_junk_bus_time_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t uart_enable : 8;
- mmr_t uart_setup_hold : 8;
- mmr_t fprom_enable : 8;
- mmr_t fprom_setup_hold : 8;
- } sh_junk_bus_time_s;
-} sh_junk_bus_time_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_JUNK_LATCH_TIME" */
/* Junk Bus Latch Timing */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_junk_latch_time_u {
mmr_t sh_junk_latch_time_regval;
struct {
@@ -2315,22 +1276,12 @@ typedef union sh_junk_latch_time_u {
mmr_t reserved_0 : 61;
} sh_junk_latch_time_s;
} sh_junk_latch_time_u_t;
-#else
-typedef union sh_junk_latch_time_u {
- mmr_t sh_junk_latch_time_regval;
- struct {
- mmr_t reserved_0 : 61;
- mmr_t setup_hold : 3;
- } sh_junk_latch_time_s;
-} sh_junk_latch_time_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_JUNK_NACK_RESET" */
/* Junk Bus Nack Counter Reset */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_junk_nack_reset_u {
mmr_t sh_junk_nack_reset_regval;
struct {
@@ -2338,22 +1289,12 @@ typedef union sh_junk_nack_reset_u {
mmr_t reserved_0 : 63;
} sh_junk_nack_reset_s;
} sh_junk_nack_reset_u_t;
-#else
-typedef union sh_junk_nack_reset_u {
- mmr_t sh_junk_nack_reset_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t pulse : 1;
- } sh_junk_nack_reset_s;
-} sh_junk_nack_reset_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_JUNK_BUS_LED0" */
/* Junk Bus LED0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_junk_bus_led0_u {
mmr_t sh_junk_bus_led0_regval;
struct {
@@ -2361,22 +1302,12 @@ typedef union sh_junk_bus_led0_u {
mmr_t reserved_0 : 56;
} sh_junk_bus_led0_s;
} sh_junk_bus_led0_u_t;
-#else
-typedef union sh_junk_bus_led0_u {
- mmr_t sh_junk_bus_led0_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t led0_data : 8;
- } sh_junk_bus_led0_s;
-} sh_junk_bus_led0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_JUNK_BUS_LED1" */
/* Junk Bus LED1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_junk_bus_led1_u {
mmr_t sh_junk_bus_led1_regval;
struct {
@@ -2384,22 +1315,12 @@ typedef union sh_junk_bus_led1_u {
mmr_t reserved_0 : 56;
} sh_junk_bus_led1_s;
} sh_junk_bus_led1_u_t;
-#else
-typedef union sh_junk_bus_led1_u {
- mmr_t sh_junk_bus_led1_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t led1_data : 8;
- } sh_junk_bus_led1_s;
-} sh_junk_bus_led1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_JUNK_BUS_LED2" */
/* Junk Bus LED2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_junk_bus_led2_u {
mmr_t sh_junk_bus_led2_regval;
struct {
@@ -2407,22 +1328,12 @@ typedef union sh_junk_bus_led2_u {
mmr_t reserved_0 : 56;
} sh_junk_bus_led2_s;
} sh_junk_bus_led2_u_t;
-#else
-typedef union sh_junk_bus_led2_u {
- mmr_t sh_junk_bus_led2_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t led2_data : 8;
- } sh_junk_bus_led2_s;
-} sh_junk_bus_led2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_JUNK_BUS_LED3" */
/* Junk Bus LED3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_junk_bus_led3_u {
mmr_t sh_junk_bus_led3_regval;
struct {
@@ -2430,22 +1341,12 @@ typedef union sh_junk_bus_led3_u {
mmr_t reserved_0 : 56;
} sh_junk_bus_led3_s;
} sh_junk_bus_led3_u_t;
-#else
-typedef union sh_junk_bus_led3_u {
- mmr_t sh_junk_bus_led3_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t led3_data : 8;
- } sh_junk_bus_led3_s;
-} sh_junk_bus_led3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_JUNK_ERROR_STATUS" */
/* Junk Bus Error Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_junk_error_status_u {
mmr_t sh_junk_error_status_regval;
struct {
@@ -2457,26 +1358,12 @@ typedef union sh_junk_error_status_u {
mmr_t reserved_1 : 3;
} sh_junk_error_status_s;
} sh_junk_error_status_u_t;
-#else
-typedef union sh_junk_error_status_u {
- mmr_t sh_junk_error_status_regval;
- struct {
- mmr_t reserved_1 : 3;
- mmr_t status : 4;
- mmr_t mode : 1;
- mmr_t cmd : 8;
- mmr_t reserved_0 : 1;
- mmr_t address : 47;
- } sh_junk_error_status_s;
-} sh_junk_error_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_LLP_STAT" */
/* This register describes the LLP status. */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_llp_stat_u {
mmr_t sh_ni0_llp_stat_regval;
struct {
@@ -2484,22 +1371,12 @@ typedef union sh_ni0_llp_stat_u {
mmr_t reserved_0 : 60;
} sh_ni0_llp_stat_s;
} sh_ni0_llp_stat_u_t;
-#else
-typedef union sh_ni0_llp_stat_u {
- mmr_t sh_ni0_llp_stat_regval;
- struct {
- mmr_t reserved_0 : 60;
- mmr_t link_reset_state : 4;
- } sh_ni0_llp_stat_s;
-} sh_ni0_llp_stat_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_LLP_RESET" */
/* Writing issues a reset to the network interface */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_llp_reset_u {
mmr_t sh_ni0_llp_reset_regval;
struct {
@@ -2508,23 +1385,12 @@ typedef union sh_ni0_llp_reset_u {
mmr_t reserved_0 : 62;
} sh_ni0_llp_reset_s;
} sh_ni0_llp_reset_u_t;
-#else
-typedef union sh_ni0_llp_reset_u {
- mmr_t sh_ni0_llp_reset_regval;
- struct {
- mmr_t reserved_0 : 62;
- mmr_t warm : 1;
- mmr_t link : 1;
- } sh_ni0_llp_reset_s;
-} sh_ni0_llp_reset_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_LLP_RESET_EN" */
/* Controls LLP warm reset propagation */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_llp_reset_en_u {
mmr_t sh_ni0_llp_reset_en_regval;
struct {
@@ -2532,22 +1398,12 @@ typedef union sh_ni0_llp_reset_en_u {
mmr_t reserved_0 : 63;
} sh_ni0_llp_reset_en_s;
} sh_ni0_llp_reset_en_u_t;
-#else
-typedef union sh_ni0_llp_reset_en_u {
- mmr_t sh_ni0_llp_reset_en_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t ok : 1;
- } sh_ni0_llp_reset_en_s;
-} sh_ni0_llp_reset_en_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_LLP_CHAN_MODE" */
/* Sets the signaling mode of LLP and channel */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_llp_chan_mode_u {
mmr_t sh_ni0_llp_chan_mode_regval;
struct {
@@ -2559,26 +1415,12 @@ typedef union sh_ni0_llp_chan_mode_u {
mmr_t reserved_0 : 59;
} sh_ni0_llp_chan_mode_s;
} sh_ni0_llp_chan_mode_u_t;
-#else
-typedef union sh_ni0_llp_chan_mode_u {
- mmr_t sh_ni0_llp_chan_mode_regval;
- struct {
- mmr_t reserved_0 : 59;
- mmr_t enable_clkquad : 1;
- mmr_t enable_rmt_ft_upd : 1;
- mmr_t enable_tuning : 1;
- mmr_t ac_encode : 1;
- mmr_t bitmode32 : 1;
- } sh_ni0_llp_chan_mode_s;
-} sh_ni0_llp_chan_mode_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_LLP_CONFIG" */
/* Sets the configuration of LLP and channel */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_llp_config_u {
mmr_t sh_ni0_llp_config_regval;
struct {
@@ -2589,24 +1431,11 @@ typedef union sh_ni0_llp_config_u {
mmr_t reserved_0 : 26;
} sh_ni0_llp_config_s;
} sh_ni0_llp_config_u_t;
-#else
-typedef union sh_ni0_llp_config_u {
- mmr_t sh_ni0_llp_config_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t ftu_time : 12;
- mmr_t nulltimeout : 6;
- mmr_t maxretry : 10;
- mmr_t maxburst : 10;
- } sh_ni0_llp_config_s;
-} sh_ni0_llp_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_LLP_TEST_CTL" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_llp_test_ctl_u {
mmr_t sh_ni0_llp_test_ctl_regval;
struct {
@@ -2627,77 +1456,36 @@ typedef union sh_ni0_llp_test_ctl_u {
mmr_t reserved_2 : 1;
} sh_ni0_llp_test_ctl_s;
} sh_ni0_llp_test_ctl_u_t;
-#else
-typedef union sh_ni0_llp_test_ctl_u {
- mmr_t sh_ni0_llp_test_ctl_regval;
- struct {
- mmr_t reserved_2 : 1;
- mmr_t cberror : 1;
- mmr_t captured : 1;
- mmr_t fakesnerror : 1;
- mmr_t sendsnerror : 1;
- mmr_t sendcberror : 1;
- mmr_t capturecbonly : 1;
- mmr_t armcapture : 1;
- mmr_t noise_mode : 2;
- mmr_t lfsr_mode : 2;
- mmr_t reserved_1 : 2;
- mmr_t wire_sel : 6;
- mmr_t reserved_0 : 2;
- mmr_t send_test_mode : 2;
- mmr_t pattern : 40;
- } sh_ni0_llp_test_ctl_s;
-} sh_ni0_llp_test_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_LLP_CAPT_WD1" */
/* low order 64-bit captured word */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_ni0_llp_capt_wd1_u {
- mmr_t sh_ni0_llp_capt_wd1_regval;
- struct {
- mmr_t data : 64;
- } sh_ni0_llp_capt_wd1_s;
-} sh_ni0_llp_capt_wd1_u_t;
-#else
typedef union sh_ni0_llp_capt_wd1_u {
mmr_t sh_ni0_llp_capt_wd1_regval;
struct {
mmr_t data : 64;
} sh_ni0_llp_capt_wd1_s;
} sh_ni0_llp_capt_wd1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_LLP_CAPT_WD2" */
/* high order 64-bit captured word */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_llp_capt_wd2_u {
mmr_t sh_ni0_llp_capt_wd2_regval;
struct {
mmr_t data : 64;
} sh_ni0_llp_capt_wd2_s;
} sh_ni0_llp_capt_wd2_u_t;
-#else
-typedef union sh_ni0_llp_capt_wd2_u {
- mmr_t sh_ni0_llp_capt_wd2_regval;
- struct {
- mmr_t data : 64;
- } sh_ni0_llp_capt_wd2_s;
-} sh_ni0_llp_capt_wd2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_LLP_CAPT_SBCB" */
/* captured sideband, sequence, and CRC */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_llp_capt_sbcb_u {
mmr_t sh_ni0_llp_capt_sbcb_regval;
struct {
@@ -2711,27 +1499,11 @@ typedef union sh_ni0_llp_capt_sbcb_u {
mmr_t reserved_0 : 27;
} sh_ni0_llp_capt_sbcb_s;
} sh_ni0_llp_capt_sbcb_u_t;
-#else
-typedef union sh_ni0_llp_capt_sbcb_u {
- mmr_t sh_ni0_llp_capt_sbcb_regval;
- struct {
- mmr_t reserved_0 : 27;
- mmr_t chargeunderflow : 1;
- mmr_t chargeoverflow : 1;
- mmr_t fakedallsnerrors : 1;
- mmr_t sentallsnerrors : 1;
- mmr_t sentallcberrors : 1;
- mmr_t capturedrcvcrc : 16;
- mmr_t capturedrcvsbsn : 16;
- } sh_ni0_llp_capt_sbcb_s;
-} sh_ni0_llp_capt_sbcb_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_LLP_ERR" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_llp_err_u {
mmr_t sh_ni0_llp_err_regval;
struct {
@@ -2747,30 +1519,12 @@ typedef union sh_ni0_llp_err_u {
mmr_t reserved_0 : 11;
} sh_ni0_llp_err_s;
} sh_ni0_llp_err_u_t;
-#else
-typedef union sh_ni0_llp_err_u {
- mmr_t sh_ni0_llp_err_regval;
- struct {
- mmr_t reserved_0 : 11;
- mmr_t wire_overflow : 1;
- mmr_t wire_cnt : 24;
- mmr_t power_not_ok : 1;
- mmr_t squash : 1;
- mmr_t rcv_link_reset : 1;
- mmr_t retry_timeout : 1;
- mmr_t retry_count : 8;
- mmr_t rx_cb_err_count : 8;
- mmr_t rx_sn_err_count : 8;
- } sh_ni0_llp_err_s;
-} sh_ni0_llp_err_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_LLP_STAT" */
/* This register describes the LLP status. */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_llp_stat_u {
mmr_t sh_ni1_llp_stat_regval;
struct {
@@ -2778,22 +1532,12 @@ typedef union sh_ni1_llp_stat_u {
mmr_t reserved_0 : 60;
} sh_ni1_llp_stat_s;
} sh_ni1_llp_stat_u_t;
-#else
-typedef union sh_ni1_llp_stat_u {
- mmr_t sh_ni1_llp_stat_regval;
- struct {
- mmr_t reserved_0 : 60;
- mmr_t link_reset_state : 4;
- } sh_ni1_llp_stat_s;
-} sh_ni1_llp_stat_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_LLP_RESET" */
/* Writing issues a reset to the network interface */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_llp_reset_u {
mmr_t sh_ni1_llp_reset_regval;
struct {
@@ -2802,23 +1546,12 @@ typedef union sh_ni1_llp_reset_u {
mmr_t reserved_0 : 62;
} sh_ni1_llp_reset_s;
} sh_ni1_llp_reset_u_t;
-#else
-typedef union sh_ni1_llp_reset_u {
- mmr_t sh_ni1_llp_reset_regval;
- struct {
- mmr_t reserved_0 : 62;
- mmr_t warm : 1;
- mmr_t link : 1;
- } sh_ni1_llp_reset_s;
-} sh_ni1_llp_reset_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_LLP_RESET_EN" */
/* Controls LLP warm reset propagation */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_llp_reset_en_u {
mmr_t sh_ni1_llp_reset_en_regval;
struct {
@@ -2826,22 +1559,12 @@ typedef union sh_ni1_llp_reset_en_u {
mmr_t reserved_0 : 63;
} sh_ni1_llp_reset_en_s;
} sh_ni1_llp_reset_en_u_t;
-#else
-typedef union sh_ni1_llp_reset_en_u {
- mmr_t sh_ni1_llp_reset_en_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t ok : 1;
- } sh_ni1_llp_reset_en_s;
-} sh_ni1_llp_reset_en_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_LLP_CHAN_MODE" */
/* Sets the signaling mode of LLP and channel */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_llp_chan_mode_u {
mmr_t sh_ni1_llp_chan_mode_regval;
struct {
@@ -2853,26 +1576,12 @@ typedef union sh_ni1_llp_chan_mode_u {
mmr_t reserved_0 : 59;
} sh_ni1_llp_chan_mode_s;
} sh_ni1_llp_chan_mode_u_t;
-#else
-typedef union sh_ni1_llp_chan_mode_u {
- mmr_t sh_ni1_llp_chan_mode_regval;
- struct {
- mmr_t reserved_0 : 59;
- mmr_t enable_clkquad : 1;
- mmr_t enable_rmt_ft_upd : 1;
- mmr_t enable_tuning : 1;
- mmr_t ac_encode : 1;
- mmr_t bitmode32 : 1;
- } sh_ni1_llp_chan_mode_s;
-} sh_ni1_llp_chan_mode_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_LLP_CONFIG" */
/* Sets the configuration of LLP and channel */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_llp_config_u {
mmr_t sh_ni1_llp_config_regval;
struct {
@@ -2883,24 +1592,11 @@ typedef union sh_ni1_llp_config_u {
mmr_t reserved_0 : 26;
} sh_ni1_llp_config_s;
} sh_ni1_llp_config_u_t;
-#else
-typedef union sh_ni1_llp_config_u {
- mmr_t sh_ni1_llp_config_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t ftu_time : 12;
- mmr_t nulltimeout : 6;
- mmr_t maxretry : 10;
- mmr_t maxburst : 10;
- } sh_ni1_llp_config_s;
-} sh_ni1_llp_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_LLP_TEST_CTL" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_llp_test_ctl_u {
mmr_t sh_ni1_llp_test_ctl_regval;
struct {
@@ -2921,77 +1617,36 @@ typedef union sh_ni1_llp_test_ctl_u {
mmr_t reserved_2 : 1;
} sh_ni1_llp_test_ctl_s;
} sh_ni1_llp_test_ctl_u_t;
-#else
-typedef union sh_ni1_llp_test_ctl_u {
- mmr_t sh_ni1_llp_test_ctl_regval;
- struct {
- mmr_t reserved_2 : 1;
- mmr_t cberror : 1;
- mmr_t captured : 1;
- mmr_t fakesnerror : 1;
- mmr_t sendsnerror : 1;
- mmr_t sendcberror : 1;
- mmr_t capturecbonly : 1;
- mmr_t armcapture : 1;
- mmr_t noise_mode : 2;
- mmr_t lfsr_mode : 2;
- mmr_t reserved_1 : 2;
- mmr_t wire_sel : 6;
- mmr_t reserved_0 : 2;
- mmr_t send_test_mode : 2;
- mmr_t pattern : 40;
- } sh_ni1_llp_test_ctl_s;
-} sh_ni1_llp_test_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_LLP_CAPT_WD1" */
/* low order 64-bit captured word */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_ni1_llp_capt_wd1_u {
- mmr_t sh_ni1_llp_capt_wd1_regval;
- struct {
- mmr_t data : 64;
- } sh_ni1_llp_capt_wd1_s;
-} sh_ni1_llp_capt_wd1_u_t;
-#else
typedef union sh_ni1_llp_capt_wd1_u {
mmr_t sh_ni1_llp_capt_wd1_regval;
struct {
mmr_t data : 64;
} sh_ni1_llp_capt_wd1_s;
} sh_ni1_llp_capt_wd1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_LLP_CAPT_WD2" */
/* high order 64-bit captured word */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_ni1_llp_capt_wd2_u {
- mmr_t sh_ni1_llp_capt_wd2_regval;
- struct {
- mmr_t data : 64;
- } sh_ni1_llp_capt_wd2_s;
-} sh_ni1_llp_capt_wd2_u_t;
-#else
typedef union sh_ni1_llp_capt_wd2_u {
mmr_t sh_ni1_llp_capt_wd2_regval;
struct {
mmr_t data : 64;
} sh_ni1_llp_capt_wd2_s;
} sh_ni1_llp_capt_wd2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_LLP_CAPT_SBCB" */
/* captured sideband, sequence, and CRC */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_llp_capt_sbcb_u {
mmr_t sh_ni1_llp_capt_sbcb_regval;
struct {
@@ -3005,27 +1660,11 @@ typedef union sh_ni1_llp_capt_sbcb_u {
mmr_t reserved_0 : 27;
} sh_ni1_llp_capt_sbcb_s;
} sh_ni1_llp_capt_sbcb_u_t;
-#else
-typedef union sh_ni1_llp_capt_sbcb_u {
- mmr_t sh_ni1_llp_capt_sbcb_regval;
- struct {
- mmr_t reserved_0 : 27;
- mmr_t chargeunderflow : 1;
- mmr_t chargeoverflow : 1;
- mmr_t fakedallsnerrors : 1;
- mmr_t sentallsnerrors : 1;
- mmr_t sentallcberrors : 1;
- mmr_t capturedrcvcrc : 16;
- mmr_t capturedrcvsbsn : 16;
- } sh_ni1_llp_capt_sbcb_s;
-} sh_ni1_llp_capt_sbcb_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_LLP_ERR" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_llp_err_u {
mmr_t sh_ni1_llp_err_regval;
struct {
@@ -3041,29 +1680,11 @@ typedef union sh_ni1_llp_err_u {
mmr_t reserved_0 : 11;
} sh_ni1_llp_err_s;
} sh_ni1_llp_err_u_t;
-#else
-typedef union sh_ni1_llp_err_u {
- mmr_t sh_ni1_llp_err_regval;
- struct {
- mmr_t reserved_0 : 11;
- mmr_t wire_overflow : 1;
- mmr_t wire_cnt : 24;
- mmr_t power_not_ok : 1;
- mmr_t squash : 1;
- mmr_t rcv_link_reset : 1;
- mmr_t retry_timeout : 1;
- mmr_t retry_count : 8;
- mmr_t rx_cb_err_count : 8;
- mmr_t rx_sn_err_count : 8;
- } sh_ni1_llp_err_s;
-} sh_ni1_llp_err_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_LLP_TO_FIFO02_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_llp_to_fifo02_flow_u {
mmr_t sh_xnni0_llp_to_fifo02_flow_regval;
struct {
@@ -3084,34 +1705,11 @@ typedef union sh_xnni0_llp_to_fifo02_flow_u {
mmr_t reserved_6 : 2;
} sh_xnni0_llp_to_fifo02_flow_s;
} sh_xnni0_llp_to_fifo02_flow_u_t;
-#else
-typedef union sh_xnni0_llp_to_fifo02_flow_u {
- mmr_t sh_xnni0_llp_to_fifo02_flow_regval;
- struct {
- mmr_t reserved_6 : 2;
- mmr_t credit_vc2_cap : 6;
- mmr_t reserved_5 : 2;
- mmr_t credit_vc2_dyn : 6;
- mmr_t reserved_4 : 10;
- mmr_t credit_vc0_cap : 6;
- mmr_t reserved_3 : 2;
- mmr_t credit_vc0_dyn : 6;
- mmr_t reserved_2 : 8;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t debit_vc2_withhold : 6;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnni0_llp_to_fifo02_flow_s;
-} sh_xnni0_llp_to_fifo02_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_LLP_TO_FIFO13_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_llp_to_fifo13_flow_u {
mmr_t sh_xnni0_llp_to_fifo13_flow_regval;
struct {
@@ -3132,34 +1730,11 @@ typedef union sh_xnni0_llp_to_fifo13_flow_u {
mmr_t reserved_6 : 2;
} sh_xnni0_llp_to_fifo13_flow_s;
} sh_xnni0_llp_to_fifo13_flow_u_t;
-#else
-typedef union sh_xnni0_llp_to_fifo13_flow_u {
- mmr_t sh_xnni0_llp_to_fifo13_flow_regval;
- struct {
- mmr_t reserved_6 : 2;
- mmr_t credit_vc2_cap : 6;
- mmr_t reserved_5 : 2;
- mmr_t credit_vc2_dyn : 6;
- mmr_t reserved_4 : 10;
- mmr_t credit_vc0_cap : 6;
- mmr_t reserved_3 : 2;
- mmr_t credit_vc0_dyn : 6;
- mmr_t reserved_2 : 8;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t debit_vc2_withhold : 6;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnni0_llp_to_fifo13_flow_s;
-} sh_xnni0_llp_to_fifo13_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_LLP_DEBIT_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_llp_debit_flow_u {
mmr_t sh_xnni0_llp_debit_flow_regval;
struct {
@@ -3181,35 +1756,11 @@ typedef union sh_xnni0_llp_debit_flow_u {
mmr_t reserved_7 : 3;
} sh_xnni0_llp_debit_flow_s;
} sh_xnni0_llp_debit_flow_u_t;
-#else
-typedef union sh_xnni0_llp_debit_flow_u {
- mmr_t sh_xnni0_llp_debit_flow_regval;
- struct {
- mmr_t reserved_7 : 3;
- mmr_t debit_vc3_cap : 5;
- mmr_t reserved_6 : 3;
- mmr_t debit_vc3_dyn : 5;
- mmr_t reserved_5 : 3;
- mmr_t debit_vc2_cap : 5;
- mmr_t reserved_4 : 3;
- mmr_t debit_vc2_dyn : 5;
- mmr_t reserved_3 : 3;
- mmr_t debit_vc1_cap : 5;
- mmr_t reserved_2 : 3;
- mmr_t debit_vc1_dyn : 5;
- mmr_t reserved_1 : 3;
- mmr_t debit_vc0_cap : 5;
- mmr_t reserved_0 : 3;
- mmr_t debit_vc0_dyn : 5;
- } sh_xnni0_llp_debit_flow_s;
-} sh_xnni0_llp_debit_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_LINK_0_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_link_0_flow_u {
mmr_t sh_xnni0_link_0_flow_regval;
struct {
@@ -3224,28 +1775,11 @@ typedef union sh_xnni0_link_0_flow_u {
mmr_t reserved_3 : 33;
} sh_xnni0_link_0_flow_s;
} sh_xnni0_link_0_flow_u_t;
-#else
-typedef union sh_xnni0_link_0_flow_u {
- mmr_t sh_xnni0_link_0_flow_regval;
- struct {
- mmr_t reserved_3 : 33;
- mmr_t credit_vc0_cap : 7;
- mmr_t reserved_2 : 1;
- mmr_t credit_vc0_dyn : 7;
- mmr_t reserved_1 : 1;
- mmr_t credit_vc0_test : 7;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnni0_link_0_flow_s;
-} sh_xnni0_link_0_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_LINK_1_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_link_1_flow_u {
mmr_t sh_xnni0_link_1_flow_regval;
struct {
@@ -3260,28 +1794,11 @@ typedef union sh_xnni0_link_1_flow_u {
mmr_t reserved_3 : 33;
} sh_xnni0_link_1_flow_s;
} sh_xnni0_link_1_flow_u_t;
-#else
-typedef union sh_xnni0_link_1_flow_u {
- mmr_t sh_xnni0_link_1_flow_regval;
- struct {
- mmr_t reserved_3 : 33;
- mmr_t credit_vc1_cap : 7;
- mmr_t reserved_2 : 1;
- mmr_t credit_vc1_dyn : 7;
- mmr_t reserved_1 : 1;
- mmr_t credit_vc1_test : 7;
- mmr_t debit_vc1_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc1_withhold : 6;
- } sh_xnni0_link_1_flow_s;
-} sh_xnni0_link_1_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_LINK_2_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_link_2_flow_u {
mmr_t sh_xnni0_link_2_flow_regval;
struct {
@@ -3296,28 +1813,11 @@ typedef union sh_xnni0_link_2_flow_u {
mmr_t reserved_3 : 33;
} sh_xnni0_link_2_flow_s;
} sh_xnni0_link_2_flow_u_t;
-#else
-typedef union sh_xnni0_link_2_flow_u {
- mmr_t sh_xnni0_link_2_flow_regval;
- struct {
- mmr_t reserved_3 : 33;
- mmr_t credit_vc2_cap : 7;
- mmr_t reserved_2 : 1;
- mmr_t credit_vc2_dyn : 7;
- mmr_t reserved_1 : 1;
- mmr_t credit_vc2_test : 7;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc2_withhold : 6;
- } sh_xnni0_link_2_flow_s;
-} sh_xnni0_link_2_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_LINK_3_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_link_3_flow_u {
mmr_t sh_xnni0_link_3_flow_regval;
struct {
@@ -3332,28 +1832,11 @@ typedef union sh_xnni0_link_3_flow_u {
mmr_t reserved_3 : 33;
} sh_xnni0_link_3_flow_s;
} sh_xnni0_link_3_flow_u_t;
-#else
-typedef union sh_xnni0_link_3_flow_u {
- mmr_t sh_xnni0_link_3_flow_regval;
- struct {
- mmr_t reserved_3 : 33;
- mmr_t credit_vc3_cap : 7;
- mmr_t reserved_2 : 1;
- mmr_t credit_vc3_dyn : 7;
- mmr_t reserved_1 : 1;
- mmr_t credit_vc3_test : 7;
- mmr_t debit_vc3_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc3_withhold : 6;
- } sh_xnni0_link_3_flow_s;
-} sh_xnni0_link_3_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_LLP_TO_FIFO02_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_llp_to_fifo02_flow_u {
mmr_t sh_xnni1_llp_to_fifo02_flow_regval;
struct {
@@ -3374,34 +1857,11 @@ typedef union sh_xnni1_llp_to_fifo02_flow_u {
mmr_t reserved_6 : 2;
} sh_xnni1_llp_to_fifo02_flow_s;
} sh_xnni1_llp_to_fifo02_flow_u_t;
-#else
-typedef union sh_xnni1_llp_to_fifo02_flow_u {
- mmr_t sh_xnni1_llp_to_fifo02_flow_regval;
- struct {
- mmr_t reserved_6 : 2;
- mmr_t credit_vc2_cap : 6;
- mmr_t reserved_5 : 2;
- mmr_t credit_vc2_dyn : 6;
- mmr_t reserved_4 : 10;
- mmr_t credit_vc0_cap : 6;
- mmr_t reserved_3 : 2;
- mmr_t credit_vc0_dyn : 6;
- mmr_t reserved_2 : 8;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t debit_vc2_withhold : 6;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnni1_llp_to_fifo02_flow_s;
-} sh_xnni1_llp_to_fifo02_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_LLP_TO_FIFO13_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_llp_to_fifo13_flow_u {
mmr_t sh_xnni1_llp_to_fifo13_flow_regval;
struct {
@@ -3422,34 +1882,11 @@ typedef union sh_xnni1_llp_to_fifo13_flow_u {
mmr_t reserved_6 : 2;
} sh_xnni1_llp_to_fifo13_flow_s;
} sh_xnni1_llp_to_fifo13_flow_u_t;
-#else
-typedef union sh_xnni1_llp_to_fifo13_flow_u {
- mmr_t sh_xnni1_llp_to_fifo13_flow_regval;
- struct {
- mmr_t reserved_6 : 2;
- mmr_t credit_vc2_cap : 6;
- mmr_t reserved_5 : 2;
- mmr_t credit_vc2_dyn : 6;
- mmr_t reserved_4 : 10;
- mmr_t credit_vc0_cap : 6;
- mmr_t reserved_3 : 2;
- mmr_t credit_vc0_dyn : 6;
- mmr_t reserved_2 : 8;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t debit_vc2_withhold : 6;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnni1_llp_to_fifo13_flow_s;
-} sh_xnni1_llp_to_fifo13_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_LLP_DEBIT_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_llp_debit_flow_u {
mmr_t sh_xnni1_llp_debit_flow_regval;
struct {
@@ -3471,35 +1908,11 @@ typedef union sh_xnni1_llp_debit_flow_u {
mmr_t reserved_7 : 3;
} sh_xnni1_llp_debit_flow_s;
} sh_xnni1_llp_debit_flow_u_t;
-#else
-typedef union sh_xnni1_llp_debit_flow_u {
- mmr_t sh_xnni1_llp_debit_flow_regval;
- struct {
- mmr_t reserved_7 : 3;
- mmr_t debit_vc3_cap : 5;
- mmr_t reserved_6 : 3;
- mmr_t debit_vc3_dyn : 5;
- mmr_t reserved_5 : 3;
- mmr_t debit_vc2_cap : 5;
- mmr_t reserved_4 : 3;
- mmr_t debit_vc2_dyn : 5;
- mmr_t reserved_3 : 3;
- mmr_t debit_vc1_cap : 5;
- mmr_t reserved_2 : 3;
- mmr_t debit_vc1_dyn : 5;
- mmr_t reserved_1 : 3;
- mmr_t debit_vc0_cap : 5;
- mmr_t reserved_0 : 3;
- mmr_t debit_vc0_dyn : 5;
- } sh_xnni1_llp_debit_flow_s;
-} sh_xnni1_llp_debit_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_LINK_0_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_link_0_flow_u {
mmr_t sh_xnni1_link_0_flow_regval;
struct {
@@ -3514,28 +1927,11 @@ typedef union sh_xnni1_link_0_flow_u {
mmr_t reserved_3 : 33;
} sh_xnni1_link_0_flow_s;
} sh_xnni1_link_0_flow_u_t;
-#else
-typedef union sh_xnni1_link_0_flow_u {
- mmr_t sh_xnni1_link_0_flow_regval;
- struct {
- mmr_t reserved_3 : 33;
- mmr_t credit_vc0_cap : 7;
- mmr_t reserved_2 : 1;
- mmr_t credit_vc0_dyn : 7;
- mmr_t reserved_1 : 1;
- mmr_t credit_vc0_test : 7;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnni1_link_0_flow_s;
-} sh_xnni1_link_0_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_LINK_1_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_link_1_flow_u {
mmr_t sh_xnni1_link_1_flow_regval;
struct {
@@ -3550,28 +1946,11 @@ typedef union sh_xnni1_link_1_flow_u {
mmr_t reserved_3 : 33;
} sh_xnni1_link_1_flow_s;
} sh_xnni1_link_1_flow_u_t;
-#else
-typedef union sh_xnni1_link_1_flow_u {
- mmr_t sh_xnni1_link_1_flow_regval;
- struct {
- mmr_t reserved_3 : 33;
- mmr_t credit_vc1_cap : 7;
- mmr_t reserved_2 : 1;
- mmr_t credit_vc1_dyn : 7;
- mmr_t reserved_1 : 1;
- mmr_t credit_vc1_test : 7;
- mmr_t debit_vc1_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc1_withhold : 6;
- } sh_xnni1_link_1_flow_s;
-} sh_xnni1_link_1_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_LINK_2_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_link_2_flow_u {
mmr_t sh_xnni1_link_2_flow_regval;
struct {
@@ -3586,28 +1965,11 @@ typedef union sh_xnni1_link_2_flow_u {
mmr_t reserved_3 : 33;
} sh_xnni1_link_2_flow_s;
} sh_xnni1_link_2_flow_u_t;
-#else
-typedef union sh_xnni1_link_2_flow_u {
- mmr_t sh_xnni1_link_2_flow_regval;
- struct {
- mmr_t reserved_3 : 33;
- mmr_t credit_vc2_cap : 7;
- mmr_t reserved_2 : 1;
- mmr_t credit_vc2_dyn : 7;
- mmr_t reserved_1 : 1;
- mmr_t credit_vc2_test : 7;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc2_withhold : 6;
- } sh_xnni1_link_2_flow_s;
-} sh_xnni1_link_2_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_LINK_3_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_link_3_flow_u {
mmr_t sh_xnni1_link_3_flow_regval;
struct {
@@ -3622,29 +1984,12 @@ typedef union sh_xnni1_link_3_flow_u {
mmr_t reserved_3 : 33;
} sh_xnni1_link_3_flow_s;
} sh_xnni1_link_3_flow_u_t;
-#else
-typedef union sh_xnni1_link_3_flow_u {
- mmr_t sh_xnni1_link_3_flow_regval;
- struct {
- mmr_t reserved_3 : 33;
- mmr_t credit_vc3_cap : 7;
- mmr_t reserved_2 : 1;
- mmr_t credit_vc3_dyn : 7;
- mmr_t reserved_1 : 1;
- mmr_t credit_vc3_test : 7;
- mmr_t debit_vc3_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc3_withhold : 6;
- } sh_xnni1_link_3_flow_s;
-} sh_xnni1_link_3_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_IILB_LOCAL_TABLE" */
/* local lookup table */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_iilb_local_table_u {
mmr_t sh_iilb_local_table_regval;
struct {
@@ -3655,25 +2000,12 @@ typedef union sh_iilb_local_table_u {
mmr_t valid : 1;
} sh_iilb_local_table_s;
} sh_iilb_local_table_u_t;
-#else
-typedef union sh_iilb_local_table_u {
- mmr_t sh_iilb_local_table_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_0 : 57;
- mmr_t ni_sel0 : 1;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_iilb_local_table_s;
-} sh_iilb_local_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_IILB_GLOBAL_TABLE" */
/* global lookup table */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_iilb_global_table_u {
mmr_t sh_iilb_global_table_regval;
struct {
@@ -3684,25 +2016,12 @@ typedef union sh_iilb_global_table_u {
mmr_t valid : 1;
} sh_iilb_global_table_s;
} sh_iilb_global_table_u_t;
-#else
-typedef union sh_iilb_global_table_u {
- mmr_t sh_iilb_global_table_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_0 : 57;
- mmr_t ni_sel0 : 1;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_iilb_global_table_s;
-} sh_iilb_global_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_IILB_OVER_RIDE_TABLE" */
/* If enabled, bypass the Global/Local tables */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_iilb_over_ride_table_u {
mmr_t sh_iilb_over_ride_table_regval;
struct {
@@ -3713,46 +2032,24 @@ typedef union sh_iilb_over_ride_table_u {
mmr_t enable : 1;
} sh_iilb_over_ride_table_s;
} sh_iilb_over_ride_table_u_t;
-#else
-typedef union sh_iilb_over_ride_table_u {
- mmr_t sh_iilb_over_ride_table_regval;
- struct {
- mmr_t enable : 1;
- mmr_t reserved_0 : 57;
- mmr_t ni_sel0 : 1;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_iilb_over_ride_table_s;
-} sh_iilb_over_ride_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_IILB_RSP_PLANE_HINT" */
/* If enabled, invert incoming response only plane hint bit before lo */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_iilb_rsp_plane_hint_u {
- mmr_t sh_iilb_rsp_plane_hint_regval;
- struct {
- mmr_t reserved_0 : 64;
- } sh_iilb_rsp_plane_hint_s;
-} sh_iilb_rsp_plane_hint_u_t;
-#else
typedef union sh_iilb_rsp_plane_hint_u {
mmr_t sh_iilb_rsp_plane_hint_regval;
struct {
mmr_t reserved_0 : 64;
} sh_iilb_rsp_plane_hint_s;
} sh_iilb_rsp_plane_hint_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_LOCAL_TABLE" */
/* local lookup table */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_local_table_u {
mmr_t sh_pi_local_table_regval;
struct {
@@ -3767,29 +2064,12 @@ typedef union sh_pi_local_table_u {
mmr_t valid : 1;
} sh_pi_local_table_s;
} sh_pi_local_table_u_t;
-#else
-typedef union sh_pi_local_table_u {
- mmr_t sh_pi_local_table_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_1 : 49;
- mmr_t ni_sel1 : 1;
- mmr_t v1 : 1;
- mmr_t dir1 : 4;
- mmr_t reserved_0 : 2;
- mmr_t ni_sel0 : 1;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_pi_local_table_s;
-} sh_pi_local_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_GLOBAL_TABLE" */
/* global lookup table */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_global_table_u {
mmr_t sh_pi_global_table_regval;
struct {
@@ -3804,29 +2084,12 @@ typedef union sh_pi_global_table_u {
mmr_t valid : 1;
} sh_pi_global_table_s;
} sh_pi_global_table_u_t;
-#else
-typedef union sh_pi_global_table_u {
- mmr_t sh_pi_global_table_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_1 : 49;
- mmr_t ni_sel1 : 1;
- mmr_t v1 : 1;
- mmr_t dir1 : 4;
- mmr_t reserved_0 : 2;
- mmr_t ni_sel0 : 1;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_pi_global_table_s;
-} sh_pi_global_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_OVER_RIDE_TABLE" */
/* If enabled, bypass the Global/Local tables */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_over_ride_table_u {
mmr_t sh_pi_over_ride_table_regval;
struct {
@@ -3841,29 +2104,12 @@ typedef union sh_pi_over_ride_table_u {
mmr_t enable : 1;
} sh_pi_over_ride_table_s;
} sh_pi_over_ride_table_u_t;
-#else
-typedef union sh_pi_over_ride_table_u {
- mmr_t sh_pi_over_ride_table_regval;
- struct {
- mmr_t enable : 1;
- mmr_t reserved_1 : 49;
- mmr_t ni_sel1 : 1;
- mmr_t v1 : 1;
- mmr_t dir1 : 4;
- mmr_t reserved_0 : 2;
- mmr_t ni_sel0 : 1;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_pi_over_ride_table_s;
-} sh_pi_over_ride_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_RSP_PLANE_HINT" */
/* If enabled, invert incoming response only plane hint bit before lo */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_rsp_plane_hint_u {
mmr_t sh_pi_rsp_plane_hint_regval;
struct {
@@ -3871,22 +2117,12 @@ typedef union sh_pi_rsp_plane_hint_u {
mmr_t reserved_0 : 63;
} sh_pi_rsp_plane_hint_s;
} sh_pi_rsp_plane_hint_u_t;
-#else
-typedef union sh_pi_rsp_plane_hint_u {
- mmr_t sh_pi_rsp_plane_hint_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t invert : 1;
- } sh_pi_rsp_plane_hint_s;
-} sh_pi_rsp_plane_hint_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_LOCAL_TABLE" */
/* local lookup table */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_local_table_u {
mmr_t sh_ni0_local_table_regval;
struct {
@@ -3896,24 +2132,12 @@ typedef union sh_ni0_local_table_u {
mmr_t valid : 1;
} sh_ni0_local_table_s;
} sh_ni0_local_table_u_t;
-#else
-typedef union sh_ni0_local_table_u {
- mmr_t sh_ni0_local_table_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_0 : 58;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_ni0_local_table_s;
-} sh_ni0_local_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_GLOBAL_TABLE" */
/* global lookup table */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_global_table_u {
mmr_t sh_ni0_global_table_regval;
struct {
@@ -3923,24 +2147,12 @@ typedef union sh_ni0_global_table_u {
mmr_t valid : 1;
} sh_ni0_global_table_s;
} sh_ni0_global_table_u_t;
-#else
-typedef union sh_ni0_global_table_u {
- mmr_t sh_ni0_global_table_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_0 : 58;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_ni0_global_table_s;
-} sh_ni0_global_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_OVER_RIDE_TABLE" */
/* If enabled, bypass the Global/Local tables */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_over_ride_table_u {
mmr_t sh_ni0_over_ride_table_regval;
struct {
@@ -3950,45 +2162,24 @@ typedef union sh_ni0_over_ride_table_u {
mmr_t enable : 1;
} sh_ni0_over_ride_table_s;
} sh_ni0_over_ride_table_u_t;
-#else
-typedef union sh_ni0_over_ride_table_u {
- mmr_t sh_ni0_over_ride_table_regval;
- struct {
- mmr_t enable : 1;
- mmr_t reserved_0 : 58;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_ni0_over_ride_table_s;
-} sh_ni0_over_ride_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_RSP_PLANE_HINT" */
/* If enabled, invert incoming response only plane hint bit before lo */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_ni0_rsp_plane_hint_u {
- mmr_t sh_ni0_rsp_plane_hint_regval;
- struct {
- mmr_t reserved_0 : 64;
- } sh_ni0_rsp_plane_hint_s;
-} sh_ni0_rsp_plane_hint_u_t;
-#else
typedef union sh_ni0_rsp_plane_hint_u {
mmr_t sh_ni0_rsp_plane_hint_regval;
struct {
mmr_t reserved_0 : 64;
} sh_ni0_rsp_plane_hint_s;
} sh_ni0_rsp_plane_hint_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_LOCAL_TABLE" */
/* local lookup table */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_local_table_u {
mmr_t sh_ni1_local_table_regval;
struct {
@@ -3998,24 +2189,12 @@ typedef union sh_ni1_local_table_u {
mmr_t valid : 1;
} sh_ni1_local_table_s;
} sh_ni1_local_table_u_t;
-#else
-typedef union sh_ni1_local_table_u {
- mmr_t sh_ni1_local_table_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_0 : 58;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_ni1_local_table_s;
-} sh_ni1_local_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_GLOBAL_TABLE" */
/* global lookup table */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_global_table_u {
mmr_t sh_ni1_global_table_regval;
struct {
@@ -4025,24 +2204,12 @@ typedef union sh_ni1_global_table_u {
mmr_t valid : 1;
} sh_ni1_global_table_s;
} sh_ni1_global_table_u_t;
-#else
-typedef union sh_ni1_global_table_u {
- mmr_t sh_ni1_global_table_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_0 : 58;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_ni1_global_table_s;
-} sh_ni1_global_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_OVER_RIDE_TABLE" */
/* If enabled, bypass the Global/Local tables */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_over_ride_table_u {
mmr_t sh_ni1_over_ride_table_regval;
struct {
@@ -4052,45 +2219,24 @@ typedef union sh_ni1_over_ride_table_u {
mmr_t enable : 1;
} sh_ni1_over_ride_table_s;
} sh_ni1_over_ride_table_u_t;
-#else
-typedef union sh_ni1_over_ride_table_u {
- mmr_t sh_ni1_over_ride_table_regval;
- struct {
- mmr_t enable : 1;
- mmr_t reserved_0 : 58;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_ni1_over_ride_table_s;
-} sh_ni1_over_ride_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_RSP_PLANE_HINT" */
/* If enabled, invert incoming response only plane hint bit before lo */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_ni1_rsp_plane_hint_u {
- mmr_t sh_ni1_rsp_plane_hint_regval;
- struct {
- mmr_t reserved_0 : 64;
- } sh_ni1_rsp_plane_hint_s;
-} sh_ni1_rsp_plane_hint_u_t;
-#else
typedef union sh_ni1_rsp_plane_hint_u {
mmr_t sh_ni1_rsp_plane_hint_regval;
struct {
mmr_t reserved_0 : 64;
} sh_ni1_rsp_plane_hint_s;
} sh_ni1_rsp_plane_hint_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_LOCAL_TABLE" */
/* local lookup table */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_local_table_u {
mmr_t sh_md_local_table_regval;
struct {
@@ -4105,29 +2251,12 @@ typedef union sh_md_local_table_u {
mmr_t valid : 1;
} sh_md_local_table_s;
} sh_md_local_table_u_t;
-#else
-typedef union sh_md_local_table_u {
- mmr_t sh_md_local_table_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_1 : 49;
- mmr_t ni_sel1 : 1;
- mmr_t v1 : 1;
- mmr_t dir1 : 4;
- mmr_t reserved_0 : 2;
- mmr_t ni_sel0 : 1;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_md_local_table_s;
-} sh_md_local_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_GLOBAL_TABLE" */
/* global lookup table */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_global_table_u {
mmr_t sh_md_global_table_regval;
struct {
@@ -4142,29 +2271,12 @@ typedef union sh_md_global_table_u {
mmr_t valid : 1;
} sh_md_global_table_s;
} sh_md_global_table_u_t;
-#else
-typedef union sh_md_global_table_u {
- mmr_t sh_md_global_table_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_1 : 49;
- mmr_t ni_sel1 : 1;
- mmr_t v1 : 1;
- mmr_t dir1 : 4;
- mmr_t reserved_0 : 2;
- mmr_t ni_sel0 : 1;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_md_global_table_s;
-} sh_md_global_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_OVER_RIDE_TABLE" */
/* If enabled, bypass the Global/Local tables */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_over_ride_table_u {
mmr_t sh_md_over_ride_table_regval;
struct {
@@ -4179,29 +2291,12 @@ typedef union sh_md_over_ride_table_u {
mmr_t enable : 1;
} sh_md_over_ride_table_s;
} sh_md_over_ride_table_u_t;
-#else
-typedef union sh_md_over_ride_table_u {
- mmr_t sh_md_over_ride_table_regval;
- struct {
- mmr_t enable : 1;
- mmr_t reserved_1 : 49;
- mmr_t ni_sel1 : 1;
- mmr_t v1 : 1;
- mmr_t dir1 : 4;
- mmr_t reserved_0 : 2;
- mmr_t ni_sel0 : 1;
- mmr_t v0 : 1;
- mmr_t dir0 : 4;
- } sh_md_over_ride_table_s;
-} sh_md_over_ride_table_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_RSP_PLANE_HINT" */
/* If enabled, invert incoming response only plane hint bit before lo */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_rsp_plane_hint_u {
mmr_t sh_md_rsp_plane_hint_regval;
struct {
@@ -4209,22 +2304,12 @@ typedef union sh_md_rsp_plane_hint_u {
mmr_t reserved_0 : 63;
} sh_md_rsp_plane_hint_s;
} sh_md_rsp_plane_hint_u_t;
-#else
-typedef union sh_md_rsp_plane_hint_u {
- mmr_t sh_md_rsp_plane_hint_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t invert : 1;
- } sh_md_rsp_plane_hint_s;
-} sh_md_rsp_plane_hint_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_LIQ_CTL" */
/* Local Block LIQ Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_liq_ctl_u {
mmr_t sh_lb_liq_ctl_regval;
struct {
@@ -4238,28 +2323,12 @@ typedef union sh_lb_liq_ctl_u {
mmr_t reserved_2 : 45;
} sh_lb_liq_ctl_s;
} sh_lb_liq_ctl_u_t;
-#else
-typedef union sh_lb_liq_ctl_u {
- mmr_t sh_lb_liq_ctl_regval;
- struct {
- mmr_t reserved_2 : 45;
- mmr_t force_linvv_credit : 1;
- mmr_t force_rp_credit : 1;
- mmr_t force_rq_credit : 1;
- mmr_t reserved_1 : 4;
- mmr_t liq_rpl_ctl : 4;
- mmr_t reserved_0 : 3;
- mmr_t liq_req_ctl : 5;
- } sh_lb_liq_ctl_s;
-} sh_lb_liq_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_LOQ_CTL" */
/* Local Block LOQ Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_loq_ctl_u {
mmr_t sh_lb_loq_ctl_regval;
struct {
@@ -4268,23 +2337,12 @@ typedef union sh_lb_loq_ctl_u {
mmr_t reserved_0 : 62;
} sh_lb_loq_ctl_s;
} sh_lb_loq_ctl_u_t;
-#else
-typedef union sh_lb_loq_ctl_u {
- mmr_t sh_lb_loq_ctl_regval;
- struct {
- mmr_t reserved_0 : 62;
- mmr_t loq_rpl_ctl : 1;
- mmr_t loq_req_ctl : 1;
- } sh_lb_loq_ctl_s;
-} sh_lb_loq_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_MAX_REP_CREDIT_CNT" */
/* Maximum number of reply credits from XN */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_max_rep_credit_cnt_u {
mmr_t sh_lb_max_rep_credit_cnt_regval;
struct {
@@ -4292,22 +2350,12 @@ typedef union sh_lb_max_rep_credit_cnt_u {
mmr_t reserved_0 : 59;
} sh_lb_max_rep_credit_cnt_s;
} sh_lb_max_rep_credit_cnt_u_t;
-#else
-typedef union sh_lb_max_rep_credit_cnt_u {
- mmr_t sh_lb_max_rep_credit_cnt_regval;
- struct {
- mmr_t reserved_0 : 59;
- mmr_t max_cnt : 5;
- } sh_lb_max_rep_credit_cnt_s;
-} sh_lb_max_rep_credit_cnt_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_MAX_REQ_CREDIT_CNT" */
/* Maximum number of request credits from XN */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_max_req_credit_cnt_u {
mmr_t sh_lb_max_req_credit_cnt_regval;
struct {
@@ -4315,22 +2363,12 @@ typedef union sh_lb_max_req_credit_cnt_u {
mmr_t reserved_0 : 59;
} sh_lb_max_req_credit_cnt_s;
} sh_lb_max_req_credit_cnt_u_t;
-#else
-typedef union sh_lb_max_req_credit_cnt_u {
- mmr_t sh_lb_max_req_credit_cnt_regval;
- struct {
- mmr_t reserved_0 : 59;
- mmr_t max_cnt : 5;
- } sh_lb_max_req_credit_cnt_s;
-} sh_lb_max_req_credit_cnt_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PIO_TIME_OUT" */
/* Local Block PIO time out value */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pio_time_out_u {
mmr_t sh_pio_time_out_regval;
struct {
@@ -4338,22 +2376,12 @@ typedef union sh_pio_time_out_u {
mmr_t reserved_0 : 48;
} sh_pio_time_out_s;
} sh_pio_time_out_u_t;
-#else
-typedef union sh_pio_time_out_u {
- mmr_t sh_pio_time_out_regval;
- struct {
- mmr_t reserved_0 : 48;
- mmr_t value : 16;
- } sh_pio_time_out_s;
-} sh_pio_time_out_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PIO_NACK_RESET" */
/* Local Block PIO Reset for nack counters */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pio_nack_reset_u {
mmr_t sh_pio_nack_reset_regval;
struct {
@@ -4361,22 +2389,12 @@ typedef union sh_pio_nack_reset_u {
mmr_t reserved_0 : 63;
} sh_pio_nack_reset_s;
} sh_pio_nack_reset_u_t;
-#else
-typedef union sh_pio_nack_reset_u {
- mmr_t sh_pio_nack_reset_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t pulse : 1;
- } sh_pio_nack_reset_s;
-} sh_pio_nack_reset_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_CONVEYOR_BELT_TIME_OUT" */
/* Local Block conveyor belt time out value */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_conveyor_belt_time_out_u {
mmr_t sh_conveyor_belt_time_out_regval;
struct {
@@ -4384,22 +2402,12 @@ typedef union sh_conveyor_belt_time_out_u {
mmr_t reserved_0 : 52;
} sh_conveyor_belt_time_out_s;
} sh_conveyor_belt_time_out_u_t;
-#else
-typedef union sh_conveyor_belt_time_out_u {
- mmr_t sh_conveyor_belt_time_out_regval;
- struct {
- mmr_t reserved_0 : 52;
- mmr_t value : 12;
- } sh_conveyor_belt_time_out_s;
-} sh_conveyor_belt_time_out_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_CREDIT_STATUS" */
/* Credit Counter Status Register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_credit_status_u {
mmr_t sh_lb_credit_status_regval;
struct {
@@ -4413,28 +2421,12 @@ typedef union sh_lb_credit_status_u {
mmr_t reserved_2 : 36;
} sh_lb_credit_status_s;
} sh_lb_credit_status_u_t;
-#else
-typedef union sh_lb_credit_status_u {
- mmr_t sh_lb_credit_status_regval;
- struct {
- mmr_t reserved_2 : 36;
- mmr_t loq_rp_credit : 5;
- mmr_t loq_rq_credit : 5;
- mmr_t linvv_credit : 6;
- mmr_t reserved_1 : 2;
- mmr_t liq_rp_credit : 4;
- mmr_t reserved_0 : 1;
- mmr_t liq_rq_credit : 5;
- } sh_lb_credit_status_s;
-} sh_lb_credit_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_DEBUG_LOCAL_SEL" */
/* LB Debug Port Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_debug_local_sel_u {
mmr_t sh_lb_debug_local_sel_regval;
struct {
@@ -4472,52 +2464,12 @@ typedef union sh_lb_debug_local_sel_u {
mmr_t trigger_enable : 1;
} sh_lb_debug_local_sel_s;
} sh_lb_debug_local_sel_u_t;
-#else
-typedef union sh_lb_debug_local_sel_u {
- mmr_t sh_lb_debug_local_sel_regval;
- struct {
- mmr_t trigger_enable : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_chiplet_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_chiplet_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_chiplet_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_chiplet_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_chiplet_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_chiplet_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_chiplet_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_chiplet_sel : 3;
- } sh_lb_debug_local_sel_s;
-} sh_lb_debug_local_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_DEBUG_PERF_SEL" */
/* LB Debug Port Performance Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_debug_perf_sel_u {
mmr_t sh_lb_debug_perf_sel_regval;
struct {
@@ -4555,52 +2507,12 @@ typedef union sh_lb_debug_perf_sel_u {
mmr_t reserved_15 : 1;
} sh_lb_debug_perf_sel_s;
} sh_lb_debug_perf_sel_u_t;
-#else
-typedef union sh_lb_debug_perf_sel_u {
- mmr_t sh_lb_debug_perf_sel_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_chiplet_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_chiplet_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_chiplet_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_chiplet_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_chiplet_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_chiplet_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_chiplet_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_chiplet_sel : 3;
- } sh_lb_debug_perf_sel_s;
-} sh_lb_debug_perf_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_DEBUG_TRIG_SEL" */
/* LB Debug Trigger Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_debug_trig_sel_u {
mmr_t sh_lb_debug_trig_sel_regval;
struct {
@@ -4638,52 +2550,12 @@ typedef union sh_lb_debug_trig_sel_u {
mmr_t reserved_15 : 1;
} sh_lb_debug_trig_sel_s;
} sh_lb_debug_trig_sel_u_t;
-#else
-typedef union sh_lb_debug_trig_sel_u {
- mmr_t sh_lb_debug_trig_sel_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t trigger7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t trigger7_chiplet_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t trigger6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t trigger6_chiplet_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t trigger5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t trigger5_chiplet_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t trigger4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t trigger4_chiplet_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t trigger3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t trigger3_chiplet_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t trigger2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t trigger2_chiplet_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t trigger1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t trigger1_chiplet_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t trigger0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t trigger0_chiplet_sel : 3;
- } sh_lb_debug_trig_sel_s;
-} sh_lb_debug_trig_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_ERROR_DETAIL_1" */
/* LB Error capture information: HDR1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_error_detail_1_u {
mmr_t sh_lb_error_detail_1_regval;
struct {
@@ -4700,31 +2572,12 @@ typedef union sh_lb_error_detail_1_u {
mmr_t valid : 1;
} sh_lb_error_detail_1_s;
} sh_lb_error_detail_1_u_t;
-#else
-typedef union sh_lb_error_detail_1_u {
- mmr_t sh_lb_error_detail_1_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_3 : 13;
- mmr_t data_err : 1;
- mmr_t hdr_err : 1;
- mmr_t reserved_2 : 5;
- mmr_t dest : 3;
- mmr_t reserved_1 : 2;
- mmr_t source : 14;
- mmr_t reserved_0 : 2;
- mmr_t suppl : 14;
- mmr_t command : 8;
- } sh_lb_error_detail_1_s;
-} sh_lb_error_detail_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_ERROR_DETAIL_2" */
/* LB Error Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_error_detail_2_u {
mmr_t sh_lb_error_detail_2_regval;
struct {
@@ -4732,64 +2585,36 @@ typedef union sh_lb_error_detail_2_u {
mmr_t reserved_0 : 17;
} sh_lb_error_detail_2_s;
} sh_lb_error_detail_2_u_t;
-#else
-typedef union sh_lb_error_detail_2_u {
- mmr_t sh_lb_error_detail_2_regval;
- struct {
- mmr_t reserved_0 : 17;
- mmr_t address : 47;
- } sh_lb_error_detail_2_s;
-} sh_lb_error_detail_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_ERROR_DETAIL_3" */
/* LB Error Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_lb_error_detail_3_u {
- mmr_t sh_lb_error_detail_3_regval;
- struct {
- mmr_t data : 64;
- } sh_lb_error_detail_3_s;
-} sh_lb_error_detail_3_u_t;
-#else
typedef union sh_lb_error_detail_3_u {
mmr_t sh_lb_error_detail_3_regval;
struct {
mmr_t data : 64;
} sh_lb_error_detail_3_s;
} sh_lb_error_detail_3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_ERROR_DETAIL_4" */
/* LB Error Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_lb_error_detail_4_u {
- mmr_t sh_lb_error_detail_4_regval;
- struct {
- mmr_t route : 64;
- } sh_lb_error_detail_4_s;
-} sh_lb_error_detail_4_u_t;
-#else
typedef union sh_lb_error_detail_4_u {
mmr_t sh_lb_error_detail_4_regval;
struct {
mmr_t route : 64;
} sh_lb_error_detail_4_s;
} sh_lb_error_detail_4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_ERROR_DETAIL_5" */
/* LB Error Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_error_detail_5_u {
mmr_t sh_lb_error_detail_5_regval;
struct {
@@ -4803,28 +2628,12 @@ typedef union sh_lb_error_detail_5_u {
mmr_t reserved_0 : 57;
} sh_lb_error_detail_5_s;
} sh_lb_error_detail_5_u_t;
-#else
-typedef union sh_lb_error_detail_5_u {
- mmr_t sh_lb_error_detail_5_regval;
- struct {
- mmr_t reserved_0 : 57;
- mmr_t nack_b_timeout : 1;
- mmr_t nack_a_timeout : 1;
- mmr_t count_b_overflow : 1;
- mmr_t count_a_overflow : 1;
- mmr_t write_retry : 1;
- mmr_t ptc1_write : 1;
- mmr_t read_retry : 1;
- } sh_lb_error_detail_5_s;
-} sh_lb_error_detail_5_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_ERROR_MASK" */
/* LB Error Mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_error_mask_u {
mmr_t sh_lb_error_mask_regval;
struct {
@@ -4854,44 +2663,12 @@ typedef union sh_lb_error_mask_u {
mmr_t reserved_0 : 41;
} sh_lb_error_mask_s;
} sh_lb_error_mask_u_t;
-#else
-typedef union sh_lb_error_mask_u {
- mmr_t sh_lb_error_mask_regval;
- struct {
- mmr_t reserved_0 : 41;
- mmr_t rp_credit_overflow : 1;
- mmr_t rq_credit_overflow : 1;
- mmr_t unexp_valid : 1;
- mmr_t rp_fifo_error : 1;
- mmr_t rq_fifo_error : 1;
- mmr_t gclk_drop : 1;
- mmr_t vector_rp_route_error : 1;
- mmr_t vector_rq_route_error : 1;
- mmr_t pio_cb_err : 1;
- mmr_t junk_bus_err : 1;
- mmr_t ptc_1_timeout : 1;
- mmr_t unexpected_linv : 1;
- mmr_t linvv_overflow : 1;
- mmr_t rq_time_out : 1;
- mmr_t rq_bad_addr : 1;
- mmr_t rp_bad_data : 1;
- mmr_t rq_bad_data : 1;
- mmr_t rp_long : 1;
- mmr_t rq_long : 1;
- mmr_t rp_short : 1;
- mmr_t rq_short : 1;
- mmr_t rp_bad_cmd : 1;
- mmr_t rq_bad_cmd : 1;
- } sh_lb_error_mask_s;
-} sh_lb_error_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_ERROR_OVERFLOW" */
/* LB Error Overflow */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_error_overflow_u {
mmr_t sh_lb_error_overflow_regval;
struct {
@@ -4921,44 +2698,12 @@ typedef union sh_lb_error_overflow_u {
mmr_t reserved_0 : 41;
} sh_lb_error_overflow_s;
} sh_lb_error_overflow_u_t;
-#else
-typedef union sh_lb_error_overflow_u {
- mmr_t sh_lb_error_overflow_regval;
- struct {
- mmr_t reserved_0 : 41;
- mmr_t rp_credit_overflow_ovrfl : 1;
- mmr_t rq_credit_overflow_ovrfl : 1;
- mmr_t unexp_valid_ovrfl : 1;
- mmr_t rp_fifo_error_ovrfl : 1;
- mmr_t rq_fifo_error_ovrfl : 1;
- mmr_t gclk_drop_ovrfl : 1;
- mmr_t vector_rp_route_error_ovrfl : 1;
- mmr_t vector_rq_route_error_ovrfl : 1;
- mmr_t pio_cb_err_ovrfl : 1;
- mmr_t junk_bus_err_ovrfl : 1;
- mmr_t ptc_1_timeout_ovrfl : 1;
- mmr_t unexpected_linv_ovrfl : 1;
- mmr_t linvv_overflow_ovrfl : 1;
- mmr_t rq_time_out_ovrfl : 1;
- mmr_t rq_bad_addr_ovrfl : 1;
- mmr_t rp_bad_data_ovrfl : 1;
- mmr_t rq_bad_data_ovrfl : 1;
- mmr_t rp_long_ovrfl : 1;
- mmr_t rq_long_ovrfl : 1;
- mmr_t rp_short_ovrfl : 1;
- mmr_t rq_short_ovrfl : 1;
- mmr_t rp_bad_cmd_ovrfl : 1;
- mmr_t rq_bad_cmd_ovrfl : 1;
- } sh_lb_error_overflow_s;
-} sh_lb_error_overflow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_ERROR_SUMMARY" */
/* LB Error Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_error_summary_u {
mmr_t sh_lb_error_summary_regval;
struct {
@@ -4988,44 +2733,12 @@ typedef union sh_lb_error_summary_u {
mmr_t reserved_0 : 41;
} sh_lb_error_summary_s;
} sh_lb_error_summary_u_t;
-#else
-typedef union sh_lb_error_summary_u {
- mmr_t sh_lb_error_summary_regval;
- struct {
- mmr_t reserved_0 : 41;
- mmr_t rp_credit_overflow : 1;
- mmr_t rq_credit_overflow : 1;
- mmr_t unexp_valid : 1;
- mmr_t rp_fifo_error : 1;
- mmr_t rq_fifo_error : 1;
- mmr_t gclk_drop : 1;
- mmr_t vector_rp_route_error : 1;
- mmr_t vector_rq_route_error : 1;
- mmr_t pio_cb_err : 1;
- mmr_t junk_bus_err : 1;
- mmr_t ptc_1_timeout : 1;
- mmr_t unexpected_linv : 1;
- mmr_t linvv_overflow : 1;
- mmr_t rq_time_out : 1;
- mmr_t rq_bad_addr : 1;
- mmr_t rp_bad_data : 1;
- mmr_t rq_bad_data : 1;
- mmr_t rp_long : 1;
- mmr_t rq_long : 1;
- mmr_t rp_short : 1;
- mmr_t rq_short : 1;
- mmr_t rp_bad_cmd : 1;
- mmr_t rq_bad_cmd : 1;
- } sh_lb_error_summary_s;
-} sh_lb_error_summary_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_FIRST_ERROR" */
/* LB First Error */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_first_error_u {
mmr_t sh_lb_first_error_regval;
struct {
@@ -5055,44 +2768,12 @@ typedef union sh_lb_first_error_u {
mmr_t reserved_0 : 41;
} sh_lb_first_error_s;
} sh_lb_first_error_u_t;
-#else
-typedef union sh_lb_first_error_u {
- mmr_t sh_lb_first_error_regval;
- struct {
- mmr_t reserved_0 : 41;
- mmr_t rp_credit_overflow : 1;
- mmr_t rq_credit_overflow : 1;
- mmr_t unexp_valid : 1;
- mmr_t rp_fifo_error : 1;
- mmr_t rq_fifo_error : 1;
- mmr_t gclk_drop : 1;
- mmr_t vector_rp_route_error : 1;
- mmr_t vector_rq_route_error : 1;
- mmr_t pio_cb_err : 1;
- mmr_t junk_bus_err : 1;
- mmr_t ptc_1_timeout : 1;
- mmr_t unexpected_linv : 1;
- mmr_t linvv_overflow : 1;
- mmr_t rq_time_out : 1;
- mmr_t rq_bad_addr : 1;
- mmr_t rp_bad_data : 1;
- mmr_t rq_bad_data : 1;
- mmr_t rp_long : 1;
- mmr_t rq_long : 1;
- mmr_t rp_short : 1;
- mmr_t rq_short : 1;
- mmr_t rp_bad_cmd : 1;
- mmr_t rq_bad_cmd : 1;
- } sh_lb_first_error_s;
-} sh_lb_first_error_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_LAST_CREDIT" */
/* Credit counter status register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_last_credit_u {
mmr_t sh_lb_last_credit_regval;
struct {
@@ -5106,28 +2787,12 @@ typedef union sh_lb_last_credit_u {
mmr_t reserved_2 : 36;
} sh_lb_last_credit_s;
} sh_lb_last_credit_u_t;
-#else
-typedef union sh_lb_last_credit_u {
- mmr_t sh_lb_last_credit_regval;
- struct {
- mmr_t reserved_2 : 36;
- mmr_t loq_rp_credit : 5;
- mmr_t loq_rq_credit : 5;
- mmr_t linvv_credit : 6;
- mmr_t reserved_1 : 2;
- mmr_t liq_rp_credit : 4;
- mmr_t reserved_0 : 1;
- mmr_t liq_rq_credit : 5;
- } sh_lb_last_credit_s;
-} sh_lb_last_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_NACK_STATUS" */
/* Nack Counter Status Register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_nack_status_u {
mmr_t sh_lb_nack_status_regval;
struct {
@@ -5141,28 +2806,12 @@ typedef union sh_lb_nack_status_u {
mmr_t reserved_2 : 2;
} sh_lb_nack_status_s;
} sh_lb_nack_status_u_t;
-#else
-typedef union sh_lb_nack_status_u {
- mmr_t sh_lb_nack_status_regval;
- struct {
- mmr_t reserved_2 : 2;
- mmr_t cb_state : 2;
- mmr_t cb_timeout_count : 12;
- mmr_t junk_nack : 16;
- mmr_t reserved_1 : 4;
- mmr_t pio_nack_b : 12;
- mmr_t reserved_0 : 4;
- mmr_t pio_nack_a : 12;
- } sh_lb_nack_status_s;
-} sh_lb_nack_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_TRIGGER_COMPARE" */
/* LB Test-point Trigger Compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_trigger_compare_u {
mmr_t sh_lb_trigger_compare_regval;
struct {
@@ -5170,22 +2819,12 @@ typedef union sh_lb_trigger_compare_u {
mmr_t reserved_0 : 32;
} sh_lb_trigger_compare_s;
} sh_lb_trigger_compare_u_t;
-#else
-typedef union sh_lb_trigger_compare_u {
- mmr_t sh_lb_trigger_compare_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t mask : 32;
- } sh_lb_trigger_compare_s;
-} sh_lb_trigger_compare_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_TRIGGER_DATA" */
/* LB Test-point Trigger Compare Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_trigger_data_u {
mmr_t sh_lb_trigger_data_regval;
struct {
@@ -5193,22 +2832,12 @@ typedef union sh_lb_trigger_data_u {
mmr_t reserved_0 : 32;
} sh_lb_trigger_data_s;
} sh_lb_trigger_data_u_t;
-#else
-typedef union sh_lb_trigger_data_u {
- mmr_t sh_lb_trigger_data_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t compare_pattern : 32;
- } sh_lb_trigger_data_s;
-} sh_lb_trigger_data_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_AEC_CONFIG" */
/* PI Adaptive Error Correction Configuration */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_aec_config_u {
mmr_t sh_pi_aec_config_regval;
struct {
@@ -5216,22 +2845,12 @@ typedef union sh_pi_aec_config_u {
mmr_t reserved_0 : 61;
} sh_pi_aec_config_s;
} sh_pi_aec_config_u_t;
-#else
-typedef union sh_pi_aec_config_u {
- mmr_t sh_pi_aec_config_regval;
- struct {
- mmr_t reserved_0 : 61;
- mmr_t mode : 3;
- } sh_pi_aec_config_s;
-} sh_pi_aec_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_AFI_ERROR_MASK" */
/* PI AFI Error Mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_afi_error_mask_u {
mmr_t sh_pi_afi_error_mask_regval;
struct {
@@ -5253,36 +2872,12 @@ typedef union sh_pi_afi_error_mask_u {
mmr_t reserved_1 : 29;
} sh_pi_afi_error_mask_s;
} sh_pi_afi_error_mask_u_t;
-#else
-typedef union sh_pi_afi_error_mask_u {
- mmr_t sh_pi_afi_error_mask_regval;
- struct {
- mmr_t reserved_1 : 29;
- mmr_t msg_len : 1;
- mmr_t fsb_tbl_miss : 1;
- mmr_t bad_snoop : 1;
- mmr_t livelock : 1;
- mmr_t shub_fsb_ce : 1;
- mmr_t shub_fsb_uce : 1;
- mmr_t shub_fsb_dqe : 1;
- mmr_t addr_parity : 1;
- mmr_t req_parity : 1;
- mmr_t addr_access : 1;
- mmr_t req_format : 1;
- mmr_t ioq_overrun : 1;
- mmr_t rsp_parity : 1;
- mmr_t hung_bus : 1;
- mmr_t reserved_0 : 21;
- } sh_pi_afi_error_mask_s;
-} sh_pi_afi_error_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_AFI_TEST_POINT_COMPARE" */
/* PI AFI Test Point Compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_afi_test_point_compare_u {
mmr_t sh_pi_afi_test_point_compare_regval;
struct {
@@ -5290,22 +2885,12 @@ typedef union sh_pi_afi_test_point_compare_u {
mmr_t compare_pattern : 32;
} sh_pi_afi_test_point_compare_s;
} sh_pi_afi_test_point_compare_u_t;
-#else
-typedef union sh_pi_afi_test_point_compare_u {
- mmr_t sh_pi_afi_test_point_compare_regval;
- struct {
- mmr_t compare_pattern : 32;
- mmr_t compare_mask : 32;
- } sh_pi_afi_test_point_compare_s;
-} sh_pi_afi_test_point_compare_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_AFI_TEST_POINT_SELECT" */
/* PI AFI Test Point Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_afi_test_point_select_u {
mmr_t sh_pi_afi_test_point_select_regval;
struct {
@@ -5335,44 +2920,12 @@ typedef union sh_pi_afi_test_point_select_u {
mmr_t trigger_enable : 1;
} sh_pi_afi_test_point_select_s;
} sh_pi_afi_test_point_select_u_t;
-#else
-typedef union sh_pi_afi_test_point_select_u {
- mmr_t sh_pi_afi_test_point_select_regval;
- struct {
- mmr_t trigger_enable : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t nibble7_chiplet_sel : 4;
- mmr_t reserved_6 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t nibble6_chiplet_sel : 4;
- mmr_t reserved_5 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t nibble5_chiplet_sel : 4;
- mmr_t reserved_4 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t nibble4_chiplet_sel : 4;
- mmr_t reserved_3 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t nibble3_chiplet_sel : 4;
- mmr_t reserved_2 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t nibble2_chiplet_sel : 4;
- mmr_t reserved_1 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t nibble1_chiplet_sel : 4;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t nibble0_chiplet_sel : 4;
- } sh_pi_afi_test_point_select_s;
-} sh_pi_afi_test_point_select_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_AFI_TEST_POINT_TRIGGER_SELECT" */
/* PI CRBC Test Point Trigger Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_afi_test_point_trigger_select_u {
mmr_t sh_pi_afi_test_point_trigger_select_regval;
struct {
@@ -5402,44 +2955,12 @@ typedef union sh_pi_afi_test_point_trigger_select_u {
mmr_t reserved_7 : 1;
} sh_pi_afi_test_point_trigger_select_s;
} sh_pi_afi_test_point_trigger_select_u_t;
-#else
-typedef union sh_pi_afi_test_point_trigger_select_u {
- mmr_t sh_pi_afi_test_point_trigger_select_regval;
- struct {
- mmr_t reserved_7 : 1;
- mmr_t trigger7_nibble_sel : 3;
- mmr_t trigger7_chiplet_sel : 4;
- mmr_t reserved_6 : 1;
- mmr_t trigger6_nibble_sel : 3;
- mmr_t trigger6_chiplet_sel : 4;
- mmr_t reserved_5 : 1;
- mmr_t trigger5_nibble_sel : 3;
- mmr_t trigger5_chiplet_sel : 4;
- mmr_t reserved_4 : 1;
- mmr_t trigger4_nibble_sel : 3;
- mmr_t trigger4_chiplet_sel : 4;
- mmr_t reserved_3 : 1;
- mmr_t trigger3_nibble_sel : 3;
- mmr_t trigger3_chiplet_sel : 4;
- mmr_t reserved_2 : 1;
- mmr_t trigger2_nibble_sel : 3;
- mmr_t trigger2_chiplet_sel : 4;
- mmr_t reserved_1 : 1;
- mmr_t trigger1_nibble_sel : 3;
- mmr_t trigger1_chiplet_sel : 4;
- mmr_t reserved_0 : 1;
- mmr_t trigger0_nibble_sel : 3;
- mmr_t trigger0_chiplet_sel : 4;
- } sh_pi_afi_test_point_trigger_select_s;
-} sh_pi_afi_test_point_trigger_select_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_AUTO_REPLY_ENABLE" */
/* PI Auto Reply Enable */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_auto_reply_enable_u {
mmr_t sh_pi_auto_reply_enable_regval;
struct {
@@ -5447,22 +2968,12 @@ typedef union sh_pi_auto_reply_enable_u {
mmr_t reserved_0 : 63;
} sh_pi_auto_reply_enable_s;
} sh_pi_auto_reply_enable_u_t;
-#else
-typedef union sh_pi_auto_reply_enable_u {
- mmr_t sh_pi_auto_reply_enable_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t auto_reply_enable : 1;
- } sh_pi_auto_reply_enable_s;
-} sh_pi_auto_reply_enable_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CAM_CONTROL" */
/* CRB CAM MMR Access Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_cam_control_u {
mmr_t sh_pi_cam_control_regval;
struct {
@@ -5474,26 +2985,12 @@ typedef union sh_pi_cam_control_u {
mmr_t start : 1;
} sh_pi_cam_control_s;
} sh_pi_cam_control_u_t;
-#else
-typedef union sh_pi_cam_control_u {
- mmr_t sh_pi_cam_control_regval;
- struct {
- mmr_t start : 1;
- mmr_t reserved_1 : 53;
- mmr_t rrb_rd_xfer_clear : 1;
- mmr_t cam_write : 1;
- mmr_t reserved_0 : 1;
- mmr_t cam_indx : 7;
- } sh_pi_cam_control_s;
-} sh_pi_cam_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBC_TEST_POINT_COMPARE" */
/* PI CRBC Test Point Compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbc_test_point_compare_u {
mmr_t sh_pi_crbc_test_point_compare_regval;
struct {
@@ -5501,22 +2998,12 @@ typedef union sh_pi_crbc_test_point_compare_u {
mmr_t compare_pattern : 32;
} sh_pi_crbc_test_point_compare_s;
} sh_pi_crbc_test_point_compare_u_t;
-#else
-typedef union sh_pi_crbc_test_point_compare_u {
- mmr_t sh_pi_crbc_test_point_compare_regval;
- struct {
- mmr_t compare_pattern : 32;
- mmr_t compare_mask : 32;
- } sh_pi_crbc_test_point_compare_s;
-} sh_pi_crbc_test_point_compare_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBC_TEST_POINT_SELECT" */
/* PI CRBC Test Point Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbc_test_point_select_u {
mmr_t sh_pi_crbc_test_point_select_regval;
struct {
@@ -5554,52 +3041,12 @@ typedef union sh_pi_crbc_test_point_select_u {
mmr_t trigger_enable : 1;
} sh_pi_crbc_test_point_select_s;
} sh_pi_crbc_test_point_select_u_t;
-#else
-typedef union sh_pi_crbc_test_point_select_u {
- mmr_t sh_pi_crbc_test_point_select_regval;
- struct {
- mmr_t trigger_enable : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_chiplet_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_chiplet_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_chiplet_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_chiplet_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_chiplet_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_chiplet_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_chiplet_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_chiplet_sel : 3;
- } sh_pi_crbc_test_point_select_s;
-} sh_pi_crbc_test_point_select_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBC_TEST_POINT_TRIGGER_SELECT" */
/* PI CRBC Test Point Trigger Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbc_test_point_trigger_select_u {
mmr_t sh_pi_crbc_test_point_trigger_select_regval;
struct {
@@ -5637,52 +3084,12 @@ typedef union sh_pi_crbc_test_point_trigger_select_u {
mmr_t reserved_15 : 1;
} sh_pi_crbc_test_point_trigger_select_s;
} sh_pi_crbc_test_point_trigger_select_u_t;
-#else
-typedef union sh_pi_crbc_test_point_trigger_select_u {
- mmr_t sh_pi_crbc_test_point_trigger_select_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t trigger7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t trigger7_chiplet_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t trigger6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t trigger6_chiplet_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t trigger5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t trigger5_chiplet_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t trigger4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t trigger4_chiplet_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t trigger3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t trigger3_chiplet_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t trigger2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t trigger2_chiplet_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t trigger1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t trigger1_chiplet_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t trigger0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t trigger0_chiplet_sel : 3;
- } sh_pi_crbc_test_point_trigger_select_s;
-} sh_pi_crbc_test_point_trigger_select_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBP_ERROR_MASK" */
/* PI CRBP Error Mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbp_error_mask_u {
mmr_t sh_pi_crbp_error_mask_regval;
struct {
@@ -5710,42 +3117,12 @@ typedef union sh_pi_crbp_error_mask_u {
mmr_t reserved_0 : 43;
} sh_pi_crbp_error_mask_s;
} sh_pi_crbp_error_mask_u_t;
-#else
-typedef union sh_pi_crbp_error_mask_u {
- mmr_t sh_pi_crbp_error_mask_regval;
- struct {
- mmr_t reserved_0 : 43;
- mmr_t xn_rp_crd_oflow : 1;
- mmr_t xn_rq_crd_oflow : 1;
- mmr_t md_rp_crd_oflow : 1;
- mmr_t md_rq_crd_oflow : 1;
- mmr_t gfx_int_1 : 1;
- mmr_t gfx_int_0 : 1;
- mmr_t nack_oflow : 1;
- mmr_t xn_rp_q_oflow : 1;
- mmr_t xn_rq_q_oflow : 1;
- mmr_t md_rp_q_oflow : 1;
- mmr_t md_rq_q_oflow : 1;
- mmr_t msg_color_err : 1;
- mmr_t fsb_shub_ce : 1;
- mmr_t fsb_shub_uce : 1;
- mmr_t pio_to_err : 1;
- mmr_t mem_to_err : 1;
- mmr_t pio_rp_err : 1;
- mmr_t mem_rp_err : 1;
- mmr_t xb_proto_err : 1;
- mmr_t gfx_rp_err : 1;
- mmr_t fsb_proto_err : 1;
- } sh_pi_crbp_error_mask_s;
-} sh_pi_crbp_error_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBP_FSB_PIPE_COMPARE" */
/* CRBP FSB Pipe Compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbp_fsb_pipe_compare_u {
mmr_t sh_pi_crbp_fsb_pipe_compare_regval;
struct {
@@ -5754,23 +3131,12 @@ typedef union sh_pi_crbp_fsb_pipe_compare_u {
mmr_t reserved_0 : 11;
} sh_pi_crbp_fsb_pipe_compare_s;
} sh_pi_crbp_fsb_pipe_compare_u_t;
-#else
-typedef union sh_pi_crbp_fsb_pipe_compare_u {
- mmr_t sh_pi_crbp_fsb_pipe_compare_regval;
- struct {
- mmr_t reserved_0 : 11;
- mmr_t compare_req : 6;
- mmr_t compare_address : 47;
- } sh_pi_crbp_fsb_pipe_compare_s;
-} sh_pi_crbp_fsb_pipe_compare_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBP_FSB_PIPE_MASK" */
/* CRBP Compare Mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbp_fsb_pipe_mask_u {
mmr_t sh_pi_crbp_fsb_pipe_mask_regval;
struct {
@@ -5779,23 +3145,12 @@ typedef union sh_pi_crbp_fsb_pipe_mask_u {
mmr_t reserved_0 : 11;
} sh_pi_crbp_fsb_pipe_mask_s;
} sh_pi_crbp_fsb_pipe_mask_u_t;
-#else
-typedef union sh_pi_crbp_fsb_pipe_mask_u {
- mmr_t sh_pi_crbp_fsb_pipe_mask_regval;
- struct {
- mmr_t reserved_0 : 11;
- mmr_t compare_req_mask : 6;
- mmr_t compare_address_mask : 47;
- } sh_pi_crbp_fsb_pipe_mask_s;
-} sh_pi_crbp_fsb_pipe_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBP_TEST_POINT_COMPARE" */
/* PI CRBP Test Point Compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbp_test_point_compare_u {
mmr_t sh_pi_crbp_test_point_compare_regval;
struct {
@@ -5803,22 +3158,12 @@ typedef union sh_pi_crbp_test_point_compare_u {
mmr_t compare_pattern : 32;
} sh_pi_crbp_test_point_compare_s;
} sh_pi_crbp_test_point_compare_u_t;
-#else
-typedef union sh_pi_crbp_test_point_compare_u {
- mmr_t sh_pi_crbp_test_point_compare_regval;
- struct {
- mmr_t compare_pattern : 32;
- mmr_t compare_mask : 32;
- } sh_pi_crbp_test_point_compare_s;
-} sh_pi_crbp_test_point_compare_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBP_TEST_POINT_SELECT" */
/* PI CRBP Test Point Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbp_test_point_select_u {
mmr_t sh_pi_crbp_test_point_select_regval;
struct {
@@ -5856,52 +3201,12 @@ typedef union sh_pi_crbp_test_point_select_u {
mmr_t trigger_enable : 1;
} sh_pi_crbp_test_point_select_s;
} sh_pi_crbp_test_point_select_u_t;
-#else
-typedef union sh_pi_crbp_test_point_select_u {
- mmr_t sh_pi_crbp_test_point_select_regval;
- struct {
- mmr_t trigger_enable : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_chiplet_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_chiplet_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_chiplet_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_chiplet_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_chiplet_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_chiplet_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_chiplet_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_chiplet_sel : 3;
- } sh_pi_crbp_test_point_select_s;
-} sh_pi_crbp_test_point_select_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBP_TEST_POINT_TRIGGER_SELECT" */
/* PI CRBP Test Point Trigger Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbp_test_point_trigger_select_u {
mmr_t sh_pi_crbp_test_point_trigger_select_regval;
struct {
@@ -5939,52 +3244,12 @@ typedef union sh_pi_crbp_test_point_trigger_select_u {
mmr_t reserved_15 : 1;
} sh_pi_crbp_test_point_trigger_select_s;
} sh_pi_crbp_test_point_trigger_select_u_t;
-#else
-typedef union sh_pi_crbp_test_point_trigger_select_u {
- mmr_t sh_pi_crbp_test_point_trigger_select_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t trigger7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t trigger7_chiplet_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t trigger6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t trigger6_chiplet_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t trigger5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t trigger5_chiplet_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t trigger4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t trigger4_chiplet_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t trigger3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t trigger3_chiplet_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t trigger2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t trigger2_chiplet_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t trigger1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t trigger1_chiplet_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t trigger0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t trigger0_chiplet_sel : 3;
- } sh_pi_crbp_test_point_trigger_select_s;
-} sh_pi_crbp_test_point_trigger_select_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBP_XB_PIPE_COMPARE_0" */
/* CRBP XB Pipe Compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbp_xb_pipe_compare_0_u {
mmr_t sh_pi_crbp_xb_pipe_compare_0_regval;
struct {
@@ -5993,23 +3258,12 @@ typedef union sh_pi_crbp_xb_pipe_compare_0_u {
mmr_t reserved_0 : 9;
} sh_pi_crbp_xb_pipe_compare_0_s;
} sh_pi_crbp_xb_pipe_compare_0_u_t;
-#else
-typedef union sh_pi_crbp_xb_pipe_compare_0_u {
- mmr_t sh_pi_crbp_xb_pipe_compare_0_regval;
- struct {
- mmr_t reserved_0 : 9;
- mmr_t compare_command : 8;
- mmr_t compare_address : 47;
- } sh_pi_crbp_xb_pipe_compare_0_s;
-} sh_pi_crbp_xb_pipe_compare_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBP_XB_PIPE_COMPARE_1" */
/* CRBP XB Pipe Compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbp_xb_pipe_compare_1_u {
mmr_t sh_pi_crbp_xb_pipe_compare_1_regval;
struct {
@@ -6021,26 +3275,12 @@ typedef union sh_pi_crbp_xb_pipe_compare_1_u {
mmr_t reserved_2 : 23;
} sh_pi_crbp_xb_pipe_compare_1_s;
} sh_pi_crbp_xb_pipe_compare_1_u_t;
-#else
-typedef union sh_pi_crbp_xb_pipe_compare_1_u {
- mmr_t sh_pi_crbp_xb_pipe_compare_1_regval;
- struct {
- mmr_t reserved_2 : 23;
- mmr_t compare_echo : 9;
- mmr_t reserved_1 : 2;
- mmr_t compare_supplemental : 14;
- mmr_t reserved_0 : 2;
- mmr_t compare_source : 14;
- } sh_pi_crbp_xb_pipe_compare_1_s;
-} sh_pi_crbp_xb_pipe_compare_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBP_XB_PIPE_MASK_0" */
/* CRBP Compare Mask Register 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbp_xb_pipe_mask_0_u {
mmr_t sh_pi_crbp_xb_pipe_mask_0_regval;
struct {
@@ -6049,23 +3289,12 @@ typedef union sh_pi_crbp_xb_pipe_mask_0_u {
mmr_t reserved_0 : 9;
} sh_pi_crbp_xb_pipe_mask_0_s;
} sh_pi_crbp_xb_pipe_mask_0_u_t;
-#else
-typedef union sh_pi_crbp_xb_pipe_mask_0_u {
- mmr_t sh_pi_crbp_xb_pipe_mask_0_regval;
- struct {
- mmr_t reserved_0 : 9;
- mmr_t compare_command_mask : 8;
- mmr_t compare_address_mask : 47;
- } sh_pi_crbp_xb_pipe_mask_0_s;
-} sh_pi_crbp_xb_pipe_mask_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBP_XB_PIPE_MASK_1" */
/* CRBP XB Pipe Compare Mask Register 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbp_xb_pipe_mask_1_u {
mmr_t sh_pi_crbp_xb_pipe_mask_1_regval;
struct {
@@ -6077,26 +3306,12 @@ typedef union sh_pi_crbp_xb_pipe_mask_1_u {
mmr_t reserved_2 : 23;
} sh_pi_crbp_xb_pipe_mask_1_s;
} sh_pi_crbp_xb_pipe_mask_1_u_t;
-#else
-typedef union sh_pi_crbp_xb_pipe_mask_1_u {
- mmr_t sh_pi_crbp_xb_pipe_mask_1_regval;
- struct {
- mmr_t reserved_2 : 23;
- mmr_t compare_echo_mask : 9;
- mmr_t reserved_1 : 2;
- mmr_t compare_supplemental_mask : 14;
- mmr_t reserved_0 : 2;
- mmr_t compare_source_mask : 14;
- } sh_pi_crbp_xb_pipe_mask_1_s;
-} sh_pi_crbp_xb_pipe_mask_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_DPC_QUEUE_CONFIG" */
/* DPC Queue Configuration */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_dpc_queue_config_u {
mmr_t sh_pi_dpc_queue_config_regval;
struct {
@@ -6110,28 +3325,12 @@ typedef union sh_pi_dpc_queue_config_u {
mmr_t reserved_3 : 35;
} sh_pi_dpc_queue_config_s;
} sh_pi_dpc_queue_config_u_t;
-#else
-typedef union sh_pi_dpc_queue_config_u {
- mmr_t sh_pi_dpc_queue_config_regval;
- struct {
- mmr_t reserved_3 : 35;
- mmr_t fwcq_af_thresh : 5;
- mmr_t reserved_2 : 3;
- mmr_t fwcq_ae_level : 5;
- mmr_t reserved_1 : 3;
- mmr_t dwcq_af_thresh : 5;
- mmr_t reserved_0 : 3;
- mmr_t dwcq_ae_level : 5;
- } sh_pi_dpc_queue_config_s;
-} sh_pi_dpc_queue_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_ERROR_MASK" */
/* PI Error Mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_error_mask_u {
mmr_t sh_pi_error_mask_regval;
struct {
@@ -6173,56 +3372,12 @@ typedef union sh_pi_error_mask_u {
mmr_t reserved_0 : 29;
} sh_pi_error_mask_s;
} sh_pi_error_mask_u_t;
-#else
-typedef union sh_pi_error_mask_u {
- mmr_t sh_pi_error_mask_regval;
- struct {
- mmr_t reserved_0 : 29;
- mmr_t msg_length : 1;
- mmr_t fsb_tbl_miss : 1;
- mmr_t bad_snoop : 1;
- mmr_t livelock : 1;
- mmr_t shub_fsb_ce : 1;
- mmr_t shub_fsb_uce : 1;
- mmr_t shub_fsb_dqe : 1;
- mmr_t addr_parity : 1;
- mmr_t req_parity : 1;
- mmr_t addr_access : 1;
- mmr_t req_format : 1;
- mmr_t ioq_overrun : 1;
- mmr_t rsp_parity : 1;
- mmr_t hung_bus : 1;
- mmr_t xn_rp_crd_oflow : 1;
- mmr_t xn_rq_crd_oflow : 1;
- mmr_t md_rp_crd_oflow : 1;
- mmr_t md_rq_crd_oflow : 1;
- mmr_t gfx_int_1 : 1;
- mmr_t gfx_int_0 : 1;
- mmr_t nack_oflow : 1;
- mmr_t xn_rp_q_oflow : 1;
- mmr_t xn_rq_q_oflow : 1;
- mmr_t md_rp_q_oflow : 1;
- mmr_t md_rq_q_oflow : 1;
- mmr_t msg_color_err : 1;
- mmr_t fsb_shub_ce : 1;
- mmr_t fsb_shub_uce : 1;
- mmr_t pio_to_err : 1;
- mmr_t mem_to_err : 1;
- mmr_t pio_rp_err : 1;
- mmr_t mem_rp_err : 1;
- mmr_t xb_proto_err : 1;
- mmr_t gfx_rp_err : 1;
- mmr_t fsb_proto_err : 1;
- } sh_pi_error_mask_s;
-} sh_pi_error_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_EXPRESS_REPLY_CONFIG" */
/* PI Express Reply Configuration */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_express_reply_config_u {
mmr_t sh_pi_express_reply_config_regval;
struct {
@@ -6230,64 +3385,36 @@ typedef union sh_pi_express_reply_config_u {
mmr_t reserved_0 : 61;
} sh_pi_express_reply_config_s;
} sh_pi_express_reply_config_u_t;
-#else
-typedef union sh_pi_express_reply_config_u {
- mmr_t sh_pi_express_reply_config_regval;
- struct {
- mmr_t reserved_0 : 61;
- mmr_t mode : 3;
- } sh_pi_express_reply_config_s;
-} sh_pi_express_reply_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_FSB_COMPARE_VALUE" */
/* FSB Compare Value */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_pi_fsb_compare_value_u {
- mmr_t sh_pi_fsb_compare_value_regval;
- struct {
- mmr_t compare_value : 64;
- } sh_pi_fsb_compare_value_s;
-} sh_pi_fsb_compare_value_u_t;
-#else
typedef union sh_pi_fsb_compare_value_u {
mmr_t sh_pi_fsb_compare_value_regval;
struct {
mmr_t compare_value : 64;
} sh_pi_fsb_compare_value_s;
} sh_pi_fsb_compare_value_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_FSB_COMPARE_MASK" */
/* FSB Compare Mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_fsb_compare_mask_u {
mmr_t sh_pi_fsb_compare_mask_regval;
struct {
mmr_t mask_value : 64;
} sh_pi_fsb_compare_mask_s;
} sh_pi_fsb_compare_mask_u_t;
-#else
-typedef union sh_pi_fsb_compare_mask_u {
- mmr_t sh_pi_fsb_compare_mask_regval;
- struct {
- mmr_t mask_value : 64;
- } sh_pi_fsb_compare_mask_s;
-} sh_pi_fsb_compare_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_FSB_ERROR_INJECTION" */
/* Inject an Error onto the FSB */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_fsb_error_injection_u {
mmr_t sh_pi_fsb_error_injection_regval;
struct {
@@ -6321,48 +3448,12 @@ typedef union sh_pi_fsb_error_injection_u {
mmr_t reserved_2 : 29;
} sh_pi_fsb_error_injection_s;
} sh_pi_fsb_error_injection_u_t;
-#else
-typedef union sh_pi_fsb_error_injection_u {
- mmr_t sh_pi_fsb_error_injection_regval;
- struct {
- mmr_t reserved_2 : 29;
- mmr_t bus_hang : 1;
- mmr_t livelock : 1;
- mmr_t ioq_overrun : 1;
- mmr_t reserved_1 : 4;
- mmr_t dw3_uce_from_fsb : 1;
- mmr_t dw3_ce_from_fsb : 1;
- mmr_t dw2_uce_from_fsb : 1;
- mmr_t dw2_ce_from_fsb : 1;
- mmr_t dw1_uce_from_fsb : 1;
- mmr_t dw1_ce_from_fsb : 1;
- mmr_t dw0_uce_from_fsb : 1;
- mmr_t dw0_ce_from_fsb : 1;
- mmr_t rsp_pe_from_fsb : 1;
- mmr_t ap1_pe_from_fsb : 1;
- mmr_t ap0_pe_from_fsb : 1;
- mmr_t rp_pe_from_fsb : 1;
- mmr_t reserved_0 : 6;
- mmr_t ip1_pe_to_fsb : 1;
- mmr_t ip0_pe_to_fsb : 1;
- mmr_t dw1_uce_to_fsb : 1;
- mmr_t dw1_ce_to_fsb : 1;
- mmr_t dw0_uce_to_fsb : 1;
- mmr_t dw0_ce_to_fsb : 1;
- mmr_t rsp_pe_to_fsb : 1;
- mmr_t ap1_pe_to_fsb : 1;
- mmr_t ap0_pe_to_fsb : 1;
- mmr_t rp_pe_to_fsb : 1;
- } sh_pi_fsb_error_injection_s;
-} sh_pi_fsb_error_injection_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_MD2PI_REPLY_VC_CONFIG" */
/* MD-to-PI Reply Virtual Channel Configuration */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_md2pi_reply_vc_config_u {
mmr_t sh_pi_md2pi_reply_vc_config_regval;
struct {
@@ -6374,26 +3465,12 @@ typedef union sh_pi_md2pi_reply_vc_config_u {
mmr_t capture_credit_status : 1;
} sh_pi_md2pi_reply_vc_config_s;
} sh_pi_md2pi_reply_vc_config_u_t;
-#else
-typedef union sh_pi_md2pi_reply_vc_config_u {
- mmr_t sh_pi_md2pi_reply_vc_config_regval;
- struct {
- mmr_t capture_credit_status : 1;
- mmr_t force_credit : 1;
- mmr_t reserved_0 : 48;
- mmr_t max_credits : 6;
- mmr_t data_depth : 4;
- mmr_t hdr_depth : 4;
- } sh_pi_md2pi_reply_vc_config_s;
-} sh_pi_md2pi_reply_vc_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_MD2PI_REQUEST_VC_CONFIG" */
/* MD-to-PI Request Virtual Channel Configuration */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_md2pi_request_vc_config_u {
mmr_t sh_pi_md2pi_request_vc_config_regval;
struct {
@@ -6405,26 +3482,12 @@ typedef union sh_pi_md2pi_request_vc_config_u {
mmr_t capture_credit_status : 1;
} sh_pi_md2pi_request_vc_config_s;
} sh_pi_md2pi_request_vc_config_u_t;
-#else
-typedef union sh_pi_md2pi_request_vc_config_u {
- mmr_t sh_pi_md2pi_request_vc_config_regval;
- struct {
- mmr_t capture_credit_status : 1;
- mmr_t force_credit : 1;
- mmr_t reserved_0 : 48;
- mmr_t max_credits : 6;
- mmr_t data_depth : 4;
- mmr_t hdr_depth : 4;
- } sh_pi_md2pi_request_vc_config_s;
-} sh_pi_md2pi_request_vc_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_QUEUE_ERROR_INJECTION" */
/* PI Queue Error Injection */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_queue_error_injection_u {
mmr_t sh_pi_queue_error_injection_regval;
struct {
@@ -6439,29 +3502,12 @@ typedef union sh_pi_queue_error_injection_u {
mmr_t reserved_0 : 56;
} sh_pi_queue_error_injection_s;
} sh_pi_queue_error_injection_u_t;
-#else
-typedef union sh_pi_queue_error_injection_u {
- mmr_t sh_pi_queue_error_injection_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t xnpi_rpy_bfr : 1;
- mmr_t rxl_rdy_q : 1;
- mmr_t rxl_kill_q : 1;
- mmr_t ptc_intr : 1;
- mmr_t mdpi_rpy_bfr : 1;
- mmr_t fsb_wtl_cmnd_q : 1;
- mmr_t dxb_wtl_cmnd_q : 1;
- mmr_t dat_dfr_q : 1;
- } sh_pi_queue_error_injection_s;
-} sh_pi_queue_error_injection_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_TEST_POINT_COMPARE" */
/* PI Test Point Compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_test_point_compare_u {
mmr_t sh_pi_test_point_compare_regval;
struct {
@@ -6469,22 +3515,12 @@ typedef union sh_pi_test_point_compare_u {
mmr_t compare_pattern : 32;
} sh_pi_test_point_compare_s;
} sh_pi_test_point_compare_u_t;
-#else
-typedef union sh_pi_test_point_compare_u {
- mmr_t sh_pi_test_point_compare_regval;
- struct {
- mmr_t compare_pattern : 32;
- mmr_t compare_mask : 32;
- } sh_pi_test_point_compare_s;
-} sh_pi_test_point_compare_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_TEST_POINT_SELECT" */
/* PI Test Point Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_test_point_select_u {
mmr_t sh_pi_test_point_select_regval;
struct {
@@ -6522,52 +3558,12 @@ typedef union sh_pi_test_point_select_u {
mmr_t trigger_enable : 1;
} sh_pi_test_point_select_s;
} sh_pi_test_point_select_u_t;
-#else
-typedef union sh_pi_test_point_select_u {
- mmr_t sh_pi_test_point_select_regval;
- struct {
- mmr_t trigger_enable : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_chiplet_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_chiplet_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_chiplet_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_chiplet_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_chiplet_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_chiplet_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_chiplet_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_chiplet_sel : 3;
- } sh_pi_test_point_select_s;
-} sh_pi_test_point_select_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_TEST_POINT_TRIGGER_SELECT" */
/* PI Test Point Trigger Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_test_point_trigger_select_u {
mmr_t sh_pi_test_point_trigger_select_regval;
struct {
@@ -6605,52 +3601,12 @@ typedef union sh_pi_test_point_trigger_select_u {
mmr_t reserved_15 : 1;
} sh_pi_test_point_trigger_select_s;
} sh_pi_test_point_trigger_select_u_t;
-#else
-typedef union sh_pi_test_point_trigger_select_u {
- mmr_t sh_pi_test_point_trigger_select_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t trigger7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t trigger7_chiplet_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t trigger6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t trigger6_chiplet_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t trigger5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t trigger5_chiplet_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t trigger4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t trigger4_chiplet_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t trigger3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t trigger3_chiplet_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t trigger2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t trigger2_chiplet_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t trigger1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t trigger1_chiplet_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t trigger0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t trigger0_chiplet_sel : 3;
- } sh_pi_test_point_trigger_select_s;
-} sh_pi_test_point_trigger_select_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_XN2PI_REPLY_VC_CONFIG" */
/* XN-to-PI Reply Virtual Channel Configuration */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_xn2pi_reply_vc_config_u {
mmr_t sh_pi_xn2pi_reply_vc_config_regval;
struct {
@@ -6662,26 +3618,12 @@ typedef union sh_pi_xn2pi_reply_vc_config_u {
mmr_t capture_credit_status : 1;
} sh_pi_xn2pi_reply_vc_config_s;
} sh_pi_xn2pi_reply_vc_config_u_t;
-#else
-typedef union sh_pi_xn2pi_reply_vc_config_u {
- mmr_t sh_pi_xn2pi_reply_vc_config_regval;
- struct {
- mmr_t capture_credit_status : 1;
- mmr_t force_credit : 1;
- mmr_t reserved_0 : 48;
- mmr_t max_credits : 6;
- mmr_t data_depth : 4;
- mmr_t hdr_depth : 4;
- } sh_pi_xn2pi_reply_vc_config_s;
-} sh_pi_xn2pi_reply_vc_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_XN2PI_REQUEST_VC_CONFIG" */
/* XN-to-PI Request Virtual Channel Configuration */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_xn2pi_request_vc_config_u {
mmr_t sh_pi_xn2pi_request_vc_config_regval;
struct {
@@ -6693,26 +3635,12 @@ typedef union sh_pi_xn2pi_request_vc_config_u {
mmr_t capture_credit_status : 1;
} sh_pi_xn2pi_request_vc_config_s;
} sh_pi_xn2pi_request_vc_config_u_t;
-#else
-typedef union sh_pi_xn2pi_request_vc_config_u {
- mmr_t sh_pi_xn2pi_request_vc_config_regval;
- struct {
- mmr_t capture_credit_status : 1;
- mmr_t force_credit : 1;
- mmr_t reserved_0 : 48;
- mmr_t max_credits : 6;
- mmr_t data_depth : 4;
- mmr_t hdr_depth : 4;
- } sh_pi_xn2pi_request_vc_config_s;
-} sh_pi_xn2pi_request_vc_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_AEC_STATUS" */
/* PI Adaptive Error Correction Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_aec_status_u {
mmr_t sh_pi_aec_status_regval;
struct {
@@ -6720,22 +3648,12 @@ typedef union sh_pi_aec_status_u {
mmr_t reserved_0 : 61;
} sh_pi_aec_status_s;
} sh_pi_aec_status_u_t;
-#else
-typedef union sh_pi_aec_status_u {
- mmr_t sh_pi_aec_status_regval;
- struct {
- mmr_t reserved_0 : 61;
- mmr_t state : 3;
- } sh_pi_aec_status_s;
-} sh_pi_aec_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_AFI_FIRST_ERROR" */
/* PI AFI First Error */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_afi_first_error_u {
mmr_t sh_pi_afi_first_error_regval;
struct {
@@ -6760,39 +3678,12 @@ typedef union sh_pi_afi_first_error_u {
mmr_t reserved_2 : 29;
} sh_pi_afi_first_error_s;
} sh_pi_afi_first_error_u_t;
-#else
-typedef union sh_pi_afi_first_error_u {
- mmr_t sh_pi_afi_first_error_regval;
- struct {
- mmr_t reserved_2 : 29;
- mmr_t msg_len : 1;
- mmr_t fsb_tbl_miss : 1;
- mmr_t bad_snoop : 1;
- mmr_t livelock : 1;
- mmr_t shub_fsb_ce : 1;
- mmr_t shub_fsb_uce : 1;
- mmr_t shub_fsb_dqe : 1;
- mmr_t addr_parity : 1;
- mmr_t req_parity : 1;
- mmr_t addr_access : 1;
- mmr_t req_format : 1;
- mmr_t ioq_overrun : 1;
- mmr_t rsp_parity : 1;
- mmr_t hung_bus : 1;
- mmr_t reserved_1 : 12;
- mmr_t fsb_shub_ce : 1;
- mmr_t fsb_shub_uce : 1;
- mmr_t reserved_0 : 7;
- } sh_pi_afi_first_error_s;
-} sh_pi_afi_first_error_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CAM_ADDRESS_READ_DATA" */
/* CRB CAM MMR Address Read Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_cam_address_read_data_u {
mmr_t sh_pi_cam_address_read_data_regval;
struct {
@@ -6801,44 +3692,24 @@ typedef union sh_pi_cam_address_read_data_u {
mmr_t cam_addr_val : 1;
} sh_pi_cam_address_read_data_s;
} sh_pi_cam_address_read_data_u_t;
-#else
-typedef union sh_pi_cam_address_read_data_u {
- mmr_t sh_pi_cam_address_read_data_regval;
- struct {
- mmr_t cam_addr_val : 1;
- mmr_t reserved_0 : 15;
- mmr_t cam_addr : 48;
- } sh_pi_cam_address_read_data_s;
-} sh_pi_cam_address_read_data_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CAM_LPRA_READ_DATA" */
/* CRB CAM MMR LPRA Read Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_cam_lpra_read_data_u {
mmr_t sh_pi_cam_lpra_read_data_regval;
struct {
mmr_t cam_lpra : 64;
} sh_pi_cam_lpra_read_data_s;
} sh_pi_cam_lpra_read_data_u_t;
-#else
-typedef union sh_pi_cam_lpra_read_data_u {
- mmr_t sh_pi_cam_lpra_read_data_regval;
- struct {
- mmr_t cam_lpra : 64;
- } sh_pi_cam_lpra_read_data_s;
-} sh_pi_cam_lpra_read_data_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CAM_STATE_READ_DATA" */
/* CRB CAM MMR State Read Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_cam_state_read_data_u {
mmr_t sh_pi_cam_state_read_data_regval;
struct {
@@ -6851,27 +3722,12 @@ typedef union sh_pi_cam_state_read_data_u {
mmr_t cam_rd_data_val : 1;
} sh_pi_cam_state_read_data_s;
} sh_pi_cam_state_read_data_u_t;
-#else
-typedef union sh_pi_cam_state_read_data_u {
- mmr_t sh_pi_cam_state_read_data_regval;
- struct {
- mmr_t cam_rd_data_val : 1;
- mmr_t reserved_1 : 13;
- mmr_t cam_lpra : 18;
- mmr_t reserved_0 : 26;
- mmr_t cam_state_rd_pend : 1;
- mmr_t cam_to : 1;
- mmr_t cam_state : 4;
- } sh_pi_cam_state_read_data_s;
-} sh_pi_cam_state_read_data_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CORRECTED_DETAIL_1" */
/* PI Corrected Error Detail */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_corrected_detail_1_u {
mmr_t sh_pi_corrected_detail_1_regval;
struct {
@@ -6880,44 +3736,24 @@ typedef union sh_pi_corrected_detail_1_u {
mmr_t dep : 8;
} sh_pi_corrected_detail_1_s;
} sh_pi_corrected_detail_1_u_t;
-#else
-typedef union sh_pi_corrected_detail_1_u {
- mmr_t sh_pi_corrected_detail_1_regval;
- struct {
- mmr_t dep : 8;
- mmr_t syndrome : 8;
- mmr_t address : 48;
- } sh_pi_corrected_detail_1_s;
-} sh_pi_corrected_detail_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CORRECTED_DETAIL_2" */
/* PI Corrected Error Detail 2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_pi_corrected_detail_2_u {
- mmr_t sh_pi_corrected_detail_2_regval;
- struct {
- mmr_t data : 64;
- } sh_pi_corrected_detail_2_s;
-} sh_pi_corrected_detail_2_u_t;
-#else
typedef union sh_pi_corrected_detail_2_u {
mmr_t sh_pi_corrected_detail_2_regval;
struct {
mmr_t data : 64;
} sh_pi_corrected_detail_2_s;
} sh_pi_corrected_detail_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CORRECTED_DETAIL_3" */
/* PI Corrected Error Detail 3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_corrected_detail_3_u {
mmr_t sh_pi_corrected_detail_3_regval;
struct {
@@ -6926,44 +3762,24 @@ typedef union sh_pi_corrected_detail_3_u {
mmr_t dep : 8;
} sh_pi_corrected_detail_3_s;
} sh_pi_corrected_detail_3_u_t;
-#else
-typedef union sh_pi_corrected_detail_3_u {
- mmr_t sh_pi_corrected_detail_3_regval;
- struct {
- mmr_t dep : 8;
- mmr_t syndrome : 8;
- mmr_t address : 48;
- } sh_pi_corrected_detail_3_s;
-} sh_pi_corrected_detail_3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CORRECTED_DETAIL_4" */
/* PI Corrected Error Detail 4 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_pi_corrected_detail_4_u {
- mmr_t sh_pi_corrected_detail_4_regval;
- struct {
- mmr_t data : 64;
- } sh_pi_corrected_detail_4_s;
-} sh_pi_corrected_detail_4_u_t;
-#else
typedef union sh_pi_corrected_detail_4_u {
mmr_t sh_pi_corrected_detail_4_regval;
struct {
mmr_t data : 64;
} sh_pi_corrected_detail_4_s;
} sh_pi_corrected_detail_4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_CRBP_FIRST_ERROR" */
/* PI CRBP First Error */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_crbp_first_error_u {
mmr_t sh_pi_crbp_first_error_regval;
struct {
@@ -6991,84 +3807,36 @@ typedef union sh_pi_crbp_first_error_u {
mmr_t reserved_0 : 43;
} sh_pi_crbp_first_error_s;
} sh_pi_crbp_first_error_u_t;
-#else
-typedef union sh_pi_crbp_first_error_u {
- mmr_t sh_pi_crbp_first_error_regval;
- struct {
- mmr_t reserved_0 : 43;
- mmr_t xn_rp_crd_oflow : 1;
- mmr_t xn_rq_crd_oflow : 1;
- mmr_t md_rp_crd_oflow : 1;
- mmr_t md_rq_crd_oflow : 1;
- mmr_t gfx_int_1 : 1;
- mmr_t gfx_int_0 : 1;
- mmr_t nack_oflow : 1;
- mmr_t xn_rp_q_oflow : 1;
- mmr_t xn_rq_q_oflow : 1;
- mmr_t md_rp_q_oflow : 1;
- mmr_t md_rq_q_oflow : 1;
- mmr_t msg_color_err : 1;
- mmr_t fsb_shub_ce : 1;
- mmr_t fsb_shub_uce : 1;
- mmr_t pio_to_err : 1;
- mmr_t mem_to_err : 1;
- mmr_t pio_rp_err : 1;
- mmr_t mem_rp_err : 1;
- mmr_t xb_proto_err : 1;
- mmr_t gfx_rp_err : 1;
- mmr_t fsb_proto_err : 1;
- } sh_pi_crbp_first_error_s;
-} sh_pi_crbp_first_error_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_ERROR_DETAIL_1" */
/* PI Error Detail 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_pi_error_detail_1_u {
- mmr_t sh_pi_error_detail_1_regval;
- struct {
- mmr_t status : 64;
- } sh_pi_error_detail_1_s;
-} sh_pi_error_detail_1_u_t;
-#else
typedef union sh_pi_error_detail_1_u {
mmr_t sh_pi_error_detail_1_regval;
struct {
mmr_t status : 64;
} sh_pi_error_detail_1_s;
} sh_pi_error_detail_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_ERROR_DETAIL_2" */
/* PI Error Detail 2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_pi_error_detail_2_u {
- mmr_t sh_pi_error_detail_2_regval;
- struct {
- mmr_t status : 64;
- } sh_pi_error_detail_2_s;
-} sh_pi_error_detail_2_u_t;
-#else
typedef union sh_pi_error_detail_2_u {
mmr_t sh_pi_error_detail_2_regval;
struct {
mmr_t status : 64;
} sh_pi_error_detail_2_s;
} sh_pi_error_detail_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_ERROR_OVERFLOW" */
/* PI Error Overflow */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_error_overflow_u {
mmr_t sh_pi_error_overflow_regval;
struct {
@@ -7110,56 +3878,12 @@ typedef union sh_pi_error_overflow_u {
mmr_t reserved_0 : 29;
} sh_pi_error_overflow_s;
} sh_pi_error_overflow_u_t;
-#else
-typedef union sh_pi_error_overflow_u {
- mmr_t sh_pi_error_overflow_regval;
- struct {
- mmr_t reserved_0 : 29;
- mmr_t msg_length : 1;
- mmr_t fsb_tbl_miss : 1;
- mmr_t bad_snoop : 1;
- mmr_t livelock : 1;
- mmr_t shub_fsb_ce : 1;
- mmr_t shub_fsb_uce : 1;
- mmr_t shub_fsb_dqe : 1;
- mmr_t addr_parity : 1;
- mmr_t req_parity : 1;
- mmr_t addr_access : 1;
- mmr_t req_format : 1;
- mmr_t ioq_overrun : 1;
- mmr_t rsp_parity : 1;
- mmr_t hung_bus : 1;
- mmr_t xn_rp_crd_oflow : 1;
- mmr_t xn_rq_crd_oflow : 1;
- mmr_t md_rp_crd_oflow : 1;
- mmr_t md_rq_crd_oflow : 1;
- mmr_t gfx_int_1 : 1;
- mmr_t gfx_int_0 : 1;
- mmr_t nack_oflow : 1;
- mmr_t xn_rp_q_oflow : 1;
- mmr_t xn_rq_q_oflow : 1;
- mmr_t md_rp_q_oflow : 1;
- mmr_t md_rq_q_oflow : 1;
- mmr_t msg_color_err : 1;
- mmr_t fsb_shub_ce : 1;
- mmr_t fsb_shub_uce : 1;
- mmr_t pio_to_err : 1;
- mmr_t mem_to_err : 1;
- mmr_t pio_rp_err : 1;
- mmr_t mem_rp_err : 1;
- mmr_t xb_proto_err : 1;
- mmr_t gfx_rp_err : 1;
- mmr_t fsb_proto_err : 1;
- } sh_pi_error_overflow_s;
-} sh_pi_error_overflow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_ERROR_SUMMARY" */
/* PI Error Summary */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_error_summary_u {
mmr_t sh_pi_error_summary_regval;
struct {
@@ -7201,56 +3925,12 @@ typedef union sh_pi_error_summary_u {
mmr_t reserved_0 : 29;
} sh_pi_error_summary_s;
} sh_pi_error_summary_u_t;
-#else
-typedef union sh_pi_error_summary_u {
- mmr_t sh_pi_error_summary_regval;
- struct {
- mmr_t reserved_0 : 29;
- mmr_t msg_length : 1;
- mmr_t fsb_tbl_miss : 1;
- mmr_t bad_snoop : 1;
- mmr_t livelock : 1;
- mmr_t shub_fsb_ce : 1;
- mmr_t shub_fsb_uce : 1;
- mmr_t shub_fsb_dqe : 1;
- mmr_t addr_parity : 1;
- mmr_t req_parity : 1;
- mmr_t addr_access : 1;
- mmr_t req_format : 1;
- mmr_t ioq_overrun : 1;
- mmr_t rsp_parity : 1;
- mmr_t hung_bus : 1;
- mmr_t xn_rp_crd_oflow : 1;
- mmr_t xn_rq_crd_oflow : 1;
- mmr_t md_rp_crd_oflow : 1;
- mmr_t md_rq_crd_oflow : 1;
- mmr_t gfx_int_1 : 1;
- mmr_t gfx_int_0 : 1;
- mmr_t nack_oflow : 1;
- mmr_t xn_rp_q_oflow : 1;
- mmr_t xn_rq_q_oflow : 1;
- mmr_t md_rp_q_oflow : 1;
- mmr_t md_rq_q_oflow : 1;
- mmr_t msg_color_err : 1;
- mmr_t fsb_shub_ce : 1;
- mmr_t fsb_shub_uce : 1;
- mmr_t pio_to_err : 1;
- mmr_t mem_to_err : 1;
- mmr_t pio_rp_err : 1;
- mmr_t mem_rp_err : 1;
- mmr_t xb_proto_err : 1;
- mmr_t gfx_rp_err : 1;
- mmr_t fsb_proto_err : 1;
- } sh_pi_error_summary_s;
-} sh_pi_error_summary_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_EXPRESS_REPLY_STATUS" */
/* PI Express Reply Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_express_reply_status_u {
mmr_t sh_pi_express_reply_status_regval;
struct {
@@ -7258,22 +3938,12 @@ typedef union sh_pi_express_reply_status_u {
mmr_t reserved_0 : 61;
} sh_pi_express_reply_status_s;
} sh_pi_express_reply_status_u_t;
-#else
-typedef union sh_pi_express_reply_status_u {
- mmr_t sh_pi_express_reply_status_regval;
- struct {
- mmr_t reserved_0 : 61;
- mmr_t state : 3;
- } sh_pi_express_reply_status_s;
-} sh_pi_express_reply_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_FIRST_ERROR" */
/* PI First Error */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_first_error_u {
mmr_t sh_pi_first_error_regval;
struct {
@@ -7315,56 +3985,12 @@ typedef union sh_pi_first_error_u {
mmr_t reserved_0 : 29;
} sh_pi_first_error_s;
} sh_pi_first_error_u_t;
-#else
-typedef union sh_pi_first_error_u {
- mmr_t sh_pi_first_error_regval;
- struct {
- mmr_t reserved_0 : 29;
- mmr_t msg_length : 1;
- mmr_t fsb_tbl_miss : 1;
- mmr_t bad_snoop : 1;
- mmr_t livelock : 1;
- mmr_t shub_fsb_ce : 1;
- mmr_t shub_fsb_uce : 1;
- mmr_t shub_fsb_dqe : 1;
- mmr_t addr_parity : 1;
- mmr_t req_parity : 1;
- mmr_t addr_access : 1;
- mmr_t req_format : 1;
- mmr_t ioq_overrun : 1;
- mmr_t rsp_parity : 1;
- mmr_t hung_bus : 1;
- mmr_t xn_rp_crd_oflow : 1;
- mmr_t xn_rq_crd_oflow : 1;
- mmr_t md_rp_crd_oflow : 1;
- mmr_t md_rq_crd_oflow : 1;
- mmr_t gfx_int_1 : 1;
- mmr_t gfx_int_0 : 1;
- mmr_t nack_oflow : 1;
- mmr_t xn_rp_q_oflow : 1;
- mmr_t xn_rq_q_oflow : 1;
- mmr_t md_rp_q_oflow : 1;
- mmr_t md_rq_q_oflow : 1;
- mmr_t msg_color_err : 1;
- mmr_t fsb_shub_ce : 1;
- mmr_t fsb_shub_uce : 1;
- mmr_t pio_to_err : 1;
- mmr_t mem_to_err : 1;
- mmr_t pio_rp_err : 1;
- mmr_t mem_rp_err : 1;
- mmr_t xb_proto_err : 1;
- mmr_t gfx_rp_err : 1;
- mmr_t fsb_proto_err : 1;
- } sh_pi_first_error_s;
-} sh_pi_first_error_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_PI2MD_REPLY_VC_STATUS" */
/* PI-to-MD Reply Virtual Channel Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_pi2md_reply_vc_status_u {
mmr_t sh_pi_pi2md_reply_vc_status_regval;
struct {
@@ -7372,22 +3998,12 @@ typedef union sh_pi_pi2md_reply_vc_status_u {
mmr_t reserved_0 : 58;
} sh_pi_pi2md_reply_vc_status_s;
} sh_pi_pi2md_reply_vc_status_u_t;
-#else
-typedef union sh_pi_pi2md_reply_vc_status_u {
- mmr_t sh_pi_pi2md_reply_vc_status_regval;
- struct {
- mmr_t reserved_0 : 58;
- mmr_t output_crd_stat : 6;
- } sh_pi_pi2md_reply_vc_status_s;
-} sh_pi_pi2md_reply_vc_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_PI2MD_REQUEST_VC_STATUS" */
/* PI-to-MD Request Virtual Channel Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_pi2md_request_vc_status_u {
mmr_t sh_pi_pi2md_request_vc_status_regval;
struct {
@@ -7395,22 +4011,12 @@ typedef union sh_pi_pi2md_request_vc_status_u {
mmr_t reserved_0 : 58;
} sh_pi_pi2md_request_vc_status_s;
} sh_pi_pi2md_request_vc_status_u_t;
-#else
-typedef union sh_pi_pi2md_request_vc_status_u {
- mmr_t sh_pi_pi2md_request_vc_status_regval;
- struct {
- mmr_t reserved_0 : 58;
- mmr_t output_crd_stat : 6;
- } sh_pi_pi2md_request_vc_status_s;
-} sh_pi_pi2md_request_vc_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_PI2XN_REPLY_VC_STATUS" */
/* PI-to-XN Reply Virtual Channel Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_pi2xn_reply_vc_status_u {
mmr_t sh_pi_pi2xn_reply_vc_status_regval;
struct {
@@ -7418,22 +4024,12 @@ typedef union sh_pi_pi2xn_reply_vc_status_u {
mmr_t reserved_0 : 58;
} sh_pi_pi2xn_reply_vc_status_s;
} sh_pi_pi2xn_reply_vc_status_u_t;
-#else
-typedef union sh_pi_pi2xn_reply_vc_status_u {
- mmr_t sh_pi_pi2xn_reply_vc_status_regval;
- struct {
- mmr_t reserved_0 : 58;
- mmr_t output_crd_stat : 6;
- } sh_pi_pi2xn_reply_vc_status_s;
-} sh_pi_pi2xn_reply_vc_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_PI2XN_REQUEST_VC_STATUS" */
/* PI-to-XN Request Virtual Channel Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_pi2xn_request_vc_status_u {
mmr_t sh_pi_pi2xn_request_vc_status_regval;
struct {
@@ -7441,22 +4037,12 @@ typedef union sh_pi_pi2xn_request_vc_status_u {
mmr_t reserved_0 : 58;
} sh_pi_pi2xn_request_vc_status_s;
} sh_pi_pi2xn_request_vc_status_u_t;
-#else
-typedef union sh_pi_pi2xn_request_vc_status_u {
- mmr_t sh_pi_pi2xn_request_vc_status_regval;
- struct {
- mmr_t reserved_0 : 58;
- mmr_t output_crd_stat : 6;
- } sh_pi_pi2xn_request_vc_status_s;
-} sh_pi_pi2xn_request_vc_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_UNCORRECTED_DETAIL_1" */
/* PI Uncorrected Error Detail 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_uncorrected_detail_1_u {
mmr_t sh_pi_uncorrected_detail_1_regval;
struct {
@@ -7465,44 +4051,24 @@ typedef union sh_pi_uncorrected_detail_1_u {
mmr_t dep : 8;
} sh_pi_uncorrected_detail_1_s;
} sh_pi_uncorrected_detail_1_u_t;
-#else
-typedef union sh_pi_uncorrected_detail_1_u {
- mmr_t sh_pi_uncorrected_detail_1_regval;
- struct {
- mmr_t dep : 8;
- mmr_t syndrome : 8;
- mmr_t address : 48;
- } sh_pi_uncorrected_detail_1_s;
-} sh_pi_uncorrected_detail_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_UNCORRECTED_DETAIL_2" */
/* PI Uncorrected Error Detail 2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_uncorrected_detail_2_u {
mmr_t sh_pi_uncorrected_detail_2_regval;
struct {
mmr_t data : 64;
} sh_pi_uncorrected_detail_2_s;
} sh_pi_uncorrected_detail_2_u_t;
-#else
-typedef union sh_pi_uncorrected_detail_2_u {
- mmr_t sh_pi_uncorrected_detail_2_regval;
- struct {
- mmr_t data : 64;
- } sh_pi_uncorrected_detail_2_s;
-} sh_pi_uncorrected_detail_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_UNCORRECTED_DETAIL_3" */
/* PI Uncorrected Error Detail 3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_uncorrected_detail_3_u {
mmr_t sh_pi_uncorrected_detail_3_regval;
struct {
@@ -7511,44 +4077,24 @@ typedef union sh_pi_uncorrected_detail_3_u {
mmr_t dep : 8;
} sh_pi_uncorrected_detail_3_s;
} sh_pi_uncorrected_detail_3_u_t;
-#else
-typedef union sh_pi_uncorrected_detail_3_u {
- mmr_t sh_pi_uncorrected_detail_3_regval;
- struct {
- mmr_t dep : 8;
- mmr_t syndrome : 8;
- mmr_t address : 48;
- } sh_pi_uncorrected_detail_3_s;
-} sh_pi_uncorrected_detail_3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_UNCORRECTED_DETAIL_4" */
/* PI Uncorrected Error Detail 4 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_pi_uncorrected_detail_4_u {
- mmr_t sh_pi_uncorrected_detail_4_regval;
- struct {
- mmr_t data : 64;
- } sh_pi_uncorrected_detail_4_s;
-} sh_pi_uncorrected_detail_4_u_t;
-#else
typedef union sh_pi_uncorrected_detail_4_u {
mmr_t sh_pi_uncorrected_detail_4_regval;
struct {
mmr_t data : 64;
} sh_pi_uncorrected_detail_4_s;
} sh_pi_uncorrected_detail_4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_MD2PI_REPLY_VC_STATUS" */
/* MD-to-PI Reply Virtual Channel Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_md2pi_reply_vc_status_u {
mmr_t sh_pi_md2pi_reply_vc_status_regval;
struct {
@@ -7558,24 +4104,12 @@ typedef union sh_pi_md2pi_reply_vc_status_u {
mmr_t reserved_0 : 52;
} sh_pi_md2pi_reply_vc_status_s;
} sh_pi_md2pi_reply_vc_status_u_t;
-#else
-typedef union sh_pi_md2pi_reply_vc_status_u {
- mmr_t sh_pi_md2pi_reply_vc_status_regval;
- struct {
- mmr_t reserved_0 : 52;
- mmr_t input_queue_stat : 4;
- mmr_t input_dat_crd_stat : 4;
- mmr_t input_hdr_crd_stat : 4;
- } sh_pi_md2pi_reply_vc_status_s;
-} sh_pi_md2pi_reply_vc_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_MD2PI_REQUEST_VC_STATUS" */
/* MD-to-PI Request Virtual Channel Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_md2pi_request_vc_status_u {
mmr_t sh_pi_md2pi_request_vc_status_regval;
struct {
@@ -7585,24 +4119,12 @@ typedef union sh_pi_md2pi_request_vc_status_u {
mmr_t reserved_0 : 52;
} sh_pi_md2pi_request_vc_status_s;
} sh_pi_md2pi_request_vc_status_u_t;
-#else
-typedef union sh_pi_md2pi_request_vc_status_u {
- mmr_t sh_pi_md2pi_request_vc_status_regval;
- struct {
- mmr_t reserved_0 : 52;
- mmr_t input_queue_stat : 4;
- mmr_t input_dat_crd_stat : 4;
- mmr_t input_hdr_crd_stat : 4;
- } sh_pi_md2pi_request_vc_status_s;
-} sh_pi_md2pi_request_vc_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_XN2PI_REPLY_VC_STATUS" */
/* XN-to-PI Reply Virtual Channel Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_xn2pi_reply_vc_status_u {
mmr_t sh_pi_xn2pi_reply_vc_status_regval;
struct {
@@ -7612,24 +4134,12 @@ typedef union sh_pi_xn2pi_reply_vc_status_u {
mmr_t reserved_0 : 52;
} sh_pi_xn2pi_reply_vc_status_s;
} sh_pi_xn2pi_reply_vc_status_u_t;
-#else
-typedef union sh_pi_xn2pi_reply_vc_status_u {
- mmr_t sh_pi_xn2pi_reply_vc_status_regval;
- struct {
- mmr_t reserved_0 : 52;
- mmr_t input_queue_stat : 4;
- mmr_t input_dat_crd_stat : 4;
- mmr_t input_hdr_crd_stat : 4;
- } sh_pi_xn2pi_reply_vc_status_s;
-} sh_pi_xn2pi_reply_vc_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_XN2PI_REQUEST_VC_STATUS" */
/* XN-to-PI Request Virtual Channel Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_xn2pi_request_vc_status_u {
mmr_t sh_pi_xn2pi_request_vc_status_regval;
struct {
@@ -7639,23 +4149,11 @@ typedef union sh_pi_xn2pi_request_vc_status_u {
mmr_t reserved_0 : 52;
} sh_pi_xn2pi_request_vc_status_s;
} sh_pi_xn2pi_request_vc_status_u_t;
-#else
-typedef union sh_pi_xn2pi_request_vc_status_u {
- mmr_t sh_pi_xn2pi_request_vc_status_regval;
- struct {
- mmr_t reserved_0 : 52;
- mmr_t input_queue_stat : 4;
- mmr_t input_dat_crd_stat : 4;
- mmr_t input_hdr_crd_stat : 4;
- } sh_pi_xn2pi_request_vc_status_s;
-} sh_pi_xn2pi_request_vc_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_SIC_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_sic_flow_u {
mmr_t sh_xnpi_sic_flow_regval;
struct {
@@ -7680,38 +4178,11 @@ typedef union sh_xnpi_sic_flow_u {
mmr_t disable_bypass_out : 1;
} sh_xnpi_sic_flow_s;
} sh_xnpi_sic_flow_u_t;
-#else
-typedef union sh_xnpi_sic_flow_u {
- mmr_t sh_xnpi_sic_flow_regval;
- struct {
- mmr_t disable_bypass_out : 1;
- mmr_t reserved_7 : 2;
- mmr_t credit_vc2_cap : 5;
- mmr_t reserved_6 : 3;
- mmr_t credit_vc2_dyn : 5;
- mmr_t reserved_5 : 3;
- mmr_t credit_vc2_test : 5;
- mmr_t reserved_4 : 3;
- mmr_t credit_vc0_cap : 5;
- mmr_t reserved_3 : 3;
- mmr_t credit_vc0_dyn : 5;
- mmr_t reserved_2 : 3;
- mmr_t credit_vc0_test : 5;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 2;
- mmr_t debit_vc2_withhold : 5;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 2;
- mmr_t debit_vc0_withhold : 5;
- } sh_xnpi_sic_flow_s;
-} sh_xnpi_sic_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_TO_NI0_PORT_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_to_ni0_port_flow_u {
mmr_t sh_xnpi_to_ni0_port_flow_regval;
struct {
@@ -7732,34 +4203,11 @@ typedef union sh_xnpi_to_ni0_port_flow_u {
mmr_t reserved_6 : 2;
} sh_xnpi_to_ni0_port_flow_s;
} sh_xnpi_to_ni0_port_flow_u_t;
-#else
-typedef union sh_xnpi_to_ni0_port_flow_u {
- mmr_t sh_xnpi_to_ni0_port_flow_regval;
- struct {
- mmr_t reserved_6 : 2;
- mmr_t credit_vc2_cap : 6;
- mmr_t reserved_5 : 2;
- mmr_t credit_vc2_dyn : 6;
- mmr_t reserved_4 : 10;
- mmr_t credit_vc0_cap : 6;
- mmr_t reserved_3 : 2;
- mmr_t credit_vc0_dyn : 6;
- mmr_t reserved_2 : 8;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t debit_vc2_withhold : 6;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnpi_to_ni0_port_flow_s;
-} sh_xnpi_to_ni0_port_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_TO_NI1_PORT_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_to_ni1_port_flow_u {
mmr_t sh_xnpi_to_ni1_port_flow_regval;
struct {
@@ -7780,34 +4228,11 @@ typedef union sh_xnpi_to_ni1_port_flow_u {
mmr_t reserved_6 : 2;
} sh_xnpi_to_ni1_port_flow_s;
} sh_xnpi_to_ni1_port_flow_u_t;
-#else
-typedef union sh_xnpi_to_ni1_port_flow_u {
- mmr_t sh_xnpi_to_ni1_port_flow_regval;
- struct {
- mmr_t reserved_6 : 2;
- mmr_t credit_vc2_cap : 6;
- mmr_t reserved_5 : 2;
- mmr_t credit_vc2_dyn : 6;
- mmr_t reserved_4 : 10;
- mmr_t credit_vc0_cap : 6;
- mmr_t reserved_3 : 2;
- mmr_t credit_vc0_dyn : 6;
- mmr_t reserved_2 : 8;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t debit_vc2_withhold : 6;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnpi_to_ni1_port_flow_s;
-} sh_xnpi_to_ni1_port_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_TO_IILB_PORT_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_to_iilb_port_flow_u {
mmr_t sh_xnpi_to_iilb_port_flow_regval;
struct {
@@ -7828,34 +4253,11 @@ typedef union sh_xnpi_to_iilb_port_flow_u {
mmr_t reserved_6 : 2;
} sh_xnpi_to_iilb_port_flow_s;
} sh_xnpi_to_iilb_port_flow_u_t;
-#else
-typedef union sh_xnpi_to_iilb_port_flow_u {
- mmr_t sh_xnpi_to_iilb_port_flow_regval;
- struct {
- mmr_t reserved_6 : 2;
- mmr_t credit_vc2_cap : 6;
- mmr_t reserved_5 : 2;
- mmr_t credit_vc2_dyn : 6;
- mmr_t reserved_4 : 10;
- mmr_t credit_vc0_cap : 6;
- mmr_t reserved_3 : 2;
- mmr_t credit_vc0_dyn : 6;
- mmr_t reserved_2 : 8;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t debit_vc2_withhold : 6;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnpi_to_iilb_port_flow_s;
-} sh_xnpi_to_iilb_port_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_FR_NI0_PORT_FLOW_FIFO" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_fr_ni0_port_flow_fifo_u {
mmr_t sh_xnpi_fr_ni0_port_flow_fifo_regval;
struct {
@@ -7873,31 +4275,11 @@ typedef union sh_xnpi_fr_ni0_port_flow_fifo_u {
mmr_t reserved_5 : 19;
} sh_xnpi_fr_ni0_port_flow_fifo_s;
} sh_xnpi_fr_ni0_port_flow_fifo_u_t;
-#else
-typedef union sh_xnpi_fr_ni0_port_flow_fifo_u {
- mmr_t sh_xnpi_fr_ni0_port_flow_fifo_regval;
- struct {
- mmr_t reserved_5 : 19;
- mmr_t entry_vc2_test : 5;
- mmr_t reserved_4 : 3;
- mmr_t entry_vc0_test : 5;
- mmr_t reserved_3 : 2;
- mmr_t entry_vc2_cap : 6;
- mmr_t reserved_2 : 2;
- mmr_t entry_vc2_dyn : 6;
- mmr_t reserved_1 : 2;
- mmr_t entry_vc0_cap : 6;
- mmr_t reserved_0 : 2;
- mmr_t entry_vc0_dyn : 6;
- } sh_xnpi_fr_ni0_port_flow_fifo_s;
-} sh_xnpi_fr_ni0_port_flow_fifo_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_FR_NI1_PORT_FLOW_FIFO" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_fr_ni1_port_flow_fifo_u {
mmr_t sh_xnpi_fr_ni1_port_flow_fifo_regval;
struct {
@@ -7915,31 +4297,11 @@ typedef union sh_xnpi_fr_ni1_port_flow_fifo_u {
mmr_t reserved_5 : 19;
} sh_xnpi_fr_ni1_port_flow_fifo_s;
} sh_xnpi_fr_ni1_port_flow_fifo_u_t;
-#else
-typedef union sh_xnpi_fr_ni1_port_flow_fifo_u {
- mmr_t sh_xnpi_fr_ni1_port_flow_fifo_regval;
- struct {
- mmr_t reserved_5 : 19;
- mmr_t entry_vc2_test : 5;
- mmr_t reserved_4 : 3;
- mmr_t entry_vc0_test : 5;
- mmr_t reserved_3 : 2;
- mmr_t entry_vc2_cap : 6;
- mmr_t reserved_2 : 2;
- mmr_t entry_vc2_dyn : 6;
- mmr_t reserved_1 : 2;
- mmr_t entry_vc0_cap : 6;
- mmr_t reserved_0 : 2;
- mmr_t entry_vc0_dyn : 6;
- } sh_xnpi_fr_ni1_port_flow_fifo_s;
-} sh_xnpi_fr_ni1_port_flow_fifo_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_FR_IILB_PORT_FLOW_FIFO" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_fr_iilb_port_flow_fifo_u {
mmr_t sh_xnpi_fr_iilb_port_flow_fifo_regval;
struct {
@@ -7957,31 +4319,11 @@ typedef union sh_xnpi_fr_iilb_port_flow_fifo_u {
mmr_t reserved_5 : 19;
} sh_xnpi_fr_iilb_port_flow_fifo_s;
} sh_xnpi_fr_iilb_port_flow_fifo_u_t;
-#else
-typedef union sh_xnpi_fr_iilb_port_flow_fifo_u {
- mmr_t sh_xnpi_fr_iilb_port_flow_fifo_regval;
- struct {
- mmr_t reserved_5 : 19;
- mmr_t entry_vc2_test : 5;
- mmr_t reserved_4 : 3;
- mmr_t entry_vc0_test : 5;
- mmr_t reserved_3 : 2;
- mmr_t entry_vc2_cap : 6;
- mmr_t reserved_2 : 2;
- mmr_t entry_vc2_dyn : 6;
- mmr_t reserved_1 : 2;
- mmr_t entry_vc0_cap : 6;
- mmr_t reserved_0 : 2;
- mmr_t entry_vc0_dyn : 6;
- } sh_xnpi_fr_iilb_port_flow_fifo_s;
-} sh_xnpi_fr_iilb_port_flow_fifo_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_SIC_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_sic_flow_u {
mmr_t sh_xnmd_sic_flow_regval;
struct {
@@ -8006,38 +4348,11 @@ typedef union sh_xnmd_sic_flow_u {
mmr_t disable_bypass_out : 1;
} sh_xnmd_sic_flow_s;
} sh_xnmd_sic_flow_u_t;
-#else
-typedef union sh_xnmd_sic_flow_u {
- mmr_t sh_xnmd_sic_flow_regval;
- struct {
- mmr_t disable_bypass_out : 1;
- mmr_t reserved_7 : 2;
- mmr_t credit_vc2_cap : 5;
- mmr_t reserved_6 : 3;
- mmr_t credit_vc2_dyn : 5;
- mmr_t reserved_5 : 3;
- mmr_t credit_vc2_test : 5;
- mmr_t reserved_4 : 3;
- mmr_t credit_vc0_cap : 5;
- mmr_t reserved_3 : 3;
- mmr_t credit_vc0_dyn : 5;
- mmr_t reserved_2 : 3;
- mmr_t credit_vc0_test : 5;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 2;
- mmr_t debit_vc2_withhold : 5;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 2;
- mmr_t debit_vc0_withhold : 5;
- } sh_xnmd_sic_flow_s;
-} sh_xnmd_sic_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_TO_NI0_PORT_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_to_ni0_port_flow_u {
mmr_t sh_xnmd_to_ni0_port_flow_regval;
struct {
@@ -8058,34 +4373,11 @@ typedef union sh_xnmd_to_ni0_port_flow_u {
mmr_t reserved_6 : 2;
} sh_xnmd_to_ni0_port_flow_s;
} sh_xnmd_to_ni0_port_flow_u_t;
-#else
-typedef union sh_xnmd_to_ni0_port_flow_u {
- mmr_t sh_xnmd_to_ni0_port_flow_regval;
- struct {
- mmr_t reserved_6 : 2;
- mmr_t credit_vc2_cap : 6;
- mmr_t reserved_5 : 2;
- mmr_t credit_vc2_dyn : 6;
- mmr_t reserved_4 : 10;
- mmr_t credit_vc0_cap : 6;
- mmr_t reserved_3 : 2;
- mmr_t credit_vc0_dyn : 6;
- mmr_t reserved_2 : 8;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t debit_vc2_withhold : 6;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnmd_to_ni0_port_flow_s;
-} sh_xnmd_to_ni0_port_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_TO_NI1_PORT_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_to_ni1_port_flow_u {
mmr_t sh_xnmd_to_ni1_port_flow_regval;
struct {
@@ -8106,34 +4398,11 @@ typedef union sh_xnmd_to_ni1_port_flow_u {
mmr_t reserved_6 : 2;
} sh_xnmd_to_ni1_port_flow_s;
} sh_xnmd_to_ni1_port_flow_u_t;
-#else
-typedef union sh_xnmd_to_ni1_port_flow_u {
- mmr_t sh_xnmd_to_ni1_port_flow_regval;
- struct {
- mmr_t reserved_6 : 2;
- mmr_t credit_vc2_cap : 6;
- mmr_t reserved_5 : 2;
- mmr_t credit_vc2_dyn : 6;
- mmr_t reserved_4 : 10;
- mmr_t credit_vc0_cap : 6;
- mmr_t reserved_3 : 2;
- mmr_t credit_vc0_dyn : 6;
- mmr_t reserved_2 : 8;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t debit_vc2_withhold : 6;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnmd_to_ni1_port_flow_s;
-} sh_xnmd_to_ni1_port_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_TO_IILB_PORT_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_to_iilb_port_flow_u {
mmr_t sh_xnmd_to_iilb_port_flow_regval;
struct {
@@ -8154,34 +4423,11 @@ typedef union sh_xnmd_to_iilb_port_flow_u {
mmr_t reserved_6 : 2;
} sh_xnmd_to_iilb_port_flow_s;
} sh_xnmd_to_iilb_port_flow_u_t;
-#else
-typedef union sh_xnmd_to_iilb_port_flow_u {
- mmr_t sh_xnmd_to_iilb_port_flow_regval;
- struct {
- mmr_t reserved_6 : 2;
- mmr_t credit_vc2_cap : 6;
- mmr_t reserved_5 : 2;
- mmr_t credit_vc2_dyn : 6;
- mmr_t reserved_4 : 10;
- mmr_t credit_vc0_cap : 6;
- mmr_t reserved_3 : 2;
- mmr_t credit_vc0_dyn : 6;
- mmr_t reserved_2 : 8;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t debit_vc2_withhold : 6;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnmd_to_iilb_port_flow_s;
-} sh_xnmd_to_iilb_port_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_FR_NI0_PORT_FLOW_FIFO" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_fr_ni0_port_flow_fifo_u {
mmr_t sh_xnmd_fr_ni0_port_flow_fifo_regval;
struct {
@@ -8199,31 +4445,11 @@ typedef union sh_xnmd_fr_ni0_port_flow_fifo_u {
mmr_t reserved_5 : 19;
} sh_xnmd_fr_ni0_port_flow_fifo_s;
} sh_xnmd_fr_ni0_port_flow_fifo_u_t;
-#else
-typedef union sh_xnmd_fr_ni0_port_flow_fifo_u {
- mmr_t sh_xnmd_fr_ni0_port_flow_fifo_regval;
- struct {
- mmr_t reserved_5 : 19;
- mmr_t entry_vc2_test : 5;
- mmr_t reserved_4 : 3;
- mmr_t entry_vc0_test : 5;
- mmr_t reserved_3 : 2;
- mmr_t entry_vc2_cap : 6;
- mmr_t reserved_2 : 2;
- mmr_t entry_vc2_dyn : 6;
- mmr_t reserved_1 : 2;
- mmr_t entry_vc0_cap : 6;
- mmr_t reserved_0 : 2;
- mmr_t entry_vc0_dyn : 6;
- } sh_xnmd_fr_ni0_port_flow_fifo_s;
-} sh_xnmd_fr_ni0_port_flow_fifo_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_FR_NI1_PORT_FLOW_FIFO" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_fr_ni1_port_flow_fifo_u {
mmr_t sh_xnmd_fr_ni1_port_flow_fifo_regval;
struct {
@@ -8241,31 +4467,11 @@ typedef union sh_xnmd_fr_ni1_port_flow_fifo_u {
mmr_t reserved_5 : 19;
} sh_xnmd_fr_ni1_port_flow_fifo_s;
} sh_xnmd_fr_ni1_port_flow_fifo_u_t;
-#else
-typedef union sh_xnmd_fr_ni1_port_flow_fifo_u {
- mmr_t sh_xnmd_fr_ni1_port_flow_fifo_regval;
- struct {
- mmr_t reserved_5 : 19;
- mmr_t entry_vc2_test : 5;
- mmr_t reserved_4 : 3;
- mmr_t entry_vc0_test : 5;
- mmr_t reserved_3 : 2;
- mmr_t entry_vc2_cap : 6;
- mmr_t reserved_2 : 2;
- mmr_t entry_vc2_dyn : 6;
- mmr_t reserved_1 : 2;
- mmr_t entry_vc0_cap : 6;
- mmr_t reserved_0 : 2;
- mmr_t entry_vc0_dyn : 6;
- } sh_xnmd_fr_ni1_port_flow_fifo_s;
-} sh_xnmd_fr_ni1_port_flow_fifo_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_FR_IILB_PORT_FLOW_FIFO" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_fr_iilb_port_flow_fifo_u {
mmr_t sh_xnmd_fr_iilb_port_flow_fifo_regval;
struct {
@@ -8283,31 +4489,11 @@ typedef union sh_xnmd_fr_iilb_port_flow_fifo_u {
mmr_t reserved_5 : 19;
} sh_xnmd_fr_iilb_port_flow_fifo_s;
} sh_xnmd_fr_iilb_port_flow_fifo_u_t;
-#else
-typedef union sh_xnmd_fr_iilb_port_flow_fifo_u {
- mmr_t sh_xnmd_fr_iilb_port_flow_fifo_regval;
- struct {
- mmr_t reserved_5 : 19;
- mmr_t entry_vc2_test : 5;
- mmr_t reserved_4 : 3;
- mmr_t entry_vc0_test : 5;
- mmr_t reserved_3 : 2;
- mmr_t entry_vc2_cap : 6;
- mmr_t reserved_2 : 2;
- mmr_t entry_vc2_dyn : 6;
- mmr_t reserved_1 : 2;
- mmr_t entry_vc0_cap : 6;
- mmr_t reserved_0 : 2;
- mmr_t entry_vc0_dyn : 6;
- } sh_xnmd_fr_iilb_port_flow_fifo_s;
-} sh_xnmd_fr_iilb_port_flow_fifo_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNII_INTRA_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnii_intra_flow_u {
mmr_t sh_xnii_intra_flow_regval;
struct {
@@ -8331,37 +4517,11 @@ typedef union sh_xnii_intra_flow_u {
mmr_t reserved_7 : 1;
} sh_xnii_intra_flow_s;
} sh_xnii_intra_flow_u_t;
-#else
-typedef union sh_xnii_intra_flow_u {
- mmr_t sh_xnii_intra_flow_regval;
- struct {
- mmr_t reserved_7 : 1;
- mmr_t credit_vc2_cap : 7;
- mmr_t reserved_6 : 1;
- mmr_t credit_vc2_dyn : 7;
- mmr_t reserved_5 : 1;
- mmr_t credit_vc2_test : 7;
- mmr_t reserved_4 : 1;
- mmr_t credit_vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t credit_vc0_dyn : 7;
- mmr_t reserved_2 : 1;
- mmr_t credit_vc0_test : 7;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t debit_vc2_withhold : 6;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnii_intra_flow_s;
-} sh_xnii_intra_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNLB_INTRA_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnlb_intra_flow_u {
mmr_t sh_xnlb_intra_flow_regval;
struct {
@@ -8385,37 +4545,11 @@ typedef union sh_xnlb_intra_flow_u {
mmr_t disable_bypass_in : 1;
} sh_xnlb_intra_flow_s;
} sh_xnlb_intra_flow_u_t;
-#else
-typedef union sh_xnlb_intra_flow_u {
- mmr_t sh_xnlb_intra_flow_regval;
- struct {
- mmr_t disable_bypass_in : 1;
- mmr_t credit_vc2_cap : 7;
- mmr_t reserved_6 : 1;
- mmr_t credit_vc2_dyn : 7;
- mmr_t reserved_5 : 1;
- mmr_t credit_vc2_test : 7;
- mmr_t reserved_4 : 1;
- mmr_t credit_vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t credit_vc0_dyn : 7;
- mmr_t reserved_2 : 1;
- mmr_t credit_vc0_test : 7;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t debit_vc2_withhold : 6;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnlb_intra_flow_s;
-} sh_xnlb_intra_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_TO_NI0_INTRA_FLOW_DEBIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_to_ni0_intra_flow_debit_u {
mmr_t sh_xniilb_to_ni0_intra_flow_debit_regval;
struct {
@@ -8436,34 +4570,11 @@ typedef union sh_xniilb_to_ni0_intra_flow_debit_u {
mmr_t reserved_6 : 1;
} sh_xniilb_to_ni0_intra_flow_debit_s;
} sh_xniilb_to_ni0_intra_flow_debit_u_t;
-#else
-typedef union sh_xniilb_to_ni0_intra_flow_debit_u {
- mmr_t sh_xniilb_to_ni0_intra_flow_debit_regval;
- struct {
- mmr_t reserved_6 : 1;
- mmr_t vc2_cap : 7;
- mmr_t reserved_5 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_4 : 9;
- mmr_t vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_2 : 8;
- mmr_t vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t vc2_withhold : 6;
- mmr_t vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t vc0_withhold : 6;
- } sh_xniilb_to_ni0_intra_flow_debit_s;
-} sh_xniilb_to_ni0_intra_flow_debit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_TO_NI1_INTRA_FLOW_DEBIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_to_ni1_intra_flow_debit_u {
mmr_t sh_xniilb_to_ni1_intra_flow_debit_regval;
struct {
@@ -8484,34 +4595,11 @@ typedef union sh_xniilb_to_ni1_intra_flow_debit_u {
mmr_t reserved_6 : 1;
} sh_xniilb_to_ni1_intra_flow_debit_s;
} sh_xniilb_to_ni1_intra_flow_debit_u_t;
-#else
-typedef union sh_xniilb_to_ni1_intra_flow_debit_u {
- mmr_t sh_xniilb_to_ni1_intra_flow_debit_regval;
- struct {
- mmr_t reserved_6 : 1;
- mmr_t vc2_cap : 7;
- mmr_t reserved_5 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_4 : 9;
- mmr_t vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_2 : 8;
- mmr_t vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t vc2_withhold : 6;
- mmr_t vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t vc0_withhold : 6;
- } sh_xniilb_to_ni1_intra_flow_debit_s;
-} sh_xniilb_to_ni1_intra_flow_debit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_TO_MD_INTRA_FLOW_DEBIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_to_md_intra_flow_debit_u {
mmr_t sh_xniilb_to_md_intra_flow_debit_regval;
struct {
@@ -8532,34 +4620,11 @@ typedef union sh_xniilb_to_md_intra_flow_debit_u {
mmr_t reserved_6 : 1;
} sh_xniilb_to_md_intra_flow_debit_s;
} sh_xniilb_to_md_intra_flow_debit_u_t;
-#else
-typedef union sh_xniilb_to_md_intra_flow_debit_u {
- mmr_t sh_xniilb_to_md_intra_flow_debit_regval;
- struct {
- mmr_t reserved_6 : 1;
- mmr_t vc2_cap : 7;
- mmr_t reserved_5 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_4 : 9;
- mmr_t vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_2 : 8;
- mmr_t vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t vc2_withhold : 6;
- mmr_t vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t vc0_withhold : 6;
- } sh_xniilb_to_md_intra_flow_debit_s;
-} sh_xniilb_to_md_intra_flow_debit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_TO_IILB_INTRA_FLOW_DEBIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_to_iilb_intra_flow_debit_u {
mmr_t sh_xniilb_to_iilb_intra_flow_debit_regval;
struct {
@@ -8580,34 +4645,11 @@ typedef union sh_xniilb_to_iilb_intra_flow_debit_u {
mmr_t reserved_6 : 1;
} sh_xniilb_to_iilb_intra_flow_debit_s;
} sh_xniilb_to_iilb_intra_flow_debit_u_t;
-#else
-typedef union sh_xniilb_to_iilb_intra_flow_debit_u {
- mmr_t sh_xniilb_to_iilb_intra_flow_debit_regval;
- struct {
- mmr_t reserved_6 : 1;
- mmr_t vc2_cap : 7;
- mmr_t reserved_5 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_4 : 9;
- mmr_t vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_2 : 8;
- mmr_t vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t vc2_withhold : 6;
- mmr_t vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t vc0_withhold : 6;
- } sh_xniilb_to_iilb_intra_flow_debit_s;
-} sh_xniilb_to_iilb_intra_flow_debit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_TO_PI_INTRA_FLOW_DEBIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_to_pi_intra_flow_debit_u {
mmr_t sh_xniilb_to_pi_intra_flow_debit_regval;
struct {
@@ -8628,34 +4670,11 @@ typedef union sh_xniilb_to_pi_intra_flow_debit_u {
mmr_t reserved_6 : 1;
} sh_xniilb_to_pi_intra_flow_debit_s;
} sh_xniilb_to_pi_intra_flow_debit_u_t;
-#else
-typedef union sh_xniilb_to_pi_intra_flow_debit_u {
- mmr_t sh_xniilb_to_pi_intra_flow_debit_regval;
- struct {
- mmr_t reserved_6 : 1;
- mmr_t vc2_cap : 7;
- mmr_t reserved_5 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_4 : 9;
- mmr_t vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_2 : 8;
- mmr_t vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t vc2_withhold : 6;
- mmr_t vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t vc0_withhold : 6;
- } sh_xniilb_to_pi_intra_flow_debit_s;
-} sh_xniilb_to_pi_intra_flow_debit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_FR_NI0_INTRA_FLOW_CREDIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_fr_ni0_intra_flow_credit_u {
mmr_t sh_xniilb_fr_ni0_intra_flow_credit_regval;
struct {
@@ -8673,31 +4692,11 @@ typedef union sh_xniilb_fr_ni0_intra_flow_credit_u {
mmr_t reserved_5 : 17;
} sh_xniilb_fr_ni0_intra_flow_credit_s;
} sh_xniilb_fr_ni0_intra_flow_credit_u_t;
-#else
-typedef union sh_xniilb_fr_ni0_intra_flow_credit_u {
- mmr_t sh_xniilb_fr_ni0_intra_flow_credit_regval;
- struct {
- mmr_t reserved_5 : 17;
- mmr_t vc2_cap : 7;
- mmr_t reserved_4 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc2_test : 7;
- mmr_t reserved_2 : 1;
- mmr_t vc0_cap : 7;
- mmr_t reserved_1 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_0 : 1;
- mmr_t vc0_test : 7;
- } sh_xniilb_fr_ni0_intra_flow_credit_s;
-} sh_xniilb_fr_ni0_intra_flow_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_FR_NI1_INTRA_FLOW_CREDIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_fr_ni1_intra_flow_credit_u {
mmr_t sh_xniilb_fr_ni1_intra_flow_credit_regval;
struct {
@@ -8715,31 +4714,11 @@ typedef union sh_xniilb_fr_ni1_intra_flow_credit_u {
mmr_t reserved_5 : 17;
} sh_xniilb_fr_ni1_intra_flow_credit_s;
} sh_xniilb_fr_ni1_intra_flow_credit_u_t;
-#else
-typedef union sh_xniilb_fr_ni1_intra_flow_credit_u {
- mmr_t sh_xniilb_fr_ni1_intra_flow_credit_regval;
- struct {
- mmr_t reserved_5 : 17;
- mmr_t vc2_cap : 7;
- mmr_t reserved_4 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc2_test : 7;
- mmr_t reserved_2 : 1;
- mmr_t vc0_cap : 7;
- mmr_t reserved_1 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_0 : 1;
- mmr_t vc0_test : 7;
- } sh_xniilb_fr_ni1_intra_flow_credit_s;
-} sh_xniilb_fr_ni1_intra_flow_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_FR_MD_INTRA_FLOW_CREDIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_fr_md_intra_flow_credit_u {
mmr_t sh_xniilb_fr_md_intra_flow_credit_regval;
struct {
@@ -8757,31 +4736,11 @@ typedef union sh_xniilb_fr_md_intra_flow_credit_u {
mmr_t reserved_5 : 17;
} sh_xniilb_fr_md_intra_flow_credit_s;
} sh_xniilb_fr_md_intra_flow_credit_u_t;
-#else
-typedef union sh_xniilb_fr_md_intra_flow_credit_u {
- mmr_t sh_xniilb_fr_md_intra_flow_credit_regval;
- struct {
- mmr_t reserved_5 : 17;
- mmr_t vc2_cap : 7;
- mmr_t reserved_4 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc2_test : 7;
- mmr_t reserved_2 : 1;
- mmr_t vc0_cap : 7;
- mmr_t reserved_1 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_0 : 1;
- mmr_t vc0_test : 7;
- } sh_xniilb_fr_md_intra_flow_credit_s;
-} sh_xniilb_fr_md_intra_flow_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_FR_IILB_INTRA_FLOW_CREDIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_fr_iilb_intra_flow_credit_u {
mmr_t sh_xniilb_fr_iilb_intra_flow_credit_regval;
struct {
@@ -8799,31 +4758,11 @@ typedef union sh_xniilb_fr_iilb_intra_flow_credit_u {
mmr_t reserved_5 : 17;
} sh_xniilb_fr_iilb_intra_flow_credit_s;
} sh_xniilb_fr_iilb_intra_flow_credit_u_t;
-#else
-typedef union sh_xniilb_fr_iilb_intra_flow_credit_u {
- mmr_t sh_xniilb_fr_iilb_intra_flow_credit_regval;
- struct {
- mmr_t reserved_5 : 17;
- mmr_t vc2_cap : 7;
- mmr_t reserved_4 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc2_test : 7;
- mmr_t reserved_2 : 1;
- mmr_t vc0_cap : 7;
- mmr_t reserved_1 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_0 : 1;
- mmr_t vc0_test : 7;
- } sh_xniilb_fr_iilb_intra_flow_credit_s;
-} sh_xniilb_fr_iilb_intra_flow_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_FR_PI_INTRA_FLOW_CREDIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_fr_pi_intra_flow_credit_u {
mmr_t sh_xniilb_fr_pi_intra_flow_credit_regval;
struct {
@@ -8841,31 +4780,11 @@ typedef union sh_xniilb_fr_pi_intra_flow_credit_u {
mmr_t reserved_5 : 17;
} sh_xniilb_fr_pi_intra_flow_credit_s;
} sh_xniilb_fr_pi_intra_flow_credit_u_t;
-#else
-typedef union sh_xniilb_fr_pi_intra_flow_credit_u {
- mmr_t sh_xniilb_fr_pi_intra_flow_credit_regval;
- struct {
- mmr_t reserved_5 : 17;
- mmr_t vc2_cap : 7;
- mmr_t reserved_4 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc2_test : 7;
- mmr_t reserved_2 : 1;
- mmr_t vc0_cap : 7;
- mmr_t reserved_1 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_0 : 1;
- mmr_t vc0_test : 7;
- } sh_xniilb_fr_pi_intra_flow_credit_s;
-} sh_xniilb_fr_pi_intra_flow_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_TO_PI_INTRA_FLOW_DEBIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_to_pi_intra_flow_debit_u {
mmr_t sh_xnni0_to_pi_intra_flow_debit_regval;
struct {
@@ -8886,34 +4805,11 @@ typedef union sh_xnni0_to_pi_intra_flow_debit_u {
mmr_t reserved_6 : 1;
} sh_xnni0_to_pi_intra_flow_debit_s;
} sh_xnni0_to_pi_intra_flow_debit_u_t;
-#else
-typedef union sh_xnni0_to_pi_intra_flow_debit_u {
- mmr_t sh_xnni0_to_pi_intra_flow_debit_regval;
- struct {
- mmr_t reserved_6 : 1;
- mmr_t vc2_cap : 7;
- mmr_t reserved_5 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_4 : 9;
- mmr_t vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_2 : 8;
- mmr_t vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t vc2_withhold : 6;
- mmr_t vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t vc0_withhold : 6;
- } sh_xnni0_to_pi_intra_flow_debit_s;
-} sh_xnni0_to_pi_intra_flow_debit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_TO_MD_INTRA_FLOW_DEBIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_to_md_intra_flow_debit_u {
mmr_t sh_xnni0_to_md_intra_flow_debit_regval;
struct {
@@ -8934,34 +4830,11 @@ typedef union sh_xnni0_to_md_intra_flow_debit_u {
mmr_t reserved_6 : 1;
} sh_xnni0_to_md_intra_flow_debit_s;
} sh_xnni0_to_md_intra_flow_debit_u_t;
-#else
-typedef union sh_xnni0_to_md_intra_flow_debit_u {
- mmr_t sh_xnni0_to_md_intra_flow_debit_regval;
- struct {
- mmr_t reserved_6 : 1;
- mmr_t vc2_cap : 7;
- mmr_t reserved_5 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_4 : 9;
- mmr_t vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_2 : 8;
- mmr_t vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t vc2_withhold : 6;
- mmr_t vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t vc0_withhold : 6;
- } sh_xnni0_to_md_intra_flow_debit_s;
-} sh_xnni0_to_md_intra_flow_debit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_TO_IILB_INTRA_FLOW_DEBIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_to_iilb_intra_flow_debit_u {
mmr_t sh_xnni0_to_iilb_intra_flow_debit_regval;
struct {
@@ -8982,34 +4855,11 @@ typedef union sh_xnni0_to_iilb_intra_flow_debit_u {
mmr_t reserved_6 : 1;
} sh_xnni0_to_iilb_intra_flow_debit_s;
} sh_xnni0_to_iilb_intra_flow_debit_u_t;
-#else
-typedef union sh_xnni0_to_iilb_intra_flow_debit_u {
- mmr_t sh_xnni0_to_iilb_intra_flow_debit_regval;
- struct {
- mmr_t reserved_6 : 1;
- mmr_t vc2_cap : 7;
- mmr_t reserved_5 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_4 : 9;
- mmr_t vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_2 : 8;
- mmr_t vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t vc2_withhold : 6;
- mmr_t vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t vc0_withhold : 6;
- } sh_xnni0_to_iilb_intra_flow_debit_s;
-} sh_xnni0_to_iilb_intra_flow_debit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_FR_PI_INTRA_FLOW_CREDIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_fr_pi_intra_flow_credit_u {
mmr_t sh_xnni0_fr_pi_intra_flow_credit_regval;
struct {
@@ -9027,31 +4877,11 @@ typedef union sh_xnni0_fr_pi_intra_flow_credit_u {
mmr_t reserved_5 : 17;
} sh_xnni0_fr_pi_intra_flow_credit_s;
} sh_xnni0_fr_pi_intra_flow_credit_u_t;
-#else
-typedef union sh_xnni0_fr_pi_intra_flow_credit_u {
- mmr_t sh_xnni0_fr_pi_intra_flow_credit_regval;
- struct {
- mmr_t reserved_5 : 17;
- mmr_t vc2_cap : 7;
- mmr_t reserved_4 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc2_test : 7;
- mmr_t reserved_2 : 1;
- mmr_t vc0_cap : 7;
- mmr_t reserved_1 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_0 : 1;
- mmr_t vc0_test : 7;
- } sh_xnni0_fr_pi_intra_flow_credit_s;
-} sh_xnni0_fr_pi_intra_flow_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_FR_MD_INTRA_FLOW_CREDIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_fr_md_intra_flow_credit_u {
mmr_t sh_xnni0_fr_md_intra_flow_credit_regval;
struct {
@@ -9069,31 +4899,11 @@ typedef union sh_xnni0_fr_md_intra_flow_credit_u {
mmr_t reserved_5 : 17;
} sh_xnni0_fr_md_intra_flow_credit_s;
} sh_xnni0_fr_md_intra_flow_credit_u_t;
-#else
-typedef union sh_xnni0_fr_md_intra_flow_credit_u {
- mmr_t sh_xnni0_fr_md_intra_flow_credit_regval;
- struct {
- mmr_t reserved_5 : 17;
- mmr_t vc2_cap : 7;
- mmr_t reserved_4 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc2_test : 7;
- mmr_t reserved_2 : 1;
- mmr_t vc0_cap : 7;
- mmr_t reserved_1 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_0 : 1;
- mmr_t vc0_test : 7;
- } sh_xnni0_fr_md_intra_flow_credit_s;
-} sh_xnni0_fr_md_intra_flow_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_FR_IILB_INTRA_FLOW_CREDIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_fr_iilb_intra_flow_credit_u {
mmr_t sh_xnni0_fr_iilb_intra_flow_credit_regval;
struct {
@@ -9111,31 +4921,11 @@ typedef union sh_xnni0_fr_iilb_intra_flow_credit_u {
mmr_t reserved_5 : 17;
} sh_xnni0_fr_iilb_intra_flow_credit_s;
} sh_xnni0_fr_iilb_intra_flow_credit_u_t;
-#else
-typedef union sh_xnni0_fr_iilb_intra_flow_credit_u {
- mmr_t sh_xnni0_fr_iilb_intra_flow_credit_regval;
- struct {
- mmr_t reserved_5 : 17;
- mmr_t vc2_cap : 7;
- mmr_t reserved_4 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc2_test : 7;
- mmr_t reserved_2 : 1;
- mmr_t vc0_cap : 7;
- mmr_t reserved_1 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_0 : 1;
- mmr_t vc0_test : 7;
- } sh_xnni0_fr_iilb_intra_flow_credit_s;
-} sh_xnni0_fr_iilb_intra_flow_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_0_INTRANI_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_0_intrani_flow_u {
mmr_t sh_xnni0_0_intrani_flow_regval;
struct {
@@ -9145,23 +4935,11 @@ typedef union sh_xnni0_0_intrani_flow_u {
mmr_t reserved_1 : 56;
} sh_xnni0_0_intrani_flow_s;
} sh_xnni0_0_intrani_flow_u_t;
-#else
-typedef union sh_xnni0_0_intrani_flow_u {
- mmr_t sh_xnni0_0_intrani_flow_regval;
- struct {
- mmr_t reserved_1 : 56;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnni0_0_intrani_flow_s;
-} sh_xnni0_0_intrani_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_1_INTRANI_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_1_intrani_flow_u {
mmr_t sh_xnni0_1_intrani_flow_regval;
struct {
@@ -9171,23 +4949,11 @@ typedef union sh_xnni0_1_intrani_flow_u {
mmr_t reserved_1 : 56;
} sh_xnni0_1_intrani_flow_s;
} sh_xnni0_1_intrani_flow_u_t;
-#else
-typedef union sh_xnni0_1_intrani_flow_u {
- mmr_t sh_xnni0_1_intrani_flow_regval;
- struct {
- mmr_t reserved_1 : 56;
- mmr_t debit_vc1_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc1_withhold : 6;
- } sh_xnni0_1_intrani_flow_s;
-} sh_xnni0_1_intrani_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_2_INTRANI_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_2_intrani_flow_u {
mmr_t sh_xnni0_2_intrani_flow_regval;
struct {
@@ -9197,23 +4963,11 @@ typedef union sh_xnni0_2_intrani_flow_u {
mmr_t reserved_1 : 56;
} sh_xnni0_2_intrani_flow_s;
} sh_xnni0_2_intrani_flow_u_t;
-#else
-typedef union sh_xnni0_2_intrani_flow_u {
- mmr_t sh_xnni0_2_intrani_flow_regval;
- struct {
- mmr_t reserved_1 : 56;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc2_withhold : 6;
- } sh_xnni0_2_intrani_flow_s;
-} sh_xnni0_2_intrani_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_3_INTRANI_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_3_intrani_flow_u {
mmr_t sh_xnni0_3_intrani_flow_regval;
struct {
@@ -9223,23 +4977,11 @@ typedef union sh_xnni0_3_intrani_flow_u {
mmr_t reserved_1 : 56;
} sh_xnni0_3_intrani_flow_s;
} sh_xnni0_3_intrani_flow_u_t;
-#else
-typedef union sh_xnni0_3_intrani_flow_u {
- mmr_t sh_xnni0_3_intrani_flow_regval;
- struct {
- mmr_t reserved_1 : 56;
- mmr_t debit_vc3_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc3_withhold : 6;
- } sh_xnni0_3_intrani_flow_s;
-} sh_xnni0_3_intrani_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_VCSWITCH_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_vcswitch_flow_u {
mmr_t sh_xnni0_vcswitch_flow_regval;
struct {
@@ -9257,31 +4999,11 @@ typedef union sh_xnni0_vcswitch_flow_u {
mmr_t reserved_4 : 29;
} sh_xnni0_vcswitch_flow_s;
} sh_xnni0_vcswitch_flow_u_t;
-#else
-typedef union sh_xnni0_vcswitch_flow_u {
- mmr_t sh_xnni0_vcswitch_flow_regval;
- struct {
- mmr_t reserved_4 : 29;
- mmr_t async_fifoes : 1;
- mmr_t disable_sync_bypass_out : 1;
- mmr_t disable_sync_bypass_in : 1;
- mmr_t reserved_3 : 7;
- mmr_t iilb_vcfifo_switch : 1;
- mmr_t reserved_2 : 7;
- mmr_t md_vcfifo_switch : 1;
- mmr_t reserved_1 : 7;
- mmr_t pi_vcfifo_switch : 1;
- mmr_t reserved_0 : 7;
- mmr_t ni_vcfifo_dateline_switch : 1;
- } sh_xnni0_vcswitch_flow_s;
-} sh_xnni0_vcswitch_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_TIMER_REG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_timer_reg_u {
mmr_t sh_xnni0_timer_reg_regval;
struct {
@@ -9291,23 +5013,11 @@ typedef union sh_xnni0_timer_reg_u {
mmr_t reserved_1 : 31;
} sh_xnni0_timer_reg_s;
} sh_xnni0_timer_reg_u_t;
-#else
-typedef union sh_xnni0_timer_reg_u {
- mmr_t sh_xnni0_timer_reg_regval;
- struct {
- mmr_t reserved_1 : 31;
- mmr_t linkcleanup_reg : 1;
- mmr_t reserved_0 : 8;
- mmr_t timeout_reg : 24;
- } sh_xnni0_timer_reg_s;
-} sh_xnni0_timer_reg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_FIFO02_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_fifo02_flow_u {
mmr_t sh_xnni0_fifo02_flow_regval;
struct {
@@ -9325,31 +5035,11 @@ typedef union sh_xnni0_fifo02_flow_u {
mmr_t reserved_5 : 20;
} sh_xnni0_fifo02_flow_s;
} sh_xnni0_fifo02_flow_u_t;
-#else
-typedef union sh_xnni0_fifo02_flow_u {
- mmr_t sh_xnni0_fifo02_flow_regval;
- struct {
- mmr_t reserved_5 : 20;
- mmr_t count_vc2_cap : 4;
- mmr_t reserved_4 : 4;
- mmr_t count_vc2_dyn : 4;
- mmr_t reserved_3 : 4;
- mmr_t count_vc2_limit : 4;
- mmr_t reserved_2 : 4;
- mmr_t count_vc0_cap : 4;
- mmr_t reserved_1 : 4;
- mmr_t count_vc0_dyn : 4;
- mmr_t reserved_0 : 4;
- mmr_t count_vc0_limit : 4;
- } sh_xnni0_fifo02_flow_s;
-} sh_xnni0_fifo02_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_FIFO13_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_fifo13_flow_u {
mmr_t sh_xnni0_fifo13_flow_regval;
struct {
@@ -9367,31 +5057,11 @@ typedef union sh_xnni0_fifo13_flow_u {
mmr_t reserved_5 : 20;
} sh_xnni0_fifo13_flow_s;
} sh_xnni0_fifo13_flow_u_t;
-#else
-typedef union sh_xnni0_fifo13_flow_u {
- mmr_t sh_xnni0_fifo13_flow_regval;
- struct {
- mmr_t reserved_5 : 20;
- mmr_t count_vc3_cap : 4;
- mmr_t reserved_4 : 4;
- mmr_t count_vc3_dyn : 4;
- mmr_t reserved_3 : 4;
- mmr_t count_vc3_limit : 4;
- mmr_t reserved_2 : 4;
- mmr_t count_vc1_cap : 4;
- mmr_t reserved_1 : 4;
- mmr_t count_vc1_dyn : 4;
- mmr_t reserved_0 : 4;
- mmr_t count_vc1_limit : 4;
- } sh_xnni0_fifo13_flow_s;
-} sh_xnni0_fifo13_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_NI_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_ni_flow_u {
mmr_t sh_xnni0_ni_flow_regval;
struct {
@@ -9413,35 +5083,11 @@ typedef union sh_xnni0_ni_flow_u {
mmr_t vc3_cap : 4;
} sh_xnni0_ni_flow_s;
} sh_xnni0_ni_flow_u_t;
-#else
-typedef union sh_xnni0_ni_flow_u {
- mmr_t sh_xnni0_ni_flow_regval;
- struct {
- mmr_t vc3_cap : 4;
- mmr_t vc3_dyn : 4;
- mmr_t reserved_3 : 4;
- mmr_t vc3_limit : 4;
- mmr_t vc2_cap : 4;
- mmr_t vc2_dyn : 4;
- mmr_t reserved_2 : 4;
- mmr_t vc2_limit : 4;
- mmr_t vc1_cap : 4;
- mmr_t vc1_dyn : 4;
- mmr_t reserved_1 : 4;
- mmr_t vc1_limit : 4;
- mmr_t vc0_cap : 4;
- mmr_t vc0_dyn : 4;
- mmr_t reserved_0 : 4;
- mmr_t vc0_limit : 4;
- } sh_xnni0_ni_flow_s;
-} sh_xnni0_ni_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_DEAD_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_dead_flow_u {
mmr_t sh_xnni0_dead_flow_regval;
struct {
@@ -9463,35 +5109,11 @@ typedef union sh_xnni0_dead_flow_u {
mmr_t vc3_cap : 4;
} sh_xnni0_dead_flow_s;
} sh_xnni0_dead_flow_u_t;
-#else
-typedef union sh_xnni0_dead_flow_u {
- mmr_t sh_xnni0_dead_flow_regval;
- struct {
- mmr_t vc3_cap : 4;
- mmr_t vc3_dyn : 4;
- mmr_t reserved_3 : 4;
- mmr_t vc3_limit : 4;
- mmr_t vc2_cap : 4;
- mmr_t vc2_dyn : 4;
- mmr_t reserved_2 : 4;
- mmr_t vc2_limit : 4;
- mmr_t vc1_cap : 4;
- mmr_t vc1_dyn : 4;
- mmr_t reserved_1 : 4;
- mmr_t vc1_limit : 4;
- mmr_t vc0_cap : 4;
- mmr_t vc0_dyn : 4;
- mmr_t reserved_0 : 4;
- mmr_t vc0_limit : 4;
- } sh_xnni0_dead_flow_s;
-} sh_xnni0_dead_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI0_INJECT_AGE" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni0_inject_age_u {
mmr_t sh_xnni0_inject_age_regval;
struct {
@@ -9500,22 +5122,11 @@ typedef union sh_xnni0_inject_age_u {
mmr_t reserved_0 : 48;
} sh_xnni0_inject_age_s;
} sh_xnni0_inject_age_u_t;
-#else
-typedef union sh_xnni0_inject_age_u {
- mmr_t sh_xnni0_inject_age_regval;
- struct {
- mmr_t reserved_0 : 48;
- mmr_t reply_inject : 8;
- mmr_t request_inject : 8;
- } sh_xnni0_inject_age_s;
-} sh_xnni0_inject_age_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_TO_PI_INTRA_FLOW_DEBIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_to_pi_intra_flow_debit_u {
mmr_t sh_xnni1_to_pi_intra_flow_debit_regval;
struct {
@@ -9536,34 +5147,11 @@ typedef union sh_xnni1_to_pi_intra_flow_debit_u {
mmr_t reserved_6 : 1;
} sh_xnni1_to_pi_intra_flow_debit_s;
} sh_xnni1_to_pi_intra_flow_debit_u_t;
-#else
-typedef union sh_xnni1_to_pi_intra_flow_debit_u {
- mmr_t sh_xnni1_to_pi_intra_flow_debit_regval;
- struct {
- mmr_t reserved_6 : 1;
- mmr_t vc2_cap : 7;
- mmr_t reserved_5 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_4 : 9;
- mmr_t vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_2 : 8;
- mmr_t vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t vc2_withhold : 6;
- mmr_t vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t vc0_withhold : 6;
- } sh_xnni1_to_pi_intra_flow_debit_s;
-} sh_xnni1_to_pi_intra_flow_debit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_TO_MD_INTRA_FLOW_DEBIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_to_md_intra_flow_debit_u {
mmr_t sh_xnni1_to_md_intra_flow_debit_regval;
struct {
@@ -9584,34 +5172,11 @@ typedef union sh_xnni1_to_md_intra_flow_debit_u {
mmr_t reserved_6 : 1;
} sh_xnni1_to_md_intra_flow_debit_s;
} sh_xnni1_to_md_intra_flow_debit_u_t;
-#else
-typedef union sh_xnni1_to_md_intra_flow_debit_u {
- mmr_t sh_xnni1_to_md_intra_flow_debit_regval;
- struct {
- mmr_t reserved_6 : 1;
- mmr_t vc2_cap : 7;
- mmr_t reserved_5 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_4 : 9;
- mmr_t vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_2 : 8;
- mmr_t vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t vc2_withhold : 6;
- mmr_t vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t vc0_withhold : 6;
- } sh_xnni1_to_md_intra_flow_debit_s;
-} sh_xnni1_to_md_intra_flow_debit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_TO_IILB_INTRA_FLOW_DEBIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_to_iilb_intra_flow_debit_u {
mmr_t sh_xnni1_to_iilb_intra_flow_debit_regval;
struct {
@@ -9632,34 +5197,11 @@ typedef union sh_xnni1_to_iilb_intra_flow_debit_u {
mmr_t reserved_6 : 1;
} sh_xnni1_to_iilb_intra_flow_debit_s;
} sh_xnni1_to_iilb_intra_flow_debit_u_t;
-#else
-typedef union sh_xnni1_to_iilb_intra_flow_debit_u {
- mmr_t sh_xnni1_to_iilb_intra_flow_debit_regval;
- struct {
- mmr_t reserved_6 : 1;
- mmr_t vc2_cap : 7;
- mmr_t reserved_5 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_4 : 9;
- mmr_t vc0_cap : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_2 : 8;
- mmr_t vc2_force_cred : 1;
- mmr_t reserved_1 : 1;
- mmr_t vc2_withhold : 6;
- mmr_t vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t vc0_withhold : 6;
- } sh_xnni1_to_iilb_intra_flow_debit_s;
-} sh_xnni1_to_iilb_intra_flow_debit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_FR_PI_INTRA_FLOW_CREDIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_fr_pi_intra_flow_credit_u {
mmr_t sh_xnni1_fr_pi_intra_flow_credit_regval;
struct {
@@ -9677,31 +5219,11 @@ typedef union sh_xnni1_fr_pi_intra_flow_credit_u {
mmr_t reserved_5 : 17;
} sh_xnni1_fr_pi_intra_flow_credit_s;
} sh_xnni1_fr_pi_intra_flow_credit_u_t;
-#else
-typedef union sh_xnni1_fr_pi_intra_flow_credit_u {
- mmr_t sh_xnni1_fr_pi_intra_flow_credit_regval;
- struct {
- mmr_t reserved_5 : 17;
- mmr_t vc2_cap : 7;
- mmr_t reserved_4 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc2_test : 7;
- mmr_t reserved_2 : 1;
- mmr_t vc0_cap : 7;
- mmr_t reserved_1 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_0 : 1;
- mmr_t vc0_test : 7;
- } sh_xnni1_fr_pi_intra_flow_credit_s;
-} sh_xnni1_fr_pi_intra_flow_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_FR_MD_INTRA_FLOW_CREDIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_fr_md_intra_flow_credit_u {
mmr_t sh_xnni1_fr_md_intra_flow_credit_regval;
struct {
@@ -9719,31 +5241,11 @@ typedef union sh_xnni1_fr_md_intra_flow_credit_u {
mmr_t reserved_5 : 17;
} sh_xnni1_fr_md_intra_flow_credit_s;
} sh_xnni1_fr_md_intra_flow_credit_u_t;
-#else
-typedef union sh_xnni1_fr_md_intra_flow_credit_u {
- mmr_t sh_xnni1_fr_md_intra_flow_credit_regval;
- struct {
- mmr_t reserved_5 : 17;
- mmr_t vc2_cap : 7;
- mmr_t reserved_4 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc2_test : 7;
- mmr_t reserved_2 : 1;
- mmr_t vc0_cap : 7;
- mmr_t reserved_1 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_0 : 1;
- mmr_t vc0_test : 7;
- } sh_xnni1_fr_md_intra_flow_credit_s;
-} sh_xnni1_fr_md_intra_flow_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_FR_IILB_INTRA_FLOW_CREDIT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_fr_iilb_intra_flow_credit_u {
mmr_t sh_xnni1_fr_iilb_intra_flow_credit_regval;
struct {
@@ -9761,31 +5263,11 @@ typedef union sh_xnni1_fr_iilb_intra_flow_credit_u {
mmr_t reserved_5 : 17;
} sh_xnni1_fr_iilb_intra_flow_credit_s;
} sh_xnni1_fr_iilb_intra_flow_credit_u_t;
-#else
-typedef union sh_xnni1_fr_iilb_intra_flow_credit_u {
- mmr_t sh_xnni1_fr_iilb_intra_flow_credit_regval;
- struct {
- mmr_t reserved_5 : 17;
- mmr_t vc2_cap : 7;
- mmr_t reserved_4 : 1;
- mmr_t vc2_dyn : 7;
- mmr_t reserved_3 : 1;
- mmr_t vc2_test : 7;
- mmr_t reserved_2 : 1;
- mmr_t vc0_cap : 7;
- mmr_t reserved_1 : 1;
- mmr_t vc0_dyn : 7;
- mmr_t reserved_0 : 1;
- mmr_t vc0_test : 7;
- } sh_xnni1_fr_iilb_intra_flow_credit_s;
-} sh_xnni1_fr_iilb_intra_flow_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_0_INTRANI_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_0_intrani_flow_u {
mmr_t sh_xnni1_0_intrani_flow_regval;
struct {
@@ -9795,23 +5277,11 @@ typedef union sh_xnni1_0_intrani_flow_u {
mmr_t reserved_1 : 56;
} sh_xnni1_0_intrani_flow_s;
} sh_xnni1_0_intrani_flow_u_t;
-#else
-typedef union sh_xnni1_0_intrani_flow_u {
- mmr_t sh_xnni1_0_intrani_flow_regval;
- struct {
- mmr_t reserved_1 : 56;
- mmr_t debit_vc0_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc0_withhold : 6;
- } sh_xnni1_0_intrani_flow_s;
-} sh_xnni1_0_intrani_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_1_INTRANI_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_1_intrani_flow_u {
mmr_t sh_xnni1_1_intrani_flow_regval;
struct {
@@ -9821,23 +5291,11 @@ typedef union sh_xnni1_1_intrani_flow_u {
mmr_t reserved_1 : 56;
} sh_xnni1_1_intrani_flow_s;
} sh_xnni1_1_intrani_flow_u_t;
-#else
-typedef union sh_xnni1_1_intrani_flow_u {
- mmr_t sh_xnni1_1_intrani_flow_regval;
- struct {
- mmr_t reserved_1 : 56;
- mmr_t debit_vc1_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc1_withhold : 6;
- } sh_xnni1_1_intrani_flow_s;
-} sh_xnni1_1_intrani_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_2_INTRANI_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_2_intrani_flow_u {
mmr_t sh_xnni1_2_intrani_flow_regval;
struct {
@@ -9847,23 +5305,11 @@ typedef union sh_xnni1_2_intrani_flow_u {
mmr_t reserved_1 : 56;
} sh_xnni1_2_intrani_flow_s;
} sh_xnni1_2_intrani_flow_u_t;
-#else
-typedef union sh_xnni1_2_intrani_flow_u {
- mmr_t sh_xnni1_2_intrani_flow_regval;
- struct {
- mmr_t reserved_1 : 56;
- mmr_t debit_vc2_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc2_withhold : 6;
- } sh_xnni1_2_intrani_flow_s;
-} sh_xnni1_2_intrani_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_3_INTRANI_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_3_intrani_flow_u {
mmr_t sh_xnni1_3_intrani_flow_regval;
struct {
@@ -9873,23 +5319,11 @@ typedef union sh_xnni1_3_intrani_flow_u {
mmr_t reserved_1 : 56;
} sh_xnni1_3_intrani_flow_s;
} sh_xnni1_3_intrani_flow_u_t;
-#else
-typedef union sh_xnni1_3_intrani_flow_u {
- mmr_t sh_xnni1_3_intrani_flow_regval;
- struct {
- mmr_t reserved_1 : 56;
- mmr_t debit_vc3_force_cred : 1;
- mmr_t reserved_0 : 1;
- mmr_t debit_vc3_withhold : 6;
- } sh_xnni1_3_intrani_flow_s;
-} sh_xnni1_3_intrani_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_VCSWITCH_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_vcswitch_flow_u {
mmr_t sh_xnni1_vcswitch_flow_regval;
struct {
@@ -9907,31 +5341,11 @@ typedef union sh_xnni1_vcswitch_flow_u {
mmr_t reserved_4 : 29;
} sh_xnni1_vcswitch_flow_s;
} sh_xnni1_vcswitch_flow_u_t;
-#else
-typedef union sh_xnni1_vcswitch_flow_u {
- mmr_t sh_xnni1_vcswitch_flow_regval;
- struct {
- mmr_t reserved_4 : 29;
- mmr_t async_fifoes : 1;
- mmr_t disable_sync_bypass_out : 1;
- mmr_t disable_sync_bypass_in : 1;
- mmr_t reserved_3 : 7;
- mmr_t iilb_vcfifo_switch : 1;
- mmr_t reserved_2 : 7;
- mmr_t md_vcfifo_switch : 1;
- mmr_t reserved_1 : 7;
- mmr_t pi_vcfifo_switch : 1;
- mmr_t reserved_0 : 7;
- mmr_t ni_vcfifo_dateline_switch : 1;
- } sh_xnni1_vcswitch_flow_s;
-} sh_xnni1_vcswitch_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_TIMER_REG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_timer_reg_u {
mmr_t sh_xnni1_timer_reg_regval;
struct {
@@ -9941,23 +5355,11 @@ typedef union sh_xnni1_timer_reg_u {
mmr_t reserved_1 : 31;
} sh_xnni1_timer_reg_s;
} sh_xnni1_timer_reg_u_t;
-#else
-typedef union sh_xnni1_timer_reg_u {
- mmr_t sh_xnni1_timer_reg_regval;
- struct {
- mmr_t reserved_1 : 31;
- mmr_t linkcleanup_reg : 1;
- mmr_t reserved_0 : 8;
- mmr_t timeout_reg : 24;
- } sh_xnni1_timer_reg_s;
-} sh_xnni1_timer_reg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_FIFO02_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_fifo02_flow_u {
mmr_t sh_xnni1_fifo02_flow_regval;
struct {
@@ -9975,31 +5377,11 @@ typedef union sh_xnni1_fifo02_flow_u {
mmr_t reserved_5 : 20;
} sh_xnni1_fifo02_flow_s;
} sh_xnni1_fifo02_flow_u_t;
-#else
-typedef union sh_xnni1_fifo02_flow_u {
- mmr_t sh_xnni1_fifo02_flow_regval;
- struct {
- mmr_t reserved_5 : 20;
- mmr_t count_vc2_cap : 4;
- mmr_t reserved_4 : 4;
- mmr_t count_vc2_dyn : 4;
- mmr_t reserved_3 : 4;
- mmr_t count_vc2_limit : 4;
- mmr_t reserved_2 : 4;
- mmr_t count_vc0_cap : 4;
- mmr_t reserved_1 : 4;
- mmr_t count_vc0_dyn : 4;
- mmr_t reserved_0 : 4;
- mmr_t count_vc0_limit : 4;
- } sh_xnni1_fifo02_flow_s;
-} sh_xnni1_fifo02_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_FIFO13_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_fifo13_flow_u {
mmr_t sh_xnni1_fifo13_flow_regval;
struct {
@@ -10017,31 +5399,11 @@ typedef union sh_xnni1_fifo13_flow_u {
mmr_t reserved_5 : 20;
} sh_xnni1_fifo13_flow_s;
} sh_xnni1_fifo13_flow_u_t;
-#else
-typedef union sh_xnni1_fifo13_flow_u {
- mmr_t sh_xnni1_fifo13_flow_regval;
- struct {
- mmr_t reserved_5 : 20;
- mmr_t count_vc3_cap : 4;
- mmr_t reserved_4 : 4;
- mmr_t count_vc3_dyn : 4;
- mmr_t reserved_3 : 4;
- mmr_t count_vc3_limit : 4;
- mmr_t reserved_2 : 4;
- mmr_t count_vc1_cap : 4;
- mmr_t reserved_1 : 4;
- mmr_t count_vc1_dyn : 4;
- mmr_t reserved_0 : 4;
- mmr_t count_vc1_limit : 4;
- } sh_xnni1_fifo13_flow_s;
-} sh_xnni1_fifo13_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_NI_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_ni_flow_u {
mmr_t sh_xnni1_ni_flow_regval;
struct {
@@ -10063,35 +5425,11 @@ typedef union sh_xnni1_ni_flow_u {
mmr_t vc3_cap : 4;
} sh_xnni1_ni_flow_s;
} sh_xnni1_ni_flow_u_t;
-#else
-typedef union sh_xnni1_ni_flow_u {
- mmr_t sh_xnni1_ni_flow_regval;
- struct {
- mmr_t vc3_cap : 4;
- mmr_t vc3_dyn : 4;
- mmr_t reserved_3 : 4;
- mmr_t vc3_limit : 4;
- mmr_t vc2_cap : 4;
- mmr_t vc2_dyn : 4;
- mmr_t reserved_2 : 4;
- mmr_t vc2_limit : 4;
- mmr_t vc1_cap : 4;
- mmr_t vc1_dyn : 4;
- mmr_t reserved_1 : 4;
- mmr_t vc1_limit : 4;
- mmr_t vc0_cap : 4;
- mmr_t vc0_dyn : 4;
- mmr_t reserved_0 : 4;
- mmr_t vc0_limit : 4;
- } sh_xnni1_ni_flow_s;
-} sh_xnni1_ni_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_DEAD_FLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_dead_flow_u {
mmr_t sh_xnni1_dead_flow_regval;
struct {
@@ -10113,35 +5451,11 @@ typedef union sh_xnni1_dead_flow_u {
mmr_t vc3_cap : 4;
} sh_xnni1_dead_flow_s;
} sh_xnni1_dead_flow_u_t;
-#else
-typedef union sh_xnni1_dead_flow_u {
- mmr_t sh_xnni1_dead_flow_regval;
- struct {
- mmr_t vc3_cap : 4;
- mmr_t vc3_dyn : 4;
- mmr_t reserved_3 : 4;
- mmr_t vc3_limit : 4;
- mmr_t vc2_cap : 4;
- mmr_t vc2_dyn : 4;
- mmr_t reserved_2 : 4;
- mmr_t vc2_limit : 4;
- mmr_t vc1_cap : 4;
- mmr_t vc1_dyn : 4;
- mmr_t reserved_1 : 4;
- mmr_t vc1_limit : 4;
- mmr_t vc0_cap : 4;
- mmr_t vc0_dyn : 4;
- mmr_t reserved_0 : 4;
- mmr_t vc0_limit : 4;
- } sh_xnni1_dead_flow_s;
-} sh_xnni1_dead_flow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNNI1_INJECT_AGE" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnni1_inject_age_u {
mmr_t sh_xnni1_inject_age_regval;
struct {
@@ -10150,23 +5464,12 @@ typedef union sh_xnni1_inject_age_u {
mmr_t reserved_0 : 48;
} sh_xnni1_inject_age_s;
} sh_xnni1_inject_age_u_t;
-#else
-typedef union sh_xnni1_inject_age_u {
- mmr_t sh_xnni1_inject_age_regval;
- struct {
- mmr_t reserved_0 : 48;
- mmr_t reply_inject : 8;
- mmr_t request_inject : 8;
- } sh_xnni1_inject_age_s;
-} sh_xnni1_inject_age_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_DEBUG_SEL" */
/* XN Debug Port Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_debug_sel_u {
mmr_t sh_xn_debug_sel_regval;
struct {
@@ -10204,52 +5507,12 @@ typedef union sh_xn_debug_sel_u {
mmr_t trigger_enable : 1;
} sh_xn_debug_sel_s;
} sh_xn_debug_sel_u_t;
-#else
-typedef union sh_xn_debug_sel_u {
- mmr_t sh_xn_debug_sel_regval;
- struct {
- mmr_t trigger_enable : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_rlm_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_rlm_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_rlm_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_rlm_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_rlm_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_rlm_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_rlm_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_rlm_sel : 3;
- } sh_xn_debug_sel_s;
-} sh_xn_debug_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_DEBUG_TRIG_SEL" */
/* XN Debug trigger Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_debug_trig_sel_u {
mmr_t sh_xn_debug_trig_sel_regval;
struct {
@@ -10287,52 +5550,12 @@ typedef union sh_xn_debug_trig_sel_u {
mmr_t reserved_15 : 1;
} sh_xn_debug_trig_sel_s;
} sh_xn_debug_trig_sel_u_t;
-#else
-typedef union sh_xn_debug_trig_sel_u {
- mmr_t sh_xn_debug_trig_sel_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t trigger7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t trigger7_rlm_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t trigger6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t trigger6_rlm_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t trigger5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t trigger5_rlm_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t trigger4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t trigger4_rlm_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t trigger3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t trigger3_rlm_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t trigger2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t trigger2_rlm_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t trigger1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t trigger1_rlm_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t trigger0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t trigger0_rlm_sel : 3;
- } sh_xn_debug_trig_sel_s;
-} sh_xn_debug_trig_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_TRIGGER_COMPARE" */
/* XN Debug Compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_trigger_compare_u {
mmr_t sh_xn_trigger_compare_regval;
struct {
@@ -10340,22 +5563,12 @@ typedef union sh_xn_trigger_compare_u {
mmr_t reserved_0 : 32;
} sh_xn_trigger_compare_s;
} sh_xn_trigger_compare_u_t;
-#else
-typedef union sh_xn_trigger_compare_u {
- mmr_t sh_xn_trigger_compare_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t mask : 32;
- } sh_xn_trigger_compare_s;
-} sh_xn_trigger_compare_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_TRIGGER_DATA" */
/* XN Debug Compare Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_trigger_data_u {
mmr_t sh_xn_trigger_data_regval;
struct {
@@ -10363,22 +5576,12 @@ typedef union sh_xn_trigger_data_u {
mmr_t reserved_0 : 32;
} sh_xn_trigger_data_s;
} sh_xn_trigger_data_u_t;
-#else
-typedef union sh_xn_trigger_data_u {
- mmr_t sh_xn_trigger_data_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t compare_pattern : 32;
- } sh_xn_trigger_data_s;
-} sh_xn_trigger_data_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_DEBUG_SEL" */
/* XN IILB Debug Port Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_iilb_debug_sel_u {
mmr_t sh_xn_iilb_debug_sel_regval;
struct {
@@ -10416,52 +5619,12 @@ typedef union sh_xn_iilb_debug_sel_u {
mmr_t reserved_15 : 1;
} sh_xn_iilb_debug_sel_s;
} sh_xn_iilb_debug_sel_u_t;
-#else
-typedef union sh_xn_iilb_debug_sel_u {
- mmr_t sh_xn_iilb_debug_sel_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_input_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_input_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_input_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_input_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_input_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_input_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_input_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_input_sel : 3;
- } sh_xn_iilb_debug_sel_s;
-} sh_xn_iilb_debug_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_DEBUG_SEL" */
/* XN PI Debug Port Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_pi_debug_sel_u {
mmr_t sh_xn_pi_debug_sel_regval;
struct {
@@ -10499,52 +5662,12 @@ typedef union sh_xn_pi_debug_sel_u {
mmr_t reserved_15 : 1;
} sh_xn_pi_debug_sel_s;
} sh_xn_pi_debug_sel_u_t;
-#else
-typedef union sh_xn_pi_debug_sel_u {
- mmr_t sh_xn_pi_debug_sel_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_input_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_input_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_input_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_input_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_input_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_input_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_input_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_input_sel : 3;
- } sh_xn_pi_debug_sel_s;
-} sh_xn_pi_debug_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_DEBUG_SEL" */
/* XN MD Debug Port Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_md_debug_sel_u {
mmr_t sh_xn_md_debug_sel_regval;
struct {
@@ -10582,52 +5705,12 @@ typedef union sh_xn_md_debug_sel_u {
mmr_t reserved_15 : 1;
} sh_xn_md_debug_sel_s;
} sh_xn_md_debug_sel_u_t;
-#else
-typedef union sh_xn_md_debug_sel_u {
- mmr_t sh_xn_md_debug_sel_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_input_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_input_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_input_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_input_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_input_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_input_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_input_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_input_sel : 3;
- } sh_xn_md_debug_sel_s;
-} sh_xn_md_debug_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_DEBUG_SEL" */
/* XN NI0 Debug Port Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni0_debug_sel_u {
mmr_t sh_xn_ni0_debug_sel_regval;
struct {
@@ -10665,52 +5748,12 @@ typedef union sh_xn_ni0_debug_sel_u {
mmr_t reserved_15 : 1;
} sh_xn_ni0_debug_sel_s;
} sh_xn_ni0_debug_sel_u_t;
-#else
-typedef union sh_xn_ni0_debug_sel_u {
- mmr_t sh_xn_ni0_debug_sel_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_input_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_input_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_input_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_input_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_input_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_input_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_input_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_input_sel : 3;
- } sh_xn_ni0_debug_sel_s;
-} sh_xn_ni0_debug_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_DEBUG_SEL" */
/* XN NI1 Debug Port Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni1_debug_sel_u {
mmr_t sh_xn_ni1_debug_sel_regval;
struct {
@@ -10748,829 +5791,456 @@ typedef union sh_xn_ni1_debug_sel_u {
mmr_t reserved_15 : 1;
} sh_xn_ni1_debug_sel_s;
} sh_xn_ni1_debug_sel_u_t;
-#else
-typedef union sh_xn_ni1_debug_sel_u {
- mmr_t sh_xn_ni1_debug_sel_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_input_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_input_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_input_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_input_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_input_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_input_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_input_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_input_sel : 3;
- } sh_xn_ni1_debug_sel_s;
-} sh_xn_ni1_debug_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_LB_CMP_EXP_DATA0" */
/* IILB compare LB input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_iilb_lb_cmp_exp_data0_u {
mmr_t sh_xn_iilb_lb_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_iilb_lb_cmp_exp_data0_s;
} sh_xn_iilb_lb_cmp_exp_data0_u_t;
-#else
-typedef union sh_xn_iilb_lb_cmp_exp_data0_u {
- mmr_t sh_xn_iilb_lb_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_iilb_lb_cmp_exp_data0_s;
-} sh_xn_iilb_lb_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_LB_CMP_EXP_DATA1" */
/* IILB compare LB input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_iilb_lb_cmp_exp_data1_u {
mmr_t sh_xn_iilb_lb_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_iilb_lb_cmp_exp_data1_s;
} sh_xn_iilb_lb_cmp_exp_data1_u_t;
-#else
-typedef union sh_xn_iilb_lb_cmp_exp_data1_u {
- mmr_t sh_xn_iilb_lb_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_iilb_lb_cmp_exp_data1_s;
-} sh_xn_iilb_lb_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_LB_CMP_ENABLE0" */
/* IILB compare LB input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_lb_cmp_enable0_u {
- mmr_t sh_xn_iilb_lb_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_iilb_lb_cmp_enable0_s;
-} sh_xn_iilb_lb_cmp_enable0_u_t;
-#else
typedef union sh_xn_iilb_lb_cmp_enable0_u {
mmr_t sh_xn_iilb_lb_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_iilb_lb_cmp_enable0_s;
} sh_xn_iilb_lb_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_LB_CMP_ENABLE1" */
/* IILB compare LB input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_lb_cmp_enable1_u {
- mmr_t sh_xn_iilb_lb_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_iilb_lb_cmp_enable1_s;
-} sh_xn_iilb_lb_cmp_enable1_u_t;
-#else
typedef union sh_xn_iilb_lb_cmp_enable1_u {
mmr_t sh_xn_iilb_lb_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_iilb_lb_cmp_enable1_s;
} sh_xn_iilb_lb_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_II_CMP_EXP_DATA0" */
/* IILB compare II input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_ii_cmp_exp_data0_u {
- mmr_t sh_xn_iilb_ii_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_iilb_ii_cmp_exp_data0_s;
-} sh_xn_iilb_ii_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_iilb_ii_cmp_exp_data0_u {
mmr_t sh_xn_iilb_ii_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_iilb_ii_cmp_exp_data0_s;
} sh_xn_iilb_ii_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_II_CMP_EXP_DATA1" */
/* IILB compare II input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_ii_cmp_exp_data1_u {
- mmr_t sh_xn_iilb_ii_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_iilb_ii_cmp_exp_data1_s;
-} sh_xn_iilb_ii_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_iilb_ii_cmp_exp_data1_u {
mmr_t sh_xn_iilb_ii_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_iilb_ii_cmp_exp_data1_s;
} sh_xn_iilb_ii_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_II_CMP_ENABLE0" */
/* IILB compare II input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_ii_cmp_enable0_u {
- mmr_t sh_xn_iilb_ii_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_iilb_ii_cmp_enable0_s;
-} sh_xn_iilb_ii_cmp_enable0_u_t;
-#else
typedef union sh_xn_iilb_ii_cmp_enable0_u {
mmr_t sh_xn_iilb_ii_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_iilb_ii_cmp_enable0_s;
} sh_xn_iilb_ii_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_II_CMP_ENABLE1" */
/* IILB compare II input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_ii_cmp_enable1_u {
- mmr_t sh_xn_iilb_ii_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_iilb_ii_cmp_enable1_s;
-} sh_xn_iilb_ii_cmp_enable1_u_t;
-#else
typedef union sh_xn_iilb_ii_cmp_enable1_u {
mmr_t sh_xn_iilb_ii_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_iilb_ii_cmp_enable1_s;
} sh_xn_iilb_ii_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_MD_CMP_EXP_DATA0" */
/* IILB compare MD input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_md_cmp_exp_data0_u {
- mmr_t sh_xn_iilb_md_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_iilb_md_cmp_exp_data0_s;
-} sh_xn_iilb_md_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_iilb_md_cmp_exp_data0_u {
mmr_t sh_xn_iilb_md_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_iilb_md_cmp_exp_data0_s;
} sh_xn_iilb_md_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_MD_CMP_EXP_DATA1" */
/* IILB compare MD input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_md_cmp_exp_data1_u {
- mmr_t sh_xn_iilb_md_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_iilb_md_cmp_exp_data1_s;
-} sh_xn_iilb_md_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_iilb_md_cmp_exp_data1_u {
mmr_t sh_xn_iilb_md_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_iilb_md_cmp_exp_data1_s;
} sh_xn_iilb_md_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_MD_CMP_ENABLE0" */
/* IILB compare MD input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_md_cmp_enable0_u {
- mmr_t sh_xn_iilb_md_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_iilb_md_cmp_enable0_s;
-} sh_xn_iilb_md_cmp_enable0_u_t;
-#else
typedef union sh_xn_iilb_md_cmp_enable0_u {
mmr_t sh_xn_iilb_md_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_iilb_md_cmp_enable0_s;
} sh_xn_iilb_md_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_MD_CMP_ENABLE1" */
/* IILB compare MD input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_md_cmp_enable1_u {
- mmr_t sh_xn_iilb_md_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_iilb_md_cmp_enable1_s;
-} sh_xn_iilb_md_cmp_enable1_u_t;
-#else
typedef union sh_xn_iilb_md_cmp_enable1_u {
mmr_t sh_xn_iilb_md_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_iilb_md_cmp_enable1_s;
} sh_xn_iilb_md_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_PI_CMP_EXP_DATA0" */
/* IILB compare PI input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_pi_cmp_exp_data0_u {
- mmr_t sh_xn_iilb_pi_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_iilb_pi_cmp_exp_data0_s;
-} sh_xn_iilb_pi_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_iilb_pi_cmp_exp_data0_u {
mmr_t sh_xn_iilb_pi_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_iilb_pi_cmp_exp_data0_s;
} sh_xn_iilb_pi_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_PI_CMP_EXP_DATA1" */
/* IILB compare PI input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_pi_cmp_exp_data1_u {
- mmr_t sh_xn_iilb_pi_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_iilb_pi_cmp_exp_data1_s;
-} sh_xn_iilb_pi_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_iilb_pi_cmp_exp_data1_u {
mmr_t sh_xn_iilb_pi_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_iilb_pi_cmp_exp_data1_s;
} sh_xn_iilb_pi_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_PI_CMP_ENABLE0" */
/* IILB compare PI input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_iilb_pi_cmp_enable0_u {
mmr_t sh_xn_iilb_pi_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_iilb_pi_cmp_enable0_s;
} sh_xn_iilb_pi_cmp_enable0_u_t;
-#else
-typedef union sh_xn_iilb_pi_cmp_enable0_u {
- mmr_t sh_xn_iilb_pi_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_iilb_pi_cmp_enable0_s;
-} sh_xn_iilb_pi_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_PI_CMP_ENABLE1" */
/* IILB compare PI input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_pi_cmp_enable1_u {
- mmr_t sh_xn_iilb_pi_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_iilb_pi_cmp_enable1_s;
-} sh_xn_iilb_pi_cmp_enable1_u_t;
-#else
typedef union sh_xn_iilb_pi_cmp_enable1_u {
mmr_t sh_xn_iilb_pi_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_iilb_pi_cmp_enable1_s;
} sh_xn_iilb_pi_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_NI0_CMP_EXP_DATA0" */
/* IILB compare NI0 input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_ni0_cmp_exp_data0_u {
- mmr_t sh_xn_iilb_ni0_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_iilb_ni0_cmp_exp_data0_s;
-} sh_xn_iilb_ni0_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_iilb_ni0_cmp_exp_data0_u {
mmr_t sh_xn_iilb_ni0_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_iilb_ni0_cmp_exp_data0_s;
} sh_xn_iilb_ni0_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_NI0_CMP_EXP_DATA1" */
/* IILB compare NI0 input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_ni0_cmp_exp_data1_u {
- mmr_t sh_xn_iilb_ni0_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_iilb_ni0_cmp_exp_data1_s;
-} sh_xn_iilb_ni0_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_iilb_ni0_cmp_exp_data1_u {
mmr_t sh_xn_iilb_ni0_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_iilb_ni0_cmp_exp_data1_s;
} sh_xn_iilb_ni0_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_NI0_CMP_ENABLE0" */
/* IILB compare NI0 input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_ni0_cmp_enable0_u {
- mmr_t sh_xn_iilb_ni0_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_iilb_ni0_cmp_enable0_s;
-} sh_xn_iilb_ni0_cmp_enable0_u_t;
-#else
typedef union sh_xn_iilb_ni0_cmp_enable0_u {
mmr_t sh_xn_iilb_ni0_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_iilb_ni0_cmp_enable0_s;
} sh_xn_iilb_ni0_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_NI0_CMP_ENABLE1" */
/* IILB compare NI0 input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_ni0_cmp_enable1_u {
- mmr_t sh_xn_iilb_ni0_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_iilb_ni0_cmp_enable1_s;
-} sh_xn_iilb_ni0_cmp_enable1_u_t;
-#else
typedef union sh_xn_iilb_ni0_cmp_enable1_u {
mmr_t sh_xn_iilb_ni0_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_iilb_ni0_cmp_enable1_s;
} sh_xn_iilb_ni0_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_NI1_CMP_EXP_DATA0" */
/* IILB compare NI1 input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_ni1_cmp_exp_data0_u {
- mmr_t sh_xn_iilb_ni1_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_iilb_ni1_cmp_exp_data0_s;
-} sh_xn_iilb_ni1_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_iilb_ni1_cmp_exp_data0_u {
mmr_t sh_xn_iilb_ni1_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_iilb_ni1_cmp_exp_data0_s;
} sh_xn_iilb_ni1_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_NI1_CMP_EXP_DATA1" */
/* IILB compare NI1 input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_iilb_ni1_cmp_exp_data1_u {
mmr_t sh_xn_iilb_ni1_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_iilb_ni1_cmp_exp_data1_s;
} sh_xn_iilb_ni1_cmp_exp_data1_u_t;
-#else
-typedef union sh_xn_iilb_ni1_cmp_exp_data1_u {
- mmr_t sh_xn_iilb_ni1_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_iilb_ni1_cmp_exp_data1_s;
-} sh_xn_iilb_ni1_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_NI1_CMP_ENABLE0" */
/* IILB compare NI1 input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_ni1_cmp_enable0_u {
- mmr_t sh_xn_iilb_ni1_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_iilb_ni1_cmp_enable0_s;
-} sh_xn_iilb_ni1_cmp_enable0_u_t;
-#else
typedef union sh_xn_iilb_ni1_cmp_enable0_u {
mmr_t sh_xn_iilb_ni1_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_iilb_ni1_cmp_enable0_s;
} sh_xn_iilb_ni1_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_IILB_NI1_CMP_ENABLE1" */
/* IILB compare NI1 input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_iilb_ni1_cmp_enable1_u {
- mmr_t sh_xn_iilb_ni1_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_iilb_ni1_cmp_enable1_s;
-} sh_xn_iilb_ni1_cmp_enable1_u_t;
-#else
typedef union sh_xn_iilb_ni1_cmp_enable1_u {
mmr_t sh_xn_iilb_ni1_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_iilb_ni1_cmp_enable1_s;
} sh_xn_iilb_ni1_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_IILB_CMP_EXP_DATA0" */
/* MD compare IILB input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_md_iilb_cmp_exp_data0_u {
mmr_t sh_xn_md_iilb_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_md_iilb_cmp_exp_data0_s;
} sh_xn_md_iilb_cmp_exp_data0_u_t;
-#else
-typedef union sh_xn_md_iilb_cmp_exp_data0_u {
- mmr_t sh_xn_md_iilb_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_md_iilb_cmp_exp_data0_s;
-} sh_xn_md_iilb_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_IILB_CMP_EXP_DATA1" */
/* MD compare IILB input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_iilb_cmp_exp_data1_u {
- mmr_t sh_xn_md_iilb_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_md_iilb_cmp_exp_data1_s;
-} sh_xn_md_iilb_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_md_iilb_cmp_exp_data1_u {
mmr_t sh_xn_md_iilb_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_md_iilb_cmp_exp_data1_s;
} sh_xn_md_iilb_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_IILB_CMP_ENABLE0" */
/* MD compare IILB input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_md_iilb_cmp_enable0_u {
mmr_t sh_xn_md_iilb_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_md_iilb_cmp_enable0_s;
} sh_xn_md_iilb_cmp_enable0_u_t;
-#else
-typedef union sh_xn_md_iilb_cmp_enable0_u {
- mmr_t sh_xn_md_iilb_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_md_iilb_cmp_enable0_s;
-} sh_xn_md_iilb_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_IILB_CMP_ENABLE1" */
/* MD compare IILB input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_iilb_cmp_enable1_u {
- mmr_t sh_xn_md_iilb_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_md_iilb_cmp_enable1_s;
-} sh_xn_md_iilb_cmp_enable1_u_t;
-#else
typedef union sh_xn_md_iilb_cmp_enable1_u {
mmr_t sh_xn_md_iilb_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_md_iilb_cmp_enable1_s;
} sh_xn_md_iilb_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_NI0_CMP_EXP_DATA0" */
/* MD compare NI0 input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_md_ni0_cmp_exp_data0_u {
mmr_t sh_xn_md_ni0_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_md_ni0_cmp_exp_data0_s;
} sh_xn_md_ni0_cmp_exp_data0_u_t;
-#else
-typedef union sh_xn_md_ni0_cmp_exp_data0_u {
- mmr_t sh_xn_md_ni0_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_md_ni0_cmp_exp_data0_s;
-} sh_xn_md_ni0_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_NI0_CMP_EXP_DATA1" */
/* MD compare NI0 input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_ni0_cmp_exp_data1_u {
- mmr_t sh_xn_md_ni0_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_md_ni0_cmp_exp_data1_s;
-} sh_xn_md_ni0_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_md_ni0_cmp_exp_data1_u {
mmr_t sh_xn_md_ni0_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_md_ni0_cmp_exp_data1_s;
} sh_xn_md_ni0_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_NI0_CMP_ENABLE0" */
/* MD compare NI0 input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_ni0_cmp_enable0_u {
- mmr_t sh_xn_md_ni0_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_md_ni0_cmp_enable0_s;
-} sh_xn_md_ni0_cmp_enable0_u_t;
-#else
typedef union sh_xn_md_ni0_cmp_enable0_u {
mmr_t sh_xn_md_ni0_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_md_ni0_cmp_enable0_s;
} sh_xn_md_ni0_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_NI0_CMP_ENABLE1" */
/* MD compare NI0 input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_ni0_cmp_enable1_u {
- mmr_t sh_xn_md_ni0_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_md_ni0_cmp_enable1_s;
-} sh_xn_md_ni0_cmp_enable1_u_t;
-#else
typedef union sh_xn_md_ni0_cmp_enable1_u {
mmr_t sh_xn_md_ni0_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_md_ni0_cmp_enable1_s;
} sh_xn_md_ni0_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_NI1_CMP_EXP_DATA0" */
/* MD compare NI1 input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_ni1_cmp_exp_data0_u {
- mmr_t sh_xn_md_ni1_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_md_ni1_cmp_exp_data0_s;
-} sh_xn_md_ni1_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_md_ni1_cmp_exp_data0_u {
mmr_t sh_xn_md_ni1_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_md_ni1_cmp_exp_data0_s;
} sh_xn_md_ni1_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_NI1_CMP_EXP_DATA1" */
/* MD compare NI1 input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_md_ni1_cmp_exp_data1_u {
mmr_t sh_xn_md_ni1_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_md_ni1_cmp_exp_data1_s;
} sh_xn_md_ni1_cmp_exp_data1_u_t;
-#else
-typedef union sh_xn_md_ni1_cmp_exp_data1_u {
- mmr_t sh_xn_md_ni1_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_md_ni1_cmp_exp_data1_s;
-} sh_xn_md_ni1_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_NI1_CMP_ENABLE0" */
/* MD compare NI1 input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_ni1_cmp_enable0_u {
- mmr_t sh_xn_md_ni1_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_md_ni1_cmp_enable0_s;
-} sh_xn_md_ni1_cmp_enable0_u_t;
-#else
typedef union sh_xn_md_ni1_cmp_enable0_u {
mmr_t sh_xn_md_ni1_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_md_ni1_cmp_enable0_s;
} sh_xn_md_ni1_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_NI1_CMP_ENABLE1" */
/* MD compare NI1 input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_ni1_cmp_enable1_u {
- mmr_t sh_xn_md_ni1_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_md_ni1_cmp_enable1_s;
-} sh_xn_md_ni1_cmp_enable1_u_t;
-#else
typedef union sh_xn_md_ni1_cmp_enable1_u {
mmr_t sh_xn_md_ni1_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_md_ni1_cmp_enable1_s;
} sh_xn_md_ni1_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_SIC_CMP_EXP_HDR0" */
/* MD compare SIC input expected header0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_sic_cmp_exp_hdr0_u {
- mmr_t sh_xn_md_sic_cmp_exp_hdr0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_md_sic_cmp_exp_hdr0_s;
-} sh_xn_md_sic_cmp_exp_hdr0_u_t;
-#else
typedef union sh_xn_md_sic_cmp_exp_hdr0_u {
mmr_t sh_xn_md_sic_cmp_exp_hdr0_regval;
struct {
mmr_t data : 64;
} sh_xn_md_sic_cmp_exp_hdr0_s;
} sh_xn_md_sic_cmp_exp_hdr0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_SIC_CMP_EXP_HDR1" */
/* MD compare SIC input expected header1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_md_sic_cmp_exp_hdr1_u {
mmr_t sh_xn_md_sic_cmp_exp_hdr1_regval;
struct {
@@ -11578,43 +6248,24 @@ typedef union sh_xn_md_sic_cmp_exp_hdr1_u {
mmr_t reserved_0 : 22;
} sh_xn_md_sic_cmp_exp_hdr1_s;
} sh_xn_md_sic_cmp_exp_hdr1_u_t;
-#else
-typedef union sh_xn_md_sic_cmp_exp_hdr1_u {
- mmr_t sh_xn_md_sic_cmp_exp_hdr1_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t data : 42;
- } sh_xn_md_sic_cmp_exp_hdr1_s;
-} sh_xn_md_sic_cmp_exp_hdr1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_SIC_CMP_HDR_ENABLE0" */
/* MD compare SIC header enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_sic_cmp_hdr_enable0_u {
- mmr_t sh_xn_md_sic_cmp_hdr_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_md_sic_cmp_hdr_enable0_s;
-} sh_xn_md_sic_cmp_hdr_enable0_u_t;
-#else
typedef union sh_xn_md_sic_cmp_hdr_enable0_u {
mmr_t sh_xn_md_sic_cmp_hdr_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_md_sic_cmp_hdr_enable0_s;
} sh_xn_md_sic_cmp_hdr_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_SIC_CMP_HDR_ENABLE1" */
/* MD compare SIC header enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_md_sic_cmp_hdr_enable1_u {
mmr_t sh_xn_md_sic_cmp_hdr_enable1_regval;
struct {
@@ -11622,463 +6273,264 @@ typedef union sh_xn_md_sic_cmp_hdr_enable1_u {
mmr_t reserved_0 : 22;
} sh_xn_md_sic_cmp_hdr_enable1_s;
} sh_xn_md_sic_cmp_hdr_enable1_u_t;
-#else
-typedef union sh_xn_md_sic_cmp_hdr_enable1_u {
- mmr_t sh_xn_md_sic_cmp_hdr_enable1_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t enable : 42;
- } sh_xn_md_sic_cmp_hdr_enable1_s;
-} sh_xn_md_sic_cmp_hdr_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_SIC_CMP_DATA0" */
/* MD compare SIC data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_sic_cmp_data0_u {
- mmr_t sh_xn_md_sic_cmp_data0_regval;
- struct {
- mmr_t data0 : 64;
- } sh_xn_md_sic_cmp_data0_s;
-} sh_xn_md_sic_cmp_data0_u_t;
-#else
typedef union sh_xn_md_sic_cmp_data0_u {
mmr_t sh_xn_md_sic_cmp_data0_regval;
struct {
mmr_t data0 : 64;
} sh_xn_md_sic_cmp_data0_s;
} sh_xn_md_sic_cmp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_SIC_CMP_DATA1" */
/* MD compare SIC data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_md_sic_cmp_data1_u {
mmr_t sh_xn_md_sic_cmp_data1_regval;
struct {
mmr_t data1 : 64;
} sh_xn_md_sic_cmp_data1_s;
} sh_xn_md_sic_cmp_data1_u_t;
-#else
-typedef union sh_xn_md_sic_cmp_data1_u {
- mmr_t sh_xn_md_sic_cmp_data1_regval;
- struct {
- mmr_t data1 : 64;
- } sh_xn_md_sic_cmp_data1_s;
-} sh_xn_md_sic_cmp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_SIC_CMP_DATA2" */
/* MD compare SIC data2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_sic_cmp_data2_u {
- mmr_t sh_xn_md_sic_cmp_data2_regval;
- struct {
- mmr_t data2 : 64;
- } sh_xn_md_sic_cmp_data2_s;
-} sh_xn_md_sic_cmp_data2_u_t;
-#else
typedef union sh_xn_md_sic_cmp_data2_u {
mmr_t sh_xn_md_sic_cmp_data2_regval;
struct {
mmr_t data2 : 64;
} sh_xn_md_sic_cmp_data2_s;
} sh_xn_md_sic_cmp_data2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_SIC_CMP_DATA3" */
/* MD compare SIC data3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_sic_cmp_data3_u {
- mmr_t sh_xn_md_sic_cmp_data3_regval;
- struct {
- mmr_t data3 : 64;
- } sh_xn_md_sic_cmp_data3_s;
-} sh_xn_md_sic_cmp_data3_u_t;
-#else
typedef union sh_xn_md_sic_cmp_data3_u {
mmr_t sh_xn_md_sic_cmp_data3_regval;
struct {
mmr_t data3 : 64;
} sh_xn_md_sic_cmp_data3_s;
} sh_xn_md_sic_cmp_data3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_SIC_CMP_DATA_ENABLE0" */
/* MD enable compare SIC data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_sic_cmp_data_enable0_u {
- mmr_t sh_xn_md_sic_cmp_data_enable0_regval;
- struct {
- mmr_t data_enable0 : 64;
- } sh_xn_md_sic_cmp_data_enable0_s;
-} sh_xn_md_sic_cmp_data_enable0_u_t;
-#else
typedef union sh_xn_md_sic_cmp_data_enable0_u {
mmr_t sh_xn_md_sic_cmp_data_enable0_regval;
struct {
mmr_t data_enable0 : 64;
} sh_xn_md_sic_cmp_data_enable0_s;
} sh_xn_md_sic_cmp_data_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_SIC_CMP_DATA_ENABLE1" */
/* MD enable compare SIC data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_md_sic_cmp_data_enable1_u {
- mmr_t sh_xn_md_sic_cmp_data_enable1_regval;
- struct {
- mmr_t data_enable1 : 64;
- } sh_xn_md_sic_cmp_data_enable1_s;
-} sh_xn_md_sic_cmp_data_enable1_u_t;
-#else
typedef union sh_xn_md_sic_cmp_data_enable1_u {
mmr_t sh_xn_md_sic_cmp_data_enable1_regval;
struct {
mmr_t data_enable1 : 64;
} sh_xn_md_sic_cmp_data_enable1_s;
} sh_xn_md_sic_cmp_data_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_SIC_CMP_DATA_ENABLE2" */
/* MD enable compare SIC data2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_md_sic_cmp_data_enable2_u {
mmr_t sh_xn_md_sic_cmp_data_enable2_regval;
struct {
mmr_t data_enable2 : 64;
} sh_xn_md_sic_cmp_data_enable2_s;
} sh_xn_md_sic_cmp_data_enable2_u_t;
-#else
-typedef union sh_xn_md_sic_cmp_data_enable2_u {
- mmr_t sh_xn_md_sic_cmp_data_enable2_regval;
- struct {
- mmr_t data_enable2 : 64;
- } sh_xn_md_sic_cmp_data_enable2_s;
-} sh_xn_md_sic_cmp_data_enable2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_SIC_CMP_DATA_ENABLE3" */
/* MD enable compare SIC data3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_md_sic_cmp_data_enable3_u {
mmr_t sh_xn_md_sic_cmp_data_enable3_regval;
struct {
mmr_t data_enable3 : 64;
} sh_xn_md_sic_cmp_data_enable3_s;
} sh_xn_md_sic_cmp_data_enable3_u_t;
-#else
-typedef union sh_xn_md_sic_cmp_data_enable3_u {
- mmr_t sh_xn_md_sic_cmp_data_enable3_regval;
- struct {
- mmr_t data_enable3 : 64;
- } sh_xn_md_sic_cmp_data_enable3_s;
-} sh_xn_md_sic_cmp_data_enable3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_IILB_CMP_EXP_DATA0" */
/* PI compare IILB input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_iilb_cmp_exp_data0_u {
- mmr_t sh_xn_pi_iilb_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_pi_iilb_cmp_exp_data0_s;
-} sh_xn_pi_iilb_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_pi_iilb_cmp_exp_data0_u {
mmr_t sh_xn_pi_iilb_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_pi_iilb_cmp_exp_data0_s;
} sh_xn_pi_iilb_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_IILB_CMP_EXP_DATA1" */
/* PI compare IILB input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_iilb_cmp_exp_data1_u {
- mmr_t sh_xn_pi_iilb_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_pi_iilb_cmp_exp_data1_s;
-} sh_xn_pi_iilb_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_pi_iilb_cmp_exp_data1_u {
mmr_t sh_xn_pi_iilb_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_pi_iilb_cmp_exp_data1_s;
} sh_xn_pi_iilb_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_IILB_CMP_ENABLE0" */
/* PI compare IILB input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_iilb_cmp_enable0_u {
- mmr_t sh_xn_pi_iilb_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_pi_iilb_cmp_enable0_s;
-} sh_xn_pi_iilb_cmp_enable0_u_t;
-#else
typedef union sh_xn_pi_iilb_cmp_enable0_u {
mmr_t sh_xn_pi_iilb_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_pi_iilb_cmp_enable0_s;
} sh_xn_pi_iilb_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_IILB_CMP_ENABLE1" */
/* PI compare IILB input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_pi_iilb_cmp_enable1_u {
mmr_t sh_xn_pi_iilb_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_pi_iilb_cmp_enable1_s;
} sh_xn_pi_iilb_cmp_enable1_u_t;
-#else
-typedef union sh_xn_pi_iilb_cmp_enable1_u {
- mmr_t sh_xn_pi_iilb_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_pi_iilb_cmp_enable1_s;
-} sh_xn_pi_iilb_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_NI0_CMP_EXP_DATA0" */
/* PI compare NI0 input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_pi_ni0_cmp_exp_data0_u {
mmr_t sh_xn_pi_ni0_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_pi_ni0_cmp_exp_data0_s;
} sh_xn_pi_ni0_cmp_exp_data0_u_t;
-#else
-typedef union sh_xn_pi_ni0_cmp_exp_data0_u {
- mmr_t sh_xn_pi_ni0_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_pi_ni0_cmp_exp_data0_s;
-} sh_xn_pi_ni0_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_NI0_CMP_EXP_DATA1" */
/* PI compare NI0 input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_pi_ni0_cmp_exp_data1_u {
mmr_t sh_xn_pi_ni0_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_pi_ni0_cmp_exp_data1_s;
} sh_xn_pi_ni0_cmp_exp_data1_u_t;
-#else
-typedef union sh_xn_pi_ni0_cmp_exp_data1_u {
- mmr_t sh_xn_pi_ni0_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_pi_ni0_cmp_exp_data1_s;
-} sh_xn_pi_ni0_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_NI0_CMP_ENABLE0" */
/* PI compare NI0 input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_pi_ni0_cmp_enable0_u {
mmr_t sh_xn_pi_ni0_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_pi_ni0_cmp_enable0_s;
} sh_xn_pi_ni0_cmp_enable0_u_t;
-#else
-typedef union sh_xn_pi_ni0_cmp_enable0_u {
- mmr_t sh_xn_pi_ni0_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_pi_ni0_cmp_enable0_s;
-} sh_xn_pi_ni0_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_NI0_CMP_ENABLE1" */
/* PI compare NI0 input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_ni0_cmp_enable1_u {
- mmr_t sh_xn_pi_ni0_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_pi_ni0_cmp_enable1_s;
-} sh_xn_pi_ni0_cmp_enable1_u_t;
-#else
typedef union sh_xn_pi_ni0_cmp_enable1_u {
mmr_t sh_xn_pi_ni0_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_pi_ni0_cmp_enable1_s;
} sh_xn_pi_ni0_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_NI1_CMP_EXP_DATA0" */
/* PI compare NI1 input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_ni1_cmp_exp_data0_u {
- mmr_t sh_xn_pi_ni1_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_pi_ni1_cmp_exp_data0_s;
-} sh_xn_pi_ni1_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_pi_ni1_cmp_exp_data0_u {
mmr_t sh_xn_pi_ni1_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_pi_ni1_cmp_exp_data0_s;
} sh_xn_pi_ni1_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_NI1_CMP_EXP_DATA1" */
/* PI compare NI1 input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_ni1_cmp_exp_data1_u {
- mmr_t sh_xn_pi_ni1_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_pi_ni1_cmp_exp_data1_s;
-} sh_xn_pi_ni1_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_pi_ni1_cmp_exp_data1_u {
mmr_t sh_xn_pi_ni1_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_pi_ni1_cmp_exp_data1_s;
} sh_xn_pi_ni1_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_NI1_CMP_ENABLE0" */
/* PI compare NI1 input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_ni1_cmp_enable0_u {
- mmr_t sh_xn_pi_ni1_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_pi_ni1_cmp_enable0_s;
-} sh_xn_pi_ni1_cmp_enable0_u_t;
-#else
typedef union sh_xn_pi_ni1_cmp_enable0_u {
mmr_t sh_xn_pi_ni1_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_pi_ni1_cmp_enable0_s;
} sh_xn_pi_ni1_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_NI1_CMP_ENABLE1" */
/* PI compare NI1 input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_ni1_cmp_enable1_u {
- mmr_t sh_xn_pi_ni1_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_pi_ni1_cmp_enable1_s;
-} sh_xn_pi_ni1_cmp_enable1_u_t;
-#else
typedef union sh_xn_pi_ni1_cmp_enable1_u {
mmr_t sh_xn_pi_ni1_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_pi_ni1_cmp_enable1_s;
} sh_xn_pi_ni1_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_SIC_CMP_EXP_HDR0" */
/* PI compare SIC input expected header0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_sic_cmp_exp_hdr0_u {
- mmr_t sh_xn_pi_sic_cmp_exp_hdr0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_pi_sic_cmp_exp_hdr0_s;
-} sh_xn_pi_sic_cmp_exp_hdr0_u_t;
-#else
typedef union sh_xn_pi_sic_cmp_exp_hdr0_u {
mmr_t sh_xn_pi_sic_cmp_exp_hdr0_regval;
struct {
mmr_t data : 64;
} sh_xn_pi_sic_cmp_exp_hdr0_s;
} sh_xn_pi_sic_cmp_exp_hdr0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_SIC_CMP_EXP_HDR1" */
/* PI compare SIC input expected header1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_pi_sic_cmp_exp_hdr1_u {
mmr_t sh_xn_pi_sic_cmp_exp_hdr1_regval;
struct {
@@ -12086,43 +6538,24 @@ typedef union sh_xn_pi_sic_cmp_exp_hdr1_u {
mmr_t reserved_0 : 22;
} sh_xn_pi_sic_cmp_exp_hdr1_s;
} sh_xn_pi_sic_cmp_exp_hdr1_u_t;
-#else
-typedef union sh_xn_pi_sic_cmp_exp_hdr1_u {
- mmr_t sh_xn_pi_sic_cmp_exp_hdr1_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t data : 42;
- } sh_xn_pi_sic_cmp_exp_hdr1_s;
-} sh_xn_pi_sic_cmp_exp_hdr1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_SIC_CMP_HDR_ENABLE0" */
/* PI compare SIC header enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_sic_cmp_hdr_enable0_u {
- mmr_t sh_xn_pi_sic_cmp_hdr_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_pi_sic_cmp_hdr_enable0_s;
-} sh_xn_pi_sic_cmp_hdr_enable0_u_t;
-#else
typedef union sh_xn_pi_sic_cmp_hdr_enable0_u {
mmr_t sh_xn_pi_sic_cmp_hdr_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_pi_sic_cmp_hdr_enable0_s;
} sh_xn_pi_sic_cmp_hdr_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_SIC_CMP_HDR_ENABLE1" */
/* PI compare SIC header enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_pi_sic_cmp_hdr_enable1_u {
mmr_t sh_xn_pi_sic_cmp_hdr_enable1_regval;
struct {
@@ -12130,1029 +6563,587 @@ typedef union sh_xn_pi_sic_cmp_hdr_enable1_u {
mmr_t reserved_0 : 22;
} sh_xn_pi_sic_cmp_hdr_enable1_s;
} sh_xn_pi_sic_cmp_hdr_enable1_u_t;
-#else
-typedef union sh_xn_pi_sic_cmp_hdr_enable1_u {
- mmr_t sh_xn_pi_sic_cmp_hdr_enable1_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t enable : 42;
- } sh_xn_pi_sic_cmp_hdr_enable1_s;
-} sh_xn_pi_sic_cmp_hdr_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_SIC_CMP_DATA0" */
/* PI compare SIC data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_sic_cmp_data0_u {
- mmr_t sh_xn_pi_sic_cmp_data0_regval;
- struct {
- mmr_t data0 : 64;
- } sh_xn_pi_sic_cmp_data0_s;
-} sh_xn_pi_sic_cmp_data0_u_t;
-#else
typedef union sh_xn_pi_sic_cmp_data0_u {
mmr_t sh_xn_pi_sic_cmp_data0_regval;
struct {
mmr_t data0 : 64;
} sh_xn_pi_sic_cmp_data0_s;
} sh_xn_pi_sic_cmp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_SIC_CMP_DATA1" */
/* PI compare SIC data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_sic_cmp_data1_u {
- mmr_t sh_xn_pi_sic_cmp_data1_regval;
- struct {
- mmr_t data1 : 64;
- } sh_xn_pi_sic_cmp_data1_s;
-} sh_xn_pi_sic_cmp_data1_u_t;
-#else
typedef union sh_xn_pi_sic_cmp_data1_u {
mmr_t sh_xn_pi_sic_cmp_data1_regval;
struct {
mmr_t data1 : 64;
} sh_xn_pi_sic_cmp_data1_s;
} sh_xn_pi_sic_cmp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_SIC_CMP_DATA2" */
/* PI compare SIC data2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_sic_cmp_data2_u {
- mmr_t sh_xn_pi_sic_cmp_data2_regval;
- struct {
- mmr_t data2 : 64;
- } sh_xn_pi_sic_cmp_data2_s;
-} sh_xn_pi_sic_cmp_data2_u_t;
-#else
typedef union sh_xn_pi_sic_cmp_data2_u {
mmr_t sh_xn_pi_sic_cmp_data2_regval;
struct {
mmr_t data2 : 64;
} sh_xn_pi_sic_cmp_data2_s;
} sh_xn_pi_sic_cmp_data2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_SIC_CMP_DATA3" */
/* PI compare SIC data3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_pi_sic_cmp_data3_u {
mmr_t sh_xn_pi_sic_cmp_data3_regval;
struct {
mmr_t data3 : 64;
} sh_xn_pi_sic_cmp_data3_s;
} sh_xn_pi_sic_cmp_data3_u_t;
-#else
-typedef union sh_xn_pi_sic_cmp_data3_u {
- mmr_t sh_xn_pi_sic_cmp_data3_regval;
- struct {
- mmr_t data3 : 64;
- } sh_xn_pi_sic_cmp_data3_s;
-} sh_xn_pi_sic_cmp_data3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_SIC_CMP_DATA_ENABLE0" */
/* PI enable compare SIC data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_sic_cmp_data_enable0_u {
- mmr_t sh_xn_pi_sic_cmp_data_enable0_regval;
- struct {
- mmr_t data_enable0 : 64;
- } sh_xn_pi_sic_cmp_data_enable0_s;
-} sh_xn_pi_sic_cmp_data_enable0_u_t;
-#else
typedef union sh_xn_pi_sic_cmp_data_enable0_u {
mmr_t sh_xn_pi_sic_cmp_data_enable0_regval;
struct {
mmr_t data_enable0 : 64;
} sh_xn_pi_sic_cmp_data_enable0_s;
} sh_xn_pi_sic_cmp_data_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_SIC_CMP_DATA_ENABLE1" */
/* PI enable compare SIC data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_sic_cmp_data_enable1_u {
- mmr_t sh_xn_pi_sic_cmp_data_enable1_regval;
- struct {
- mmr_t data_enable1 : 64;
- } sh_xn_pi_sic_cmp_data_enable1_s;
-} sh_xn_pi_sic_cmp_data_enable1_u_t;
-#else
typedef union sh_xn_pi_sic_cmp_data_enable1_u {
mmr_t sh_xn_pi_sic_cmp_data_enable1_regval;
struct {
mmr_t data_enable1 : 64;
} sh_xn_pi_sic_cmp_data_enable1_s;
} sh_xn_pi_sic_cmp_data_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_SIC_CMP_DATA_ENABLE2" */
/* PI enable compare SIC data2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_sic_cmp_data_enable2_u {
- mmr_t sh_xn_pi_sic_cmp_data_enable2_regval;
- struct {
- mmr_t data_enable2 : 64;
- } sh_xn_pi_sic_cmp_data_enable2_s;
-} sh_xn_pi_sic_cmp_data_enable2_u_t;
-#else
typedef union sh_xn_pi_sic_cmp_data_enable2_u {
mmr_t sh_xn_pi_sic_cmp_data_enable2_regval;
struct {
mmr_t data_enable2 : 64;
} sh_xn_pi_sic_cmp_data_enable2_s;
} sh_xn_pi_sic_cmp_data_enable2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_PI_SIC_CMP_DATA_ENABLE3" */
/* PI enable compare SIC data3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_pi_sic_cmp_data_enable3_u {
- mmr_t sh_xn_pi_sic_cmp_data_enable3_regval;
- struct {
- mmr_t data_enable3 : 64;
- } sh_xn_pi_sic_cmp_data_enable3_s;
-} sh_xn_pi_sic_cmp_data_enable3_u_t;
-#else
typedef union sh_xn_pi_sic_cmp_data_enable3_u {
mmr_t sh_xn_pi_sic_cmp_data_enable3_regval;
struct {
mmr_t data_enable3 : 64;
} sh_xn_pi_sic_cmp_data_enable3_s;
} sh_xn_pi_sic_cmp_data_enable3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_IILB_CMP_EXP_DATA0" */
/* NI0 compare IILB input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_iilb_cmp_exp_data0_u {
- mmr_t sh_xn_ni0_iilb_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni0_iilb_cmp_exp_data0_s;
-} sh_xn_ni0_iilb_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_ni0_iilb_cmp_exp_data0_u {
mmr_t sh_xn_ni0_iilb_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_ni0_iilb_cmp_exp_data0_s;
} sh_xn_ni0_iilb_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_IILB_CMP_EXP_DATA1" */
/* NI0 compare IILB input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni0_iilb_cmp_exp_data1_u {
mmr_t sh_xn_ni0_iilb_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_ni0_iilb_cmp_exp_data1_s;
} sh_xn_ni0_iilb_cmp_exp_data1_u_t;
-#else
-typedef union sh_xn_ni0_iilb_cmp_exp_data1_u {
- mmr_t sh_xn_ni0_iilb_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni0_iilb_cmp_exp_data1_s;
-} sh_xn_ni0_iilb_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_IILB_CMP_ENABLE0" */
/* NI0 compare IILB input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_iilb_cmp_enable0_u {
- mmr_t sh_xn_ni0_iilb_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni0_iilb_cmp_enable0_s;
-} sh_xn_ni0_iilb_cmp_enable0_u_t;
-#else
typedef union sh_xn_ni0_iilb_cmp_enable0_u {
mmr_t sh_xn_ni0_iilb_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni0_iilb_cmp_enable0_s;
} sh_xn_ni0_iilb_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_IILB_CMP_ENABLE1" */
/* NI0 compare IILB input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_iilb_cmp_enable1_u {
- mmr_t sh_xn_ni0_iilb_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni0_iilb_cmp_enable1_s;
-} sh_xn_ni0_iilb_cmp_enable1_u_t;
-#else
typedef union sh_xn_ni0_iilb_cmp_enable1_u {
mmr_t sh_xn_ni0_iilb_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni0_iilb_cmp_enable1_s;
} sh_xn_ni0_iilb_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_PI_CMP_EXP_DATA0" */
/* NI0 compare PI input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_pi_cmp_exp_data0_u {
- mmr_t sh_xn_ni0_pi_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni0_pi_cmp_exp_data0_s;
-} sh_xn_ni0_pi_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_ni0_pi_cmp_exp_data0_u {
mmr_t sh_xn_ni0_pi_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_ni0_pi_cmp_exp_data0_s;
} sh_xn_ni0_pi_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_PI_CMP_EXP_DATA1" */
/* NI0 compare PI input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni0_pi_cmp_exp_data1_u {
mmr_t sh_xn_ni0_pi_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_ni0_pi_cmp_exp_data1_s;
} sh_xn_ni0_pi_cmp_exp_data1_u_t;
-#else
-typedef union sh_xn_ni0_pi_cmp_exp_data1_u {
- mmr_t sh_xn_ni0_pi_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni0_pi_cmp_exp_data1_s;
-} sh_xn_ni0_pi_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_PI_CMP_ENABLE0" */
/* NI0 compare PI input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni0_pi_cmp_enable0_u {
mmr_t sh_xn_ni0_pi_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni0_pi_cmp_enable0_s;
} sh_xn_ni0_pi_cmp_enable0_u_t;
-#else
-typedef union sh_xn_ni0_pi_cmp_enable0_u {
- mmr_t sh_xn_ni0_pi_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni0_pi_cmp_enable0_s;
-} sh_xn_ni0_pi_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_PI_CMP_ENABLE1" */
/* NI0 compare PI input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni0_pi_cmp_enable1_u {
mmr_t sh_xn_ni0_pi_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni0_pi_cmp_enable1_s;
} sh_xn_ni0_pi_cmp_enable1_u_t;
-#else
-typedef union sh_xn_ni0_pi_cmp_enable1_u {
- mmr_t sh_xn_ni0_pi_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni0_pi_cmp_enable1_s;
-} sh_xn_ni0_pi_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_MD_CMP_EXP_DATA0" */
/* NI0 compare MD input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_md_cmp_exp_data0_u {
- mmr_t sh_xn_ni0_md_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni0_md_cmp_exp_data0_s;
-} sh_xn_ni0_md_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_ni0_md_cmp_exp_data0_u {
mmr_t sh_xn_ni0_md_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_ni0_md_cmp_exp_data0_s;
} sh_xn_ni0_md_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_MD_CMP_EXP_DATA1" */
/* NI0 compare MD input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_md_cmp_exp_data1_u {
- mmr_t sh_xn_ni0_md_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni0_md_cmp_exp_data1_s;
-} sh_xn_ni0_md_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_ni0_md_cmp_exp_data1_u {
mmr_t sh_xn_ni0_md_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_ni0_md_cmp_exp_data1_s;
} sh_xn_ni0_md_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_MD_CMP_ENABLE0" */
/* NI0 compare MD input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni0_md_cmp_enable0_u {
mmr_t sh_xn_ni0_md_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni0_md_cmp_enable0_s;
} sh_xn_ni0_md_cmp_enable0_u_t;
-#else
-typedef union sh_xn_ni0_md_cmp_enable0_u {
- mmr_t sh_xn_ni0_md_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni0_md_cmp_enable0_s;
-} sh_xn_ni0_md_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_MD_CMP_ENABLE1" */
/* NI0 compare MD input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_md_cmp_enable1_u {
- mmr_t sh_xn_ni0_md_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni0_md_cmp_enable1_s;
-} sh_xn_ni0_md_cmp_enable1_u_t;
-#else
typedef union sh_xn_ni0_md_cmp_enable1_u {
mmr_t sh_xn_ni0_md_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni0_md_cmp_enable1_s;
} sh_xn_ni0_md_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_NI_CMP_EXP_DATA0" */
/* NI0 compare NI input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_ni_cmp_exp_data0_u {
- mmr_t sh_xn_ni0_ni_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni0_ni_cmp_exp_data0_s;
-} sh_xn_ni0_ni_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_ni0_ni_cmp_exp_data0_u {
mmr_t sh_xn_ni0_ni_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_ni0_ni_cmp_exp_data0_s;
} sh_xn_ni0_ni_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_NI_CMP_EXP_DATA1" */
/* NI0 compare NI input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_ni_cmp_exp_data1_u {
- mmr_t sh_xn_ni0_ni_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni0_ni_cmp_exp_data1_s;
-} sh_xn_ni0_ni_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_ni0_ni_cmp_exp_data1_u {
mmr_t sh_xn_ni0_ni_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_ni0_ni_cmp_exp_data1_s;
} sh_xn_ni0_ni_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_NI_CMP_ENABLE0" */
/* NI0 compare NI input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_ni_cmp_enable0_u {
- mmr_t sh_xn_ni0_ni_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni0_ni_cmp_enable0_s;
-} sh_xn_ni0_ni_cmp_enable0_u_t;
-#else
typedef union sh_xn_ni0_ni_cmp_enable0_u {
mmr_t sh_xn_ni0_ni_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni0_ni_cmp_enable0_s;
} sh_xn_ni0_ni_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_NI_CMP_ENABLE1" */
/* NI0 compare NI input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni0_ni_cmp_enable1_u {
mmr_t sh_xn_ni0_ni_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni0_ni_cmp_enable1_s;
} sh_xn_ni0_ni_cmp_enable1_u_t;
-#else
-typedef union sh_xn_ni0_ni_cmp_enable1_u {
- mmr_t sh_xn_ni0_ni_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni0_ni_cmp_enable1_s;
-} sh_xn_ni0_ni_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_LLP_CMP_EXP_DATA0" */
/* NI0 compare LLP input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_llp_cmp_exp_data0_u {
- mmr_t sh_xn_ni0_llp_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni0_llp_cmp_exp_data0_s;
-} sh_xn_ni0_llp_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_ni0_llp_cmp_exp_data0_u {
mmr_t sh_xn_ni0_llp_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_ni0_llp_cmp_exp_data0_s;
} sh_xn_ni0_llp_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_LLP_CMP_EXP_DATA1" */
/* NI0 compare LLP input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_llp_cmp_exp_data1_u {
- mmr_t sh_xn_ni0_llp_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni0_llp_cmp_exp_data1_s;
-} sh_xn_ni0_llp_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_ni0_llp_cmp_exp_data1_u {
mmr_t sh_xn_ni0_llp_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_ni0_llp_cmp_exp_data1_s;
} sh_xn_ni0_llp_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_LLP_CMP_ENABLE0" */
/* NI0 compare LLP input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_llp_cmp_enable0_u {
- mmr_t sh_xn_ni0_llp_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni0_llp_cmp_enable0_s;
-} sh_xn_ni0_llp_cmp_enable0_u_t;
-#else
typedef union sh_xn_ni0_llp_cmp_enable0_u {
mmr_t sh_xn_ni0_llp_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni0_llp_cmp_enable0_s;
} sh_xn_ni0_llp_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI0_LLP_CMP_ENABLE1" */
/* NI0 compare LLP input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni0_llp_cmp_enable1_u {
- mmr_t sh_xn_ni0_llp_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni0_llp_cmp_enable1_s;
-} sh_xn_ni0_llp_cmp_enable1_u_t;
-#else
typedef union sh_xn_ni0_llp_cmp_enable1_u {
mmr_t sh_xn_ni0_llp_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni0_llp_cmp_enable1_s;
} sh_xn_ni0_llp_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_IILB_CMP_EXP_DATA0" */
/* NI1 compare IILB input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni1_iilb_cmp_exp_data0_u {
mmr_t sh_xn_ni1_iilb_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_ni1_iilb_cmp_exp_data0_s;
} sh_xn_ni1_iilb_cmp_exp_data0_u_t;
-#else
-typedef union sh_xn_ni1_iilb_cmp_exp_data0_u {
- mmr_t sh_xn_ni1_iilb_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni1_iilb_cmp_exp_data0_s;
-} sh_xn_ni1_iilb_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_IILB_CMP_EXP_DATA1" */
/* NI1 compare IILB input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni1_iilb_cmp_exp_data1_u {
mmr_t sh_xn_ni1_iilb_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_ni1_iilb_cmp_exp_data1_s;
} sh_xn_ni1_iilb_cmp_exp_data1_u_t;
-#else
-typedef union sh_xn_ni1_iilb_cmp_exp_data1_u {
- mmr_t sh_xn_ni1_iilb_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni1_iilb_cmp_exp_data1_s;
-} sh_xn_ni1_iilb_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_IILB_CMP_ENABLE0" */
/* NI1 compare IILB input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_iilb_cmp_enable0_u {
- mmr_t sh_xn_ni1_iilb_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni1_iilb_cmp_enable0_s;
-} sh_xn_ni1_iilb_cmp_enable0_u_t;
-#else
typedef union sh_xn_ni1_iilb_cmp_enable0_u {
mmr_t sh_xn_ni1_iilb_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni1_iilb_cmp_enable0_s;
} sh_xn_ni1_iilb_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_IILB_CMP_ENABLE1" */
/* NI1 compare IILB input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_iilb_cmp_enable1_u {
- mmr_t sh_xn_ni1_iilb_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni1_iilb_cmp_enable1_s;
-} sh_xn_ni1_iilb_cmp_enable1_u_t;
-#else
typedef union sh_xn_ni1_iilb_cmp_enable1_u {
mmr_t sh_xn_ni1_iilb_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni1_iilb_cmp_enable1_s;
} sh_xn_ni1_iilb_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_PI_CMP_EXP_DATA0" */
/* NI1 compare PI input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_pi_cmp_exp_data0_u {
- mmr_t sh_xn_ni1_pi_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni1_pi_cmp_exp_data0_s;
-} sh_xn_ni1_pi_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_ni1_pi_cmp_exp_data0_u {
mmr_t sh_xn_ni1_pi_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_ni1_pi_cmp_exp_data0_s;
} sh_xn_ni1_pi_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_PI_CMP_EXP_DATA1" */
/* NI1 compare PI input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni1_pi_cmp_exp_data1_u {
mmr_t sh_xn_ni1_pi_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_ni1_pi_cmp_exp_data1_s;
} sh_xn_ni1_pi_cmp_exp_data1_u_t;
-#else
-typedef union sh_xn_ni1_pi_cmp_exp_data1_u {
- mmr_t sh_xn_ni1_pi_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni1_pi_cmp_exp_data1_s;
-} sh_xn_ni1_pi_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_PI_CMP_ENABLE0" */
/* NI1 compare PI input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_pi_cmp_enable0_u {
- mmr_t sh_xn_ni1_pi_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni1_pi_cmp_enable0_s;
-} sh_xn_ni1_pi_cmp_enable0_u_t;
-#else
typedef union sh_xn_ni1_pi_cmp_enable0_u {
mmr_t sh_xn_ni1_pi_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni1_pi_cmp_enable0_s;
} sh_xn_ni1_pi_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_PI_CMP_ENABLE1" */
/* NI1 compare PI input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_pi_cmp_enable1_u {
- mmr_t sh_xn_ni1_pi_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni1_pi_cmp_enable1_s;
-} sh_xn_ni1_pi_cmp_enable1_u_t;
-#else
typedef union sh_xn_ni1_pi_cmp_enable1_u {
mmr_t sh_xn_ni1_pi_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni1_pi_cmp_enable1_s;
} sh_xn_ni1_pi_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_MD_CMP_EXP_DATA0" */
/* NI1 compare MD input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni1_md_cmp_exp_data0_u {
mmr_t sh_xn_ni1_md_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_ni1_md_cmp_exp_data0_s;
} sh_xn_ni1_md_cmp_exp_data0_u_t;
-#else
-typedef union sh_xn_ni1_md_cmp_exp_data0_u {
- mmr_t sh_xn_ni1_md_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni1_md_cmp_exp_data0_s;
-} sh_xn_ni1_md_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_MD_CMP_EXP_DATA1" */
/* NI1 compare MD input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_md_cmp_exp_data1_u {
- mmr_t sh_xn_ni1_md_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni1_md_cmp_exp_data1_s;
-} sh_xn_ni1_md_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_ni1_md_cmp_exp_data1_u {
mmr_t sh_xn_ni1_md_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_ni1_md_cmp_exp_data1_s;
} sh_xn_ni1_md_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_MD_CMP_ENABLE0" */
/* NI1 compare MD input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni1_md_cmp_enable0_u {
mmr_t sh_xn_ni1_md_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni1_md_cmp_enable0_s;
} sh_xn_ni1_md_cmp_enable0_u_t;
-#else
-typedef union sh_xn_ni1_md_cmp_enable0_u {
- mmr_t sh_xn_ni1_md_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni1_md_cmp_enable0_s;
-} sh_xn_ni1_md_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_MD_CMP_ENABLE1" */
/* NI1 compare MD input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni1_md_cmp_enable1_u {
mmr_t sh_xn_ni1_md_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni1_md_cmp_enable1_s;
} sh_xn_ni1_md_cmp_enable1_u_t;
-#else
-typedef union sh_xn_ni1_md_cmp_enable1_u {
- mmr_t sh_xn_ni1_md_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni1_md_cmp_enable1_s;
-} sh_xn_ni1_md_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_NI_CMP_EXP_DATA0" */
/* NI1 compare NI input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_ni_cmp_exp_data0_u {
- mmr_t sh_xn_ni1_ni_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni1_ni_cmp_exp_data0_s;
-} sh_xn_ni1_ni_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_ni1_ni_cmp_exp_data0_u {
mmr_t sh_xn_ni1_ni_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_ni1_ni_cmp_exp_data0_s;
} sh_xn_ni1_ni_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_NI_CMP_EXP_DATA1" */
/* NI1 compare NI input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_ni1_ni_cmp_exp_data1_u {
mmr_t sh_xn_ni1_ni_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_ni1_ni_cmp_exp_data1_s;
} sh_xn_ni1_ni_cmp_exp_data1_u_t;
-#else
-typedef union sh_xn_ni1_ni_cmp_exp_data1_u {
- mmr_t sh_xn_ni1_ni_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni1_ni_cmp_exp_data1_s;
-} sh_xn_ni1_ni_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_NI_CMP_ENABLE0" */
/* NI1 compare NI input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_ni_cmp_enable0_u {
- mmr_t sh_xn_ni1_ni_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni1_ni_cmp_enable0_s;
-} sh_xn_ni1_ni_cmp_enable0_u_t;
-#else
typedef union sh_xn_ni1_ni_cmp_enable0_u {
mmr_t sh_xn_ni1_ni_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni1_ni_cmp_enable0_s;
} sh_xn_ni1_ni_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_NI_CMP_ENABLE1" */
/* NI1 compare NI input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_ni_cmp_enable1_u {
- mmr_t sh_xn_ni1_ni_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni1_ni_cmp_enable1_s;
-} sh_xn_ni1_ni_cmp_enable1_u_t;
-#else
typedef union sh_xn_ni1_ni_cmp_enable1_u {
mmr_t sh_xn_ni1_ni_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni1_ni_cmp_enable1_s;
} sh_xn_ni1_ni_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_LLP_CMP_EXP_DATA0" */
/* NI1 compare LLP input expected data0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_llp_cmp_exp_data0_u {
- mmr_t sh_xn_ni1_llp_cmp_exp_data0_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni1_llp_cmp_exp_data0_s;
-} sh_xn_ni1_llp_cmp_exp_data0_u_t;
-#else
typedef union sh_xn_ni1_llp_cmp_exp_data0_u {
mmr_t sh_xn_ni1_llp_cmp_exp_data0_regval;
struct {
mmr_t data : 64;
} sh_xn_ni1_llp_cmp_exp_data0_s;
} sh_xn_ni1_llp_cmp_exp_data0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_LLP_CMP_EXP_DATA1" */
/* NI1 compare LLP input expected data1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_llp_cmp_exp_data1_u {
- mmr_t sh_xn_ni1_llp_cmp_exp_data1_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_ni1_llp_cmp_exp_data1_s;
-} sh_xn_ni1_llp_cmp_exp_data1_u_t;
-#else
typedef union sh_xn_ni1_llp_cmp_exp_data1_u {
mmr_t sh_xn_ni1_llp_cmp_exp_data1_regval;
struct {
mmr_t data : 64;
} sh_xn_ni1_llp_cmp_exp_data1_s;
} sh_xn_ni1_llp_cmp_exp_data1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_LLP_CMP_ENABLE0" */
/* NI1 compare LLP input enable0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_llp_cmp_enable0_u {
- mmr_t sh_xn_ni1_llp_cmp_enable0_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni1_llp_cmp_enable0_s;
-} sh_xn_ni1_llp_cmp_enable0_u_t;
-#else
typedef union sh_xn_ni1_llp_cmp_enable0_u {
mmr_t sh_xn_ni1_llp_cmp_enable0_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni1_llp_cmp_enable0_s;
} sh_xn_ni1_llp_cmp_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_NI1_LLP_CMP_ENABLE1" */
/* NI1 compare LLP input enable1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_ni1_llp_cmp_enable1_u {
- mmr_t sh_xn_ni1_llp_cmp_enable1_regval;
- struct {
- mmr_t enable : 64;
- } sh_xn_ni1_llp_cmp_enable1_s;
-} sh_xn_ni1_llp_cmp_enable1_u_t;
-#else
typedef union sh_xn_ni1_llp_cmp_enable1_u {
mmr_t sh_xn_ni1_llp_cmp_enable1_regval;
struct {
mmr_t enable : 64;
} sh_xn_ni1_llp_cmp_enable1_s;
} sh_xn_ni1_llp_cmp_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_ECC_INJ_REG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_ecc_inj_reg_u {
mmr_t sh_xnpi_ecc_inj_reg_regval;
struct {
@@ -13182,123 +7173,55 @@ typedef union sh_xnpi_ecc_inj_reg_u {
mmr_t data_cb_cont3 : 1;
} sh_xnpi_ecc_inj_reg_s;
} sh_xnpi_ecc_inj_reg_u_t;
-#else
-typedef union sh_xnpi_ecc_inj_reg_u {
- mmr_t sh_xnpi_ecc_inj_reg_regval;
- struct {
- mmr_t data_cb_cont3 : 1;
- mmr_t data_cb_1shot3 : 1;
- mmr_t data_cont3 : 1;
- mmr_t data_1shot3 : 1;
- mmr_t reserved_3 : 4;
- mmr_t byte3 : 8;
- mmr_t data_cb_cont2 : 1;
- mmr_t data_cb_1shot2 : 1;
- mmr_t data_cont2 : 1;
- mmr_t data_1shot2 : 1;
- mmr_t reserved_2 : 4;
- mmr_t byte2 : 8;
- mmr_t data_cb_cont1 : 1;
- mmr_t data_cb_1shot1 : 1;
- mmr_t data_cont1 : 1;
- mmr_t data_1shot1 : 1;
- mmr_t reserved_1 : 4;
- mmr_t byte1 : 8;
- mmr_t data_cb_cont0 : 1;
- mmr_t data_cb_1shot0 : 1;
- mmr_t data_cont0 : 1;
- mmr_t data_1shot0 : 1;
- mmr_t reserved_0 : 4;
- mmr_t byte0 : 8;
- } sh_xnpi_ecc_inj_reg_s;
-} sh_xnpi_ecc_inj_reg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_ECC0_INJ_MASK_REG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_ecc0_inj_mask_reg_u {
mmr_t sh_xnpi_ecc0_inj_mask_reg_regval;
struct {
mmr_t mask_ecc0 : 64;
} sh_xnpi_ecc0_inj_mask_reg_s;
} sh_xnpi_ecc0_inj_mask_reg_u_t;
-#else
-typedef union sh_xnpi_ecc0_inj_mask_reg_u {
- mmr_t sh_xnpi_ecc0_inj_mask_reg_regval;
- struct {
- mmr_t mask_ecc0 : 64;
- } sh_xnpi_ecc0_inj_mask_reg_s;
-} sh_xnpi_ecc0_inj_mask_reg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_ECC1_INJ_MASK_REG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xnpi_ecc1_inj_mask_reg_u {
- mmr_t sh_xnpi_ecc1_inj_mask_reg_regval;
- struct {
- mmr_t mask_ecc1 : 64;
- } sh_xnpi_ecc1_inj_mask_reg_s;
-} sh_xnpi_ecc1_inj_mask_reg_u_t;
-#else
typedef union sh_xnpi_ecc1_inj_mask_reg_u {
mmr_t sh_xnpi_ecc1_inj_mask_reg_regval;
struct {
mmr_t mask_ecc1 : 64;
} sh_xnpi_ecc1_inj_mask_reg_s;
} sh_xnpi_ecc1_inj_mask_reg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_ECC2_INJ_MASK_REG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xnpi_ecc2_inj_mask_reg_u {
- mmr_t sh_xnpi_ecc2_inj_mask_reg_regval;
- struct {
- mmr_t mask_ecc2 : 64;
- } sh_xnpi_ecc2_inj_mask_reg_s;
-} sh_xnpi_ecc2_inj_mask_reg_u_t;
-#else
typedef union sh_xnpi_ecc2_inj_mask_reg_u {
mmr_t sh_xnpi_ecc2_inj_mask_reg_regval;
struct {
mmr_t mask_ecc2 : 64;
} sh_xnpi_ecc2_inj_mask_reg_s;
} sh_xnpi_ecc2_inj_mask_reg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_ECC3_INJ_MASK_REG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_ecc3_inj_mask_reg_u {
mmr_t sh_xnpi_ecc3_inj_mask_reg_regval;
struct {
mmr_t mask_ecc3 : 64;
} sh_xnpi_ecc3_inj_mask_reg_s;
} sh_xnpi_ecc3_inj_mask_reg_u_t;
-#else
-typedef union sh_xnpi_ecc3_inj_mask_reg_u {
- mmr_t sh_xnpi_ecc3_inj_mask_reg_regval;
- struct {
- mmr_t mask_ecc3 : 64;
- } sh_xnpi_ecc3_inj_mask_reg_s;
-} sh_xnpi_ecc3_inj_mask_reg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_ECC_INJ_REG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_ecc_inj_reg_u {
mmr_t sh_xnmd_ecc_inj_reg_regval;
struct {
@@ -13328,123 +7251,55 @@ typedef union sh_xnmd_ecc_inj_reg_u {
mmr_t data_cb_cont3 : 1;
} sh_xnmd_ecc_inj_reg_s;
} sh_xnmd_ecc_inj_reg_u_t;
-#else
-typedef union sh_xnmd_ecc_inj_reg_u {
- mmr_t sh_xnmd_ecc_inj_reg_regval;
- struct {
- mmr_t data_cb_cont3 : 1;
- mmr_t data_cb_1shot3 : 1;
- mmr_t data_cont3 : 1;
- mmr_t data_1shot3 : 1;
- mmr_t reserved_3 : 4;
- mmr_t byte3 : 8;
- mmr_t data_cb_cont2 : 1;
- mmr_t data_cb_1shot2 : 1;
- mmr_t data_cont2 : 1;
- mmr_t data_1shot2 : 1;
- mmr_t reserved_2 : 4;
- mmr_t byte2 : 8;
- mmr_t data_cb_cont1 : 1;
- mmr_t data_cb_1shot1 : 1;
- mmr_t data_cont1 : 1;
- mmr_t data_1shot1 : 1;
- mmr_t reserved_1 : 4;
- mmr_t byte1 : 8;
- mmr_t data_cb_cont0 : 1;
- mmr_t data_cb_1shot0 : 1;
- mmr_t data_cont0 : 1;
- mmr_t data_1shot0 : 1;
- mmr_t reserved_0 : 4;
- mmr_t byte0 : 8;
- } sh_xnmd_ecc_inj_reg_s;
-} sh_xnmd_ecc_inj_reg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_ECC0_INJ_MASK_REG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xnmd_ecc0_inj_mask_reg_u {
- mmr_t sh_xnmd_ecc0_inj_mask_reg_regval;
- struct {
- mmr_t mask_ecc0 : 64;
- } sh_xnmd_ecc0_inj_mask_reg_s;
-} sh_xnmd_ecc0_inj_mask_reg_u_t;
-#else
typedef union sh_xnmd_ecc0_inj_mask_reg_u {
mmr_t sh_xnmd_ecc0_inj_mask_reg_regval;
struct {
mmr_t mask_ecc0 : 64;
} sh_xnmd_ecc0_inj_mask_reg_s;
} sh_xnmd_ecc0_inj_mask_reg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_ECC1_INJ_MASK_REG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_ecc1_inj_mask_reg_u {
mmr_t sh_xnmd_ecc1_inj_mask_reg_regval;
struct {
mmr_t mask_ecc1 : 64;
} sh_xnmd_ecc1_inj_mask_reg_s;
} sh_xnmd_ecc1_inj_mask_reg_u_t;
-#else
-typedef union sh_xnmd_ecc1_inj_mask_reg_u {
- mmr_t sh_xnmd_ecc1_inj_mask_reg_regval;
- struct {
- mmr_t mask_ecc1 : 64;
- } sh_xnmd_ecc1_inj_mask_reg_s;
-} sh_xnmd_ecc1_inj_mask_reg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_ECC2_INJ_MASK_REG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xnmd_ecc2_inj_mask_reg_u {
- mmr_t sh_xnmd_ecc2_inj_mask_reg_regval;
- struct {
- mmr_t mask_ecc2 : 64;
- } sh_xnmd_ecc2_inj_mask_reg_s;
-} sh_xnmd_ecc2_inj_mask_reg_u_t;
-#else
typedef union sh_xnmd_ecc2_inj_mask_reg_u {
mmr_t sh_xnmd_ecc2_inj_mask_reg_regval;
struct {
mmr_t mask_ecc2 : 64;
} sh_xnmd_ecc2_inj_mask_reg_s;
} sh_xnmd_ecc2_inj_mask_reg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_ECC3_INJ_MASK_REG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xnmd_ecc3_inj_mask_reg_u {
- mmr_t sh_xnmd_ecc3_inj_mask_reg_regval;
- struct {
- mmr_t mask_ecc3 : 64;
- } sh_xnmd_ecc3_inj_mask_reg_s;
-} sh_xnmd_ecc3_inj_mask_reg_u_t;
-#else
typedef union sh_xnmd_ecc3_inj_mask_reg_u {
mmr_t sh_xnmd_ecc3_inj_mask_reg_regval;
struct {
mmr_t mask_ecc3 : 64;
} sh_xnmd_ecc3_inj_mask_reg_s;
} sh_xnmd_ecc3_inj_mask_reg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_ECC_ERR_REPORT" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_ecc_err_report_u {
mmr_t sh_xnmd_ecc_err_report_regval;
struct {
@@ -13458,28 +7313,12 @@ typedef union sh_xnmd_ecc_err_report_u {
mmr_t reserved_3 : 15;
} sh_xnmd_ecc_err_report_s;
} sh_xnmd_ecc_err_report_u_t;
-#else
-typedef union sh_xnmd_ecc_err_report_u {
- mmr_t sh_xnmd_ecc_err_report_regval;
- struct {
- mmr_t reserved_3 : 15;
- mmr_t ecc_disable3 : 1;
- mmr_t reserved_2 : 15;
- mmr_t ecc_disable2 : 1;
- mmr_t reserved_1 : 15;
- mmr_t ecc_disable1 : 1;
- mmr_t reserved_0 : 15;
- mmr_t ecc_disable0 : 1;
- } sh_xnmd_ecc_err_report_s;
-} sh_xnmd_ecc_err_report_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_ERROR_SUMMARY_1" */
/* ni0 Error Summary Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_error_summary_1_u {
mmr_t sh_ni0_error_summary_1_regval;
struct {
@@ -13549,84 +7388,12 @@ typedef union sh_ni0_error_summary_1_u {
mmr_t tail_timeout_ni_vc3 : 1;
} sh_ni0_error_summary_1_s;
} sh_ni0_error_summary_1_u_t;
-#else
-typedef union sh_ni0_error_summary_1_u {
- mmr_t sh_ni0_error_summary_1_regval;
- struct {
- mmr_t tail_timeout_ni_vc3 : 1;
- mmr_t tail_timeout_ni_vc2 : 1;
- mmr_t tail_timeout_ni_vc1 : 1;
- mmr_t tail_timeout_ni_vc0 : 1;
- mmr_t tail_timeout_fifo13_vc3 : 1;
- mmr_t tail_timeout_fifo13_vc1 : 1;
- mmr_t tail_timeout_fifo02_vc2 : 1;
- mmr_t tail_timeout_fifo02_vc0 : 1;
- mmr_t overflow_ni_fifo_vc3_credit : 1;
- mmr_t overflow_ni_fifo_vc2_credit : 1;
- mmr_t overflow_ni_fifo_vc1_credit : 1;
- mmr_t overflow_ni_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_credit : 1;
- mmr_t overflow_md_fifo_vc0_credit : 1;
- mmr_t overflow_iilb_fifo_vc2_credit : 1;
- mmr_t overflow_iilb_fifo_vc0_credit : 1;
- mmr_t overflow_pi_fifo_vc2_credit : 1;
- mmr_t overflow_pi_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_push : 1;
- mmr_t overflow_md_fifo_vc0_push : 1;
- mmr_t overflow_iilb_fifo_vc2_push : 1;
- mmr_t overflow_iilb_fifo_vc0_push : 1;
- mmr_t overflow_pi_fifo_vc2_push : 1;
- mmr_t overflow_pi_fifo_vc0_push : 1;
- mmr_t overflow_ni_fifo_vc2_pop : 1;
- mmr_t overflow_ni_fifo_vc0_pop : 1;
- mmr_t overflow_md_fifo_vc2_pop : 1;
- mmr_t overflow_md_fifo_vc0_pop : 1;
- mmr_t overflow_iilb_fifo_vc2_pop : 1;
- mmr_t overflow_iilb_fifo_vc0_pop : 1;
- mmr_t overflow_pi_fifo_vc2_pop : 1;
- mmr_t overflow_pi_fifo_vc0_pop : 1;
- mmr_t overflow_ni_fifo_debit3 : 1;
- mmr_t overflow_ni_fifo_debit2 : 1;
- mmr_t overflow_ni_fifo_debit1 : 1;
- mmr_t overflow_ni_fifo_debit0 : 1;
- mmr_t overflow_md_fifo_debit2 : 1;
- mmr_t overflow_md_fifo_debit0 : 1;
- mmr_t overflow_iilb_fifo_debit2 : 1;
- mmr_t overflow_iilb_fifo_debit0 : 1;
- mmr_t overflow_pi_fifo_debit2 : 1;
- mmr_t overflow_pi_fifo_debit0 : 1;
- mmr_t overflow2_vc2_credit : 1;
- mmr_t overflow1_vc2_credit : 1;
- mmr_t overflow0_vc2_credit : 1;
- mmr_t overflow2_vc0_credit : 1;
- mmr_t overflow1_vc0_credit : 1;
- mmr_t overflow0_vc0_credit : 1;
- mmr_t overflow_fifo13_vc2_credit : 1;
- mmr_t overflow_fifo13_vc0_credit : 1;
- mmr_t overflow_fifo02_vc2_credit : 1;
- mmr_t overflow_fifo02_vc0_credit : 1;
- mmr_t overflow_fifo13_vc3_push : 1;
- mmr_t overflow_fifo13_vc1_push : 1;
- mmr_t overflow_fifo02_vc2_push : 1;
- mmr_t overflow_fifo02_vc0_push : 1;
- mmr_t overflow_fifo13_vc3_pop : 1;
- mmr_t overflow_fifo13_vc1_pop : 1;
- mmr_t overflow_fifo02_vc2_pop : 1;
- mmr_t overflow_fifo02_vc0_pop : 1;
- mmr_t overflow_fifo13_debit2 : 1;
- mmr_t overflow_fifo13_debit0 : 1;
- mmr_t overflow_fifo02_debit2 : 1;
- mmr_t overflow_fifo02_debit0 : 1;
- } sh_ni0_error_summary_1_s;
-} sh_ni0_error_summary_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_ERROR_SUMMARY_2" */
/* ni0 Error Summary Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_error_summary_2_u {
mmr_t sh_ni0_error_summary_2_regval;
struct {
@@ -13687,75 +7454,12 @@ typedef union sh_ni0_error_summary_2_u {
mmr_t reserved_1 : 1;
} sh_ni0_error_summary_2_s;
} sh_ni0_error_summary_2_u_t;
-#else
-typedef union sh_ni0_error_summary_2_u {
- mmr_t sh_ni0_error_summary_2_regval;
- struct {
- mmr_t reserved_1 : 1;
- mmr_t retry_timeout_error : 1;
- mmr_t lut_read_error : 1;
- mmr_t chiplet_nomatch : 1;
- mmr_t llp_deadlock_vc3 : 1;
- mmr_t llp_deadlock_vc2 : 1;
- mmr_t llp_deadlock_vc1 : 1;
- mmr_t llp_deadlock_vc0 : 1;
- mmr_t underflow_ni_fifo_vc3_credit : 1;
- mmr_t underflow_ni_fifo_vc2_credit : 1;
- mmr_t underflow_ni_fifo_vc1_credit : 1;
- mmr_t underflow_ni_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_credit : 1;
- mmr_t underflow_md_fifo_vc0_credit : 1;
- mmr_t underflow_iilb_fifo_vc2_credit : 1;
- mmr_t underflow_iilb_fifo_vc0_credit : 1;
- mmr_t underflow_pi_fifo_vc2_credit : 1;
- mmr_t underflow_pi_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_push : 1;
- mmr_t underflow_md_fifo_vc0_push : 1;
- mmr_t underflow_iilb_fifo_vc2_push : 1;
- mmr_t underflow_iilb_fifo_vc0_push : 1;
- mmr_t underflow_pi_fifo_vc2_push : 1;
- mmr_t underflow_pi_fifo_vc0_push : 1;
- mmr_t underflow_ni_fifo_vc2_pop : 1;
- mmr_t underflow_ni_fifo_vc0_pop : 1;
- mmr_t underflow_md_fifo_vc2_pop : 1;
- mmr_t underflow_md_fifo_vc0_pop : 1;
- mmr_t underflow_iilb_fifo_vc2_pop : 1;
- mmr_t underflow_iilb_fifo_vc0_pop : 1;
- mmr_t underflow_pi_fifo_vc2_pop : 1;
- mmr_t underflow_pi_fifo_vc0_pop : 1;
- mmr_t reserved_0 : 10;
- mmr_t underflow2_vc2_credit : 1;
- mmr_t underflow1_vc2_credit : 1;
- mmr_t underflow0_vc2_credit : 1;
- mmr_t underflow2_vc0_credit : 1;
- mmr_t underflow1_vc0_credit : 1;
- mmr_t underflow0_vc0_credit : 1;
- mmr_t underflow_fifo13_vc2_credit : 1;
- mmr_t underflow_fifo13_vc0_credit : 1;
- mmr_t underflow_fifo02_vc2_credit : 1;
- mmr_t underflow_fifo02_vc0_credit : 1;
- mmr_t underflow_fifo13_vc3_push : 1;
- mmr_t underflow_fifo13_vc1_push : 1;
- mmr_t underflow_fifo02_vc2_push : 1;
- mmr_t underflow_fifo02_vc0_push : 1;
- mmr_t underflow_fifo13_vc3_pop : 1;
- mmr_t underflow_fifo13_vc1_pop : 1;
- mmr_t underflow_fifo02_vc2_pop : 1;
- mmr_t underflow_fifo02_vc0_pop : 1;
- mmr_t illegal_vciilb : 1;
- mmr_t illegal_vcmd : 1;
- mmr_t illegal_vcpi : 1;
- mmr_t illegal_vcni : 1;
- } sh_ni0_error_summary_2_s;
-} sh_ni0_error_summary_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_ERROR_OVERFLOW_1" */
/* ni0 Error Overflow Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_error_overflow_1_u {
mmr_t sh_ni0_error_overflow_1_regval;
struct {
@@ -13825,84 +7529,12 @@ typedef union sh_ni0_error_overflow_1_u {
mmr_t tail_timeout_ni_vc3 : 1;
} sh_ni0_error_overflow_1_s;
} sh_ni0_error_overflow_1_u_t;
-#else
-typedef union sh_ni0_error_overflow_1_u {
- mmr_t sh_ni0_error_overflow_1_regval;
- struct {
- mmr_t tail_timeout_ni_vc3 : 1;
- mmr_t tail_timeout_ni_vc2 : 1;
- mmr_t tail_timeout_ni_vc1 : 1;
- mmr_t tail_timeout_ni_vc0 : 1;
- mmr_t tail_timeout_fifo13_vc3 : 1;
- mmr_t tail_timeout_fifo13_vc1 : 1;
- mmr_t tail_timeout_fifo02_vc2 : 1;
- mmr_t tail_timeout_fifo02_vc0 : 1;
- mmr_t overflow_ni_fifo_vc3_credit : 1;
- mmr_t overflow_ni_fifo_vc2_credit : 1;
- mmr_t overflow_ni_fifo_vc1_credit : 1;
- mmr_t overflow_ni_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_credit : 1;
- mmr_t overflow_md_fifo_vc0_credit : 1;
- mmr_t overflow_iilb_fifo_vc2_credit : 1;
- mmr_t overflow_iilb_fifo_vc0_credit : 1;
- mmr_t overflow_pi_fifo_vc2_credit : 1;
- mmr_t overflow_pi_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_push : 1;
- mmr_t overflow_md_fifo_vc0_push : 1;
- mmr_t overflow_iilb_fifo_vc2_push : 1;
- mmr_t overflow_iilb_fifo_vc0_push : 1;
- mmr_t overflow_pi_fifo_vc2_push : 1;
- mmr_t overflow_pi_fifo_vc0_push : 1;
- mmr_t overflow_ni_fifo_vc2_pop : 1;
- mmr_t overflow_ni_fifo_vc0_pop : 1;
- mmr_t overflow_md_fifo_vc2_pop : 1;
- mmr_t overflow_md_fifo_vc0_pop : 1;
- mmr_t overflow_iilb_fifo_vc2_pop : 1;
- mmr_t overflow_iilb_fifo_vc0_pop : 1;
- mmr_t overflow_pi_fifo_vc2_pop : 1;
- mmr_t overflow_pi_fifo_vc0_pop : 1;
- mmr_t overflow_ni_fifo_debit3 : 1;
- mmr_t overflow_ni_fifo_debit2 : 1;
- mmr_t overflow_ni_fifo_debit1 : 1;
- mmr_t overflow_ni_fifo_debit0 : 1;
- mmr_t overflow_md_fifo_debit2 : 1;
- mmr_t overflow_md_fifo_debit0 : 1;
- mmr_t overflow_iilb_fifo_debit2 : 1;
- mmr_t overflow_iilb_fifo_debit0 : 1;
- mmr_t overflow_pi_fifo_debit2 : 1;
- mmr_t overflow_pi_fifo_debit0 : 1;
- mmr_t overflow2_vc2_credit : 1;
- mmr_t overflow1_vc2_credit : 1;
- mmr_t overflow0_vc2_credit : 1;
- mmr_t overflow2_vc0_credit : 1;
- mmr_t overflow1_vc0_credit : 1;
- mmr_t overflow0_vc0_credit : 1;
- mmr_t overflow_fifo13_vc2_credit : 1;
- mmr_t overflow_fifo13_vc0_credit : 1;
- mmr_t overflow_fifo02_vc2_credit : 1;
- mmr_t overflow_fifo02_vc0_credit : 1;
- mmr_t overflow_fifo13_vc3_push : 1;
- mmr_t overflow_fifo13_vc1_push : 1;
- mmr_t overflow_fifo02_vc2_push : 1;
- mmr_t overflow_fifo02_vc0_push : 1;
- mmr_t overflow_fifo13_vc3_pop : 1;
- mmr_t overflow_fifo13_vc1_pop : 1;
- mmr_t overflow_fifo02_vc2_pop : 1;
- mmr_t overflow_fifo02_vc0_pop : 1;
- mmr_t overflow_fifo13_debit2 : 1;
- mmr_t overflow_fifo13_debit0 : 1;
- mmr_t overflow_fifo02_debit2 : 1;
- mmr_t overflow_fifo02_debit0 : 1;
- } sh_ni0_error_overflow_1_s;
-} sh_ni0_error_overflow_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_ERROR_OVERFLOW_2" */
/* ni0 Error Overflow Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_error_overflow_2_u {
mmr_t sh_ni0_error_overflow_2_regval;
struct {
@@ -13963,75 +7595,12 @@ typedef union sh_ni0_error_overflow_2_u {
mmr_t reserved_1 : 1;
} sh_ni0_error_overflow_2_s;
} sh_ni0_error_overflow_2_u_t;
-#else
-typedef union sh_ni0_error_overflow_2_u {
- mmr_t sh_ni0_error_overflow_2_regval;
- struct {
- mmr_t reserved_1 : 1;
- mmr_t retry_timeout_error : 1;
- mmr_t lut_read_error : 1;
- mmr_t chiplet_nomatch : 1;
- mmr_t llp_deadlock_vc3 : 1;
- mmr_t llp_deadlock_vc2 : 1;
- mmr_t llp_deadlock_vc1 : 1;
- mmr_t llp_deadlock_vc0 : 1;
- mmr_t underflow_ni_fifo_vc3_credit : 1;
- mmr_t underflow_ni_fifo_vc2_credit : 1;
- mmr_t underflow_ni_fifo_vc1_credit : 1;
- mmr_t underflow_ni_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_credit : 1;
- mmr_t underflow_md_fifo_vc0_credit : 1;
- mmr_t underflow_iilb_fifo_vc2_credit : 1;
- mmr_t underflow_iilb_fifo_vc0_credit : 1;
- mmr_t underflow_pi_fifo_vc2_credit : 1;
- mmr_t underflow_pi_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_push : 1;
- mmr_t underflow_md_fifo_vc0_push : 1;
- mmr_t underflow_iilb_fifo_vc2_push : 1;
- mmr_t underflow_iilb_fifo_vc0_push : 1;
- mmr_t underflow_pi_fifo_vc2_push : 1;
- mmr_t underflow_pi_fifo_vc0_push : 1;
- mmr_t underflow_ni_fifo_vc2_pop : 1;
- mmr_t underflow_ni_fifo_vc0_pop : 1;
- mmr_t underflow_md_fifo_vc2_pop : 1;
- mmr_t underflow_md_fifo_vc0_pop : 1;
- mmr_t underflow_iilb_fifo_vc2_pop : 1;
- mmr_t underflow_iilb_fifo_vc0_pop : 1;
- mmr_t underflow_pi_fifo_vc2_pop : 1;
- mmr_t underflow_pi_fifo_vc0_pop : 1;
- mmr_t reserved_0 : 10;
- mmr_t underflow2_vc2_credit : 1;
- mmr_t underflow1_vc2_credit : 1;
- mmr_t underflow0_vc2_credit : 1;
- mmr_t underflow2_vc0_credit : 1;
- mmr_t underflow1_vc0_credit : 1;
- mmr_t underflow0_vc0_credit : 1;
- mmr_t underflow_fifo13_vc2_credit : 1;
- mmr_t underflow_fifo13_vc0_credit : 1;
- mmr_t underflow_fifo02_vc2_credit : 1;
- mmr_t underflow_fifo02_vc0_credit : 1;
- mmr_t underflow_fifo13_vc3_push : 1;
- mmr_t underflow_fifo13_vc1_push : 1;
- mmr_t underflow_fifo02_vc2_push : 1;
- mmr_t underflow_fifo02_vc0_push : 1;
- mmr_t underflow_fifo13_vc3_pop : 1;
- mmr_t underflow_fifo13_vc1_pop : 1;
- mmr_t underflow_fifo02_vc2_pop : 1;
- mmr_t underflow_fifo02_vc0_pop : 1;
- mmr_t illegal_vciilb : 1;
- mmr_t illegal_vcmd : 1;
- mmr_t illegal_vcpi : 1;
- mmr_t illegal_vcni : 1;
- } sh_ni0_error_overflow_2_s;
-} sh_ni0_error_overflow_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_ERROR_MASK_1" */
/* ni0 Error Mask Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_error_mask_1_u {
mmr_t sh_ni0_error_mask_1_regval;
struct {
@@ -14101,84 +7670,12 @@ typedef union sh_ni0_error_mask_1_u {
mmr_t tail_timeout_ni_vc3 : 1;
} sh_ni0_error_mask_1_s;
} sh_ni0_error_mask_1_u_t;
-#else
-typedef union sh_ni0_error_mask_1_u {
- mmr_t sh_ni0_error_mask_1_regval;
- struct {
- mmr_t tail_timeout_ni_vc3 : 1;
- mmr_t tail_timeout_ni_vc2 : 1;
- mmr_t tail_timeout_ni_vc1 : 1;
- mmr_t tail_timeout_ni_vc0 : 1;
- mmr_t tail_timeout_fifo13_vc3 : 1;
- mmr_t tail_timeout_fifo13_vc1 : 1;
- mmr_t tail_timeout_fifo02_vc2 : 1;
- mmr_t tail_timeout_fifo02_vc0 : 1;
- mmr_t overflow_ni_fifo_vc3_credit : 1;
- mmr_t overflow_ni_fifo_vc2_credit : 1;
- mmr_t overflow_ni_fifo_vc1_credit : 1;
- mmr_t overflow_ni_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_credit : 1;
- mmr_t overflow_md_fifo_vc0_credit : 1;
- mmr_t overflow_iilb_fifo_vc2_credit : 1;
- mmr_t overflow_iilb_fifo_vc0_credit : 1;
- mmr_t overflow_pi_fifo_vc2_credit : 1;
- mmr_t overflow_pi_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_push : 1;
- mmr_t overflow_md_fifo_vc0_push : 1;
- mmr_t overflow_iilb_fifo_vc2_push : 1;
- mmr_t overflow_iilb_fifo_vc0_push : 1;
- mmr_t overflow_pi_fifo_vc2_push : 1;
- mmr_t overflow_pi_fifo_vc0_push : 1;
- mmr_t overflow_ni_fifo_vc2_pop : 1;
- mmr_t overflow_ni_fifo_vc0_pop : 1;
- mmr_t overflow_md_fifo_vc2_pop : 1;
- mmr_t overflow_md_fifo_vc0_pop : 1;
- mmr_t overflow_iilb_fifo_vc2_pop : 1;
- mmr_t overflow_iilb_fifo_vc0_pop : 1;
- mmr_t overflow_pi_fifo_vc2_pop : 1;
- mmr_t overflow_pi_fifo_vc0_pop : 1;
- mmr_t overflow_ni_fifo_debit3 : 1;
- mmr_t overflow_ni_fifo_debit2 : 1;
- mmr_t overflow_ni_fifo_debit1 : 1;
- mmr_t overflow_ni_fifo_debit0 : 1;
- mmr_t overflow_md_fifo_debit2 : 1;
- mmr_t overflow_md_fifo_debit0 : 1;
- mmr_t overflow_iilb_fifo_debit2 : 1;
- mmr_t overflow_iilb_fifo_debit0 : 1;
- mmr_t overflow_pi_fifo_debit2 : 1;
- mmr_t overflow_pi_fifo_debit0 : 1;
- mmr_t overflow2_vc2_credit : 1;
- mmr_t overflow1_vc2_credit : 1;
- mmr_t overflow0_vc2_credit : 1;
- mmr_t overflow2_vc0_credit : 1;
- mmr_t overflow1_vc0_credit : 1;
- mmr_t overflow0_vc0_credit : 1;
- mmr_t overflow_fifo13_vc2_credit : 1;
- mmr_t overflow_fifo13_vc0_credit : 1;
- mmr_t overflow_fifo02_vc2_credit : 1;
- mmr_t overflow_fifo02_vc0_credit : 1;
- mmr_t overflow_fifo13_vc3_push : 1;
- mmr_t overflow_fifo13_vc1_push : 1;
- mmr_t overflow_fifo02_vc2_push : 1;
- mmr_t overflow_fifo02_vc0_push : 1;
- mmr_t overflow_fifo13_vc3_pop : 1;
- mmr_t overflow_fifo13_vc1_pop : 1;
- mmr_t overflow_fifo02_vc2_pop : 1;
- mmr_t overflow_fifo02_vc0_pop : 1;
- mmr_t overflow_fifo13_debit2 : 1;
- mmr_t overflow_fifo13_debit0 : 1;
- mmr_t overflow_fifo02_debit2 : 1;
- mmr_t overflow_fifo02_debit0 : 1;
- } sh_ni0_error_mask_1_s;
-} sh_ni0_error_mask_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_ERROR_MASK_2" */
/* ni0 Error Mask Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_error_mask_2_u {
mmr_t sh_ni0_error_mask_2_regval;
struct {
@@ -14239,75 +7736,12 @@ typedef union sh_ni0_error_mask_2_u {
mmr_t reserved_1 : 1;
} sh_ni0_error_mask_2_s;
} sh_ni0_error_mask_2_u_t;
-#else
-typedef union sh_ni0_error_mask_2_u {
- mmr_t sh_ni0_error_mask_2_regval;
- struct {
- mmr_t reserved_1 : 1;
- mmr_t retry_timeout_error : 1;
- mmr_t lut_read_error : 1;
- mmr_t chiplet_nomatch : 1;
- mmr_t llp_deadlock_vc3 : 1;
- mmr_t llp_deadlock_vc2 : 1;
- mmr_t llp_deadlock_vc1 : 1;
- mmr_t llp_deadlock_vc0 : 1;
- mmr_t underflow_ni_fifo_vc3_credit : 1;
- mmr_t underflow_ni_fifo_vc2_credit : 1;
- mmr_t underflow_ni_fifo_vc1_credit : 1;
- mmr_t underflow_ni_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_credit : 1;
- mmr_t underflow_md_fifo_vc0_credit : 1;
- mmr_t underflow_iilb_fifo_vc2_credit : 1;
- mmr_t underflow_iilb_fifo_vc0_credit : 1;
- mmr_t underflow_pi_fifo_vc2_credit : 1;
- mmr_t underflow_pi_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_push : 1;
- mmr_t underflow_md_fifo_vc0_push : 1;
- mmr_t underflow_iilb_fifo_vc2_push : 1;
- mmr_t underflow_iilb_fifo_vc0_push : 1;
- mmr_t underflow_pi_fifo_vc2_push : 1;
- mmr_t underflow_pi_fifo_vc0_push : 1;
- mmr_t underflow_ni_fifo_vc2_pop : 1;
- mmr_t underflow_ni_fifo_vc0_pop : 1;
- mmr_t underflow_md_fifo_vc2_pop : 1;
- mmr_t underflow_md_fifo_vc0_pop : 1;
- mmr_t underflow_iilb_fifo_vc2_pop : 1;
- mmr_t underflow_iilb_fifo_vc0_pop : 1;
- mmr_t underflow_pi_fifo_vc2_pop : 1;
- mmr_t underflow_pi_fifo_vc0_pop : 1;
- mmr_t reserved_0 : 10;
- mmr_t underflow2_vc2_credit : 1;
- mmr_t underflow1_vc2_credit : 1;
- mmr_t underflow0_vc2_credit : 1;
- mmr_t underflow2_vc0_credit : 1;
- mmr_t underflow1_vc0_credit : 1;
- mmr_t underflow0_vc0_credit : 1;
- mmr_t underflow_fifo13_vc2_credit : 1;
- mmr_t underflow_fifo13_vc0_credit : 1;
- mmr_t underflow_fifo02_vc2_credit : 1;
- mmr_t underflow_fifo02_vc0_credit : 1;
- mmr_t underflow_fifo13_vc3_push : 1;
- mmr_t underflow_fifo13_vc1_push : 1;
- mmr_t underflow_fifo02_vc2_push : 1;
- mmr_t underflow_fifo02_vc0_push : 1;
- mmr_t underflow_fifo13_vc3_pop : 1;
- mmr_t underflow_fifo13_vc1_pop : 1;
- mmr_t underflow_fifo02_vc2_pop : 1;
- mmr_t underflow_fifo02_vc0_pop : 1;
- mmr_t illegal_vciilb : 1;
- mmr_t illegal_vcmd : 1;
- mmr_t illegal_vcpi : 1;
- mmr_t illegal_vcni : 1;
- } sh_ni0_error_mask_2_s;
-} sh_ni0_error_mask_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_FIRST_ERROR_1" */
/* ni0 First Error Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_first_error_1_u {
mmr_t sh_ni0_first_error_1_regval;
struct {
@@ -14377,84 +7811,12 @@ typedef union sh_ni0_first_error_1_u {
mmr_t tail_timeout_ni_vc3 : 1;
} sh_ni0_first_error_1_s;
} sh_ni0_first_error_1_u_t;
-#else
-typedef union sh_ni0_first_error_1_u {
- mmr_t sh_ni0_first_error_1_regval;
- struct {
- mmr_t tail_timeout_ni_vc3 : 1;
- mmr_t tail_timeout_ni_vc2 : 1;
- mmr_t tail_timeout_ni_vc1 : 1;
- mmr_t tail_timeout_ni_vc0 : 1;
- mmr_t tail_timeout_fifo13_vc3 : 1;
- mmr_t tail_timeout_fifo13_vc1 : 1;
- mmr_t tail_timeout_fifo02_vc2 : 1;
- mmr_t tail_timeout_fifo02_vc0 : 1;
- mmr_t overflow_ni_fifo_vc3_credit : 1;
- mmr_t overflow_ni_fifo_vc2_credit : 1;
- mmr_t overflow_ni_fifo_vc1_credit : 1;
- mmr_t overflow_ni_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_credit : 1;
- mmr_t overflow_md_fifo_vc0_credit : 1;
- mmr_t overflow_iilb_fifo_vc2_credit : 1;
- mmr_t overflow_iilb_fifo_vc0_credit : 1;
- mmr_t overflow_pi_fifo_vc2_credit : 1;
- mmr_t overflow_pi_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_push : 1;
- mmr_t overflow_md_fifo_vc0_push : 1;
- mmr_t overflow_iilb_fifo_vc2_push : 1;
- mmr_t overflow_iilb_fifo_vc0_push : 1;
- mmr_t overflow_pi_fifo_vc2_push : 1;
- mmr_t overflow_pi_fifo_vc0_push : 1;
- mmr_t overflow_ni_fifo_vc2_pop : 1;
- mmr_t overflow_ni_fifo_vc0_pop : 1;
- mmr_t overflow_md_fifo_vc2_pop : 1;
- mmr_t overflow_md_fifo_vc0_pop : 1;
- mmr_t overflow_iilb_fifo_vc2_pop : 1;
- mmr_t overflow_iilb_fifo_vc0_pop : 1;
- mmr_t overflow_pi_fifo_vc2_pop : 1;
- mmr_t overflow_pi_fifo_vc0_pop : 1;
- mmr_t overflow_ni_fifo_debit3 : 1;
- mmr_t overflow_ni_fifo_debit2 : 1;
- mmr_t overflow_ni_fifo_debit1 : 1;
- mmr_t overflow_ni_fifo_debit0 : 1;
- mmr_t overflow_md_fifo_debit2 : 1;
- mmr_t overflow_md_fifo_debit0 : 1;
- mmr_t overflow_iilb_fifo_debit2 : 1;
- mmr_t overflow_iilb_fifo_debit0 : 1;
- mmr_t overflow_pi_fifo_debit2 : 1;
- mmr_t overflow_pi_fifo_debit0 : 1;
- mmr_t overflow2_vc2_credit : 1;
- mmr_t overflow1_vc2_credit : 1;
- mmr_t overflow0_vc2_credit : 1;
- mmr_t overflow2_vc0_credit : 1;
- mmr_t overflow1_vc0_credit : 1;
- mmr_t overflow0_vc0_credit : 1;
- mmr_t overflow_fifo13_vc2_credit : 1;
- mmr_t overflow_fifo13_vc0_credit : 1;
- mmr_t overflow_fifo02_vc2_credit : 1;
- mmr_t overflow_fifo02_vc0_credit : 1;
- mmr_t overflow_fifo13_vc3_push : 1;
- mmr_t overflow_fifo13_vc1_push : 1;
- mmr_t overflow_fifo02_vc2_push : 1;
- mmr_t overflow_fifo02_vc0_push : 1;
- mmr_t overflow_fifo13_vc3_pop : 1;
- mmr_t overflow_fifo13_vc1_pop : 1;
- mmr_t overflow_fifo02_vc2_pop : 1;
- mmr_t overflow_fifo02_vc0_pop : 1;
- mmr_t overflow_fifo13_debit2 : 1;
- mmr_t overflow_fifo13_debit0 : 1;
- mmr_t overflow_fifo02_debit2 : 1;
- mmr_t overflow_fifo02_debit0 : 1;
- } sh_ni0_first_error_1_s;
-} sh_ni0_first_error_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_FIRST_ERROR_2" */
/* ni0 First Error Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_first_error_2_u {
mmr_t sh_ni0_first_error_2_regval;
struct {
@@ -14515,117 +7877,36 @@ typedef union sh_ni0_first_error_2_u {
mmr_t reserved_1 : 1;
} sh_ni0_first_error_2_s;
} sh_ni0_first_error_2_u_t;
-#else
-typedef union sh_ni0_first_error_2_u {
- mmr_t sh_ni0_first_error_2_regval;
- struct {
- mmr_t reserved_1 : 1;
- mmr_t retry_timeout_error : 1;
- mmr_t lut_read_error : 1;
- mmr_t chiplet_nomatch : 1;
- mmr_t llp_deadlock_vc3 : 1;
- mmr_t llp_deadlock_vc2 : 1;
- mmr_t llp_deadlock_vc1 : 1;
- mmr_t llp_deadlock_vc0 : 1;
- mmr_t underflow_ni_fifo_vc3_credit : 1;
- mmr_t underflow_ni_fifo_vc2_credit : 1;
- mmr_t underflow_ni_fifo_vc1_credit : 1;
- mmr_t underflow_ni_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_credit : 1;
- mmr_t underflow_md_fifo_vc0_credit : 1;
- mmr_t underflow_iilb_fifo_vc2_credit : 1;
- mmr_t underflow_iilb_fifo_vc0_credit : 1;
- mmr_t underflow_pi_fifo_vc2_credit : 1;
- mmr_t underflow_pi_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_push : 1;
- mmr_t underflow_md_fifo_vc0_push : 1;
- mmr_t underflow_iilb_fifo_vc2_push : 1;
- mmr_t underflow_iilb_fifo_vc0_push : 1;
- mmr_t underflow_pi_fifo_vc2_push : 1;
- mmr_t underflow_pi_fifo_vc0_push : 1;
- mmr_t underflow_ni_fifo_vc2_pop : 1;
- mmr_t underflow_ni_fifo_vc0_pop : 1;
- mmr_t underflow_md_fifo_vc2_pop : 1;
- mmr_t underflow_md_fifo_vc0_pop : 1;
- mmr_t underflow_iilb_fifo_vc2_pop : 1;
- mmr_t underflow_iilb_fifo_vc0_pop : 1;
- mmr_t underflow_pi_fifo_vc2_pop : 1;
- mmr_t underflow_pi_fifo_vc0_pop : 1;
- mmr_t reserved_0 : 10;
- mmr_t underflow2_vc2_credit : 1;
- mmr_t underflow1_vc2_credit : 1;
- mmr_t underflow0_vc2_credit : 1;
- mmr_t underflow2_vc0_credit : 1;
- mmr_t underflow1_vc0_credit : 1;
- mmr_t underflow0_vc0_credit : 1;
- mmr_t underflow_fifo13_vc2_credit : 1;
- mmr_t underflow_fifo13_vc0_credit : 1;
- mmr_t underflow_fifo02_vc2_credit : 1;
- mmr_t underflow_fifo02_vc0_credit : 1;
- mmr_t underflow_fifo13_vc3_push : 1;
- mmr_t underflow_fifo13_vc1_push : 1;
- mmr_t underflow_fifo02_vc2_push : 1;
- mmr_t underflow_fifo02_vc0_push : 1;
- mmr_t underflow_fifo13_vc3_pop : 1;
- mmr_t underflow_fifo13_vc1_pop : 1;
- mmr_t underflow_fifo02_vc2_pop : 1;
- mmr_t underflow_fifo02_vc0_pop : 1;
- mmr_t illegal_vciilb : 1;
- mmr_t illegal_vcmd : 1;
- mmr_t illegal_vcpi : 1;
- mmr_t illegal_vcni : 1;
- } sh_ni0_first_error_2_s;
-} sh_ni0_first_error_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_ERROR_DETAIL_1" */
/* ni0 Chiplet no match header bits 63:0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_ni0_error_detail_1_u {
- mmr_t sh_ni0_error_detail_1_regval;
- struct {
- mmr_t header : 64;
- } sh_ni0_error_detail_1_s;
-} sh_ni0_error_detail_1_u_t;
-#else
typedef union sh_ni0_error_detail_1_u {
mmr_t sh_ni0_error_detail_1_regval;
struct {
mmr_t header : 64;
} sh_ni0_error_detail_1_s;
} sh_ni0_error_detail_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_ERROR_DETAIL_2" */
/* ni0 Chiplet no match header bits 127:64 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_ni0_error_detail_2_u {
- mmr_t sh_ni0_error_detail_2_regval;
- struct {
- mmr_t header : 64;
- } sh_ni0_error_detail_2_s;
-} sh_ni0_error_detail_2_u_t;
-#else
typedef union sh_ni0_error_detail_2_u {
mmr_t sh_ni0_error_detail_2_regval;
struct {
mmr_t header : 64;
} sh_ni0_error_detail_2_s;
} sh_ni0_error_detail_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_ERROR_SUMMARY_1" */
/* ni1 Error Summary Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_error_summary_1_u {
mmr_t sh_ni1_error_summary_1_regval;
struct {
@@ -14695,84 +7976,12 @@ typedef union sh_ni1_error_summary_1_u {
mmr_t tail_timeout_ni_vc3 : 1;
} sh_ni1_error_summary_1_s;
} sh_ni1_error_summary_1_u_t;
-#else
-typedef union sh_ni1_error_summary_1_u {
- mmr_t sh_ni1_error_summary_1_regval;
- struct {
- mmr_t tail_timeout_ni_vc3 : 1;
- mmr_t tail_timeout_ni_vc2 : 1;
- mmr_t tail_timeout_ni_vc1 : 1;
- mmr_t tail_timeout_ni_vc0 : 1;
- mmr_t tail_timeout_fifo13_vc3 : 1;
- mmr_t tail_timeout_fifo13_vc1 : 1;
- mmr_t tail_timeout_fifo02_vc2 : 1;
- mmr_t tail_timeout_fifo02_vc0 : 1;
- mmr_t overflow_ni_fifo_vc3_credit : 1;
- mmr_t overflow_ni_fifo_vc2_credit : 1;
- mmr_t overflow_ni_fifo_vc1_credit : 1;
- mmr_t overflow_ni_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_credit : 1;
- mmr_t overflow_md_fifo_vc0_credit : 1;
- mmr_t overflow_iilb_fifo_vc2_credit : 1;
- mmr_t overflow_iilb_fifo_vc0_credit : 1;
- mmr_t overflow_pi_fifo_vc2_credit : 1;
- mmr_t overflow_pi_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_push : 1;
- mmr_t overflow_md_fifo_vc0_push : 1;
- mmr_t overflow_iilb_fifo_vc2_push : 1;
- mmr_t overflow_iilb_fifo_vc0_push : 1;
- mmr_t overflow_pi_fifo_vc2_push : 1;
- mmr_t overflow_pi_fifo_vc0_push : 1;
- mmr_t overflow_ni_fifo_vc2_pop : 1;
- mmr_t overflow_ni_fifo_vc0_pop : 1;
- mmr_t overflow_md_fifo_vc2_pop : 1;
- mmr_t overflow_md_fifo_vc0_pop : 1;
- mmr_t overflow_iilb_fifo_vc2_pop : 1;
- mmr_t overflow_iilb_fifo_vc0_pop : 1;
- mmr_t overflow_pi_fifo_vc2_pop : 1;
- mmr_t overflow_pi_fifo_vc0_pop : 1;
- mmr_t overflow_ni_fifo_debit3 : 1;
- mmr_t overflow_ni_fifo_debit2 : 1;
- mmr_t overflow_ni_fifo_debit1 : 1;
- mmr_t overflow_ni_fifo_debit0 : 1;
- mmr_t overflow_md_fifo_debit2 : 1;
- mmr_t overflow_md_fifo_debit0 : 1;
- mmr_t overflow_iilb_fifo_debit2 : 1;
- mmr_t overflow_iilb_fifo_debit0 : 1;
- mmr_t overflow_pi_fifo_debit2 : 1;
- mmr_t overflow_pi_fifo_debit0 : 1;
- mmr_t overflow2_vc2_credit : 1;
- mmr_t overflow1_vc2_credit : 1;
- mmr_t overflow0_vc2_credit : 1;
- mmr_t overflow2_vc0_credit : 1;
- mmr_t overflow1_vc0_credit : 1;
- mmr_t overflow0_vc0_credit : 1;
- mmr_t overflow_fifo13_vc2_credit : 1;
- mmr_t overflow_fifo13_vc0_credit : 1;
- mmr_t overflow_fifo02_vc2_credit : 1;
- mmr_t overflow_fifo02_vc0_credit : 1;
- mmr_t overflow_fifo13_vc3_push : 1;
- mmr_t overflow_fifo13_vc1_push : 1;
- mmr_t overflow_fifo02_vc2_push : 1;
- mmr_t overflow_fifo02_vc0_push : 1;
- mmr_t overflow_fifo13_vc3_pop : 1;
- mmr_t overflow_fifo13_vc1_pop : 1;
- mmr_t overflow_fifo02_vc2_pop : 1;
- mmr_t overflow_fifo02_vc0_pop : 1;
- mmr_t overflow_fifo13_debit2 : 1;
- mmr_t overflow_fifo13_debit0 : 1;
- mmr_t overflow_fifo02_debit2 : 1;
- mmr_t overflow_fifo02_debit0 : 1;
- } sh_ni1_error_summary_1_s;
-} sh_ni1_error_summary_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_ERROR_SUMMARY_2" */
/* ni1 Error Summary Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_error_summary_2_u {
mmr_t sh_ni1_error_summary_2_regval;
struct {
@@ -14833,75 +8042,12 @@ typedef union sh_ni1_error_summary_2_u {
mmr_t reserved_1 : 1;
} sh_ni1_error_summary_2_s;
} sh_ni1_error_summary_2_u_t;
-#else
-typedef union sh_ni1_error_summary_2_u {
- mmr_t sh_ni1_error_summary_2_regval;
- struct {
- mmr_t reserved_1 : 1;
- mmr_t retry_timeout_error : 1;
- mmr_t lut_read_error : 1;
- mmr_t chiplet_nomatch : 1;
- mmr_t llp_deadlock_vc3 : 1;
- mmr_t llp_deadlock_vc2 : 1;
- mmr_t llp_deadlock_vc1 : 1;
- mmr_t llp_deadlock_vc0 : 1;
- mmr_t underflow_ni_fifo_vc3_credit : 1;
- mmr_t underflow_ni_fifo_vc2_credit : 1;
- mmr_t underflow_ni_fifo_vc1_credit : 1;
- mmr_t underflow_ni_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_credit : 1;
- mmr_t underflow_md_fifo_vc0_credit : 1;
- mmr_t underflow_iilb_fifo_vc2_credit : 1;
- mmr_t underflow_iilb_fifo_vc0_credit : 1;
- mmr_t underflow_pi_fifo_vc2_credit : 1;
- mmr_t underflow_pi_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_push : 1;
- mmr_t underflow_md_fifo_vc0_push : 1;
- mmr_t underflow_iilb_fifo_vc2_push : 1;
- mmr_t underflow_iilb_fifo_vc0_push : 1;
- mmr_t underflow_pi_fifo_vc2_push : 1;
- mmr_t underflow_pi_fifo_vc0_push : 1;
- mmr_t underflow_ni_fifo_vc2_pop : 1;
- mmr_t underflow_ni_fifo_vc0_pop : 1;
- mmr_t underflow_md_fifo_vc2_pop : 1;
- mmr_t underflow_md_fifo_vc0_pop : 1;
- mmr_t underflow_iilb_fifo_vc2_pop : 1;
- mmr_t underflow_iilb_fifo_vc0_pop : 1;
- mmr_t underflow_pi_fifo_vc2_pop : 1;
- mmr_t underflow_pi_fifo_vc0_pop : 1;
- mmr_t reserved_0 : 10;
- mmr_t underflow2_vc2_credit : 1;
- mmr_t underflow1_vc2_credit : 1;
- mmr_t underflow0_vc2_credit : 1;
- mmr_t underflow2_vc0_credit : 1;
- mmr_t underflow1_vc0_credit : 1;
- mmr_t underflow0_vc0_credit : 1;
- mmr_t underflow_fifo13_vc2_credit : 1;
- mmr_t underflow_fifo13_vc0_credit : 1;
- mmr_t underflow_fifo02_vc2_credit : 1;
- mmr_t underflow_fifo02_vc0_credit : 1;
- mmr_t underflow_fifo13_vc3_push : 1;
- mmr_t underflow_fifo13_vc1_push : 1;
- mmr_t underflow_fifo02_vc2_push : 1;
- mmr_t underflow_fifo02_vc0_push : 1;
- mmr_t underflow_fifo13_vc3_pop : 1;
- mmr_t underflow_fifo13_vc1_pop : 1;
- mmr_t underflow_fifo02_vc2_pop : 1;
- mmr_t underflow_fifo02_vc0_pop : 1;
- mmr_t illegal_vciilb : 1;
- mmr_t illegal_vcmd : 1;
- mmr_t illegal_vcpi : 1;
- mmr_t illegal_vcni : 1;
- } sh_ni1_error_summary_2_s;
-} sh_ni1_error_summary_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_ERROR_OVERFLOW_1" */
/* ni1 Error Overflow Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_error_overflow_1_u {
mmr_t sh_ni1_error_overflow_1_regval;
struct {
@@ -14971,84 +8117,12 @@ typedef union sh_ni1_error_overflow_1_u {
mmr_t tail_timeout_ni_vc3 : 1;
} sh_ni1_error_overflow_1_s;
} sh_ni1_error_overflow_1_u_t;
-#else
-typedef union sh_ni1_error_overflow_1_u {
- mmr_t sh_ni1_error_overflow_1_regval;
- struct {
- mmr_t tail_timeout_ni_vc3 : 1;
- mmr_t tail_timeout_ni_vc2 : 1;
- mmr_t tail_timeout_ni_vc1 : 1;
- mmr_t tail_timeout_ni_vc0 : 1;
- mmr_t tail_timeout_fifo13_vc3 : 1;
- mmr_t tail_timeout_fifo13_vc1 : 1;
- mmr_t tail_timeout_fifo02_vc2 : 1;
- mmr_t tail_timeout_fifo02_vc0 : 1;
- mmr_t overflow_ni_fifo_vc3_credit : 1;
- mmr_t overflow_ni_fifo_vc2_credit : 1;
- mmr_t overflow_ni_fifo_vc1_credit : 1;
- mmr_t overflow_ni_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_credit : 1;
- mmr_t overflow_md_fifo_vc0_credit : 1;
- mmr_t overflow_iilb_fifo_vc2_credit : 1;
- mmr_t overflow_iilb_fifo_vc0_credit : 1;
- mmr_t overflow_pi_fifo_vc2_credit : 1;
- mmr_t overflow_pi_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_push : 1;
- mmr_t overflow_md_fifo_vc0_push : 1;
- mmr_t overflow_iilb_fifo_vc2_push : 1;
- mmr_t overflow_iilb_fifo_vc0_push : 1;
- mmr_t overflow_pi_fifo_vc2_push : 1;
- mmr_t overflow_pi_fifo_vc0_push : 1;
- mmr_t overflow_ni_fifo_vc2_pop : 1;
- mmr_t overflow_ni_fifo_vc0_pop : 1;
- mmr_t overflow_md_fifo_vc2_pop : 1;
- mmr_t overflow_md_fifo_vc0_pop : 1;
- mmr_t overflow_iilb_fifo_vc2_pop : 1;
- mmr_t overflow_iilb_fifo_vc0_pop : 1;
- mmr_t overflow_pi_fifo_vc2_pop : 1;
- mmr_t overflow_pi_fifo_vc0_pop : 1;
- mmr_t overflow_ni_fifo_debit3 : 1;
- mmr_t overflow_ni_fifo_debit2 : 1;
- mmr_t overflow_ni_fifo_debit1 : 1;
- mmr_t overflow_ni_fifo_debit0 : 1;
- mmr_t overflow_md_fifo_debit2 : 1;
- mmr_t overflow_md_fifo_debit0 : 1;
- mmr_t overflow_iilb_fifo_debit2 : 1;
- mmr_t overflow_iilb_fifo_debit0 : 1;
- mmr_t overflow_pi_fifo_debit2 : 1;
- mmr_t overflow_pi_fifo_debit0 : 1;
- mmr_t overflow2_vc2_credit : 1;
- mmr_t overflow1_vc2_credit : 1;
- mmr_t overflow0_vc2_credit : 1;
- mmr_t overflow2_vc0_credit : 1;
- mmr_t overflow1_vc0_credit : 1;
- mmr_t overflow0_vc0_credit : 1;
- mmr_t overflow_fifo13_vc2_credit : 1;
- mmr_t overflow_fifo13_vc0_credit : 1;
- mmr_t overflow_fifo02_vc2_credit : 1;
- mmr_t overflow_fifo02_vc0_credit : 1;
- mmr_t overflow_fifo13_vc3_push : 1;
- mmr_t overflow_fifo13_vc1_push : 1;
- mmr_t overflow_fifo02_vc2_push : 1;
- mmr_t overflow_fifo02_vc0_push : 1;
- mmr_t overflow_fifo13_vc3_pop : 1;
- mmr_t overflow_fifo13_vc1_pop : 1;
- mmr_t overflow_fifo02_vc2_pop : 1;
- mmr_t overflow_fifo02_vc0_pop : 1;
- mmr_t overflow_fifo13_debit2 : 1;
- mmr_t overflow_fifo13_debit0 : 1;
- mmr_t overflow_fifo02_debit2 : 1;
- mmr_t overflow_fifo02_debit0 : 1;
- } sh_ni1_error_overflow_1_s;
-} sh_ni1_error_overflow_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_ERROR_OVERFLOW_2" */
/* ni1 Error Overflow Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_error_overflow_2_u {
mmr_t sh_ni1_error_overflow_2_regval;
struct {
@@ -15109,75 +8183,12 @@ typedef union sh_ni1_error_overflow_2_u {
mmr_t reserved_1 : 1;
} sh_ni1_error_overflow_2_s;
} sh_ni1_error_overflow_2_u_t;
-#else
-typedef union sh_ni1_error_overflow_2_u {
- mmr_t sh_ni1_error_overflow_2_regval;
- struct {
- mmr_t reserved_1 : 1;
- mmr_t retry_timeout_error : 1;
- mmr_t lut_read_error : 1;
- mmr_t chiplet_nomatch : 1;
- mmr_t llp_deadlock_vc3 : 1;
- mmr_t llp_deadlock_vc2 : 1;
- mmr_t llp_deadlock_vc1 : 1;
- mmr_t llp_deadlock_vc0 : 1;
- mmr_t underflow_ni_fifo_vc3_credit : 1;
- mmr_t underflow_ni_fifo_vc2_credit : 1;
- mmr_t underflow_ni_fifo_vc1_credit : 1;
- mmr_t underflow_ni_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_credit : 1;
- mmr_t underflow_md_fifo_vc0_credit : 1;
- mmr_t underflow_iilb_fifo_vc2_credit : 1;
- mmr_t underflow_iilb_fifo_vc0_credit : 1;
- mmr_t underflow_pi_fifo_vc2_credit : 1;
- mmr_t underflow_pi_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_push : 1;
- mmr_t underflow_md_fifo_vc0_push : 1;
- mmr_t underflow_iilb_fifo_vc2_push : 1;
- mmr_t underflow_iilb_fifo_vc0_push : 1;
- mmr_t underflow_pi_fifo_vc2_push : 1;
- mmr_t underflow_pi_fifo_vc0_push : 1;
- mmr_t underflow_ni_fifo_vc2_pop : 1;
- mmr_t underflow_ni_fifo_vc0_pop : 1;
- mmr_t underflow_md_fifo_vc2_pop : 1;
- mmr_t underflow_md_fifo_vc0_pop : 1;
- mmr_t underflow_iilb_fifo_vc2_pop : 1;
- mmr_t underflow_iilb_fifo_vc0_pop : 1;
- mmr_t underflow_pi_fifo_vc2_pop : 1;
- mmr_t underflow_pi_fifo_vc0_pop : 1;
- mmr_t reserved_0 : 10;
- mmr_t underflow2_vc2_credit : 1;
- mmr_t underflow1_vc2_credit : 1;
- mmr_t underflow0_vc2_credit : 1;
- mmr_t underflow2_vc0_credit : 1;
- mmr_t underflow1_vc0_credit : 1;
- mmr_t underflow0_vc0_credit : 1;
- mmr_t underflow_fifo13_vc2_credit : 1;
- mmr_t underflow_fifo13_vc0_credit : 1;
- mmr_t underflow_fifo02_vc2_credit : 1;
- mmr_t underflow_fifo02_vc0_credit : 1;
- mmr_t underflow_fifo13_vc3_push : 1;
- mmr_t underflow_fifo13_vc1_push : 1;
- mmr_t underflow_fifo02_vc2_push : 1;
- mmr_t underflow_fifo02_vc0_push : 1;
- mmr_t underflow_fifo13_vc3_pop : 1;
- mmr_t underflow_fifo13_vc1_pop : 1;
- mmr_t underflow_fifo02_vc2_pop : 1;
- mmr_t underflow_fifo02_vc0_pop : 1;
- mmr_t illegal_vciilb : 1;
- mmr_t illegal_vcmd : 1;
- mmr_t illegal_vcpi : 1;
- mmr_t illegal_vcni : 1;
- } sh_ni1_error_overflow_2_s;
-} sh_ni1_error_overflow_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_ERROR_MASK_1" */
/* ni1 Error Mask Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_error_mask_1_u {
mmr_t sh_ni1_error_mask_1_regval;
struct {
@@ -15247,84 +8258,12 @@ typedef union sh_ni1_error_mask_1_u {
mmr_t tail_timeout_ni_vc3 : 1;
} sh_ni1_error_mask_1_s;
} sh_ni1_error_mask_1_u_t;
-#else
-typedef union sh_ni1_error_mask_1_u {
- mmr_t sh_ni1_error_mask_1_regval;
- struct {
- mmr_t tail_timeout_ni_vc3 : 1;
- mmr_t tail_timeout_ni_vc2 : 1;
- mmr_t tail_timeout_ni_vc1 : 1;
- mmr_t tail_timeout_ni_vc0 : 1;
- mmr_t tail_timeout_fifo13_vc3 : 1;
- mmr_t tail_timeout_fifo13_vc1 : 1;
- mmr_t tail_timeout_fifo02_vc2 : 1;
- mmr_t tail_timeout_fifo02_vc0 : 1;
- mmr_t overflow_ni_fifo_vc3_credit : 1;
- mmr_t overflow_ni_fifo_vc2_credit : 1;
- mmr_t overflow_ni_fifo_vc1_credit : 1;
- mmr_t overflow_ni_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_credit : 1;
- mmr_t overflow_md_fifo_vc0_credit : 1;
- mmr_t overflow_iilb_fifo_vc2_credit : 1;
- mmr_t overflow_iilb_fifo_vc0_credit : 1;
- mmr_t overflow_pi_fifo_vc2_credit : 1;
- mmr_t overflow_pi_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_push : 1;
- mmr_t overflow_md_fifo_vc0_push : 1;
- mmr_t overflow_iilb_fifo_vc2_push : 1;
- mmr_t overflow_iilb_fifo_vc0_push : 1;
- mmr_t overflow_pi_fifo_vc2_push : 1;
- mmr_t overflow_pi_fifo_vc0_push : 1;
- mmr_t overflow_ni_fifo_vc2_pop : 1;
- mmr_t overflow_ni_fifo_vc0_pop : 1;
- mmr_t overflow_md_fifo_vc2_pop : 1;
- mmr_t overflow_md_fifo_vc0_pop : 1;
- mmr_t overflow_iilb_fifo_vc2_pop : 1;
- mmr_t overflow_iilb_fifo_vc0_pop : 1;
- mmr_t overflow_pi_fifo_vc2_pop : 1;
- mmr_t overflow_pi_fifo_vc0_pop : 1;
- mmr_t overflow_ni_fifo_debit3 : 1;
- mmr_t overflow_ni_fifo_debit2 : 1;
- mmr_t overflow_ni_fifo_debit1 : 1;
- mmr_t overflow_ni_fifo_debit0 : 1;
- mmr_t overflow_md_fifo_debit2 : 1;
- mmr_t overflow_md_fifo_debit0 : 1;
- mmr_t overflow_iilb_fifo_debit2 : 1;
- mmr_t overflow_iilb_fifo_debit0 : 1;
- mmr_t overflow_pi_fifo_debit2 : 1;
- mmr_t overflow_pi_fifo_debit0 : 1;
- mmr_t overflow2_vc2_credit : 1;
- mmr_t overflow1_vc2_credit : 1;
- mmr_t overflow0_vc2_credit : 1;
- mmr_t overflow2_vc0_credit : 1;
- mmr_t overflow1_vc0_credit : 1;
- mmr_t overflow0_vc0_credit : 1;
- mmr_t overflow_fifo13_vc2_credit : 1;
- mmr_t overflow_fifo13_vc0_credit : 1;
- mmr_t overflow_fifo02_vc2_credit : 1;
- mmr_t overflow_fifo02_vc0_credit : 1;
- mmr_t overflow_fifo13_vc3_push : 1;
- mmr_t overflow_fifo13_vc1_push : 1;
- mmr_t overflow_fifo02_vc2_push : 1;
- mmr_t overflow_fifo02_vc0_push : 1;
- mmr_t overflow_fifo13_vc3_pop : 1;
- mmr_t overflow_fifo13_vc1_pop : 1;
- mmr_t overflow_fifo02_vc2_pop : 1;
- mmr_t overflow_fifo02_vc0_pop : 1;
- mmr_t overflow_fifo13_debit2 : 1;
- mmr_t overflow_fifo13_debit0 : 1;
- mmr_t overflow_fifo02_debit2 : 1;
- mmr_t overflow_fifo02_debit0 : 1;
- } sh_ni1_error_mask_1_s;
-} sh_ni1_error_mask_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_ERROR_MASK_2" */
/* ni1 Error Mask Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_error_mask_2_u {
mmr_t sh_ni1_error_mask_2_regval;
struct {
@@ -15385,75 +8324,12 @@ typedef union sh_ni1_error_mask_2_u {
mmr_t reserved_1 : 1;
} sh_ni1_error_mask_2_s;
} sh_ni1_error_mask_2_u_t;
-#else
-typedef union sh_ni1_error_mask_2_u {
- mmr_t sh_ni1_error_mask_2_regval;
- struct {
- mmr_t reserved_1 : 1;
- mmr_t retry_timeout_error : 1;
- mmr_t lut_read_error : 1;
- mmr_t chiplet_nomatch : 1;
- mmr_t llp_deadlock_vc3 : 1;
- mmr_t llp_deadlock_vc2 : 1;
- mmr_t llp_deadlock_vc1 : 1;
- mmr_t llp_deadlock_vc0 : 1;
- mmr_t underflow_ni_fifo_vc3_credit : 1;
- mmr_t underflow_ni_fifo_vc2_credit : 1;
- mmr_t underflow_ni_fifo_vc1_credit : 1;
- mmr_t underflow_ni_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_credit : 1;
- mmr_t underflow_md_fifo_vc0_credit : 1;
- mmr_t underflow_iilb_fifo_vc2_credit : 1;
- mmr_t underflow_iilb_fifo_vc0_credit : 1;
- mmr_t underflow_pi_fifo_vc2_credit : 1;
- mmr_t underflow_pi_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_push : 1;
- mmr_t underflow_md_fifo_vc0_push : 1;
- mmr_t underflow_iilb_fifo_vc2_push : 1;
- mmr_t underflow_iilb_fifo_vc0_push : 1;
- mmr_t underflow_pi_fifo_vc2_push : 1;
- mmr_t underflow_pi_fifo_vc0_push : 1;
- mmr_t underflow_ni_fifo_vc2_pop : 1;
- mmr_t underflow_ni_fifo_vc0_pop : 1;
- mmr_t underflow_md_fifo_vc2_pop : 1;
- mmr_t underflow_md_fifo_vc0_pop : 1;
- mmr_t underflow_iilb_fifo_vc2_pop : 1;
- mmr_t underflow_iilb_fifo_vc0_pop : 1;
- mmr_t underflow_pi_fifo_vc2_pop : 1;
- mmr_t underflow_pi_fifo_vc0_pop : 1;
- mmr_t reserved_0 : 10;
- mmr_t underflow2_vc2_credit : 1;
- mmr_t underflow1_vc2_credit : 1;
- mmr_t underflow0_vc2_credit : 1;
- mmr_t underflow2_vc0_credit : 1;
- mmr_t underflow1_vc0_credit : 1;
- mmr_t underflow0_vc0_credit : 1;
- mmr_t underflow_fifo13_vc2_credit : 1;
- mmr_t underflow_fifo13_vc0_credit : 1;
- mmr_t underflow_fifo02_vc2_credit : 1;
- mmr_t underflow_fifo02_vc0_credit : 1;
- mmr_t underflow_fifo13_vc3_push : 1;
- mmr_t underflow_fifo13_vc1_push : 1;
- mmr_t underflow_fifo02_vc2_push : 1;
- mmr_t underflow_fifo02_vc0_push : 1;
- mmr_t underflow_fifo13_vc3_pop : 1;
- mmr_t underflow_fifo13_vc1_pop : 1;
- mmr_t underflow_fifo02_vc2_pop : 1;
- mmr_t underflow_fifo02_vc0_pop : 1;
- mmr_t illegal_vciilb : 1;
- mmr_t illegal_vcmd : 1;
- mmr_t illegal_vcpi : 1;
- mmr_t illegal_vcni : 1;
- } sh_ni1_error_mask_2_s;
-} sh_ni1_error_mask_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_FIRST_ERROR_1" */
/* ni1 First Error Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_first_error_1_u {
mmr_t sh_ni1_first_error_1_regval;
struct {
@@ -15523,84 +8399,12 @@ typedef union sh_ni1_first_error_1_u {
mmr_t tail_timeout_ni_vc3 : 1;
} sh_ni1_first_error_1_s;
} sh_ni1_first_error_1_u_t;
-#else
-typedef union sh_ni1_first_error_1_u {
- mmr_t sh_ni1_first_error_1_regval;
- struct {
- mmr_t tail_timeout_ni_vc3 : 1;
- mmr_t tail_timeout_ni_vc2 : 1;
- mmr_t tail_timeout_ni_vc1 : 1;
- mmr_t tail_timeout_ni_vc0 : 1;
- mmr_t tail_timeout_fifo13_vc3 : 1;
- mmr_t tail_timeout_fifo13_vc1 : 1;
- mmr_t tail_timeout_fifo02_vc2 : 1;
- mmr_t tail_timeout_fifo02_vc0 : 1;
- mmr_t overflow_ni_fifo_vc3_credit : 1;
- mmr_t overflow_ni_fifo_vc2_credit : 1;
- mmr_t overflow_ni_fifo_vc1_credit : 1;
- mmr_t overflow_ni_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_credit : 1;
- mmr_t overflow_md_fifo_vc0_credit : 1;
- mmr_t overflow_iilb_fifo_vc2_credit : 1;
- mmr_t overflow_iilb_fifo_vc0_credit : 1;
- mmr_t overflow_pi_fifo_vc2_credit : 1;
- mmr_t overflow_pi_fifo_vc0_credit : 1;
- mmr_t overflow_md_fifo_vc2_push : 1;
- mmr_t overflow_md_fifo_vc0_push : 1;
- mmr_t overflow_iilb_fifo_vc2_push : 1;
- mmr_t overflow_iilb_fifo_vc0_push : 1;
- mmr_t overflow_pi_fifo_vc2_push : 1;
- mmr_t overflow_pi_fifo_vc0_push : 1;
- mmr_t overflow_ni_fifo_vc2_pop : 1;
- mmr_t overflow_ni_fifo_vc0_pop : 1;
- mmr_t overflow_md_fifo_vc2_pop : 1;
- mmr_t overflow_md_fifo_vc0_pop : 1;
- mmr_t overflow_iilb_fifo_vc2_pop : 1;
- mmr_t overflow_iilb_fifo_vc0_pop : 1;
- mmr_t overflow_pi_fifo_vc2_pop : 1;
- mmr_t overflow_pi_fifo_vc0_pop : 1;
- mmr_t overflow_ni_fifo_debit3 : 1;
- mmr_t overflow_ni_fifo_debit2 : 1;
- mmr_t overflow_ni_fifo_debit1 : 1;
- mmr_t overflow_ni_fifo_debit0 : 1;
- mmr_t overflow_md_fifo_debit2 : 1;
- mmr_t overflow_md_fifo_debit0 : 1;
- mmr_t overflow_iilb_fifo_debit2 : 1;
- mmr_t overflow_iilb_fifo_debit0 : 1;
- mmr_t overflow_pi_fifo_debit2 : 1;
- mmr_t overflow_pi_fifo_debit0 : 1;
- mmr_t overflow2_vc2_credit : 1;
- mmr_t overflow1_vc2_credit : 1;
- mmr_t overflow0_vc2_credit : 1;
- mmr_t overflow2_vc0_credit : 1;
- mmr_t overflow1_vc0_credit : 1;
- mmr_t overflow0_vc0_credit : 1;
- mmr_t overflow_fifo13_vc2_credit : 1;
- mmr_t overflow_fifo13_vc0_credit : 1;
- mmr_t overflow_fifo02_vc2_credit : 1;
- mmr_t overflow_fifo02_vc0_credit : 1;
- mmr_t overflow_fifo13_vc3_push : 1;
- mmr_t overflow_fifo13_vc1_push : 1;
- mmr_t overflow_fifo02_vc2_push : 1;
- mmr_t overflow_fifo02_vc0_push : 1;
- mmr_t overflow_fifo13_vc3_pop : 1;
- mmr_t overflow_fifo13_vc1_pop : 1;
- mmr_t overflow_fifo02_vc2_pop : 1;
- mmr_t overflow_fifo02_vc0_pop : 1;
- mmr_t overflow_fifo13_debit2 : 1;
- mmr_t overflow_fifo13_debit0 : 1;
- mmr_t overflow_fifo02_debit2 : 1;
- mmr_t overflow_fifo02_debit0 : 1;
- } sh_ni1_first_error_1_s;
-} sh_ni1_first_error_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_FIRST_ERROR_2" */
/* ni1 First Error Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_first_error_2_u {
mmr_t sh_ni1_first_error_2_regval;
struct {
@@ -15661,117 +8465,36 @@ typedef union sh_ni1_first_error_2_u {
mmr_t reserved_1 : 1;
} sh_ni1_first_error_2_s;
} sh_ni1_first_error_2_u_t;
-#else
-typedef union sh_ni1_first_error_2_u {
- mmr_t sh_ni1_first_error_2_regval;
- struct {
- mmr_t reserved_1 : 1;
- mmr_t retry_timeout_error : 1;
- mmr_t lut_read_error : 1;
- mmr_t chiplet_nomatch : 1;
- mmr_t llp_deadlock_vc3 : 1;
- mmr_t llp_deadlock_vc2 : 1;
- mmr_t llp_deadlock_vc1 : 1;
- mmr_t llp_deadlock_vc0 : 1;
- mmr_t underflow_ni_fifo_vc3_credit : 1;
- mmr_t underflow_ni_fifo_vc2_credit : 1;
- mmr_t underflow_ni_fifo_vc1_credit : 1;
- mmr_t underflow_ni_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_credit : 1;
- mmr_t underflow_md_fifo_vc0_credit : 1;
- mmr_t underflow_iilb_fifo_vc2_credit : 1;
- mmr_t underflow_iilb_fifo_vc0_credit : 1;
- mmr_t underflow_pi_fifo_vc2_credit : 1;
- mmr_t underflow_pi_fifo_vc0_credit : 1;
- mmr_t underflow_md_fifo_vc2_push : 1;
- mmr_t underflow_md_fifo_vc0_push : 1;
- mmr_t underflow_iilb_fifo_vc2_push : 1;
- mmr_t underflow_iilb_fifo_vc0_push : 1;
- mmr_t underflow_pi_fifo_vc2_push : 1;
- mmr_t underflow_pi_fifo_vc0_push : 1;
- mmr_t underflow_ni_fifo_vc2_pop : 1;
- mmr_t underflow_ni_fifo_vc0_pop : 1;
- mmr_t underflow_md_fifo_vc2_pop : 1;
- mmr_t underflow_md_fifo_vc0_pop : 1;
- mmr_t underflow_iilb_fifo_vc2_pop : 1;
- mmr_t underflow_iilb_fifo_vc0_pop : 1;
- mmr_t underflow_pi_fifo_vc2_pop : 1;
- mmr_t underflow_pi_fifo_vc0_pop : 1;
- mmr_t reserved_0 : 10;
- mmr_t underflow2_vc2_credit : 1;
- mmr_t underflow1_vc2_credit : 1;
- mmr_t underflow0_vc2_credit : 1;
- mmr_t underflow2_vc0_credit : 1;
- mmr_t underflow1_vc0_credit : 1;
- mmr_t underflow0_vc0_credit : 1;
- mmr_t underflow_fifo13_vc2_credit : 1;
- mmr_t underflow_fifo13_vc0_credit : 1;
- mmr_t underflow_fifo02_vc2_credit : 1;
- mmr_t underflow_fifo02_vc0_credit : 1;
- mmr_t underflow_fifo13_vc3_push : 1;
- mmr_t underflow_fifo13_vc1_push : 1;
- mmr_t underflow_fifo02_vc2_push : 1;
- mmr_t underflow_fifo02_vc0_push : 1;
- mmr_t underflow_fifo13_vc3_pop : 1;
- mmr_t underflow_fifo13_vc1_pop : 1;
- mmr_t underflow_fifo02_vc2_pop : 1;
- mmr_t underflow_fifo02_vc0_pop : 1;
- mmr_t illegal_vciilb : 1;
- mmr_t illegal_vcmd : 1;
- mmr_t illegal_vcpi : 1;
- mmr_t illegal_vcni : 1;
- } sh_ni1_first_error_2_s;
-} sh_ni1_first_error_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_ERROR_DETAIL_1" */
/* ni1 Chiplet no match header bits 63:0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_error_detail_1_u {
mmr_t sh_ni1_error_detail_1_regval;
struct {
mmr_t header : 64;
} sh_ni1_error_detail_1_s;
} sh_ni1_error_detail_1_u_t;
-#else
-typedef union sh_ni1_error_detail_1_u {
- mmr_t sh_ni1_error_detail_1_regval;
- struct {
- mmr_t header : 64;
- } sh_ni1_error_detail_1_s;
-} sh_ni1_error_detail_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_ERROR_DETAIL_2" */
/* ni1 Chiplet no match header bits 127:64 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_ni1_error_detail_2_u {
- mmr_t sh_ni1_error_detail_2_regval;
- struct {
- mmr_t header : 64;
- } sh_ni1_error_detail_2_s;
-} sh_ni1_error_detail_2_u_t;
-#else
typedef union sh_ni1_error_detail_2_u {
mmr_t sh_ni1_error_detail_2_regval;
struct {
mmr_t header : 64;
} sh_ni1_error_detail_2_s;
} sh_ni1_error_detail_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_CORRECTED_DETAIL_1" */
/* Corrected error details */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_corrected_detail_1_u {
mmr_t sh_xn_corrected_detail_1_regval;
struct {
@@ -15793,78 +8516,36 @@ typedef union sh_xn_corrected_detail_1_u {
mmr_t reserved_3 : 4;
} sh_xn_corrected_detail_1_s;
} sh_xn_corrected_detail_1_u_t;
-#else
-typedef union sh_xn_corrected_detail_1_u {
- mmr_t sh_xn_corrected_detail_1_regval;
- struct {
- mmr_t reserved_3 : 4;
- mmr_t ecc3_vc : 2;
- mmr_t ecc3_wc : 2;
- mmr_t ecc3_syndrome : 8;
- mmr_t reserved_2 : 4;
- mmr_t ecc2_vc : 2;
- mmr_t ecc2_wc : 2;
- mmr_t ecc2_syndrome : 8;
- mmr_t reserved_1 : 4;
- mmr_t ecc1_vc : 2;
- mmr_t ecc1_wc : 2;
- mmr_t ecc1_syndrome : 8;
- mmr_t reserved_0 : 4;
- mmr_t ecc0_vc : 2;
- mmr_t ecc0_wc : 2;
- mmr_t ecc0_syndrome : 8;
- } sh_xn_corrected_detail_1_s;
-} sh_xn_corrected_detail_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_CORRECTED_DETAIL_2" */
/* Corrected error data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_corrected_detail_2_u {
- mmr_t sh_xn_corrected_detail_2_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_corrected_detail_2_s;
-} sh_xn_corrected_detail_2_u_t;
-#else
typedef union sh_xn_corrected_detail_2_u {
mmr_t sh_xn_corrected_detail_2_regval;
struct {
mmr_t data : 64;
} sh_xn_corrected_detail_2_s;
} sh_xn_corrected_detail_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_CORRECTED_DETAIL_3" */
/* Corrected error header0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_corrected_detail_3_u {
mmr_t sh_xn_corrected_detail_3_regval;
struct {
mmr_t header0 : 64;
} sh_xn_corrected_detail_3_s;
} sh_xn_corrected_detail_3_u_t;
-#else
-typedef union sh_xn_corrected_detail_3_u {
- mmr_t sh_xn_corrected_detail_3_regval;
- struct {
- mmr_t header0 : 64;
- } sh_xn_corrected_detail_3_s;
-} sh_xn_corrected_detail_3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_CORRECTED_DETAIL_4" */
/* Corrected error header1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_corrected_detail_4_u {
mmr_t sh_xn_corrected_detail_4_regval;
struct {
@@ -15873,23 +8554,12 @@ typedef union sh_xn_corrected_detail_4_u {
mmr_t err_group : 2;
} sh_xn_corrected_detail_4_s;
} sh_xn_corrected_detail_4_u_t;
-#else
-typedef union sh_xn_corrected_detail_4_u {
- mmr_t sh_xn_corrected_detail_4_regval;
- struct {
- mmr_t err_group : 2;
- mmr_t reserved_0 : 20;
- mmr_t header1 : 42;
- } sh_xn_corrected_detail_4_s;
-} sh_xn_corrected_detail_4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_UNCORRECTED_DETAIL_1" */
/* Uncorrected error details */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_uncorrected_detail_1_u {
mmr_t sh_xn_uncorrected_detail_1_regval;
struct {
@@ -15911,78 +8581,36 @@ typedef union sh_xn_uncorrected_detail_1_u {
mmr_t reserved_3 : 4;
} sh_xn_uncorrected_detail_1_s;
} sh_xn_uncorrected_detail_1_u_t;
-#else
-typedef union sh_xn_uncorrected_detail_1_u {
- mmr_t sh_xn_uncorrected_detail_1_regval;
- struct {
- mmr_t reserved_3 : 4;
- mmr_t ecc3_vc : 2;
- mmr_t ecc3_wc : 2;
- mmr_t ecc3_syndrome : 8;
- mmr_t reserved_2 : 4;
- mmr_t ecc2_vc : 2;
- mmr_t ecc2_wc : 2;
- mmr_t ecc2_syndrome : 8;
- mmr_t reserved_1 : 4;
- mmr_t ecc1_vc : 2;
- mmr_t ecc1_wc : 2;
- mmr_t ecc1_syndrome : 8;
- mmr_t reserved_0 : 4;
- mmr_t ecc0_vc : 2;
- mmr_t ecc0_wc : 2;
- mmr_t ecc0_syndrome : 8;
- } sh_xn_uncorrected_detail_1_s;
-} sh_xn_uncorrected_detail_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_UNCORRECTED_DETAIL_2" */
/* Uncorrected error data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xn_uncorrected_detail_2_u {
- mmr_t sh_xn_uncorrected_detail_2_regval;
- struct {
- mmr_t data : 64;
- } sh_xn_uncorrected_detail_2_s;
-} sh_xn_uncorrected_detail_2_u_t;
-#else
typedef union sh_xn_uncorrected_detail_2_u {
mmr_t sh_xn_uncorrected_detail_2_regval;
struct {
mmr_t data : 64;
} sh_xn_uncorrected_detail_2_s;
} sh_xn_uncorrected_detail_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_UNCORRECTED_DETAIL_3" */
/* Uncorrected error header0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_uncorrected_detail_3_u {
mmr_t sh_xn_uncorrected_detail_3_regval;
struct {
mmr_t header0 : 64;
} sh_xn_uncorrected_detail_3_s;
} sh_xn_uncorrected_detail_3_u_t;
-#else
-typedef union sh_xn_uncorrected_detail_3_u {
- mmr_t sh_xn_uncorrected_detail_3_regval;
- struct {
- mmr_t header0 : 64;
- } sh_xn_uncorrected_detail_3_s;
-} sh_xn_uncorrected_detail_3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_UNCORRECTED_DETAIL_4" */
/* Uncorrected error header1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_uncorrected_detail_4_u {
mmr_t sh_xn_uncorrected_detail_4_regval;
struct {
@@ -15991,23 +8619,12 @@ typedef union sh_xn_uncorrected_detail_4_u {
mmr_t err_group : 2;
} sh_xn_uncorrected_detail_4_s;
} sh_xn_uncorrected_detail_4_u_t;
-#else
-typedef union sh_xn_uncorrected_detail_4_u {
- mmr_t sh_xn_uncorrected_detail_4_regval;
- struct {
- mmr_t err_group : 2;
- mmr_t reserved_0 : 20;
- mmr_t header1 : 42;
- } sh_xn_uncorrected_detail_4_s;
-} sh_xn_uncorrected_detail_4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_ERROR_DETAIL_1" */
/* Look Up Table Address (md) */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_error_detail_1_u {
mmr_t sh_xnmd_error_detail_1_regval;
struct {
@@ -16015,22 +8632,12 @@ typedef union sh_xnmd_error_detail_1_u {
mmr_t reserved_0 : 53;
} sh_xnmd_error_detail_1_s;
} sh_xnmd_error_detail_1_u_t;
-#else
-typedef union sh_xnmd_error_detail_1_u {
- mmr_t sh_xnmd_error_detail_1_regval;
- struct {
- mmr_t reserved_0 : 53;
- mmr_t lut_addr : 11;
- } sh_xnmd_error_detail_1_s;
-} sh_xnmd_error_detail_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_ERROR_DETAIL_1" */
/* Look Up Table Address (pi) */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_error_detail_1_u {
mmr_t sh_xnpi_error_detail_1_regval;
struct {
@@ -16038,64 +8645,36 @@ typedef union sh_xnpi_error_detail_1_u {
mmr_t reserved_0 : 53;
} sh_xnpi_error_detail_1_s;
} sh_xnpi_error_detail_1_u_t;
-#else
-typedef union sh_xnpi_error_detail_1_u {
- mmr_t sh_xnpi_error_detail_1_regval;
- struct {
- mmr_t reserved_0 : 53;
- mmr_t lut_addr : 11;
- } sh_xnpi_error_detail_1_s;
-} sh_xnpi_error_detail_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_ERROR_DETAIL_1" */
/* Chiplet NoMatch header [63:0] */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xniilb_error_detail_1_u {
- mmr_t sh_xniilb_error_detail_1_regval;
- struct {
- mmr_t header : 64;
- } sh_xniilb_error_detail_1_s;
-} sh_xniilb_error_detail_1_u_t;
-#else
typedef union sh_xniilb_error_detail_1_u {
mmr_t sh_xniilb_error_detail_1_regval;
struct {
mmr_t header : 64;
} sh_xniilb_error_detail_1_s;
} sh_xniilb_error_detail_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_ERROR_DETAIL_2" */
/* Chiplet NoMatch header [127:64] */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_xniilb_error_detail_2_u {
- mmr_t sh_xniilb_error_detail_2_regval;
- struct {
- mmr_t header : 64;
- } sh_xniilb_error_detail_2_s;
-} sh_xniilb_error_detail_2_u_t;
-#else
typedef union sh_xniilb_error_detail_2_u {
mmr_t sh_xniilb_error_detail_2_regval;
struct {
mmr_t header : 64;
} sh_xniilb_error_detail_2_s;
} sh_xniilb_error_detail_2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_ERROR_DETAIL_3" */
/* Look Up Table Address (iilb) */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_error_detail_3_u {
mmr_t sh_xniilb_error_detail_3_regval;
struct {
@@ -16103,22 +8682,12 @@ typedef union sh_xniilb_error_detail_3_u {
mmr_t reserved_0 : 53;
} sh_xniilb_error_detail_3_s;
} sh_xniilb_error_detail_3_u_t;
-#else
-typedef union sh_xniilb_error_detail_3_u {
- mmr_t sh_xniilb_error_detail_3_regval;
- struct {
- mmr_t reserved_0 : 53;
- mmr_t lut_addr : 11;
- } sh_xniilb_error_detail_3_s;
-} sh_xniilb_error_detail_3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI0_ERROR_DETAIL_3" */
/* Look Up Table Address (ni0) */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni0_error_detail_3_u {
mmr_t sh_ni0_error_detail_3_regval;
struct {
@@ -16126,22 +8695,12 @@ typedef union sh_ni0_error_detail_3_u {
mmr_t reserved_0 : 53;
} sh_ni0_error_detail_3_s;
} sh_ni0_error_detail_3_u_t;
-#else
-typedef union sh_ni0_error_detail_3_u {
- mmr_t sh_ni0_error_detail_3_regval;
- struct {
- mmr_t reserved_0 : 53;
- mmr_t lut_addr : 11;
- } sh_ni0_error_detail_3_s;
-} sh_ni0_error_detail_3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_NI1_ERROR_DETAIL_3" */
/* Look Up Table Address (ni1) */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ni1_error_detail_3_u {
mmr_t sh_ni1_error_detail_3_regval;
struct {
@@ -16149,21 +8708,11 @@ typedef union sh_ni1_error_detail_3_u {
mmr_t reserved_0 : 53;
} sh_ni1_error_detail_3_s;
} sh_ni1_error_detail_3_u_t;
-#else
-typedef union sh_ni1_error_detail_3_u {
- mmr_t sh_ni1_error_detail_3_regval;
- struct {
- mmr_t reserved_0 : 53;
- mmr_t lut_addr : 11;
- } sh_ni1_error_detail_3_s;
-} sh_ni1_error_detail_3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_ERROR_SUMMARY" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_error_summary_u {
mmr_t sh_xn_error_summary_regval;
struct {
@@ -16208,58 +8757,11 @@ typedef union sh_xn_error_summary_u {
mmr_t reserved_0 : 26;
} sh_xn_error_summary_s;
} sh_xn_error_summary_u_t;
-#else
-typedef union sh_xn_error_summary_u {
- mmr_t sh_xn_error_summary_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t iilb_chiplet_or_lut : 1;
- mmr_t iilb_fifo_underflow : 1;
- mmr_t iilb_credit_underflow : 1;
- mmr_t iilb_fifo_overflow : 1;
- mmr_t iilb_credit_overflow : 1;
- mmr_t iilb_debit_overflow : 1;
- mmr_t xnpi_lut_error : 1;
- mmr_t xnpi_uce_error : 1;
- mmr_t xnpi_sbe_error : 1;
- mmr_t xnpi_credit_underflow : 1;
- mmr_t xnpi_data_buff_overflow : 1;
- mmr_t xnpi_debit_overflow : 1;
- mmr_t xnpi_credit_overflow : 1;
- mmr_t xnmd_lut_error : 1;
- mmr_t xnmd_uce_error : 1;
- mmr_t xnmd_sbe_error : 1;
- mmr_t xnmd_credit_underflow : 1;
- mmr_t xnmd_data_buff_overflow : 1;
- mmr_t xnmd_debit_overflow : 1;
- mmr_t xnmd_credit_overflow : 1;
- mmr_t ni1_pipe_error : 1;
- mmr_t ni1_llp_error : 1;
- mmr_t ni1_credit_underflow : 1;
- mmr_t ni1_push_underflow : 1;
- mmr_t ni1_pop_underflow : 1;
- mmr_t ni1_debit_overflow : 1;
- mmr_t ni1_credit_overflow : 1;
- mmr_t ni1_push_overflow : 1;
- mmr_t ni1_pop_overflow : 1;
- mmr_t ni0_pipe_error : 1;
- mmr_t ni0_llp_error : 1;
- mmr_t ni0_credit_underflow : 1;
- mmr_t ni0_push_underflow : 1;
- mmr_t ni0_pop_underflow : 1;
- mmr_t ni0_debit_overflow : 1;
- mmr_t ni0_credit_overflow : 1;
- mmr_t ni0_push_overflow : 1;
- mmr_t ni0_pop_overflow : 1;
- } sh_xn_error_summary_s;
-} sh_xn_error_summary_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_ERROR_OVERFLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_error_overflow_u {
mmr_t sh_xn_error_overflow_regval;
struct {
@@ -16304,58 +8806,11 @@ typedef union sh_xn_error_overflow_u {
mmr_t reserved_0 : 26;
} sh_xn_error_overflow_s;
} sh_xn_error_overflow_u_t;
-#else
-typedef union sh_xn_error_overflow_u {
- mmr_t sh_xn_error_overflow_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t iilb_chiplet_or_lut : 1;
- mmr_t iilb_fifo_underflow : 1;
- mmr_t iilb_credit_underflow : 1;
- mmr_t iilb_fifo_overflow : 1;
- mmr_t iilb_credit_overflow : 1;
- mmr_t iilb_debit_overflow : 1;
- mmr_t xnpi_lut_error : 1;
- mmr_t xnpi_uce_error : 1;
- mmr_t xnpi_sbe_error : 1;
- mmr_t xnpi_credit_underflow : 1;
- mmr_t xnpi_data_buff_overflow : 1;
- mmr_t xnpi_debit_overflow : 1;
- mmr_t xnpi_credit_overflow : 1;
- mmr_t xnmd_lut_error : 1;
- mmr_t xnmd_uce_error : 1;
- mmr_t xnmd_sbe_error : 1;
- mmr_t xnmd_credit_underflow : 1;
- mmr_t xnmd_data_buff_overflow : 1;
- mmr_t xnmd_debit_overflow : 1;
- mmr_t xnmd_credit_overflow : 1;
- mmr_t ni1_pipe_error : 1;
- mmr_t ni1_llp_error : 1;
- mmr_t ni1_credit_underflow : 1;
- mmr_t ni1_push_underflow : 1;
- mmr_t ni1_pop_underflow : 1;
- mmr_t ni1_debit_overflow : 1;
- mmr_t ni1_credit_overflow : 1;
- mmr_t ni1_push_overflow : 1;
- mmr_t ni1_pop_overflow : 1;
- mmr_t ni0_pipe_error : 1;
- mmr_t ni0_llp_error : 1;
- mmr_t ni0_credit_underflow : 1;
- mmr_t ni0_push_underflow : 1;
- mmr_t ni0_pop_underflow : 1;
- mmr_t ni0_debit_overflow : 1;
- mmr_t ni0_credit_overflow : 1;
- mmr_t ni0_push_overflow : 1;
- mmr_t ni0_pop_overflow : 1;
- } sh_xn_error_overflow_s;
-} sh_xn_error_overflow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_ERROR_MASK" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_error_mask_u {
mmr_t sh_xn_error_mask_regval;
struct {
@@ -16400,58 +8855,11 @@ typedef union sh_xn_error_mask_u {
mmr_t reserved_0 : 26;
} sh_xn_error_mask_s;
} sh_xn_error_mask_u_t;
-#else
-typedef union sh_xn_error_mask_u {
- mmr_t sh_xn_error_mask_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t iilb_chiplet_or_lut : 1;
- mmr_t iilb_fifo_underflow : 1;
- mmr_t iilb_credit_underflow : 1;
- mmr_t iilb_fifo_overflow : 1;
- mmr_t iilb_credit_overflow : 1;
- mmr_t iilb_debit_overflow : 1;
- mmr_t xnpi_lut_error : 1;
- mmr_t xnpi_uce_error : 1;
- mmr_t xnpi_sbe_error : 1;
- mmr_t xnpi_credit_underflow : 1;
- mmr_t xnpi_data_buff_overflow : 1;
- mmr_t xnpi_debit_overflow : 1;
- mmr_t xnpi_credit_overflow : 1;
- mmr_t xnmd_lut_error : 1;
- mmr_t xnmd_uce_error : 1;
- mmr_t xnmd_sbe_error : 1;
- mmr_t xnmd_credit_underflow : 1;
- mmr_t xnmd_data_buff_overflow : 1;
- mmr_t xnmd_debit_overflow : 1;
- mmr_t xnmd_credit_overflow : 1;
- mmr_t ni1_pipe_error : 1;
- mmr_t ni1_llp_error : 1;
- mmr_t ni1_credit_underflow : 1;
- mmr_t ni1_push_underflow : 1;
- mmr_t ni1_pop_underflow : 1;
- mmr_t ni1_debit_overflow : 1;
- mmr_t ni1_credit_overflow : 1;
- mmr_t ni1_push_overflow : 1;
- mmr_t ni1_pop_overflow : 1;
- mmr_t ni0_pipe_error : 1;
- mmr_t ni0_llp_error : 1;
- mmr_t ni0_credit_underflow : 1;
- mmr_t ni0_push_underflow : 1;
- mmr_t ni0_pop_underflow : 1;
- mmr_t ni0_debit_overflow : 1;
- mmr_t ni0_credit_overflow : 1;
- mmr_t ni0_push_overflow : 1;
- mmr_t ni0_pop_overflow : 1;
- } sh_xn_error_mask_s;
-} sh_xn_error_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_FIRST_ERROR" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_first_error_u {
mmr_t sh_xn_first_error_regval;
struct {
@@ -16496,58 +8904,11 @@ typedef union sh_xn_first_error_u {
mmr_t reserved_0 : 26;
} sh_xn_first_error_s;
} sh_xn_first_error_u_t;
-#else
-typedef union sh_xn_first_error_u {
- mmr_t sh_xn_first_error_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t iilb_chiplet_or_lut : 1;
- mmr_t iilb_fifo_underflow : 1;
- mmr_t iilb_credit_underflow : 1;
- mmr_t iilb_fifo_overflow : 1;
- mmr_t iilb_credit_overflow : 1;
- mmr_t iilb_debit_overflow : 1;
- mmr_t xnpi_lut_error : 1;
- mmr_t xnpi_uce_error : 1;
- mmr_t xnpi_sbe_error : 1;
- mmr_t xnpi_credit_underflow : 1;
- mmr_t xnpi_data_buff_overflow : 1;
- mmr_t xnpi_debit_overflow : 1;
- mmr_t xnpi_credit_overflow : 1;
- mmr_t xnmd_lut_error : 1;
- mmr_t xnmd_uce_error : 1;
- mmr_t xnmd_sbe_error : 1;
- mmr_t xnmd_credit_underflow : 1;
- mmr_t xnmd_data_buff_overflow : 1;
- mmr_t xnmd_debit_overflow : 1;
- mmr_t xnmd_credit_overflow : 1;
- mmr_t ni1_pipe_error : 1;
- mmr_t ni1_llp_error : 1;
- mmr_t ni1_credit_underflow : 1;
- mmr_t ni1_push_underflow : 1;
- mmr_t ni1_pop_underflow : 1;
- mmr_t ni1_debit_overflow : 1;
- mmr_t ni1_credit_overflow : 1;
- mmr_t ni1_push_overflow : 1;
- mmr_t ni1_pop_overflow : 1;
- mmr_t ni0_pipe_error : 1;
- mmr_t ni0_llp_error : 1;
- mmr_t ni0_credit_underflow : 1;
- mmr_t ni0_push_underflow : 1;
- mmr_t ni0_pop_underflow : 1;
- mmr_t ni0_debit_overflow : 1;
- mmr_t ni0_credit_overflow : 1;
- mmr_t ni0_push_overflow : 1;
- mmr_t ni0_pop_overflow : 1;
- } sh_xn_first_error_s;
-} sh_xn_first_error_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_ERROR_SUMMARY" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_error_summary_u {
mmr_t sh_xniilb_error_summary_regval;
struct {
@@ -16617,83 +8978,11 @@ typedef union sh_xniilb_error_summary_u {
mmr_t lut_read_error : 1;
} sh_xniilb_error_summary_s;
} sh_xniilb_error_summary_u_t;
-#else
-typedef union sh_xniilb_error_summary_u {
- mmr_t sh_xniilb_error_summary_regval;
- struct {
- mmr_t lut_read_error : 1;
- mmr_t chiplet_nomatch : 1;
- mmr_t underflow_ni1_vc2_credit_out : 1;
- mmr_t underflow_ni1_vc0_credit_out : 1;
- mmr_t underflow_ni0_vc2_credit_out : 1;
- mmr_t underflow_ni0_vc0_credit_out : 1;
- mmr_t underflow_iilb_vc2_credit_out : 1;
- mmr_t underflow_iilb_vc0_credit_out : 1;
- mmr_t underflow_md_vc2_credit_out : 1;
- mmr_t underflow_md_vc0_credit_out : 1;
- mmr_t underflow_pi_vc2_credit_out : 1;
- mmr_t underflow_pi_vc0_credit_out : 1;
- mmr_t overflow_ni1_vc2_credit_out : 1;
- mmr_t overflow_ni1_vc0_credit_out : 1;
- mmr_t overflow_ni0_vc2_credit_out : 1;
- mmr_t overflow_ni0_vc0_credit_out : 1;
- mmr_t overflow_iilb_vc2_credit_out : 1;
- mmr_t overflow_iilb_vc0_credit_out : 1;
- mmr_t overflow_md_vc2_credit_out : 1;
- mmr_t overflow_md_vc0_credit_out : 1;
- mmr_t overflow_pi_vc2_credit_out : 1;
- mmr_t overflow_pi_vc0_credit_out : 1;
- mmr_t overflow_ni1_debit2 : 1;
- mmr_t overflow_ni1_debit0 : 1;
- mmr_t overflow_ni0_debit2 : 1;
- mmr_t overflow_ni0_debit0 : 1;
- mmr_t overflow_md_debit2 : 1;
- mmr_t overflow_md_debit0 : 1;
- mmr_t overflow_iilb_debit2 : 1;
- mmr_t overflow_iilb_debit0 : 1;
- mmr_t overflow_pi_debit2 : 1;
- mmr_t overflow_pi_debit0 : 1;
- mmr_t underflow_ni1_vc2_credit_in : 1;
- mmr_t underflow_ni0_vc2_credit_in : 1;
- mmr_t underflow_md_vc2_credit_in : 1;
- mmr_t underflow_iilb_vc2_credit_in : 1;
- mmr_t underflow_pi_vc2_credit_in : 1;
- mmr_t underflow_ni1_vc0_credit_in : 1;
- mmr_t underflow_ni0_vc0_credit_in : 1;
- mmr_t underflow_md_vc0_credit_in : 1;
- mmr_t underflow_iilb_vc0_credit_in : 1;
- mmr_t underflow_pi_vc0_credit_in : 1;
- mmr_t overflow_ni1_vc2_credit_in : 1;
- mmr_t overflow_ni0_vc2_credit_in : 1;
- mmr_t overflow_md_vc2_credit_in : 1;
- mmr_t overflow_iilb_vc2_credit_in : 1;
- mmr_t overflow_pi_vc2_credit_in : 1;
- mmr_t overflow_ni1_vc0_credit_in : 1;
- mmr_t overflow_ni0_vc0_credit_in : 1;
- mmr_t overflow_md_vc0_credit_in : 1;
- mmr_t overflow_iilb_vc0_credit_in : 1;
- mmr_t overflow_pi_vc0_credit_in : 1;
- mmr_t underflow_lb_vc2 : 1;
- mmr_t underflow_lb_vc0 : 1;
- mmr_t overflow_lb_vc2 : 1;
- mmr_t overflow_lb_vc0 : 1;
- mmr_t underflow_ii_vc2 : 1;
- mmr_t underflow_ii_vc0 : 1;
- mmr_t overflow_ii_vc2 : 1;
- mmr_t overflow_ii_vc0 : 1;
- mmr_t overflow_lb_debit2 : 1;
- mmr_t overflow_lb_debit0 : 1;
- mmr_t overflow_ii_debit2 : 1;
- mmr_t overflow_ii_debit0 : 1;
- } sh_xniilb_error_summary_s;
-} sh_xniilb_error_summary_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_ERROR_OVERFLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_error_overflow_u {
mmr_t sh_xniilb_error_overflow_regval;
struct {
@@ -16763,83 +9052,11 @@ typedef union sh_xniilb_error_overflow_u {
mmr_t lut_read_error : 1;
} sh_xniilb_error_overflow_s;
} sh_xniilb_error_overflow_u_t;
-#else
-typedef union sh_xniilb_error_overflow_u {
- mmr_t sh_xniilb_error_overflow_regval;
- struct {
- mmr_t lut_read_error : 1;
- mmr_t chiplet_nomatch : 1;
- mmr_t underflow_ni1_vc2_credit_out : 1;
- mmr_t underflow_ni1_vc0_credit_out : 1;
- mmr_t underflow_ni0_vc2_credit_out : 1;
- mmr_t underflow_ni0_vc0_credit_out : 1;
- mmr_t underflow_iilb_vc2_credit_out : 1;
- mmr_t underflow_iilb_vc0_credit_out : 1;
- mmr_t underflow_md_vc2_credit_out : 1;
- mmr_t underflow_md_vc0_credit_out : 1;
- mmr_t underflow_pi_vc2_credit_out : 1;
- mmr_t underflow_pi_vc0_credit_out : 1;
- mmr_t overflow_ni1_vc2_credit_out : 1;
- mmr_t overflow_ni1_vc0_credit_out : 1;
- mmr_t overflow_ni0_vc2_credit_out : 1;
- mmr_t overflow_ni0_vc0_credit_out : 1;
- mmr_t overflow_iilb_vc2_credit_out : 1;
- mmr_t overflow_iilb_vc0_credit_out : 1;
- mmr_t overflow_md_vc2_credit_out : 1;
- mmr_t overflow_md_vc0_credit_out : 1;
- mmr_t overflow_pi_vc2_credit_out : 1;
- mmr_t overflow_pi_vc0_credit_out : 1;
- mmr_t overflow_ni1_debit2 : 1;
- mmr_t overflow_ni1_debit0 : 1;
- mmr_t overflow_ni0_debit2 : 1;
- mmr_t overflow_ni0_debit0 : 1;
- mmr_t overflow_md_debit2 : 1;
- mmr_t overflow_md_debit0 : 1;
- mmr_t overflow_iilb_debit2 : 1;
- mmr_t overflow_iilb_debit0 : 1;
- mmr_t overflow_pi_debit2 : 1;
- mmr_t overflow_pi_debit0 : 1;
- mmr_t underflow_ni1_vc2_credit_in : 1;
- mmr_t underflow_ni0_vc2_credit_in : 1;
- mmr_t underflow_md_vc2_credit_in : 1;
- mmr_t underflow_iilb_vc2_credit_in : 1;
- mmr_t underflow_pi_vc2_credit_in : 1;
- mmr_t underflow_ni1_vc0_credit_in : 1;
- mmr_t underflow_ni0_vc0_credit_in : 1;
- mmr_t underflow_md_vc0_credit_in : 1;
- mmr_t underflow_iilb_vc0_credit_in : 1;
- mmr_t underflow_pi_vc0_credit_in : 1;
- mmr_t overflow_ni1_vc2_credit_in : 1;
- mmr_t overflow_ni0_vc2_credit_in : 1;
- mmr_t overflow_md_vc2_credit_in : 1;
- mmr_t overflow_iilb_vc2_credit_in : 1;
- mmr_t overflow_pi_vc2_credit_in : 1;
- mmr_t overflow_ni1_vc0_credit_in : 1;
- mmr_t overflow_ni0_vc0_credit_in : 1;
- mmr_t overflow_md_vc0_credit_in : 1;
- mmr_t overflow_iilb_vc0_credit_in : 1;
- mmr_t overflow_pi_vc0_credit_in : 1;
- mmr_t underflow_lb_vc2 : 1;
- mmr_t underflow_lb_vc0 : 1;
- mmr_t overflow_lb_vc2 : 1;
- mmr_t overflow_lb_vc0 : 1;
- mmr_t underflow_ii_vc2 : 1;
- mmr_t underflow_ii_vc0 : 1;
- mmr_t overflow_ii_vc2 : 1;
- mmr_t overflow_ii_vc0 : 1;
- mmr_t overflow_lb_debit2 : 1;
- mmr_t overflow_lb_debit0 : 1;
- mmr_t overflow_ii_debit2 : 1;
- mmr_t overflow_ii_debit0 : 1;
- } sh_xniilb_error_overflow_s;
-} sh_xniilb_error_overflow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_ERROR_MASK" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_error_mask_u {
mmr_t sh_xniilb_error_mask_regval;
struct {
@@ -16909,83 +9126,11 @@ typedef union sh_xniilb_error_mask_u {
mmr_t lut_read_error : 1;
} sh_xniilb_error_mask_s;
} sh_xniilb_error_mask_u_t;
-#else
-typedef union sh_xniilb_error_mask_u {
- mmr_t sh_xniilb_error_mask_regval;
- struct {
- mmr_t lut_read_error : 1;
- mmr_t chiplet_nomatch : 1;
- mmr_t underflow_ni1_vc2_credit_out : 1;
- mmr_t underflow_ni1_vc0_credit_out : 1;
- mmr_t underflow_ni0_vc2_credit_out : 1;
- mmr_t underflow_ni0_vc0_credit_out : 1;
- mmr_t underflow_iilb_vc2_credit_out : 1;
- mmr_t underflow_iilb_vc0_credit_out : 1;
- mmr_t underflow_md_vc2_credit_out : 1;
- mmr_t underflow_md_vc0_credit_out : 1;
- mmr_t underflow_pi_vc2_credit_out : 1;
- mmr_t underflow_pi_vc0_credit_out : 1;
- mmr_t overflow_ni1_vc2_credit_out : 1;
- mmr_t overflow_ni1_vc0_credit_out : 1;
- mmr_t overflow_ni0_vc2_credit_out : 1;
- mmr_t overflow_ni0_vc0_credit_out : 1;
- mmr_t overflow_iilb_vc2_credit_out : 1;
- mmr_t overflow_iilb_vc0_credit_out : 1;
- mmr_t overflow_md_vc2_credit_out : 1;
- mmr_t overflow_md_vc0_credit_out : 1;
- mmr_t overflow_pi_vc2_credit_out : 1;
- mmr_t overflow_pi_vc0_credit_out : 1;
- mmr_t overflow_ni1_debit2 : 1;
- mmr_t overflow_ni1_debit0 : 1;
- mmr_t overflow_ni0_debit2 : 1;
- mmr_t overflow_ni0_debit0 : 1;
- mmr_t overflow_md_debit2 : 1;
- mmr_t overflow_md_debit0 : 1;
- mmr_t overflow_iilb_debit2 : 1;
- mmr_t overflow_iilb_debit0 : 1;
- mmr_t overflow_pi_debit2 : 1;
- mmr_t overflow_pi_debit0 : 1;
- mmr_t underflow_ni1_vc2_credit_in : 1;
- mmr_t underflow_ni0_vc2_credit_in : 1;
- mmr_t underflow_md_vc2_credit_in : 1;
- mmr_t underflow_iilb_vc2_credit_in : 1;
- mmr_t underflow_pi_vc2_credit_in : 1;
- mmr_t underflow_ni1_vc0_credit_in : 1;
- mmr_t underflow_ni0_vc0_credit_in : 1;
- mmr_t underflow_md_vc0_credit_in : 1;
- mmr_t underflow_iilb_vc0_credit_in : 1;
- mmr_t underflow_pi_vc0_credit_in : 1;
- mmr_t overflow_ni1_vc2_credit_in : 1;
- mmr_t overflow_ni0_vc2_credit_in : 1;
- mmr_t overflow_md_vc2_credit_in : 1;
- mmr_t overflow_iilb_vc2_credit_in : 1;
- mmr_t overflow_pi_vc2_credit_in : 1;
- mmr_t overflow_ni1_vc0_credit_in : 1;
- mmr_t overflow_ni0_vc0_credit_in : 1;
- mmr_t overflow_md_vc0_credit_in : 1;
- mmr_t overflow_iilb_vc0_credit_in : 1;
- mmr_t overflow_pi_vc0_credit_in : 1;
- mmr_t underflow_lb_vc2 : 1;
- mmr_t underflow_lb_vc0 : 1;
- mmr_t overflow_lb_vc2 : 1;
- mmr_t overflow_lb_vc0 : 1;
- mmr_t underflow_ii_vc2 : 1;
- mmr_t underflow_ii_vc0 : 1;
- mmr_t overflow_ii_vc2 : 1;
- mmr_t overflow_ii_vc0 : 1;
- mmr_t overflow_lb_debit2 : 1;
- mmr_t overflow_lb_debit0 : 1;
- mmr_t overflow_ii_debit2 : 1;
- mmr_t overflow_ii_debit0 : 1;
- } sh_xniilb_error_mask_s;
-} sh_xniilb_error_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNIILB_FIRST_ERROR" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xniilb_first_error_u {
mmr_t sh_xniilb_first_error_regval;
struct {
@@ -17055,83 +9200,11 @@ typedef union sh_xniilb_first_error_u {
mmr_t lut_read_error : 1;
} sh_xniilb_first_error_s;
} sh_xniilb_first_error_u_t;
-#else
-typedef union sh_xniilb_first_error_u {
- mmr_t sh_xniilb_first_error_regval;
- struct {
- mmr_t lut_read_error : 1;
- mmr_t chiplet_nomatch : 1;
- mmr_t underflow_ni1_vc2_credit_out : 1;
- mmr_t underflow_ni1_vc0_credit_out : 1;
- mmr_t underflow_ni0_vc2_credit_out : 1;
- mmr_t underflow_ni0_vc0_credit_out : 1;
- mmr_t underflow_iilb_vc2_credit_out : 1;
- mmr_t underflow_iilb_vc0_credit_out : 1;
- mmr_t underflow_md_vc2_credit_out : 1;
- mmr_t underflow_md_vc0_credit_out : 1;
- mmr_t underflow_pi_vc2_credit_out : 1;
- mmr_t underflow_pi_vc0_credit_out : 1;
- mmr_t overflow_ni1_vc2_credit_out : 1;
- mmr_t overflow_ni1_vc0_credit_out : 1;
- mmr_t overflow_ni0_vc2_credit_out : 1;
- mmr_t overflow_ni0_vc0_credit_out : 1;
- mmr_t overflow_iilb_vc2_credit_out : 1;
- mmr_t overflow_iilb_vc0_credit_out : 1;
- mmr_t overflow_md_vc2_credit_out : 1;
- mmr_t overflow_md_vc0_credit_out : 1;
- mmr_t overflow_pi_vc2_credit_out : 1;
- mmr_t overflow_pi_vc0_credit_out : 1;
- mmr_t overflow_ni1_debit2 : 1;
- mmr_t overflow_ni1_debit0 : 1;
- mmr_t overflow_ni0_debit2 : 1;
- mmr_t overflow_ni0_debit0 : 1;
- mmr_t overflow_md_debit2 : 1;
- mmr_t overflow_md_debit0 : 1;
- mmr_t overflow_iilb_debit2 : 1;
- mmr_t overflow_iilb_debit0 : 1;
- mmr_t overflow_pi_debit2 : 1;
- mmr_t overflow_pi_debit0 : 1;
- mmr_t underflow_ni1_vc2_credit_in : 1;
- mmr_t underflow_ni0_vc2_credit_in : 1;
- mmr_t underflow_md_vc2_credit_in : 1;
- mmr_t underflow_iilb_vc2_credit_in : 1;
- mmr_t underflow_pi_vc2_credit_in : 1;
- mmr_t underflow_ni1_vc0_credit_in : 1;
- mmr_t underflow_ni0_vc0_credit_in : 1;
- mmr_t underflow_md_vc0_credit_in : 1;
- mmr_t underflow_iilb_vc0_credit_in : 1;
- mmr_t underflow_pi_vc0_credit_in : 1;
- mmr_t overflow_ni1_vc2_credit_in : 1;
- mmr_t overflow_ni0_vc2_credit_in : 1;
- mmr_t overflow_md_vc2_credit_in : 1;
- mmr_t overflow_iilb_vc2_credit_in : 1;
- mmr_t overflow_pi_vc2_credit_in : 1;
- mmr_t overflow_ni1_vc0_credit_in : 1;
- mmr_t overflow_ni0_vc0_credit_in : 1;
- mmr_t overflow_md_vc0_credit_in : 1;
- mmr_t overflow_iilb_vc0_credit_in : 1;
- mmr_t overflow_pi_vc0_credit_in : 1;
- mmr_t underflow_lb_vc2 : 1;
- mmr_t underflow_lb_vc0 : 1;
- mmr_t overflow_lb_vc2 : 1;
- mmr_t overflow_lb_vc0 : 1;
- mmr_t underflow_ii_vc2 : 1;
- mmr_t underflow_ii_vc0 : 1;
- mmr_t overflow_ii_vc2 : 1;
- mmr_t overflow_ii_vc0 : 1;
- mmr_t overflow_lb_debit2 : 1;
- mmr_t overflow_lb_debit0 : 1;
- mmr_t overflow_ii_debit2 : 1;
- mmr_t overflow_ii_debit0 : 1;
- } sh_xniilb_first_error_s;
-} sh_xniilb_first_error_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_ERROR_SUMMARY" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_error_summary_u {
mmr_t sh_xnpi_error_summary_regval;
struct {
@@ -17188,70 +9261,11 @@ typedef union sh_xnpi_error_summary_u {
mmr_t reserved_0 : 14;
} sh_xnpi_error_summary_s;
} sh_xnpi_error_summary_u_t;
-#else
-typedef union sh_xnpi_error_summary_u {
- mmr_t sh_xnpi_error_summary_regval;
- struct {
- mmr_t reserved_0 : 14;
- mmr_t overflow_header_cancel_fifo : 1;
- mmr_t overflow_iilb_vc2_credit : 1;
- mmr_t underflow_iilb_vc2_credit : 1;
- mmr_t overflow_iilb_vc0_credit : 1;
- mmr_t underflow_iilb_vc0_credit : 1;
- mmr_t overflow_ni1_vc2_credit : 1;
- mmr_t underflow_ni1_vc2_credit : 1;
- mmr_t overflow_ni1_vc0_credit : 1;
- mmr_t underflow_ni1_vc0_credit : 1;
- mmr_t overflow_ni0_vc2_credit : 1;
- mmr_t underflow_ni0_vc2_credit : 1;
- mmr_t overflow_ni0_vc0_credit : 1;
- mmr_t underflow_ni0_vc0_credit : 1;
- mmr_t overflow_iilb_debit2 : 1;
- mmr_t overflow_iilb_debit0 : 1;
- mmr_t overflow_ni1_debit2 : 1;
- mmr_t overflow_ni1_debit0 : 1;
- mmr_t overflow_ni0_debit2 : 1;
- mmr_t overflow_ni0_debit0 : 1;
- mmr_t overflow_sic_cntr2 : 1;
- mmr_t underflow_sic_cntr2 : 1;
- mmr_t overflow_sic_cntr0 : 1;
- mmr_t underflow_sic_cntr0 : 1;
- mmr_t uncor_error3 : 1;
- mmr_t uncor_error2 : 1;
- mmr_t uncor_error1 : 1;
- mmr_t uncor_error0 : 1;
- mmr_t single_bit_error3 : 1;
- mmr_t single_bit_error2 : 1;
- mmr_t single_bit_error1 : 1;
- mmr_t single_bit_error0 : 1;
- mmr_t lut_read_error : 1;
- mmr_t overflow_databuff_vc2 : 1;
- mmr_t overflow_databuff_vc0 : 1;
- mmr_t overflow_vc2_credit : 1;
- mmr_t underflow_vc2_credit : 1;
- mmr_t overflow_vc0_credit : 1;
- mmr_t underflow_vc0_credit : 1;
- mmr_t overflow_iilb_vc2 : 1;
- mmr_t underflow_iilb_vc2 : 1;
- mmr_t overflow_iilb_vc0 : 1;
- mmr_t underflow_iilb_vc0 : 1;
- mmr_t overflow_ni1_vc2 : 1;
- mmr_t underflow_ni1_vc2 : 1;
- mmr_t overflow_ni1_vc0 : 1;
- mmr_t underflow_ni1_vc0 : 1;
- mmr_t overflow_ni0_vc2 : 1;
- mmr_t underflow_ni0_vc2 : 1;
- mmr_t overflow_ni0_vc0 : 1;
- mmr_t underflow_ni0_vc0 : 1;
- } sh_xnpi_error_summary_s;
-} sh_xnpi_error_summary_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_ERROR_OVERFLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_error_overflow_u {
mmr_t sh_xnpi_error_overflow_regval;
struct {
@@ -17308,70 +9322,11 @@ typedef union sh_xnpi_error_overflow_u {
mmr_t reserved_0 : 14;
} sh_xnpi_error_overflow_s;
} sh_xnpi_error_overflow_u_t;
-#else
-typedef union sh_xnpi_error_overflow_u {
- mmr_t sh_xnpi_error_overflow_regval;
- struct {
- mmr_t reserved_0 : 14;
- mmr_t overflow_header_cancel_fifo : 1;
- mmr_t overflow_iilb_vc2_credit : 1;
- mmr_t underflow_iilb_vc2_credit : 1;
- mmr_t overflow_iilb_vc0_credit : 1;
- mmr_t underflow_iilb_vc0_credit : 1;
- mmr_t overflow_ni1_vc2_credit : 1;
- mmr_t underflow_ni1_vc2_credit : 1;
- mmr_t overflow_ni1_vc0_credit : 1;
- mmr_t underflow_ni1_vc0_credit : 1;
- mmr_t overflow_ni0_vc2_credit : 1;
- mmr_t underflow_ni0_vc2_credit : 1;
- mmr_t overflow_ni0_vc0_credit : 1;
- mmr_t underflow_ni0_vc0_credit : 1;
- mmr_t overflow_iilb_debit2 : 1;
- mmr_t overflow_iilb_debit0 : 1;
- mmr_t overflow_ni1_debit2 : 1;
- mmr_t overflow_ni1_debit0 : 1;
- mmr_t overflow_ni0_debit2 : 1;
- mmr_t overflow_ni0_debit0 : 1;
- mmr_t overflow_sic_cntr2 : 1;
- mmr_t underflow_sic_cntr2 : 1;
- mmr_t overflow_sic_cntr0 : 1;
- mmr_t underflow_sic_cntr0 : 1;
- mmr_t uncor_error3 : 1;
- mmr_t uncor_error2 : 1;
- mmr_t uncor_error1 : 1;
- mmr_t uncor_error0 : 1;
- mmr_t single_bit_error3 : 1;
- mmr_t single_bit_error2 : 1;
- mmr_t single_bit_error1 : 1;
- mmr_t single_bit_error0 : 1;
- mmr_t lut_read_error : 1;
- mmr_t overflow_databuff_vc2 : 1;
- mmr_t overflow_databuff_vc0 : 1;
- mmr_t overflow_vc2_credit : 1;
- mmr_t underflow_vc2_credit : 1;
- mmr_t overflow_vc0_credit : 1;
- mmr_t underflow_vc0_credit : 1;
- mmr_t overflow_iilb_vc2 : 1;
- mmr_t underflow_iilb_vc2 : 1;
- mmr_t overflow_iilb_vc0 : 1;
- mmr_t underflow_iilb_vc0 : 1;
- mmr_t overflow_ni1_vc2 : 1;
- mmr_t underflow_ni1_vc2 : 1;
- mmr_t overflow_ni1_vc0 : 1;
- mmr_t underflow_ni1_vc0 : 1;
- mmr_t overflow_ni0_vc2 : 1;
- mmr_t underflow_ni0_vc2 : 1;
- mmr_t overflow_ni0_vc0 : 1;
- mmr_t underflow_ni0_vc0 : 1;
- } sh_xnpi_error_overflow_s;
-} sh_xnpi_error_overflow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_ERROR_MASK" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_error_mask_u {
mmr_t sh_xnpi_error_mask_regval;
struct {
@@ -17428,70 +9383,11 @@ typedef union sh_xnpi_error_mask_u {
mmr_t reserved_0 : 14;
} sh_xnpi_error_mask_s;
} sh_xnpi_error_mask_u_t;
-#else
-typedef union sh_xnpi_error_mask_u {
- mmr_t sh_xnpi_error_mask_regval;
- struct {
- mmr_t reserved_0 : 14;
- mmr_t overflow_header_cancel_fifo : 1;
- mmr_t overflow_iilb_vc2_credit : 1;
- mmr_t underflow_iilb_vc2_credit : 1;
- mmr_t overflow_iilb_vc0_credit : 1;
- mmr_t underflow_iilb_vc0_credit : 1;
- mmr_t overflow_ni1_vc2_credit : 1;
- mmr_t underflow_ni1_vc2_credit : 1;
- mmr_t overflow_ni1_vc0_credit : 1;
- mmr_t underflow_ni1_vc0_credit : 1;
- mmr_t overflow_ni0_vc2_credit : 1;
- mmr_t underflow_ni0_vc2_credit : 1;
- mmr_t overflow_ni0_vc0_credit : 1;
- mmr_t underflow_ni0_vc0_credit : 1;
- mmr_t overflow_iilb_debit2 : 1;
- mmr_t overflow_iilb_debit0 : 1;
- mmr_t overflow_ni1_debit2 : 1;
- mmr_t overflow_ni1_debit0 : 1;
- mmr_t overflow_ni0_debit2 : 1;
- mmr_t overflow_ni0_debit0 : 1;
- mmr_t overflow_sic_cntr2 : 1;
- mmr_t underflow_sic_cntr2 : 1;
- mmr_t overflow_sic_cntr0 : 1;
- mmr_t underflow_sic_cntr0 : 1;
- mmr_t uncor_error3 : 1;
- mmr_t uncor_error2 : 1;
- mmr_t uncor_error1 : 1;
- mmr_t uncor_error0 : 1;
- mmr_t single_bit_error3 : 1;
- mmr_t single_bit_error2 : 1;
- mmr_t single_bit_error1 : 1;
- mmr_t single_bit_error0 : 1;
- mmr_t lut_read_error : 1;
- mmr_t overflow_databuff_vc2 : 1;
- mmr_t overflow_databuff_vc0 : 1;
- mmr_t overflow_vc2_credit : 1;
- mmr_t underflow_vc2_credit : 1;
- mmr_t overflow_vc0_credit : 1;
- mmr_t underflow_vc0_credit : 1;
- mmr_t overflow_iilb_vc2 : 1;
- mmr_t underflow_iilb_vc2 : 1;
- mmr_t overflow_iilb_vc0 : 1;
- mmr_t underflow_iilb_vc0 : 1;
- mmr_t overflow_ni1_vc2 : 1;
- mmr_t underflow_ni1_vc2 : 1;
- mmr_t overflow_ni1_vc0 : 1;
- mmr_t underflow_ni1_vc0 : 1;
- mmr_t overflow_ni0_vc2 : 1;
- mmr_t underflow_ni0_vc2 : 1;
- mmr_t overflow_ni0_vc0 : 1;
- mmr_t underflow_ni0_vc0 : 1;
- } sh_xnpi_error_mask_s;
-} sh_xnpi_error_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNPI_FIRST_ERROR" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnpi_first_error_u {
mmr_t sh_xnpi_first_error_regval;
struct {
@@ -17548,70 +9444,11 @@ typedef union sh_xnpi_first_error_u {
mmr_t reserved_0 : 14;
} sh_xnpi_first_error_s;
} sh_xnpi_first_error_u_t;
-#else
-typedef union sh_xnpi_first_error_u {
- mmr_t sh_xnpi_first_error_regval;
- struct {
- mmr_t reserved_0 : 14;
- mmr_t overflow_header_cancel_fifo : 1;
- mmr_t overflow_iilb_vc2_credit : 1;
- mmr_t underflow_iilb_vc2_credit : 1;
- mmr_t overflow_iilb_vc0_credit : 1;
- mmr_t underflow_iilb_vc0_credit : 1;
- mmr_t overflow_ni1_vc2_credit : 1;
- mmr_t underflow_ni1_vc2_credit : 1;
- mmr_t overflow_ni1_vc0_credit : 1;
- mmr_t underflow_ni1_vc0_credit : 1;
- mmr_t overflow_ni0_vc2_credit : 1;
- mmr_t underflow_ni0_vc2_credit : 1;
- mmr_t overflow_ni0_vc0_credit : 1;
- mmr_t underflow_ni0_vc0_credit : 1;
- mmr_t overflow_iilb_debit2 : 1;
- mmr_t overflow_iilb_debit0 : 1;
- mmr_t overflow_ni1_debit2 : 1;
- mmr_t overflow_ni1_debit0 : 1;
- mmr_t overflow_ni0_debit2 : 1;
- mmr_t overflow_ni0_debit0 : 1;
- mmr_t overflow_sic_cntr2 : 1;
- mmr_t underflow_sic_cntr2 : 1;
- mmr_t overflow_sic_cntr0 : 1;
- mmr_t underflow_sic_cntr0 : 1;
- mmr_t uncor_error3 : 1;
- mmr_t uncor_error2 : 1;
- mmr_t uncor_error1 : 1;
- mmr_t uncor_error0 : 1;
- mmr_t single_bit_error3 : 1;
- mmr_t single_bit_error2 : 1;
- mmr_t single_bit_error1 : 1;
- mmr_t single_bit_error0 : 1;
- mmr_t lut_read_error : 1;
- mmr_t overflow_databuff_vc2 : 1;
- mmr_t overflow_databuff_vc0 : 1;
- mmr_t overflow_vc2_credit : 1;
- mmr_t underflow_vc2_credit : 1;
- mmr_t overflow_vc0_credit : 1;
- mmr_t underflow_vc0_credit : 1;
- mmr_t overflow_iilb_vc2 : 1;
- mmr_t underflow_iilb_vc2 : 1;
- mmr_t overflow_iilb_vc0 : 1;
- mmr_t underflow_iilb_vc0 : 1;
- mmr_t overflow_ni1_vc2 : 1;
- mmr_t underflow_ni1_vc2 : 1;
- mmr_t overflow_ni1_vc0 : 1;
- mmr_t underflow_ni1_vc0 : 1;
- mmr_t overflow_ni0_vc2 : 1;
- mmr_t underflow_ni0_vc2 : 1;
- mmr_t overflow_ni0_vc0 : 1;
- mmr_t underflow_ni0_vc0 : 1;
- } sh_xnpi_first_error_s;
-} sh_xnpi_first_error_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_ERROR_SUMMARY" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_error_summary_u {
mmr_t sh_xnmd_error_summary_regval;
struct {
@@ -17668,70 +9505,11 @@ typedef union sh_xnmd_error_summary_u {
mmr_t reserved_0 : 14;
} sh_xnmd_error_summary_s;
} sh_xnmd_error_summary_u_t;
-#else
-typedef union sh_xnmd_error_summary_u {
- mmr_t sh_xnmd_error_summary_regval;
- struct {
- mmr_t reserved_0 : 14;
- mmr_t overflow_header_cancel_fifo : 1;
- mmr_t overflow_iilb_vc2_credit : 1;
- mmr_t underflow_iilb_vc2_credit : 1;
- mmr_t overflow_iilb_vc0_credit : 1;
- mmr_t underflow_iilb_vc0_credit : 1;
- mmr_t overflow_ni1_vc2_credit : 1;
- mmr_t underflow_ni1_vc2_credit : 1;
- mmr_t overflow_ni1_vc0_credit : 1;
- mmr_t underflow_ni1_vc0_credit : 1;
- mmr_t overflow_ni0_vc2_credit : 1;
- mmr_t underflow_ni0_vc2_credit : 1;
- mmr_t overflow_ni0_vc0_credit : 1;
- mmr_t underflow_ni0_vc0_credit : 1;
- mmr_t overflow_iilb_debit2 : 1;
- mmr_t overflow_iilb_debit0 : 1;
- mmr_t overflow_ni1_debit2 : 1;
- mmr_t overflow_ni1_debit0 : 1;
- mmr_t overflow_ni0_debit2 : 1;
- mmr_t overflow_ni0_debit0 : 1;
- mmr_t overflow_sic_cntr2 : 1;
- mmr_t underflow_sic_cntr2 : 1;
- mmr_t overflow_sic_cntr0 : 1;
- mmr_t underflow_sic_cntr0 : 1;
- mmr_t uncor_error3 : 1;
- mmr_t uncor_error2 : 1;
- mmr_t uncor_error1 : 1;
- mmr_t uncor_error0 : 1;
- mmr_t single_bit_error3 : 1;
- mmr_t single_bit_error2 : 1;
- mmr_t single_bit_error1 : 1;
- mmr_t single_bit_error0 : 1;
- mmr_t lut_read_error : 1;
- mmr_t overflow_databuff_vc2 : 1;
- mmr_t overflow_databuff_vc0 : 1;
- mmr_t overflow_vc2_credit : 1;
- mmr_t underflow_vc2_credit : 1;
- mmr_t overflow_vc0_credit : 1;
- mmr_t underflow_vc0_credit : 1;
- mmr_t overflow_iilb_vc2 : 1;
- mmr_t underflow_iilb_vc2 : 1;
- mmr_t overflow_iilb_vc0 : 1;
- mmr_t underflow_iilb_vc0 : 1;
- mmr_t overflow_ni1_vc2 : 1;
- mmr_t underflow_ni1_vc2 : 1;
- mmr_t overflow_ni1_vc0 : 1;
- mmr_t underflow_ni1_vc0 : 1;
- mmr_t overflow_ni0_vc2 : 1;
- mmr_t underflow_ni0_vc2 : 1;
- mmr_t overflow_ni0_vc0 : 1;
- mmr_t underflow_ni0_vc0 : 1;
- } sh_xnmd_error_summary_s;
-} sh_xnmd_error_summary_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_ERROR_OVERFLOW" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_error_overflow_u {
mmr_t sh_xnmd_error_overflow_regval;
struct {
@@ -17788,70 +9566,11 @@ typedef union sh_xnmd_error_overflow_u {
mmr_t reserved_0 : 14;
} sh_xnmd_error_overflow_s;
} sh_xnmd_error_overflow_u_t;
-#else
-typedef union sh_xnmd_error_overflow_u {
- mmr_t sh_xnmd_error_overflow_regval;
- struct {
- mmr_t reserved_0 : 14;
- mmr_t overflow_header_cancel_fifo : 1;
- mmr_t overflow_iilb_vc2_credit : 1;
- mmr_t underflow_iilb_vc2_credit : 1;
- mmr_t overflow_iilb_vc0_credit : 1;
- mmr_t underflow_iilb_vc0_credit : 1;
- mmr_t overflow_ni1_vc2_credit : 1;
- mmr_t underflow_ni1_vc2_credit : 1;
- mmr_t overflow_ni1_vc0_credit : 1;
- mmr_t underflow_ni1_vc0_credit : 1;
- mmr_t overflow_ni0_vc2_credit : 1;
- mmr_t underflow_ni0_vc2_credit : 1;
- mmr_t overflow_ni0_vc0_credit : 1;
- mmr_t underflow_ni0_vc0_credit : 1;
- mmr_t overflow_iilb_debit2 : 1;
- mmr_t overflow_iilb_debit0 : 1;
- mmr_t overflow_ni1_debit2 : 1;
- mmr_t overflow_ni1_debit0 : 1;
- mmr_t overflow_ni0_debit2 : 1;
- mmr_t overflow_ni0_debit0 : 1;
- mmr_t overflow_sic_cntr2 : 1;
- mmr_t underflow_sic_cntr2 : 1;
- mmr_t overflow_sic_cntr0 : 1;
- mmr_t underflow_sic_cntr0 : 1;
- mmr_t uncor_error3 : 1;
- mmr_t uncor_error2 : 1;
- mmr_t uncor_error1 : 1;
- mmr_t uncor_error0 : 1;
- mmr_t single_bit_error3 : 1;
- mmr_t single_bit_error2 : 1;
- mmr_t single_bit_error1 : 1;
- mmr_t single_bit_error0 : 1;
- mmr_t lut_read_error : 1;
- mmr_t overflow_databuff_vc2 : 1;
- mmr_t overflow_databuff_vc0 : 1;
- mmr_t overflow_vc2_credit : 1;
- mmr_t underflow_vc2_credit : 1;
- mmr_t overflow_vc0_credit : 1;
- mmr_t underflow_vc0_credit : 1;
- mmr_t overflow_iilb_vc2 : 1;
- mmr_t underflow_iilb_vc2 : 1;
- mmr_t overflow_iilb_vc0 : 1;
- mmr_t underflow_iilb_vc0 : 1;
- mmr_t overflow_ni1_vc2 : 1;
- mmr_t underflow_ni1_vc2 : 1;
- mmr_t overflow_ni1_vc0 : 1;
- mmr_t underflow_ni1_vc0 : 1;
- mmr_t overflow_ni0_vc2 : 1;
- mmr_t underflow_ni0_vc2 : 1;
- mmr_t overflow_ni0_vc0 : 1;
- mmr_t underflow_ni0_vc0 : 1;
- } sh_xnmd_error_overflow_s;
-} sh_xnmd_error_overflow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_ERROR_MASK" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_error_mask_u {
mmr_t sh_xnmd_error_mask_regval;
struct {
@@ -17908,70 +9627,11 @@ typedef union sh_xnmd_error_mask_u {
mmr_t reserved_0 : 14;
} sh_xnmd_error_mask_s;
} sh_xnmd_error_mask_u_t;
-#else
-typedef union sh_xnmd_error_mask_u {
- mmr_t sh_xnmd_error_mask_regval;
- struct {
- mmr_t reserved_0 : 14;
- mmr_t overflow_header_cancel_fifo : 1;
- mmr_t overflow_iilb_vc2_credit : 1;
- mmr_t underflow_iilb_vc2_credit : 1;
- mmr_t overflow_iilb_vc0_credit : 1;
- mmr_t underflow_iilb_vc0_credit : 1;
- mmr_t overflow_ni1_vc2_credit : 1;
- mmr_t underflow_ni1_vc2_credit : 1;
- mmr_t overflow_ni1_vc0_credit : 1;
- mmr_t underflow_ni1_vc0_credit : 1;
- mmr_t overflow_ni0_vc2_credit : 1;
- mmr_t underflow_ni0_vc2_credit : 1;
- mmr_t overflow_ni0_vc0_credit : 1;
- mmr_t underflow_ni0_vc0_credit : 1;
- mmr_t overflow_iilb_debit2 : 1;
- mmr_t overflow_iilb_debit0 : 1;
- mmr_t overflow_ni1_debit2 : 1;
- mmr_t overflow_ni1_debit0 : 1;
- mmr_t overflow_ni0_debit2 : 1;
- mmr_t overflow_ni0_debit0 : 1;
- mmr_t overflow_sic_cntr2 : 1;
- mmr_t underflow_sic_cntr2 : 1;
- mmr_t overflow_sic_cntr0 : 1;
- mmr_t underflow_sic_cntr0 : 1;
- mmr_t uncor_error3 : 1;
- mmr_t uncor_error2 : 1;
- mmr_t uncor_error1 : 1;
- mmr_t uncor_error0 : 1;
- mmr_t single_bit_error3 : 1;
- mmr_t single_bit_error2 : 1;
- mmr_t single_bit_error1 : 1;
- mmr_t single_bit_error0 : 1;
- mmr_t lut_read_error : 1;
- mmr_t overflow_databuff_vc2 : 1;
- mmr_t overflow_databuff_vc0 : 1;
- mmr_t overflow_vc2_credit : 1;
- mmr_t underflow_vc2_credit : 1;
- mmr_t overflow_vc0_credit : 1;
- mmr_t underflow_vc0_credit : 1;
- mmr_t overflow_iilb_vc2 : 1;
- mmr_t underflow_iilb_vc2 : 1;
- mmr_t overflow_iilb_vc0 : 1;
- mmr_t underflow_iilb_vc0 : 1;
- mmr_t overflow_ni1_vc2 : 1;
- mmr_t underflow_ni1_vc2 : 1;
- mmr_t overflow_ni1_vc0 : 1;
- mmr_t underflow_ni1_vc0 : 1;
- mmr_t overflow_ni0_vc2 : 1;
- mmr_t underflow_ni0_vc2 : 1;
- mmr_t overflow_ni0_vc0 : 1;
- mmr_t underflow_ni0_vc0 : 1;
- } sh_xnmd_error_mask_s;
-} sh_xnmd_error_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XNMD_FIRST_ERROR" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xnmd_first_error_u {
mmr_t sh_xnmd_first_error_regval;
struct {
@@ -18028,155 +9688,60 @@ typedef union sh_xnmd_first_error_u {
mmr_t reserved_0 : 14;
} sh_xnmd_first_error_s;
} sh_xnmd_first_error_u_t;
-#else
-typedef union sh_xnmd_first_error_u {
- mmr_t sh_xnmd_first_error_regval;
- struct {
- mmr_t reserved_0 : 14;
- mmr_t overflow_header_cancel_fifo : 1;
- mmr_t overflow_iilb_vc2_credit : 1;
- mmr_t underflow_iilb_vc2_credit : 1;
- mmr_t overflow_iilb_vc0_credit : 1;
- mmr_t underflow_iilb_vc0_credit : 1;
- mmr_t overflow_ni1_vc2_credit : 1;
- mmr_t underflow_ni1_vc2_credit : 1;
- mmr_t overflow_ni1_vc0_credit : 1;
- mmr_t underflow_ni1_vc0_credit : 1;
- mmr_t overflow_ni0_vc2_credit : 1;
- mmr_t underflow_ni0_vc2_credit : 1;
- mmr_t overflow_ni0_vc0_credit : 1;
- mmr_t underflow_ni0_vc0_credit : 1;
- mmr_t overflow_iilb_debit2 : 1;
- mmr_t overflow_iilb_debit0 : 1;
- mmr_t overflow_ni1_debit2 : 1;
- mmr_t overflow_ni1_debit0 : 1;
- mmr_t overflow_ni0_debit2 : 1;
- mmr_t overflow_ni0_debit0 : 1;
- mmr_t overflow_sic_cntr2 : 1;
- mmr_t underflow_sic_cntr2 : 1;
- mmr_t overflow_sic_cntr0 : 1;
- mmr_t underflow_sic_cntr0 : 1;
- mmr_t uncor_error3 : 1;
- mmr_t uncor_error2 : 1;
- mmr_t uncor_error1 : 1;
- mmr_t uncor_error0 : 1;
- mmr_t single_bit_error3 : 1;
- mmr_t single_bit_error2 : 1;
- mmr_t single_bit_error1 : 1;
- mmr_t single_bit_error0 : 1;
- mmr_t lut_read_error : 1;
- mmr_t overflow_databuff_vc2 : 1;
- mmr_t overflow_databuff_vc0 : 1;
- mmr_t overflow_vc2_credit : 1;
- mmr_t underflow_vc2_credit : 1;
- mmr_t overflow_vc0_credit : 1;
- mmr_t underflow_vc0_credit : 1;
- mmr_t overflow_iilb_vc2 : 1;
- mmr_t underflow_iilb_vc2 : 1;
- mmr_t overflow_iilb_vc0 : 1;
- mmr_t underflow_iilb_vc0 : 1;
- mmr_t overflow_ni1_vc2 : 1;
- mmr_t underflow_ni1_vc2 : 1;
- mmr_t overflow_ni1_vc0 : 1;
- mmr_t underflow_ni1_vc0 : 1;
- mmr_t overflow_ni0_vc2 : 1;
- mmr_t underflow_ni0_vc2 : 1;
- mmr_t overflow_ni0_vc0 : 1;
- mmr_t underflow_ni0_vc0 : 1;
- } sh_xnmd_first_error_s;
-} sh_xnmd_first_error_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_AUTO_REPLY_ENABLE0" */
/* Automatic Maintenance Reply Enable 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_auto_reply_enable0_u {
- mmr_t sh_auto_reply_enable0_regval;
- struct {
- mmr_t enable0 : 64;
- } sh_auto_reply_enable0_s;
-} sh_auto_reply_enable0_u_t;
-#else
typedef union sh_auto_reply_enable0_u {
mmr_t sh_auto_reply_enable0_regval;
struct {
mmr_t enable0 : 64;
} sh_auto_reply_enable0_s;
} sh_auto_reply_enable0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_AUTO_REPLY_ENABLE1" */
/* Automatic Maintenance Reply Enable 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_auto_reply_enable1_u {
- mmr_t sh_auto_reply_enable1_regval;
- struct {
- mmr_t enable1 : 64;
- } sh_auto_reply_enable1_s;
-} sh_auto_reply_enable1_u_t;
-#else
typedef union sh_auto_reply_enable1_u {
mmr_t sh_auto_reply_enable1_regval;
struct {
mmr_t enable1 : 64;
} sh_auto_reply_enable1_s;
} sh_auto_reply_enable1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_AUTO_REPLY_HEADER0" */
/* Automatic Maintenance Reply Header 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_auto_reply_header0_u {
- mmr_t sh_auto_reply_header0_regval;
- struct {
- mmr_t header0 : 64;
- } sh_auto_reply_header0_s;
-} sh_auto_reply_header0_u_t;
-#else
typedef union sh_auto_reply_header0_u {
mmr_t sh_auto_reply_header0_regval;
struct {
mmr_t header0 : 64;
} sh_auto_reply_header0_s;
} sh_auto_reply_header0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_AUTO_REPLY_HEADER1" */
/* Automatic Maintenance Reply Header 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_auto_reply_header1_u {
- mmr_t sh_auto_reply_header1_regval;
- struct {
- mmr_t header1 : 64;
- } sh_auto_reply_header1_s;
-} sh_auto_reply_header1_u_t;
-#else
typedef union sh_auto_reply_header1_u {
mmr_t sh_auto_reply_header1_regval;
struct {
mmr_t header1 : 64;
} sh_auto_reply_header1_s;
} sh_auto_reply_header1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_ENABLE_RP_AUTO_REPLY" */
/* Enable Automatic Maintenance Reply From Reply Queue */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_enable_rp_auto_reply_u {
mmr_t sh_enable_rp_auto_reply_regval;
struct {
@@ -18184,22 +9749,12 @@ typedef union sh_enable_rp_auto_reply_u {
mmr_t reserved_0 : 63;
} sh_enable_rp_auto_reply_s;
} sh_enable_rp_auto_reply_u_t;
-#else
-typedef union sh_enable_rp_auto_reply_u {
- mmr_t sh_enable_rp_auto_reply_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t enable : 1;
- } sh_enable_rp_auto_reply_s;
-} sh_enable_rp_auto_reply_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_ENABLE_RQ_AUTO_REPLY" */
/* Enable Automatic Maintenance Reply From Request Queue */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_enable_rq_auto_reply_u {
mmr_t sh_enable_rq_auto_reply_regval;
struct {
@@ -18207,22 +9762,12 @@ typedef union sh_enable_rq_auto_reply_u {
mmr_t reserved_0 : 63;
} sh_enable_rq_auto_reply_s;
} sh_enable_rq_auto_reply_u_t;
-#else
-typedef union sh_enable_rq_auto_reply_u {
- mmr_t sh_enable_rq_auto_reply_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t enable : 1;
- } sh_enable_rq_auto_reply_s;
-} sh_enable_rq_auto_reply_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_REDIRECT_INVAL" */
/* Redirect invalidate to LB instead of PI */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_redirect_inval_u {
mmr_t sh_redirect_inval_regval;
struct {
@@ -18230,22 +9775,12 @@ typedef union sh_redirect_inval_u {
mmr_t reserved_0 : 63;
} sh_redirect_inval_s;
} sh_redirect_inval_u_t;
-#else
-typedef union sh_redirect_inval_u {
- mmr_t sh_redirect_inval_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t redirect : 1;
- } sh_redirect_inval_s;
-} sh_redirect_inval_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_CNTRL" */
/* Diagnostic Message Control Register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_diag_msg_cntrl_u {
mmr_t sh_diag_msg_cntrl_regval;
struct {
@@ -18258,447 +9793,252 @@ typedef union sh_diag_msg_cntrl_u {
mmr_t busy : 1;
} sh_diag_msg_cntrl_s;
} sh_diag_msg_cntrl_u_t;
-#else
-typedef union sh_diag_msg_cntrl_u {
- mmr_t sh_diag_msg_cntrl_regval;
- struct {
- mmr_t busy : 1;
- mmr_t start : 1;
- mmr_t reserved_0 : 48;
- mmr_t port : 1;
- mmr_t error_inject_enable : 1;
- mmr_t error_inject_point : 6;
- mmr_t msg_length : 6;
- } sh_diag_msg_cntrl_s;
-} sh_diag_msg_cntrl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA0L" */
/* Diagnostic Data, lower 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data0l_u {
- mmr_t sh_diag_msg_data0l_regval;
- struct {
- mmr_t data_lower : 64;
- } sh_diag_msg_data0l_s;
-} sh_diag_msg_data0l_u_t;
-#else
typedef union sh_diag_msg_data0l_u {
mmr_t sh_diag_msg_data0l_regval;
struct {
mmr_t data_lower : 64;
} sh_diag_msg_data0l_s;
} sh_diag_msg_data0l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA0U" */
/* Diagnostice Data, upper 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data0u_u {
- mmr_t sh_diag_msg_data0u_regval;
- struct {
- mmr_t data_upper : 64;
- } sh_diag_msg_data0u_s;
-} sh_diag_msg_data0u_u_t;
-#else
typedef union sh_diag_msg_data0u_u {
mmr_t sh_diag_msg_data0u_regval;
struct {
mmr_t data_upper : 64;
} sh_diag_msg_data0u_s;
} sh_diag_msg_data0u_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA1L" */
/* Diagnostic Data, lower 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_diag_msg_data1l_u {
mmr_t sh_diag_msg_data1l_regval;
struct {
mmr_t data_lower : 64;
} sh_diag_msg_data1l_s;
} sh_diag_msg_data1l_u_t;
-#else
-typedef union sh_diag_msg_data1l_u {
- mmr_t sh_diag_msg_data1l_regval;
- struct {
- mmr_t data_lower : 64;
- } sh_diag_msg_data1l_s;
-} sh_diag_msg_data1l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA1U" */
/* Diagnostice Data, upper 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data1u_u {
- mmr_t sh_diag_msg_data1u_regval;
- struct {
- mmr_t data_upper : 64;
- } sh_diag_msg_data1u_s;
-} sh_diag_msg_data1u_u_t;
-#else
typedef union sh_diag_msg_data1u_u {
mmr_t sh_diag_msg_data1u_regval;
struct {
mmr_t data_upper : 64;
} sh_diag_msg_data1u_s;
} sh_diag_msg_data1u_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA2L" */
/* Diagnostic Data, lower 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data2l_u {
- mmr_t sh_diag_msg_data2l_regval;
- struct {
- mmr_t data_lower : 64;
- } sh_diag_msg_data2l_s;
-} sh_diag_msg_data2l_u_t;
-#else
typedef union sh_diag_msg_data2l_u {
mmr_t sh_diag_msg_data2l_regval;
struct {
mmr_t data_lower : 64;
} sh_diag_msg_data2l_s;
} sh_diag_msg_data2l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA2U" */
/* Diagnostice Data, upper 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data2u_u {
- mmr_t sh_diag_msg_data2u_regval;
- struct {
- mmr_t data_upper : 64;
- } sh_diag_msg_data2u_s;
-} sh_diag_msg_data2u_u_t;
-#else
typedef union sh_diag_msg_data2u_u {
mmr_t sh_diag_msg_data2u_regval;
struct {
mmr_t data_upper : 64;
} sh_diag_msg_data2u_s;
} sh_diag_msg_data2u_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA3L" */
/* Diagnostic Data, lower 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data3l_u {
- mmr_t sh_diag_msg_data3l_regval;
- struct {
- mmr_t data_lower : 64;
- } sh_diag_msg_data3l_s;
-} sh_diag_msg_data3l_u_t;
-#else
typedef union sh_diag_msg_data3l_u {
mmr_t sh_diag_msg_data3l_regval;
struct {
mmr_t data_lower : 64;
} sh_diag_msg_data3l_s;
} sh_diag_msg_data3l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA3U" */
/* Diagnostice Data, upper 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data3u_u {
- mmr_t sh_diag_msg_data3u_regval;
- struct {
- mmr_t data_upper : 64;
- } sh_diag_msg_data3u_s;
-} sh_diag_msg_data3u_u_t;
-#else
typedef union sh_diag_msg_data3u_u {
mmr_t sh_diag_msg_data3u_regval;
struct {
mmr_t data_upper : 64;
} sh_diag_msg_data3u_s;
} sh_diag_msg_data3u_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA4L" */
/* Diagnostic Data, lower 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data4l_u {
- mmr_t sh_diag_msg_data4l_regval;
- struct {
- mmr_t data_lower : 64;
- } sh_diag_msg_data4l_s;
-} sh_diag_msg_data4l_u_t;
-#else
typedef union sh_diag_msg_data4l_u {
mmr_t sh_diag_msg_data4l_regval;
struct {
mmr_t data_lower : 64;
} sh_diag_msg_data4l_s;
} sh_diag_msg_data4l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA4U" */
/* Diagnostice Data, upper 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_diag_msg_data4u_u {
mmr_t sh_diag_msg_data4u_regval;
struct {
mmr_t data_upper : 64;
} sh_diag_msg_data4u_s;
} sh_diag_msg_data4u_u_t;
-#else
-typedef union sh_diag_msg_data4u_u {
- mmr_t sh_diag_msg_data4u_regval;
- struct {
- mmr_t data_upper : 64;
- } sh_diag_msg_data4u_s;
-} sh_diag_msg_data4u_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA5L" */
/* Diagnostic Data, lower 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data5l_u {
- mmr_t sh_diag_msg_data5l_regval;
- struct {
- mmr_t data_lower : 64;
- } sh_diag_msg_data5l_s;
-} sh_diag_msg_data5l_u_t;
-#else
typedef union sh_diag_msg_data5l_u {
mmr_t sh_diag_msg_data5l_regval;
struct {
mmr_t data_lower : 64;
} sh_diag_msg_data5l_s;
} sh_diag_msg_data5l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA5U" */
/* Diagnostice Data, upper 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data5u_u {
- mmr_t sh_diag_msg_data5u_regval;
- struct {
- mmr_t data_upper : 64;
- } sh_diag_msg_data5u_s;
-} sh_diag_msg_data5u_u_t;
-#else
typedef union sh_diag_msg_data5u_u {
mmr_t sh_diag_msg_data5u_regval;
struct {
mmr_t data_upper : 64;
} sh_diag_msg_data5u_s;
} sh_diag_msg_data5u_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA6L" */
/* Diagnostic Data, lower 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_diag_msg_data6l_u {
mmr_t sh_diag_msg_data6l_regval;
struct {
mmr_t data_lower : 64;
} sh_diag_msg_data6l_s;
} sh_diag_msg_data6l_u_t;
-#else
-typedef union sh_diag_msg_data6l_u {
- mmr_t sh_diag_msg_data6l_regval;
- struct {
- mmr_t data_lower : 64;
- } sh_diag_msg_data6l_s;
-} sh_diag_msg_data6l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA6U" */
/* Diagnostice Data, upper 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data6u_u {
- mmr_t sh_diag_msg_data6u_regval;
- struct {
- mmr_t data_upper : 64;
- } sh_diag_msg_data6u_s;
-} sh_diag_msg_data6u_u_t;
-#else
typedef union sh_diag_msg_data6u_u {
mmr_t sh_diag_msg_data6u_regval;
struct {
mmr_t data_upper : 64;
} sh_diag_msg_data6u_s;
} sh_diag_msg_data6u_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA7L" */
/* Diagnostic Data, lower 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_diag_msg_data7l_u {
mmr_t sh_diag_msg_data7l_regval;
struct {
mmr_t data_lower : 64;
} sh_diag_msg_data7l_s;
} sh_diag_msg_data7l_u_t;
-#else
-typedef union sh_diag_msg_data7l_u {
- mmr_t sh_diag_msg_data7l_regval;
- struct {
- mmr_t data_lower : 64;
- } sh_diag_msg_data7l_s;
-} sh_diag_msg_data7l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA7U" */
/* Diagnostice Data, upper 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data7u_u {
- mmr_t sh_diag_msg_data7u_regval;
- struct {
- mmr_t data_upper : 64;
- } sh_diag_msg_data7u_s;
-} sh_diag_msg_data7u_u_t;
-#else
typedef union sh_diag_msg_data7u_u {
mmr_t sh_diag_msg_data7u_regval;
struct {
mmr_t data_upper : 64;
} sh_diag_msg_data7u_s;
} sh_diag_msg_data7u_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA8L" */
/* Diagnostic Data, lower 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_diag_msg_data8l_u {
mmr_t sh_diag_msg_data8l_regval;
struct {
mmr_t data_lower : 64;
} sh_diag_msg_data8l_s;
} sh_diag_msg_data8l_u_t;
-#else
-typedef union sh_diag_msg_data8l_u {
- mmr_t sh_diag_msg_data8l_regval;
- struct {
- mmr_t data_lower : 64;
- } sh_diag_msg_data8l_s;
-} sh_diag_msg_data8l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_DATA8U" */
/* Diagnostice Data, upper 64 bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_data8u_u {
- mmr_t sh_diag_msg_data8u_regval;
- struct {
- mmr_t data_upper : 64;
- } sh_diag_msg_data8u_s;
-} sh_diag_msg_data8u_u_t;
-#else
typedef union sh_diag_msg_data8u_u {
mmr_t sh_diag_msg_data8u_regval;
struct {
mmr_t data_upper : 64;
} sh_diag_msg_data8u_s;
} sh_diag_msg_data8u_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_HDR0" */
/* Diagnostice Data, lower 64 bits of header */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_hdr0_u {
- mmr_t sh_diag_msg_hdr0_regval;
- struct {
- mmr_t header0 : 64;
- } sh_diag_msg_hdr0_s;
-} sh_diag_msg_hdr0_u_t;
-#else
typedef union sh_diag_msg_hdr0_u {
mmr_t sh_diag_msg_hdr0_regval;
struct {
mmr_t header0 : 64;
} sh_diag_msg_hdr0_s;
} sh_diag_msg_hdr0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIAG_MSG_HDR1" */
/* Diagnostice Data, upper 64 bits of header */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_diag_msg_hdr1_u {
- mmr_t sh_diag_msg_hdr1_regval;
- struct {
- mmr_t header1 : 64;
- } sh_diag_msg_hdr1_s;
-} sh_diag_msg_hdr1_u_t;
-#else
typedef union sh_diag_msg_hdr1_u {
mmr_t sh_diag_msg_hdr1_regval;
struct {
mmr_t header1 : 64;
} sh_diag_msg_hdr1_s;
} sh_diag_msg_hdr1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DEBUG_SELECT" */
/* SHub Debug Port Select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_debug_select_u {
mmr_t sh_debug_select_regval;
struct {
@@ -18724,40 +10064,12 @@ typedef union sh_debug_select_u {
mmr_t trigger_enable : 1;
} sh_debug_select_s;
} sh_debug_select_u_t;
-#else
-typedef union sh_debug_select_u {
- mmr_t sh_debug_select_regval;
- struct {
- mmr_t trigger_enable : 1;
- mmr_t reserved_0 : 3;
- mmr_t sel_ii : 9;
- mmr_t debug_ii_sel : 3;
- mmr_t nibble7_chiplet_sel : 3;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t nibble6_chiplet_sel : 3;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t nibble5_chiplet_sel : 3;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t nibble4_chiplet_sel : 3;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t nibble3_chiplet_sel : 3;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t nibble2_chiplet_sel : 3;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t nibble1_chiplet_sel : 3;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t nibble0_chiplet_sel : 3;
- mmr_t nibble0_nibble_sel : 3;
- } sh_debug_select_s;
-} sh_debug_select_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TRIGGER_COMPARE_MASK" */
/* SHub Trigger Compare Mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_trigger_compare_mask_u {
mmr_t sh_trigger_compare_mask_regval;
struct {
@@ -18765,22 +10077,12 @@ typedef union sh_trigger_compare_mask_u {
mmr_t reserved_0 : 32;
} sh_trigger_compare_mask_s;
} sh_trigger_compare_mask_u_t;
-#else
-typedef union sh_trigger_compare_mask_u {
- mmr_t sh_trigger_compare_mask_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t mask : 32;
- } sh_trigger_compare_mask_s;
-} sh_trigger_compare_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TRIGGER_COMPARE_PATTERN" */
/* SHub Trigger Compare Pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_trigger_compare_pattern_u {
mmr_t sh_trigger_compare_pattern_regval;
struct {
@@ -18788,22 +10090,12 @@ typedef union sh_trigger_compare_pattern_u {
mmr_t reserved_0 : 32;
} sh_trigger_compare_pattern_s;
} sh_trigger_compare_pattern_u_t;
-#else
-typedef union sh_trigger_compare_pattern_u {
- mmr_t sh_trigger_compare_pattern_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t data : 32;
- } sh_trigger_compare_pattern_s;
-} sh_trigger_compare_pattern_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TRIGGER_SEL" */
/* Trigger select for SHUB debug port */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_trigger_sel_u {
mmr_t sh_trigger_sel_regval;
struct {
@@ -18841,52 +10133,12 @@ typedef union sh_trigger_sel_u {
mmr_t reserved_15 : 1;
} sh_trigger_sel_s;
} sh_trigger_sel_u_t;
-#else
-typedef union sh_trigger_sel_u {
- mmr_t sh_trigger_sel_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t nibble7_nibble_sel : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_input_sel : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble_sel : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_input_sel : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble_sel : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_input_sel : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble_sel : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_input_sel : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_input_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_input_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_input_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_input_sel : 3;
- } sh_trigger_sel_s;
-} sh_trigger_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_STOP_CLK_CONTROL" */
/* Stop Clock Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_stop_clk_control_u {
mmr_t sh_stop_clk_control_regval;
struct {
@@ -18897,25 +10149,12 @@ typedef union sh_stop_clk_control_u {
mmr_t reserved_0 : 56;
} sh_stop_clk_control_s;
} sh_stop_clk_control_u_t;
-#else
-typedef union sh_stop_clk_control_u {
- mmr_t sh_stop_clk_control_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t mode : 1;
- mmr_t polarity : 1;
- mmr_t event : 1;
- mmr_t stimulus : 5;
- } sh_stop_clk_control_s;
-} sh_stop_clk_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_STOP_CLK_DELAY_PHASE" */
/* Stop Clock Delay Phase */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_stop_clk_delay_phase_u {
mmr_t sh_stop_clk_delay_phase_regval;
struct {
@@ -18923,43 +10162,24 @@ typedef union sh_stop_clk_delay_phase_u {
mmr_t reserved_0 : 56;
} sh_stop_clk_delay_phase_s;
} sh_stop_clk_delay_phase_u_t;
-#else
-typedef union sh_stop_clk_delay_phase_u {
- mmr_t sh_stop_clk_delay_phase_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t delay : 8;
- } sh_stop_clk_delay_phase_s;
-} sh_stop_clk_delay_phase_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_ARM_MASK" */
/* Trigger sequencing facility arm mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_tsf_arm_mask_u {
mmr_t sh_tsf_arm_mask_regval;
struct {
mmr_t mask : 64;
} sh_tsf_arm_mask_s;
} sh_tsf_arm_mask_u_t;
-#else
-typedef union sh_tsf_arm_mask_u {
- mmr_t sh_tsf_arm_mask_regval;
- struct {
- mmr_t mask : 64;
- } sh_tsf_arm_mask_s;
-} sh_tsf_arm_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_COUNTER_PRESETS" */
/* Trigger sequencing facility counter presets */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_tsf_counter_presets_u {
mmr_t sh_tsf_counter_presets_regval;
struct {
@@ -18969,24 +10189,12 @@ typedef union sh_tsf_counter_presets_u {
mmr_t count_8a : 8;
} sh_tsf_counter_presets_s;
} sh_tsf_counter_presets_u_t;
-#else
-typedef union sh_tsf_counter_presets_u {
- mmr_t sh_tsf_counter_presets_regval;
- struct {
- mmr_t count_8a : 8;
- mmr_t count_8b : 8;
- mmr_t count_16 : 16;
- mmr_t count_32 : 32;
- } sh_tsf_counter_presets_s;
-} sh_tsf_counter_presets_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_DECREMENT_CTL" */
/* Trigger sequencing facility counter decrement control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_tsf_decrement_ctl_u {
mmr_t sh_tsf_decrement_ctl_regval;
struct {
@@ -18994,22 +10202,12 @@ typedef union sh_tsf_decrement_ctl_u {
mmr_t reserved_0 : 48;
} sh_tsf_decrement_ctl_s;
} sh_tsf_decrement_ctl_u_t;
-#else
-typedef union sh_tsf_decrement_ctl_u {
- mmr_t sh_tsf_decrement_ctl_regval;
- struct {
- mmr_t reserved_0 : 48;
- mmr_t ctl : 16;
- } sh_tsf_decrement_ctl_s;
-} sh_tsf_decrement_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_DIAG_MSG_CTL" */
/* Trigger sequencing facility diagnostic message control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_tsf_diag_msg_ctl_u {
mmr_t sh_tsf_diag_msg_ctl_regval;
struct {
@@ -19017,43 +10215,24 @@ typedef union sh_tsf_diag_msg_ctl_u {
mmr_t reserved_0 : 56;
} sh_tsf_diag_msg_ctl_s;
} sh_tsf_diag_msg_ctl_u_t;
-#else
-typedef union sh_tsf_diag_msg_ctl_u {
- mmr_t sh_tsf_diag_msg_ctl_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t enable : 8;
- } sh_tsf_diag_msg_ctl_s;
-} sh_tsf_diag_msg_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_DISARM_MASK" */
/* Trigger sequencing facility disarm mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_tsf_disarm_mask_u {
mmr_t sh_tsf_disarm_mask_regval;
struct {
mmr_t mask : 64;
} sh_tsf_disarm_mask_s;
} sh_tsf_disarm_mask_u_t;
-#else
-typedef union sh_tsf_disarm_mask_u {
- mmr_t sh_tsf_disarm_mask_regval;
- struct {
- mmr_t mask : 64;
- } sh_tsf_disarm_mask_s;
-} sh_tsf_disarm_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_ENABLE_CTL" */
/* Trigger sequencing facility counter enable control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_tsf_enable_ctl_u {
mmr_t sh_tsf_enable_ctl_regval;
struct {
@@ -19061,22 +10240,12 @@ typedef union sh_tsf_enable_ctl_u {
mmr_t reserved_0 : 48;
} sh_tsf_enable_ctl_s;
} sh_tsf_enable_ctl_u_t;
-#else
-typedef union sh_tsf_enable_ctl_u {
- mmr_t sh_tsf_enable_ctl_regval;
- struct {
- mmr_t reserved_0 : 48;
- mmr_t ctl : 16;
- } sh_tsf_enable_ctl_s;
-} sh_tsf_enable_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_SOFTWARE_ARM" */
/* Trigger sequencing facility software arm */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_tsf_software_arm_u {
mmr_t sh_tsf_software_arm_regval;
struct {
@@ -19091,29 +10260,12 @@ typedef union sh_tsf_software_arm_u {
mmr_t reserved_0 : 56;
} sh_tsf_software_arm_s;
} sh_tsf_software_arm_u_t;
-#else
-typedef union sh_tsf_software_arm_u {
- mmr_t sh_tsf_software_arm_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t bit7 : 1;
- mmr_t bit6 : 1;
- mmr_t bit5 : 1;
- mmr_t bit4 : 1;
- mmr_t bit3 : 1;
- mmr_t bit2 : 1;
- mmr_t bit1 : 1;
- mmr_t bit0 : 1;
- } sh_tsf_software_arm_s;
-} sh_tsf_software_arm_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_SOFTWARE_DISARM" */
/* Trigger sequencing facility software disarm */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_tsf_software_disarm_u {
mmr_t sh_tsf_software_disarm_regval;
struct {
@@ -19128,29 +10280,12 @@ typedef union sh_tsf_software_disarm_u {
mmr_t reserved_0 : 56;
} sh_tsf_software_disarm_s;
} sh_tsf_software_disarm_u_t;
-#else
-typedef union sh_tsf_software_disarm_u {
- mmr_t sh_tsf_software_disarm_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t bit7 : 1;
- mmr_t bit6 : 1;
- mmr_t bit5 : 1;
- mmr_t bit4 : 1;
- mmr_t bit3 : 1;
- mmr_t bit2 : 1;
- mmr_t bit1 : 1;
- mmr_t bit0 : 1;
- } sh_tsf_software_disarm_s;
-} sh_tsf_software_disarm_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_SOFTWARE_TRIGGERED" */
/* Trigger sequencing facility software triggered */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_tsf_software_triggered_u {
mmr_t sh_tsf_software_triggered_regval;
struct {
@@ -19165,71 +10300,36 @@ typedef union sh_tsf_software_triggered_u {
mmr_t reserved_0 : 56;
} sh_tsf_software_triggered_s;
} sh_tsf_software_triggered_u_t;
-#else
-typedef union sh_tsf_software_triggered_u {
- mmr_t sh_tsf_software_triggered_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t bit7 : 1;
- mmr_t bit6 : 1;
- mmr_t bit5 : 1;
- mmr_t bit4 : 1;
- mmr_t bit3 : 1;
- mmr_t bit2 : 1;
- mmr_t bit1 : 1;
- mmr_t bit0 : 1;
- } sh_tsf_software_triggered_s;
-} sh_tsf_software_triggered_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_TRIGGER_MASK" */
/* Trigger sequencing facility trigger mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_tsf_trigger_mask_u {
- mmr_t sh_tsf_trigger_mask_regval;
- struct {
- mmr_t mask : 64;
- } sh_tsf_trigger_mask_s;
-} sh_tsf_trigger_mask_u_t;
-#else
typedef union sh_tsf_trigger_mask_u {
mmr_t sh_tsf_trigger_mask_regval;
struct {
mmr_t mask : 64;
} sh_tsf_trigger_mask_s;
} sh_tsf_trigger_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_VEC_DATA" */
/* Vector Write Request Message Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_vec_data_u {
- mmr_t sh_vec_data_regval;
- struct {
- mmr_t data : 64;
- } sh_vec_data_s;
-} sh_vec_data_u_t;
-#else
typedef union sh_vec_data_u {
mmr_t sh_vec_data_regval;
struct {
mmr_t data : 64;
} sh_vec_data_s;
} sh_vec_data_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_VEC_PARMS" */
/* Vector Message Parameters Register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_vec_parms_u {
mmr_t sh_vec_parms_regval;
struct {
@@ -19243,133 +10343,72 @@ typedef union sh_vec_parms_u {
mmr_t busy : 1;
} sh_vec_parms_s;
} sh_vec_parms_u_t;
-#else
-typedef union sh_vec_parms_u {
- mmr_t sh_vec_parms_regval;
- struct {
- mmr_t busy : 1;
- mmr_t start : 1;
- mmr_t reserved_1 : 16;
- mmr_t pio_id : 11;
- mmr_t address : 32;
- mmr_t reserved_0 : 1;
- mmr_t ni_port : 1;
- mmr_t type : 1;
- } sh_vec_parms_s;
-} sh_vec_parms_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_VEC_ROUTE" */
/* Vector Request Message Route */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_vec_route_u {
- mmr_t sh_vec_route_regval;
- struct {
- mmr_t route : 64;
- } sh_vec_route_s;
-} sh_vec_route_u_t;
-#else
typedef union sh_vec_route_u {
mmr_t sh_vec_route_regval;
struct {
mmr_t route : 64;
} sh_vec_route_s;
} sh_vec_route_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_CPU_PERM" */
/* CPU MMR Access Permission Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_cpu_perm_u {
- mmr_t sh_cpu_perm_regval;
- struct {
- mmr_t access_bits : 64;
- } sh_cpu_perm_s;
-} sh_cpu_perm_u_t;
-#else
typedef union sh_cpu_perm_u {
mmr_t sh_cpu_perm_regval;
struct {
mmr_t access_bits : 64;
} sh_cpu_perm_s;
} sh_cpu_perm_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_CPU_PERM_OVR" */
/* CPU MMR Access Permission Override */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_cpu_perm_ovr_u {
mmr_t sh_cpu_perm_ovr_regval;
struct {
mmr_t override : 64;
} sh_cpu_perm_ovr_s;
} sh_cpu_perm_ovr_u_t;
-#else
-typedef union sh_cpu_perm_ovr_u {
- mmr_t sh_cpu_perm_ovr_regval;
- struct {
- mmr_t override : 64;
- } sh_cpu_perm_ovr_s;
-} sh_cpu_perm_ovr_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_EXT_IO_PERM" */
/* External IO MMR Access Permission Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_ext_io_perm_u {
- mmr_t sh_ext_io_perm_regval;
- struct {
- mmr_t access_bits : 64;
- } sh_ext_io_perm_s;
-} sh_ext_io_perm_u_t;
-#else
typedef union sh_ext_io_perm_u {
mmr_t sh_ext_io_perm_regval;
struct {
mmr_t access_bits : 64;
} sh_ext_io_perm_s;
} sh_ext_io_perm_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_EXT_IOI_ACCESS" */
/* External IO Interrupt Access Permission Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_ext_ioi_access_u {
- mmr_t sh_ext_ioi_access_regval;
- struct {
- mmr_t access_bits : 64;
- } sh_ext_ioi_access_s;
-} sh_ext_ioi_access_u_t;
-#else
typedef union sh_ext_ioi_access_u {
mmr_t sh_ext_ioi_access_regval;
struct {
mmr_t access_bits : 64;
} sh_ext_ioi_access_s;
} sh_ext_ioi_access_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GC_FIL_CTRL" */
/* SHub Global Clock Filter Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gc_fil_ctrl_u {
mmr_t sh_gc_fil_ctrl_regval;
struct {
@@ -19386,31 +10425,12 @@ typedef union sh_gc_fil_ctrl_u {
mmr_t reserved_4 : 6;
} sh_gc_fil_ctrl_s;
} sh_gc_fil_ctrl_u_t;
-#else
-typedef union sh_gc_fil_ctrl_u {
- mmr_t sh_gc_fil_ctrl_regval;
- struct {
- mmr_t reserved_4 : 6;
- mmr_t error_counter : 10;
- mmr_t reserved_3 : 2;
- mmr_t dropout_thresh : 10;
- mmr_t reserved_2 : 2;
- mmr_t dropout_counter : 10;
- mmr_t reserved_1 : 3;
- mmr_t mask_enable : 1;
- mmr_t mask_counter : 12;
- mmr_t reserved_0 : 3;
- mmr_t offset : 5;
- } sh_gc_fil_ctrl_s;
-} sh_gc_fil_ctrl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_GC_SRC_CTRL" */
/* SHub Global Clock Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_gc_src_ctrl_u {
mmr_t sh_gc_src_ctrl_regval;
struct {
@@ -19426,30 +10446,12 @@ typedef union sh_gc_src_ctrl_u {
mmr_t reserved_4 : 30;
} sh_gc_src_ctrl_s;
} sh_gc_src_ctrl_u_t;
-#else
-typedef union sh_gc_src_ctrl_u {
- mmr_t sh_gc_src_ctrl_regval;
- struct {
- mmr_t reserved_4 : 30;
- mmr_t source_sel : 2;
- mmr_t reserved_3 : 3;
- mmr_t toggle_bit : 1;
- mmr_t reserved_2 : 2;
- mmr_t counter : 10;
- mmr_t reserved_1 : 2;
- mmr_t max_count : 10;
- mmr_t reserved_0 : 3;
- mmr_t enable_counter : 1;
- } sh_gc_src_ctrl_s;
-} sh_gc_src_ctrl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_HARD_RESET" */
/* SHub Hard Reset */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_hard_reset_u {
mmr_t sh_hard_reset_regval;
struct {
@@ -19457,85 +10459,48 @@ typedef union sh_hard_reset_u {
mmr_t reserved_0 : 63;
} sh_hard_reset_s;
} sh_hard_reset_u_t;
-#else
-typedef union sh_hard_reset_u {
- mmr_t sh_hard_reset_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t hard_reset : 1;
- } sh_hard_reset_s;
-} sh_hard_reset_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_IO_PERM" */
/* II MMR Access Permission Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_io_perm_u {
mmr_t sh_io_perm_regval;
struct {
mmr_t access_bits : 64;
} sh_io_perm_s;
} sh_io_perm_u_t;
-#else
-typedef union sh_io_perm_u {
- mmr_t sh_io_perm_regval;
- struct {
- mmr_t access_bits : 64;
- } sh_io_perm_s;
-} sh_io_perm_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_IOI_ACCESS" */
/* II Interrupt Access Permission Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_ioi_access_u {
- mmr_t sh_ioi_access_regval;
- struct {
- mmr_t access_bits : 64;
- } sh_ioi_access_s;
-} sh_ioi_access_u_t;
-#else
typedef union sh_ioi_access_u {
mmr_t sh_ioi_access_regval;
struct {
mmr_t access_bits : 64;
} sh_ioi_access_s;
} sh_ioi_access_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_IPI_ACCESS" */
/* CPU interrupt Access Permission Bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ipi_access_u {
mmr_t sh_ipi_access_regval;
struct {
mmr_t access_bits : 64;
} sh_ipi_access_s;
} sh_ipi_access_u_t;
-#else
-typedef union sh_ipi_access_u {
- mmr_t sh_ipi_access_regval;
- struct {
- mmr_t access_bits : 64;
- } sh_ipi_access_s;
-} sh_ipi_access_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_JTAG_CONFIG" */
/* SHub JTAG configuration */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_jtag_config_u {
mmr_t sh_jtag_config_regval;
struct {
@@ -19559,38 +10524,12 @@ typedef union sh_jtag_config_u {
mmr_t reserved_0 : 8;
} sh_jtag_config_s;
} sh_jtag_config_u_t;
-#else
-typedef union sh_jtag_config_u {
- mmr_t sh_jtag_config_regval;
- struct {
- mmr_t reserved_0 : 8;
- mmr_t gtl_config_re : 1;
- mmr_t fsb_config_aux : 2;
- mmr_t fsb_config_enable_bist : 1;
- mmr_t fsb_config_output_tristate : 4;
- mmr_t fsb_config_clock_ratio : 5;
- mmr_t fsb_config_enable_bus_parking : 1;
- mmr_t fsb_config_sample_binit : 1;
- mmr_t fsb_config_ioq_depth : 1;
- mmr_t jtag_mci_override : 1;
- mmr_t jtag_mci_target : 14;
- mmr_t jtag_mci_reset_delay : 4;
- mmr_t wrt90_override : 1;
- mmr_t wrt90_overrider : 1;
- mmr_t wrt90_target : 14;
- mmr_t ii_clk_sel : 2;
- mmr_t ni_clk_sel : 1;
- mmr_t md_clk_sel : 2;
- } sh_jtag_config_s;
-} sh_jtag_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_SHUB_ID" */
/* SHub ID Number */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_shub_id_u {
mmr_t sh_shub_id_regval;
struct {
@@ -19608,116 +10547,60 @@ typedef union sh_shub_id_u {
mmr_t reserved_3 : 7;
} sh_shub_id_s;
} sh_shub_id_u_t;
-#else
-typedef union sh_shub_id_u {
- mmr_t sh_shub_id_regval;
- struct {
- mmr_t reserved_3 : 7;
- mmr_t ni_port : 1;
- mmr_t reserved_2 : 3;
- mmr_t nodes_per_bit : 5;
- mmr_t reserved_1 : 2;
- mmr_t sharing_mode : 2;
- mmr_t reserved_0 : 1;
- mmr_t node_id : 11;
- mmr_t revision : 4;
- mmr_t part_number : 16;
- mmr_t manufacturer : 11;
- mmr_t force1 : 1;
- } sh_shub_id_s;
-} sh_shub_id_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_SHUBS_PRESENT0" */
/* Shubs 0 - 63 Present. Used for invalidate generation */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_shubs_present0_u {
- mmr_t sh_shubs_present0_regval;
- struct {
- mmr_t shubs_present0 : 64;
- } sh_shubs_present0_s;
-} sh_shubs_present0_u_t;
-#else
typedef union sh_shubs_present0_u {
mmr_t sh_shubs_present0_regval;
struct {
mmr_t shubs_present0 : 64;
} sh_shubs_present0_s;
} sh_shubs_present0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_SHUBS_PRESENT1" */
/* Shubs 64 - 127 Present. Used for invalidate generation */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_shubs_present1_u {
mmr_t sh_shubs_present1_regval;
struct {
mmr_t shubs_present1 : 64;
} sh_shubs_present1_s;
} sh_shubs_present1_u_t;
-#else
-typedef union sh_shubs_present1_u {
- mmr_t sh_shubs_present1_regval;
- struct {
- mmr_t shubs_present1 : 64;
- } sh_shubs_present1_s;
-} sh_shubs_present1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_SHUBS_PRESENT2" */
/* Shubs 128 - 191 Present. Used for invalidate generation */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_shubs_present2_u {
- mmr_t sh_shubs_present2_regval;
- struct {
- mmr_t shubs_present2 : 64;
- } sh_shubs_present2_s;
-} sh_shubs_present2_u_t;
-#else
typedef union sh_shubs_present2_u {
mmr_t sh_shubs_present2_regval;
struct {
mmr_t shubs_present2 : 64;
} sh_shubs_present2_s;
} sh_shubs_present2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_SHUBS_PRESENT3" */
/* Shubs 192 - 255 Present. Used for invalidate generation */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_shubs_present3_u {
- mmr_t sh_shubs_present3_regval;
- struct {
- mmr_t shubs_present3 : 64;
- } sh_shubs_present3_s;
-} sh_shubs_present3_u_t;
-#else
typedef union sh_shubs_present3_u {
mmr_t sh_shubs_present3_regval;
struct {
mmr_t shubs_present3 : 64;
} sh_shubs_present3_s;
} sh_shubs_present3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_SOFT_RESET" */
/* SHub Soft Reset */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_soft_reset_u {
mmr_t sh_soft_reset_regval;
struct {
@@ -19725,22 +10608,12 @@ typedef union sh_soft_reset_u {
mmr_t reserved_0 : 63;
} sh_soft_reset_s;
} sh_soft_reset_u_t;
-#else
-typedef union sh_soft_reset_u {
- mmr_t sh_soft_reset_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t soft_reset : 1;
- } sh_soft_reset_s;
-} sh_soft_reset_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_FIRST_ERROR" */
/* Shub Global First Error Flags */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_first_error_u {
mmr_t sh_first_error_regval;
struct {
@@ -19748,22 +10621,12 @@ typedef union sh_first_error_u {
mmr_t reserved_0 : 45;
} sh_first_error_s;
} sh_first_error_u_t;
-#else
-typedef union sh_first_error_u {
- mmr_t sh_first_error_regval;
- struct {
- mmr_t reserved_0 : 45;
- mmr_t first_error : 19;
- } sh_first_error_s;
-} sh_first_error_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_II_HW_TIME_STAMP" */
/* II hardware error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ii_hw_time_stamp_u {
mmr_t sh_ii_hw_time_stamp_regval;
struct {
@@ -19771,22 +10634,12 @@ typedef union sh_ii_hw_time_stamp_u {
mmr_t valid : 1;
} sh_ii_hw_time_stamp_s;
} sh_ii_hw_time_stamp_u_t;
-#else
-typedef union sh_ii_hw_time_stamp_u {
- mmr_t sh_ii_hw_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_ii_hw_time_stamp_s;
-} sh_ii_hw_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_HW_TIME_STAMP" */
/* LB hardware error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_hw_time_stamp_u {
mmr_t sh_lb_hw_time_stamp_regval;
struct {
@@ -19794,22 +10647,12 @@ typedef union sh_lb_hw_time_stamp_u {
mmr_t valid : 1;
} sh_lb_hw_time_stamp_s;
} sh_lb_hw_time_stamp_u_t;
-#else
-typedef union sh_lb_hw_time_stamp_u {
- mmr_t sh_lb_hw_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_lb_hw_time_stamp_s;
-} sh_lb_hw_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_COR_TIME_STAMP" */
/* MD correctable error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_cor_time_stamp_u {
mmr_t sh_md_cor_time_stamp_regval;
struct {
@@ -19817,22 +10660,12 @@ typedef union sh_md_cor_time_stamp_u {
mmr_t valid : 1;
} sh_md_cor_time_stamp_s;
} sh_md_cor_time_stamp_u_t;
-#else
-typedef union sh_md_cor_time_stamp_u {
- mmr_t sh_md_cor_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_md_cor_time_stamp_s;
-} sh_md_cor_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_HW_TIME_STAMP" */
/* MD hardware error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_hw_time_stamp_u {
mmr_t sh_md_hw_time_stamp_regval;
struct {
@@ -19840,22 +10673,12 @@ typedef union sh_md_hw_time_stamp_u {
mmr_t valid : 1;
} sh_md_hw_time_stamp_s;
} sh_md_hw_time_stamp_u_t;
-#else
-typedef union sh_md_hw_time_stamp_u {
- mmr_t sh_md_hw_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_md_hw_time_stamp_s;
-} sh_md_hw_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_UNCOR_TIME_STAMP" */
/* MD uncorrectable error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_uncor_time_stamp_u {
mmr_t sh_md_uncor_time_stamp_regval;
struct {
@@ -19863,22 +10686,12 @@ typedef union sh_md_uncor_time_stamp_u {
mmr_t valid : 1;
} sh_md_uncor_time_stamp_s;
} sh_md_uncor_time_stamp_u_t;
-#else
-typedef union sh_md_uncor_time_stamp_u {
- mmr_t sh_md_uncor_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_md_uncor_time_stamp_s;
-} sh_md_uncor_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_COR_TIME_STAMP" */
/* PI correctable error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_cor_time_stamp_u {
mmr_t sh_pi_cor_time_stamp_regval;
struct {
@@ -19886,22 +10699,12 @@ typedef union sh_pi_cor_time_stamp_u {
mmr_t valid : 1;
} sh_pi_cor_time_stamp_s;
} sh_pi_cor_time_stamp_u_t;
-#else
-typedef union sh_pi_cor_time_stamp_u {
- mmr_t sh_pi_cor_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_pi_cor_time_stamp_s;
-} sh_pi_cor_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_HW_TIME_STAMP" */
/* PI hardware error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_hw_time_stamp_u {
mmr_t sh_pi_hw_time_stamp_regval;
struct {
@@ -19909,22 +10712,12 @@ typedef union sh_pi_hw_time_stamp_u {
mmr_t valid : 1;
} sh_pi_hw_time_stamp_s;
} sh_pi_hw_time_stamp_u_t;
-#else
-typedef union sh_pi_hw_time_stamp_u {
- mmr_t sh_pi_hw_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_pi_hw_time_stamp_s;
-} sh_pi_hw_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_UNCOR_TIME_STAMP" */
/* PI uncorrectable error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_uncor_time_stamp_u {
mmr_t sh_pi_uncor_time_stamp_regval;
struct {
@@ -19932,22 +10725,12 @@ typedef union sh_pi_uncor_time_stamp_u {
mmr_t valid : 1;
} sh_pi_uncor_time_stamp_s;
} sh_pi_uncor_time_stamp_u_t;
-#else
-typedef union sh_pi_uncor_time_stamp_u {
- mmr_t sh_pi_uncor_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_pi_uncor_time_stamp_s;
-} sh_pi_uncor_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC0_ADV_TIME_STAMP" */
/* Proc 0 advisory time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc0_adv_time_stamp_u {
mmr_t sh_proc0_adv_time_stamp_regval;
struct {
@@ -19955,22 +10738,12 @@ typedef union sh_proc0_adv_time_stamp_u {
mmr_t valid : 1;
} sh_proc0_adv_time_stamp_s;
} sh_proc0_adv_time_stamp_u_t;
-#else
-typedef union sh_proc0_adv_time_stamp_u {
- mmr_t sh_proc0_adv_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_proc0_adv_time_stamp_s;
-} sh_proc0_adv_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC0_ERR_TIME_STAMP" */
/* Proc 0 error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc0_err_time_stamp_u {
mmr_t sh_proc0_err_time_stamp_regval;
struct {
@@ -19978,22 +10751,12 @@ typedef union sh_proc0_err_time_stamp_u {
mmr_t valid : 1;
} sh_proc0_err_time_stamp_s;
} sh_proc0_err_time_stamp_u_t;
-#else
-typedef union sh_proc0_err_time_stamp_u {
- mmr_t sh_proc0_err_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_proc0_err_time_stamp_s;
-} sh_proc0_err_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC1_ADV_TIME_STAMP" */
/* Proc 1 advisory time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc1_adv_time_stamp_u {
mmr_t sh_proc1_adv_time_stamp_regval;
struct {
@@ -20001,22 +10764,12 @@ typedef union sh_proc1_adv_time_stamp_u {
mmr_t valid : 1;
} sh_proc1_adv_time_stamp_s;
} sh_proc1_adv_time_stamp_u_t;
-#else
-typedef union sh_proc1_adv_time_stamp_u {
- mmr_t sh_proc1_adv_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_proc1_adv_time_stamp_s;
-} sh_proc1_adv_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC1_ERR_TIME_STAMP" */
/* Proc 1 error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc1_err_time_stamp_u {
mmr_t sh_proc1_err_time_stamp_regval;
struct {
@@ -20024,22 +10777,12 @@ typedef union sh_proc1_err_time_stamp_u {
mmr_t valid : 1;
} sh_proc1_err_time_stamp_s;
} sh_proc1_err_time_stamp_u_t;
-#else
-typedef union sh_proc1_err_time_stamp_u {
- mmr_t sh_proc1_err_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_proc1_err_time_stamp_s;
-} sh_proc1_err_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC2_ADV_TIME_STAMP" */
/* Proc 2 advisory time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc2_adv_time_stamp_u {
mmr_t sh_proc2_adv_time_stamp_regval;
struct {
@@ -20047,22 +10790,12 @@ typedef union sh_proc2_adv_time_stamp_u {
mmr_t valid : 1;
} sh_proc2_adv_time_stamp_s;
} sh_proc2_adv_time_stamp_u_t;
-#else
-typedef union sh_proc2_adv_time_stamp_u {
- mmr_t sh_proc2_adv_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_proc2_adv_time_stamp_s;
-} sh_proc2_adv_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC2_ERR_TIME_STAMP" */
/* Proc 2 error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc2_err_time_stamp_u {
mmr_t sh_proc2_err_time_stamp_regval;
struct {
@@ -20070,22 +10803,12 @@ typedef union sh_proc2_err_time_stamp_u {
mmr_t valid : 1;
} sh_proc2_err_time_stamp_s;
} sh_proc2_err_time_stamp_u_t;
-#else
-typedef union sh_proc2_err_time_stamp_u {
- mmr_t sh_proc2_err_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_proc2_err_time_stamp_s;
-} sh_proc2_err_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC3_ADV_TIME_STAMP" */
/* Proc 3 advisory time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc3_adv_time_stamp_u {
mmr_t sh_proc3_adv_time_stamp_regval;
struct {
@@ -20093,22 +10816,12 @@ typedef union sh_proc3_adv_time_stamp_u {
mmr_t valid : 1;
} sh_proc3_adv_time_stamp_s;
} sh_proc3_adv_time_stamp_u_t;
-#else
-typedef union sh_proc3_adv_time_stamp_u {
- mmr_t sh_proc3_adv_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_proc3_adv_time_stamp_s;
-} sh_proc3_adv_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROC3_ERR_TIME_STAMP" */
/* Proc 3 error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_proc3_err_time_stamp_u {
mmr_t sh_proc3_err_time_stamp_regval;
struct {
@@ -20116,22 +10829,12 @@ typedef union sh_proc3_err_time_stamp_u {
mmr_t valid : 1;
} sh_proc3_err_time_stamp_s;
} sh_proc3_err_time_stamp_u_t;
-#else
-typedef union sh_proc3_err_time_stamp_u {
- mmr_t sh_proc3_err_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_proc3_err_time_stamp_s;
-} sh_proc3_err_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_COR_TIME_STAMP" */
/* XN correctable error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_cor_time_stamp_u {
mmr_t sh_xn_cor_time_stamp_regval;
struct {
@@ -20139,22 +10842,12 @@ typedef union sh_xn_cor_time_stamp_u {
mmr_t valid : 1;
} sh_xn_cor_time_stamp_s;
} sh_xn_cor_time_stamp_u_t;
-#else
-typedef union sh_xn_cor_time_stamp_u {
- mmr_t sh_xn_cor_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_xn_cor_time_stamp_s;
-} sh_xn_cor_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_HW_TIME_STAMP" */
/* XN hardware error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_hw_time_stamp_u {
mmr_t sh_xn_hw_time_stamp_regval;
struct {
@@ -20162,22 +10855,12 @@ typedef union sh_xn_hw_time_stamp_u {
mmr_t valid : 1;
} sh_xn_hw_time_stamp_s;
} sh_xn_hw_time_stamp_u_t;
-#else
-typedef union sh_xn_hw_time_stamp_u {
- mmr_t sh_xn_hw_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_xn_hw_time_stamp_s;
-} sh_xn_hw_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_UNCOR_TIME_STAMP" */
/* XN uncorrectable error time stamp */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_uncor_time_stamp_u {
mmr_t sh_xn_uncor_time_stamp_regval;
struct {
@@ -20185,22 +10868,12 @@ typedef union sh_xn_uncor_time_stamp_u {
mmr_t valid : 1;
} sh_xn_uncor_time_stamp_s;
} sh_xn_uncor_time_stamp_u_t;
-#else
-typedef union sh_xn_uncor_time_stamp_u {
- mmr_t sh_xn_uncor_time_stamp_regval;
- struct {
- mmr_t valid : 1;
- mmr_t time : 63;
- } sh_xn_uncor_time_stamp_s;
-} sh_xn_uncor_time_stamp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DEBUG_PORT" */
/* SHub Debug Port */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_debug_port_u {
mmr_t sh_debug_port_regval;
struct {
@@ -20215,29 +10888,12 @@ typedef union sh_debug_port_u {
mmr_t reserved_0 : 32;
} sh_debug_port_s;
} sh_debug_port_u_t;
-#else
-typedef union sh_debug_port_u {
- mmr_t sh_debug_port_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t debug_nibble7 : 4;
- mmr_t debug_nibble6 : 4;
- mmr_t debug_nibble5 : 4;
- mmr_t debug_nibble4 : 4;
- mmr_t debug_nibble3 : 4;
- mmr_t debug_nibble2 : 4;
- mmr_t debug_nibble1 : 4;
- mmr_t debug_nibble0 : 4;
- } sh_debug_port_s;
-} sh_debug_port_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_II_DEBUG_DATA" */
/* II Debug Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ii_debug_data_u {
mmr_t sh_ii_debug_data_regval;
struct {
@@ -20245,22 +10901,12 @@ typedef union sh_ii_debug_data_u {
mmr_t reserved_0 : 32;
} sh_ii_debug_data_s;
} sh_ii_debug_data_u_t;
-#else
-typedef union sh_ii_debug_data_u {
- mmr_t sh_ii_debug_data_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t ii_data : 32;
- } sh_ii_debug_data_s;
-} sh_ii_debug_data_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_II_WRAP_DEBUG_DATA" */
/* SHub II Wrapper Debug Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ii_wrap_debug_data_u {
mmr_t sh_ii_wrap_debug_data_regval;
struct {
@@ -20268,22 +10914,12 @@ typedef union sh_ii_wrap_debug_data_u {
mmr_t reserved_0 : 32;
} sh_ii_wrap_debug_data_s;
} sh_ii_wrap_debug_data_u_t;
-#else
-typedef union sh_ii_wrap_debug_data_u {
- mmr_t sh_ii_wrap_debug_data_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t ii_wrap_data : 32;
- } sh_ii_wrap_debug_data_s;
-} sh_ii_wrap_debug_data_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_LB_DEBUG_DATA" */
/* SHub LB Debug Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_lb_debug_data_u {
mmr_t sh_lb_debug_data_regval;
struct {
@@ -20291,22 +10927,12 @@ typedef union sh_lb_debug_data_u {
mmr_t reserved_0 : 32;
} sh_lb_debug_data_s;
} sh_lb_debug_data_u_t;
-#else
-typedef union sh_lb_debug_data_u {
- mmr_t sh_lb_debug_data_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t lb_data : 32;
- } sh_lb_debug_data_s;
-} sh_lb_debug_data_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DEBUG_DATA" */
/* SHub MD Debug Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_debug_data_u {
mmr_t sh_md_debug_data_regval;
struct {
@@ -20314,22 +10940,12 @@ typedef union sh_md_debug_data_u {
mmr_t reserved_0 : 32;
} sh_md_debug_data_s;
} sh_md_debug_data_u_t;
-#else
-typedef union sh_md_debug_data_u {
- mmr_t sh_md_debug_data_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t md_data : 32;
- } sh_md_debug_data_s;
-} sh_md_debug_data_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_DEBUG_DATA" */
/* SHub PI Debug Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_debug_data_u {
mmr_t sh_pi_debug_data_regval;
struct {
@@ -20337,22 +10953,12 @@ typedef union sh_pi_debug_data_u {
mmr_t reserved_0 : 32;
} sh_pi_debug_data_s;
} sh_pi_debug_data_u_t;
-#else
-typedef union sh_pi_debug_data_u {
- mmr_t sh_pi_debug_data_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t pi_data : 32;
- } sh_pi_debug_data_s;
-} sh_pi_debug_data_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_DEBUG_DATA" */
/* SHub XN Debug Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_debug_data_u {
mmr_t sh_xn_debug_data_regval;
struct {
@@ -20360,22 +10966,12 @@ typedef union sh_xn_debug_data_u {
mmr_t reserved_0 : 32;
} sh_xn_debug_data_s;
} sh_xn_debug_data_u_t;
-#else
-typedef union sh_xn_debug_data_u {
- mmr_t sh_xn_debug_data_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t xn_data : 32;
- } sh_xn_debug_data_s;
-} sh_xn_debug_data_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_ARMED_STATE" */
/* Trigger sequencing facility arm state */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_tsf_armed_state_u {
mmr_t sh_tsf_armed_state_regval;
struct {
@@ -20383,22 +10979,12 @@ typedef union sh_tsf_armed_state_u {
mmr_t reserved_0 : 56;
} sh_tsf_armed_state_s;
} sh_tsf_armed_state_u_t;
-#else
-typedef union sh_tsf_armed_state_u {
- mmr_t sh_tsf_armed_state_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t state : 8;
- } sh_tsf_armed_state_s;
-} sh_tsf_armed_state_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_COUNTER_VALUE" */
/* Trigger sequencing facility counter value */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_tsf_counter_value_u {
mmr_t sh_tsf_counter_value_regval;
struct {
@@ -20408,24 +10994,12 @@ typedef union sh_tsf_counter_value_u {
mmr_t count_8a : 8;
} sh_tsf_counter_value_s;
} sh_tsf_counter_value_u_t;
-#else
-typedef union sh_tsf_counter_value_u {
- mmr_t sh_tsf_counter_value_regval;
- struct {
- mmr_t count_8a : 8;
- mmr_t count_8b : 8;
- mmr_t count_16 : 16;
- mmr_t count_32 : 32;
- } sh_tsf_counter_value_s;
-} sh_tsf_counter_value_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_TSF_TRIGGERED_STATE" */
/* Trigger sequencing facility triggered state */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_tsf_triggered_state_u {
mmr_t sh_tsf_triggered_state_regval;
struct {
@@ -20433,64 +11007,36 @@ typedef union sh_tsf_triggered_state_u {
mmr_t reserved_0 : 56;
} sh_tsf_triggered_state_s;
} sh_tsf_triggered_state_u_t;
-#else
-typedef union sh_tsf_triggered_state_u {
- mmr_t sh_tsf_triggered_state_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t state : 8;
- } sh_tsf_triggered_state_s;
-} sh_tsf_triggered_state_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_VEC_RDDATA" */
/* Vector Reply Message Data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_vec_rddata_u {
- mmr_t sh_vec_rddata_regval;
- struct {
- mmr_t data : 64;
- } sh_vec_rddata_s;
-} sh_vec_rddata_u_t;
-#else
typedef union sh_vec_rddata_u {
mmr_t sh_vec_rddata_regval;
struct {
mmr_t data : 64;
} sh_vec_rddata_s;
} sh_vec_rddata_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_VEC_RETURN" */
/* Vector Reply Message Return Route */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_vec_return_u {
- mmr_t sh_vec_return_regval;
- struct {
- mmr_t route : 64;
- } sh_vec_return_s;
-} sh_vec_return_u_t;
-#else
typedef union sh_vec_return_u {
mmr_t sh_vec_return_regval;
struct {
mmr_t route : 64;
} sh_vec_return_s;
} sh_vec_return_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_VEC_STATUS" */
/* Vector Reply Message Status */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_vec_status_u {
mmr_t sh_vec_status_regval;
struct {
@@ -20503,27 +11049,12 @@ typedef union sh_vec_status_u {
mmr_t status_valid : 1;
} sh_vec_status_s;
} sh_vec_status_u_t;
-#else
-typedef union sh_vec_status_u {
- mmr_t sh_vec_status_regval;
- struct {
- mmr_t status_valid : 1;
- mmr_t overrun : 1;
- mmr_t reserved_0 : 2;
- mmr_t source : 14;
- mmr_t pio_id : 11;
- mmr_t address : 32;
- mmr_t type : 3;
- } sh_vec_status_s;
-} sh_vec_status_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNT0_CONTROL" */
/* Performance Counter 0 Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_count0_control_u {
mmr_t sh_performance_count0_control_regval;
struct {
@@ -20541,32 +11072,12 @@ typedef union sh_performance_count0_control_u {
mmr_t reserved_0 : 45;
} sh_performance_count0_control_s;
} sh_performance_count0_control_u_t;
-#else
-typedef union sh_performance_count0_control_u {
- mmr_t sh_performance_count0_control_regval;
- struct {
- mmr_t reserved_0 : 45;
- mmr_t peak_det_enable : 1;
- mmr_t dec_enable : 1;
- mmr_t inc_enable : 1;
- mmr_t dn_mode : 1;
- mmr_t dn_polarity : 1;
- mmr_t dn_event : 1;
- mmr_t dn_stimulus : 5;
- mmr_t up_mode : 1;
- mmr_t up_polarity : 1;
- mmr_t up_event : 1;
- mmr_t up_stimulus : 5;
- } sh_performance_count0_control_s;
-} sh_performance_count0_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNT1_CONTROL" */
/* Performance Counter 1 Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_count1_control_u {
mmr_t sh_performance_count1_control_regval;
struct {
@@ -20584,32 +11095,12 @@ typedef union sh_performance_count1_control_u {
mmr_t reserved_0 : 45;
} sh_performance_count1_control_s;
} sh_performance_count1_control_u_t;
-#else
-typedef union sh_performance_count1_control_u {
- mmr_t sh_performance_count1_control_regval;
- struct {
- mmr_t reserved_0 : 45;
- mmr_t peak_det_enable : 1;
- mmr_t dec_enable : 1;
- mmr_t inc_enable : 1;
- mmr_t dn_mode : 1;
- mmr_t dn_polarity : 1;
- mmr_t dn_event : 1;
- mmr_t dn_stimulus : 5;
- mmr_t up_mode : 1;
- mmr_t up_polarity : 1;
- mmr_t up_event : 1;
- mmr_t up_stimulus : 5;
- } sh_performance_count1_control_s;
-} sh_performance_count1_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNT2_CONTROL" */
/* Performance Counter 2 Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_count2_control_u {
mmr_t sh_performance_count2_control_regval;
struct {
@@ -20627,32 +11118,12 @@ typedef union sh_performance_count2_control_u {
mmr_t reserved_0 : 45;
} sh_performance_count2_control_s;
} sh_performance_count2_control_u_t;
-#else
-typedef union sh_performance_count2_control_u {
- mmr_t sh_performance_count2_control_regval;
- struct {
- mmr_t reserved_0 : 45;
- mmr_t peak_det_enable : 1;
- mmr_t dec_enable : 1;
- mmr_t inc_enable : 1;
- mmr_t dn_mode : 1;
- mmr_t dn_polarity : 1;
- mmr_t dn_event : 1;
- mmr_t dn_stimulus : 5;
- mmr_t up_mode : 1;
- mmr_t up_polarity : 1;
- mmr_t up_event : 1;
- mmr_t up_stimulus : 5;
- } sh_performance_count2_control_s;
-} sh_performance_count2_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNT3_CONTROL" */
/* Performance Counter 3 Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_count3_control_u {
mmr_t sh_performance_count3_control_regval;
struct {
@@ -20670,32 +11141,12 @@ typedef union sh_performance_count3_control_u {
mmr_t reserved_0 : 45;
} sh_performance_count3_control_s;
} sh_performance_count3_control_u_t;
-#else
-typedef union sh_performance_count3_control_u {
- mmr_t sh_performance_count3_control_regval;
- struct {
- mmr_t reserved_0 : 45;
- mmr_t peak_det_enable : 1;
- mmr_t dec_enable : 1;
- mmr_t inc_enable : 1;
- mmr_t dn_mode : 1;
- mmr_t dn_polarity : 1;
- mmr_t dn_event : 1;
- mmr_t dn_stimulus : 5;
- mmr_t up_mode : 1;
- mmr_t up_polarity : 1;
- mmr_t up_event : 1;
- mmr_t up_stimulus : 5;
- } sh_performance_count3_control_s;
-} sh_performance_count3_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNT4_CONTROL" */
/* Performance Counter 4 Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_count4_control_u {
mmr_t sh_performance_count4_control_regval;
struct {
@@ -20713,32 +11164,12 @@ typedef union sh_performance_count4_control_u {
mmr_t reserved_0 : 45;
} sh_performance_count4_control_s;
} sh_performance_count4_control_u_t;
-#else
-typedef union sh_performance_count4_control_u {
- mmr_t sh_performance_count4_control_regval;
- struct {
- mmr_t reserved_0 : 45;
- mmr_t peak_det_enable : 1;
- mmr_t dec_enable : 1;
- mmr_t inc_enable : 1;
- mmr_t dn_mode : 1;
- mmr_t dn_polarity : 1;
- mmr_t dn_event : 1;
- mmr_t dn_stimulus : 5;
- mmr_t up_mode : 1;
- mmr_t up_polarity : 1;
- mmr_t up_event : 1;
- mmr_t up_stimulus : 5;
- } sh_performance_count4_control_s;
-} sh_performance_count4_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNT5_CONTROL" */
/* Performance Counter 5 Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_count5_control_u {
mmr_t sh_performance_count5_control_regval;
struct {
@@ -20756,32 +11187,12 @@ typedef union sh_performance_count5_control_u {
mmr_t reserved_0 : 45;
} sh_performance_count5_control_s;
} sh_performance_count5_control_u_t;
-#else
-typedef union sh_performance_count5_control_u {
- mmr_t sh_performance_count5_control_regval;
- struct {
- mmr_t reserved_0 : 45;
- mmr_t peak_det_enable : 1;
- mmr_t dec_enable : 1;
- mmr_t inc_enable : 1;
- mmr_t dn_mode : 1;
- mmr_t dn_polarity : 1;
- mmr_t dn_event : 1;
- mmr_t dn_stimulus : 5;
- mmr_t up_mode : 1;
- mmr_t up_polarity : 1;
- mmr_t up_event : 1;
- mmr_t up_stimulus : 5;
- } sh_performance_count5_control_s;
-} sh_performance_count5_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNT6_CONTROL" */
/* Performance Counter 6 Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_count6_control_u {
mmr_t sh_performance_count6_control_regval;
struct {
@@ -20799,32 +11210,12 @@ typedef union sh_performance_count6_control_u {
mmr_t reserved_0 : 45;
} sh_performance_count6_control_s;
} sh_performance_count6_control_u_t;
-#else
-typedef union sh_performance_count6_control_u {
- mmr_t sh_performance_count6_control_regval;
- struct {
- mmr_t reserved_0 : 45;
- mmr_t peak_det_enable : 1;
- mmr_t dec_enable : 1;
- mmr_t inc_enable : 1;
- mmr_t dn_mode : 1;
- mmr_t dn_polarity : 1;
- mmr_t dn_event : 1;
- mmr_t dn_stimulus : 5;
- mmr_t up_mode : 1;
- mmr_t up_polarity : 1;
- mmr_t up_event : 1;
- mmr_t up_stimulus : 5;
- } sh_performance_count6_control_s;
-} sh_performance_count6_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNT7_CONTROL" */
/* Performance Counter 7 Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_count7_control_u {
mmr_t sh_performance_count7_control_regval;
struct {
@@ -20842,32 +11233,12 @@ typedef union sh_performance_count7_control_u {
mmr_t reserved_0 : 45;
} sh_performance_count7_control_s;
} sh_performance_count7_control_u_t;
-#else
-typedef union sh_performance_count7_control_u {
- mmr_t sh_performance_count7_control_regval;
- struct {
- mmr_t reserved_0 : 45;
- mmr_t peak_det_enable : 1;
- mmr_t dec_enable : 1;
- mmr_t inc_enable : 1;
- mmr_t dn_mode : 1;
- mmr_t dn_polarity : 1;
- mmr_t dn_event : 1;
- mmr_t dn_stimulus : 5;
- mmr_t up_mode : 1;
- mmr_t up_polarity : 1;
- mmr_t up_event : 1;
- mmr_t up_stimulus : 5;
- } sh_performance_count7_control_s;
-} sh_performance_count7_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROFILE_DN_CONTROL" */
/* Profile Counter Down Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_profile_dn_control_u {
mmr_t sh_profile_dn_control_regval;
struct {
@@ -20878,25 +11249,12 @@ typedef union sh_profile_dn_control_u {
mmr_t reserved_0 : 56;
} sh_profile_dn_control_s;
} sh_profile_dn_control_u_t;
-#else
-typedef union sh_profile_dn_control_u {
- mmr_t sh_profile_dn_control_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t mode : 1;
- mmr_t polarity : 1;
- mmr_t event : 1;
- mmr_t stimulus : 5;
- } sh_profile_dn_control_s;
-} sh_profile_dn_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROFILE_PEAK_CONTROL" */
/* Profile Counter Peak Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_profile_peak_control_u {
mmr_t sh_profile_peak_control_regval;
struct {
@@ -20908,26 +11266,12 @@ typedef union sh_profile_peak_control_u {
mmr_t reserved_2 : 57;
} sh_profile_peak_control_s;
} sh_profile_peak_control_u_t;
-#else
-typedef union sh_profile_peak_control_u {
- mmr_t sh_profile_peak_control_regval;
- struct {
- mmr_t reserved_2 : 57;
- mmr_t polarity : 1;
- mmr_t event : 1;
- mmr_t reserved_1 : 1;
- mmr_t stimulus : 1;
- mmr_t reserved_0 : 3;
- } sh_profile_peak_control_s;
-} sh_profile_peak_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROFILE_RANGE" */
/* Profile Counter Range */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_profile_range_u {
mmr_t sh_profile_range_regval;
struct {
@@ -20941,28 +11285,12 @@ typedef union sh_profile_range_u {
mmr_t range7 : 8;
} sh_profile_range_s;
} sh_profile_range_u_t;
-#else
-typedef union sh_profile_range_u {
- mmr_t sh_profile_range_regval;
- struct {
- mmr_t range7 : 8;
- mmr_t range6 : 8;
- mmr_t range5 : 8;
- mmr_t range4 : 8;
- mmr_t range3 : 8;
- mmr_t range2 : 8;
- mmr_t range1 : 8;
- mmr_t range0 : 8;
- } sh_profile_range_s;
-} sh_profile_range_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROFILE_UP_CONTROL" */
/* Profile Counter Up Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_profile_up_control_u {
mmr_t sh_profile_up_control_regval;
struct {
@@ -20973,25 +11301,12 @@ typedef union sh_profile_up_control_u {
mmr_t reserved_0 : 56;
} sh_profile_up_control_s;
} sh_profile_up_control_u_t;
-#else
-typedef union sh_profile_up_control_u {
- mmr_t sh_profile_up_control_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t mode : 1;
- mmr_t polarity : 1;
- mmr_t event : 1;
- mmr_t stimulus : 5;
- } sh_profile_up_control_s;
-} sh_profile_up_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNTER0" */
/* Performance Counter 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_counter0_u {
mmr_t sh_performance_counter0_regval;
struct {
@@ -20999,22 +11314,12 @@ typedef union sh_performance_counter0_u {
mmr_t reserved_0 : 32;
} sh_performance_counter0_s;
} sh_performance_counter0_u_t;
-#else
-typedef union sh_performance_counter0_u {
- mmr_t sh_performance_counter0_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t count : 32;
- } sh_performance_counter0_s;
-} sh_performance_counter0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNTER1" */
/* Performance Counter 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_counter1_u {
mmr_t sh_performance_counter1_regval;
struct {
@@ -21022,22 +11327,12 @@ typedef union sh_performance_counter1_u {
mmr_t reserved_0 : 32;
} sh_performance_counter1_s;
} sh_performance_counter1_u_t;
-#else
-typedef union sh_performance_counter1_u {
- mmr_t sh_performance_counter1_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t count : 32;
- } sh_performance_counter1_s;
-} sh_performance_counter1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNTER2" */
/* Performance Counter 2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_counter2_u {
mmr_t sh_performance_counter2_regval;
struct {
@@ -21045,22 +11340,12 @@ typedef union sh_performance_counter2_u {
mmr_t reserved_0 : 32;
} sh_performance_counter2_s;
} sh_performance_counter2_u_t;
-#else
-typedef union sh_performance_counter2_u {
- mmr_t sh_performance_counter2_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t count : 32;
- } sh_performance_counter2_s;
-} sh_performance_counter2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNTER3" */
/* Performance Counter 3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_counter3_u {
mmr_t sh_performance_counter3_regval;
struct {
@@ -21068,22 +11353,12 @@ typedef union sh_performance_counter3_u {
mmr_t reserved_0 : 32;
} sh_performance_counter3_s;
} sh_performance_counter3_u_t;
-#else
-typedef union sh_performance_counter3_u {
- mmr_t sh_performance_counter3_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t count : 32;
- } sh_performance_counter3_s;
-} sh_performance_counter3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNTER4" */
/* Performance Counter 4 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_counter4_u {
mmr_t sh_performance_counter4_regval;
struct {
@@ -21091,22 +11366,12 @@ typedef union sh_performance_counter4_u {
mmr_t reserved_0 : 32;
} sh_performance_counter4_s;
} sh_performance_counter4_u_t;
-#else
-typedef union sh_performance_counter4_u {
- mmr_t sh_performance_counter4_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t count : 32;
- } sh_performance_counter4_s;
-} sh_performance_counter4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNTER5" */
/* Performance Counter 5 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_counter5_u {
mmr_t sh_performance_counter5_regval;
struct {
@@ -21114,22 +11379,12 @@ typedef union sh_performance_counter5_u {
mmr_t reserved_0 : 32;
} sh_performance_counter5_s;
} sh_performance_counter5_u_t;
-#else
-typedef union sh_performance_counter5_u {
- mmr_t sh_performance_counter5_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t count : 32;
- } sh_performance_counter5_s;
-} sh_performance_counter5_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNTER6" */
/* Performance Counter 6 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_counter6_u {
mmr_t sh_performance_counter6_regval;
struct {
@@ -21137,22 +11392,12 @@ typedef union sh_performance_counter6_u {
mmr_t reserved_0 : 32;
} sh_performance_counter6_s;
} sh_performance_counter6_u_t;
-#else
-typedef union sh_performance_counter6_u {
- mmr_t sh_performance_counter6_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t count : 32;
- } sh_performance_counter6_s;
-} sh_performance_counter6_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PERFORMANCE_COUNTER7" */
/* Performance Counter 7 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_performance_counter7_u {
mmr_t sh_performance_counter7_regval;
struct {
@@ -21160,22 +11405,12 @@ typedef union sh_performance_counter7_u {
mmr_t reserved_0 : 32;
} sh_performance_counter7_s;
} sh_performance_counter7_u_t;
-#else
-typedef union sh_performance_counter7_u {
- mmr_t sh_performance_counter7_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t count : 32;
- } sh_performance_counter7_s;
-} sh_performance_counter7_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROFILE_COUNTER" */
/* Profile Counter */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_profile_counter_u {
mmr_t sh_profile_counter_regval;
struct {
@@ -21183,22 +11418,12 @@ typedef union sh_profile_counter_u {
mmr_t reserved_0 : 56;
} sh_profile_counter_s;
} sh_profile_counter_u_t;
-#else
-typedef union sh_profile_counter_u {
- mmr_t sh_profile_counter_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t counter : 8;
- } sh_profile_counter_s;
-} sh_profile_counter_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PROFILE_PEAK" */
/* Profile Peak Counter */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_profile_peak_u {
mmr_t sh_profile_peak_regval;
struct {
@@ -21206,22 +11431,12 @@ typedef union sh_profile_peak_u {
mmr_t reserved_0 : 56;
} sh_profile_peak_s;
} sh_profile_peak_u_t;
-#else
-typedef union sh_profile_peak_u {
- mmr_t sh_profile_peak_regval;
- struct {
- mmr_t reserved_0 : 56;
- mmr_t counter : 8;
- } sh_profile_peak_s;
-} sh_profile_peak_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PTC_0" */
/* Puge Translation Cache Message Configuration Information */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ptc_0_u {
mmr_t sh_ptc_0_regval;
struct {
@@ -21233,26 +11448,12 @@ typedef union sh_ptc_0_u {
mmr_t start : 1;
} sh_ptc_0_s;
} sh_ptc_0_u_t;
-#else
-typedef union sh_ptc_0_u {
- mmr_t sh_ptc_0_regval;
- struct {
- mmr_t start : 1;
- mmr_t reserved_1 : 31;
- mmr_t rid : 24;
- mmr_t ps : 6;
- mmr_t reserved_0 : 1;
- mmr_t a : 1;
- } sh_ptc_0_s;
-} sh_ptc_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PTC_1" */
/* Puge Translation Cache Message Configuration Information */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ptc_1_u {
mmr_t sh_ptc_1_regval;
struct {
@@ -21262,24 +11463,12 @@ typedef union sh_ptc_1_u {
mmr_t start : 1;
} sh_ptc_1_s;
} sh_ptc_1_u_t;
-#else
-typedef union sh_ptc_1_u {
- mmr_t sh_ptc_1_regval;
- struct {
- mmr_t start : 1;
- mmr_t reserved_1 : 2;
- mmr_t vpn : 49;
- mmr_t reserved_0 : 12;
- } sh_ptc_1_s;
-} sh_ptc_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PTC_PARMS" */
/* PTC Time-out parmaeters */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_ptc_parms_u {
mmr_t sh_ptc_parms_regval;
struct {
@@ -21288,23 +11477,12 @@ typedef union sh_ptc_parms_u {
mmr_t reserved_0 : 28;
} sh_ptc_parms_s;
} sh_ptc_parms_u_t;
-#else
-typedef union sh_ptc_parms_u {
- mmr_t sh_ptc_parms_regval;
- struct {
- mmr_t reserved_0 : 28;
- mmr_t ptc_to_val : 12;
- mmr_t ptc_to_wrap : 24;
- } sh_ptc_parms_s;
-} sh_ptc_parms_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_INT_CMPA" */
/* RTC Compare Value for Processor A */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_int_cmpa_u {
mmr_t sh_int_cmpa_regval;
struct {
@@ -21312,22 +11490,12 @@ typedef union sh_int_cmpa_u {
mmr_t reserved_0 : 9;
} sh_int_cmpa_s;
} sh_int_cmpa_u_t;
-#else
-typedef union sh_int_cmpa_u {
- mmr_t sh_int_cmpa_regval;
- struct {
- mmr_t reserved_0 : 9;
- mmr_t real_time_cmpa : 55;
- } sh_int_cmpa_s;
-} sh_int_cmpa_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_INT_CMPB" */
/* RTC Compare Value for Processor B */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_int_cmpb_u {
mmr_t sh_int_cmpb_regval;
struct {
@@ -21335,22 +11503,12 @@ typedef union sh_int_cmpb_u {
mmr_t reserved_0 : 9;
} sh_int_cmpb_s;
} sh_int_cmpb_u_t;
-#else
-typedef union sh_int_cmpb_u {
- mmr_t sh_int_cmpb_regval;
- struct {
- mmr_t reserved_0 : 9;
- mmr_t real_time_cmpb : 55;
- } sh_int_cmpb_s;
-} sh_int_cmpb_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_INT_CMPC" */
/* RTC Compare Value for Processor C */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_int_cmpc_u {
mmr_t sh_int_cmpc_regval;
struct {
@@ -21358,22 +11516,12 @@ typedef union sh_int_cmpc_u {
mmr_t reserved_0 : 9;
} sh_int_cmpc_s;
} sh_int_cmpc_u_t;
-#else
-typedef union sh_int_cmpc_u {
- mmr_t sh_int_cmpc_regval;
- struct {
- mmr_t reserved_0 : 9;
- mmr_t real_time_cmpc : 55;
- } sh_int_cmpc_s;
-} sh_int_cmpc_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_INT_CMPD" */
/* RTC Compare Value for Processor D */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_int_cmpd_u {
mmr_t sh_int_cmpd_regval;
struct {
@@ -21381,22 +11529,12 @@ typedef union sh_int_cmpd_u {
mmr_t reserved_0 : 9;
} sh_int_cmpd_s;
} sh_int_cmpd_u_t;
-#else
-typedef union sh_int_cmpd_u {
- mmr_t sh_int_cmpd_regval;
- struct {
- mmr_t reserved_0 : 9;
- mmr_t real_time_cmpd : 55;
- } sh_int_cmpd_s;
-} sh_int_cmpd_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_INT_PROF" */
/* Profile Compare Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_int_prof_u {
mmr_t sh_int_prof_regval;
struct {
@@ -21404,22 +11542,12 @@ typedef union sh_int_prof_u {
mmr_t reserved_0 : 32;
} sh_int_prof_s;
} sh_int_prof_u_t;
-#else
-typedef union sh_int_prof_u {
- mmr_t sh_int_prof_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t profile_compare : 32;
- } sh_int_prof_s;
-} sh_int_prof_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_RTC" */
/* Real-time Clock */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_rtc_u {
mmr_t sh_rtc_regval;
struct {
@@ -21427,85 +11555,48 @@ typedef union sh_rtc_u {
mmr_t reserved_0 : 9;
} sh_rtc_s;
} sh_rtc_u_t;
-#else
-typedef union sh_rtc_u {
- mmr_t sh_rtc_regval;
- struct {
- mmr_t reserved_0 : 9;
- mmr_t real_time_clock : 55;
- } sh_rtc_s;
-} sh_rtc_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_SCRATCH0" */
/* Scratch Register 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_scratch0_u {
mmr_t sh_scratch0_regval;
struct {
mmr_t scratch0 : 64;
} sh_scratch0_s;
} sh_scratch0_u_t;
-#else
-typedef union sh_scratch0_u {
- mmr_t sh_scratch0_regval;
- struct {
- mmr_t scratch0 : 64;
- } sh_scratch0_s;
-} sh_scratch0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_SCRATCH1" */
/* Scratch Register 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_scratch1_u {
- mmr_t sh_scratch1_regval;
- struct {
- mmr_t scratch1 : 64;
- } sh_scratch1_s;
-} sh_scratch1_u_t;
-#else
typedef union sh_scratch1_u {
mmr_t sh_scratch1_regval;
struct {
mmr_t scratch1 : 64;
} sh_scratch1_s;
} sh_scratch1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_SCRATCH2" */
/* Scratch Register 2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_scratch2_u {
- mmr_t sh_scratch2_regval;
- struct {
- mmr_t scratch2 : 64;
- } sh_scratch2_s;
-} sh_scratch2_u_t;
-#else
typedef union sh_scratch2_u {
mmr_t sh_scratch2_regval;
struct {
mmr_t scratch2 : 64;
} sh_scratch2_s;
} sh_scratch2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_SCRATCH3" */
/* Scratch Register 3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_scratch3_u {
mmr_t sh_scratch3_regval;
struct {
@@ -21513,22 +11604,12 @@ typedef union sh_scratch3_u {
mmr_t reserved_0 : 63;
} sh_scratch3_s;
} sh_scratch3_u_t;
-#else
-typedef union sh_scratch3_u {
- mmr_t sh_scratch3_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t scratch3 : 1;
- } sh_scratch3_s;
-} sh_scratch3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_SCRATCH4" */
/* Scratch Register 4 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_scratch4_u {
mmr_t sh_scratch4_regval;
struct {
@@ -21536,22 +11617,12 @@ typedef union sh_scratch4_u {
mmr_t reserved_0 : 63;
} sh_scratch4_s;
} sh_scratch4_u_t;
-#else
-typedef union sh_scratch4_u {
- mmr_t sh_scratch4_regval;
- struct {
- mmr_t reserved_0 : 63;
- mmr_t scratch4 : 1;
- } sh_scratch4_s;
-} sh_scratch4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_CRB_MESSAGE_CONTROL" */
/* Coherent Request Buffer Message Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_crb_message_control_u {
mmr_t sh_crb_message_control_regval;
struct {
@@ -21572,35 +11643,12 @@ typedef union sh_crb_message_control_u {
mmr_t ivack_throttle_control : 16;
} sh_crb_message_control_s;
} sh_crb_message_control_u_t;
-#else
-typedef union sh_crb_message_control_u {
- mmr_t sh_crb_message_control_regval;
- struct {
- mmr_t ivack_throttle_control : 16;
- mmr_t ivack_stall_count : 16;
- mmr_t reserved_0 : 20;
- mmr_t enable_ivack_consolidation : 1;
- mmr_t suppress_bogus_writes : 1;
- mmr_t wrb_attribute_mismatch_xb_enable : 1;
- mmr_t rrb_attribute_mismatch_xb_enable : 1;
- mmr_t irb_attribute_mismatch_fsb_enable : 1;
- mmr_t wrb_attribute_mismatch_fsb_enable : 1;
- mmr_t rrb_attribute_mismatch_fsb_enable : 1;
- mmr_t message_color_enable : 1;
- mmr_t message_color : 1;
- mmr_t remote_speculative_message_enable : 1;
- mmr_t local_speculative_message_enable : 1;
- mmr_t system_coherence_enable : 1;
- } sh_crb_message_control_s;
-} sh_crb_message_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_CRB_NACK_LIMIT" */
/* CRB Nack Limit */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_crb_nack_limit_u {
mmr_t sh_crb_nack_limit_regval;
struct {
@@ -21610,24 +11658,12 @@ typedef union sh_crb_nack_limit_u {
mmr_t enable : 1;
} sh_crb_nack_limit_s;
} sh_crb_nack_limit_u_t;
-#else
-typedef union sh_crb_nack_limit_u {
- mmr_t sh_crb_nack_limit_regval;
- struct {
- mmr_t enable : 1;
- mmr_t reserved_0 : 47;
- mmr_t pri_freq : 4;
- mmr_t limit : 12;
- } sh_crb_nack_limit_s;
-} sh_crb_nack_limit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_CRB_TIMEOUT_PRESCALE" */
/* Coherent Request Buffer Timeout Prescale */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_crb_timeout_prescale_u {
mmr_t sh_crb_timeout_prescale_regval;
struct {
@@ -21635,22 +11671,12 @@ typedef union sh_crb_timeout_prescale_u {
mmr_t reserved_0 : 32;
} sh_crb_timeout_prescale_s;
} sh_crb_timeout_prescale_u_t;
-#else
-typedef union sh_crb_timeout_prescale_u {
- mmr_t sh_crb_timeout_prescale_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t scaling_factor : 32;
- } sh_crb_timeout_prescale_s;
-} sh_crb_timeout_prescale_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_CRB_TIMEOUT_SKID" */
/* Coherent Request Buffer Timeout Skid Limit */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_crb_timeout_skid_u {
mmr_t sh_crb_timeout_skid_regval;
struct {
@@ -21659,23 +11685,12 @@ typedef union sh_crb_timeout_skid_u {
mmr_t reset_skid_count : 1;
} sh_crb_timeout_skid_s;
} sh_crb_timeout_skid_u_t;
-#else
-typedef union sh_crb_timeout_skid_u {
- mmr_t sh_crb_timeout_skid_regval;
- struct {
- mmr_t reset_skid_count : 1;
- mmr_t reserved_0 : 57;
- mmr_t skid : 6;
- } sh_crb_timeout_skid_s;
-} sh_crb_timeout_skid_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MEMORY_WRITE_STATUS_0" */
/* Memory Write Status for CPU 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_memory_write_status_0_u {
mmr_t sh_memory_write_status_0_regval;
struct {
@@ -21683,22 +11698,12 @@ typedef union sh_memory_write_status_0_u {
mmr_t reserved_0 : 58;
} sh_memory_write_status_0_s;
} sh_memory_write_status_0_u_t;
-#else
-typedef union sh_memory_write_status_0_u {
- mmr_t sh_memory_write_status_0_regval;
- struct {
- mmr_t reserved_0 : 58;
- mmr_t pending_write_count : 6;
- } sh_memory_write_status_0_s;
-} sh_memory_write_status_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MEMORY_WRITE_STATUS_1" */
/* Memory Write Status for CPU 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_memory_write_status_1_u {
mmr_t sh_memory_write_status_1_regval;
struct {
@@ -21706,22 +11711,12 @@ typedef union sh_memory_write_status_1_u {
mmr_t reserved_0 : 58;
} sh_memory_write_status_1_s;
} sh_memory_write_status_1_u_t;
-#else
-typedef union sh_memory_write_status_1_u {
- mmr_t sh_memory_write_status_1_regval;
- struct {
- mmr_t reserved_0 : 58;
- mmr_t pending_write_count : 6;
- } sh_memory_write_status_1_s;
-} sh_memory_write_status_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PIO_WRITE_STATUS_0" */
/* PIO Write Status for CPU 0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pio_write_status_0_u {
mmr_t sh_pio_write_status_0_regval;
struct {
@@ -21735,28 +11730,12 @@ typedef union sh_pio_write_status_0_u {
mmr_t writes_ok : 1;
} sh_pio_write_status_0_s;
} sh_pio_write_status_0_u_t;
-#else
-typedef union sh_pio_write_status_0_u {
- mmr_t sh_pio_write_status_0_regval;
- struct {
- mmr_t writes_ok : 1;
- mmr_t reserved_1 : 1;
- mmr_t pending_write_count : 6;
- mmr_t reserved_0 : 6;
- mmr_t write_error_address : 47;
- mmr_t write_error : 1;
- mmr_t write_deadlock : 1;
- mmr_t multi_write_error : 1;
- } sh_pio_write_status_0_s;
-} sh_pio_write_status_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PIO_WRITE_STATUS_1" */
/* PIO Write Status for CPU 1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pio_write_status_1_u {
mmr_t sh_pio_write_status_1_regval;
struct {
@@ -21770,28 +11749,12 @@ typedef union sh_pio_write_status_1_u {
mmr_t writes_ok : 1;
} sh_pio_write_status_1_s;
} sh_pio_write_status_1_u_t;
-#else
-typedef union sh_pio_write_status_1_u {
- mmr_t sh_pio_write_status_1_regval;
- struct {
- mmr_t writes_ok : 1;
- mmr_t reserved_1 : 1;
- mmr_t pending_write_count : 6;
- mmr_t reserved_0 : 6;
- mmr_t write_error_address : 47;
- mmr_t write_error : 1;
- mmr_t write_deadlock : 1;
- mmr_t multi_write_error : 1;
- } sh_pio_write_status_1_s;
-} sh_pio_write_status_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MEMORY_WRITE_STATUS_NON_USER_0" */
/* Memory Write Status for CPU 0. OS access only */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_memory_write_status_non_user_0_u {
mmr_t sh_memory_write_status_non_user_0_regval;
struct {
@@ -21800,23 +11763,12 @@ typedef union sh_memory_write_status_non_user_0_u {
mmr_t clear : 1;
} sh_memory_write_status_non_user_0_s;
} sh_memory_write_status_non_user_0_u_t;
-#else
-typedef union sh_memory_write_status_non_user_0_u {
- mmr_t sh_memory_write_status_non_user_0_regval;
- struct {
- mmr_t clear : 1;
- mmr_t reserved_0 : 57;
- mmr_t pending_write_count : 6;
- } sh_memory_write_status_non_user_0_s;
-} sh_memory_write_status_non_user_0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MEMORY_WRITE_STATUS_NON_USER_1" */
/* Memory Write Status for CPU 1. OS access only */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_memory_write_status_non_user_1_u {
mmr_t sh_memory_write_status_non_user_1_regval;
struct {
@@ -21825,23 +11777,12 @@ typedef union sh_memory_write_status_non_user_1_u {
mmr_t clear : 1;
} sh_memory_write_status_non_user_1_s;
} sh_memory_write_status_non_user_1_u_t;
-#else
-typedef union sh_memory_write_status_non_user_1_u {
- mmr_t sh_memory_write_status_non_user_1_regval;
- struct {
- mmr_t clear : 1;
- mmr_t reserved_0 : 57;
- mmr_t pending_write_count : 6;
- } sh_memory_write_status_non_user_1_s;
-} sh_memory_write_status_non_user_1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MMRBIST_ERR" */
/* Error capture for bist read errors */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_mmrbist_err_u {
mmr_t sh_mmrbist_err_regval;
struct {
@@ -21853,26 +11794,12 @@ typedef union sh_mmrbist_err_u {
mmr_t reserved_1 : 25;
} sh_mmrbist_err_s;
} sh_mmrbist_err_u_t;
-#else
-typedef union sh_mmrbist_err_u {
- mmr_t sh_mmrbist_err_regval;
- struct {
- mmr_t reserved_1 : 25;
- mmr_t cancelled : 1;
- mmr_t multiple_detected : 1;
- mmr_t detected : 1;
- mmr_t reserved_0 : 3;
- mmr_t addr : 33;
- } sh_mmrbist_err_s;
-} sh_mmrbist_err_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MISC_ERR_HDR_LOWER" */
/* Header capture register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_misc_err_hdr_lower_u {
mmr_t sh_misc_err_hdr_lower_regval;
struct {
@@ -21886,28 +11813,12 @@ typedef union sh_misc_err_hdr_lower_u {
mmr_t valid : 1;
} sh_misc_err_hdr_lower_s;
} sh_misc_err_hdr_lower_u_t;
-#else
-typedef union sh_misc_err_hdr_lower_u {
- mmr_t sh_misc_err_hdr_lower_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_2 : 2;
- mmr_t write : 1;
- mmr_t reserved_1 : 2;
- mmr_t src : 14;
- mmr_t cmd : 8;
- mmr_t addr : 33;
- mmr_t reserved_0 : 3;
- } sh_misc_err_hdr_lower_s;
-} sh_misc_err_hdr_lower_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MISC_ERR_HDR_UPPER" */
/* Error header capture packet and protocol errors */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_misc_err_hdr_upper_u {
mmr_t sh_misc_err_hdr_upper_regval;
struct {
@@ -21924,31 +11835,12 @@ typedef union sh_misc_err_hdr_upper_u {
mmr_t reserved_1 : 35;
} sh_misc_err_hdr_upper_s;
} sh_misc_err_hdr_upper_u_t;
-#else
-typedef union sh_misc_err_hdr_upper_u {
- mmr_t sh_misc_err_hdr_upper_regval;
- struct {
- mmr_t reserved_1 : 35;
- mmr_t echo : 9;
- mmr_t reserved_0 : 12;
- mmr_t xn_pkt_size : 1;
- mmr_t pi_pkt_size : 1;
- mmr_t dir_acc : 1;
- mmr_t rmw_cor : 1;
- mmr_t rmw_uc : 1;
- mmr_t nonexist_addr : 1;
- mmr_t illegal_cmd : 1;
- mmr_t dir_protocol : 1;
- } sh_misc_err_hdr_upper_s;
-} sh_misc_err_hdr_upper_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIR_UC_ERR_HDR_LOWER" */
/* Header capture register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_dir_uc_err_hdr_lower_u {
mmr_t sh_dir_uc_err_hdr_lower_regval;
struct {
@@ -21962,28 +11854,12 @@ typedef union sh_dir_uc_err_hdr_lower_u {
mmr_t valid : 1;
} sh_dir_uc_err_hdr_lower_s;
} sh_dir_uc_err_hdr_lower_u_t;
-#else
-typedef union sh_dir_uc_err_hdr_lower_u {
- mmr_t sh_dir_uc_err_hdr_lower_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_2 : 2;
- mmr_t write : 1;
- mmr_t reserved_1 : 2;
- mmr_t src : 14;
- mmr_t cmd : 8;
- mmr_t addr : 33;
- mmr_t reserved_0 : 3;
- } sh_dir_uc_err_hdr_lower_s;
-} sh_dir_uc_err_hdr_lower_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIR_UC_ERR_HDR_UPPER" */
/* Error header capture packet and protocol errors */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_dir_uc_err_hdr_upper_u {
mmr_t sh_dir_uc_err_hdr_upper_regval;
struct {
@@ -21994,25 +11870,12 @@ typedef union sh_dir_uc_err_hdr_upper_u {
mmr_t reserved_2 : 35;
} sh_dir_uc_err_hdr_upper_s;
} sh_dir_uc_err_hdr_upper_u_t;
-#else
-typedef union sh_dir_uc_err_hdr_upper_u {
- mmr_t sh_dir_uc_err_hdr_upper_regval;
- struct {
- mmr_t reserved_2 : 35;
- mmr_t echo : 9;
- mmr_t reserved_1 : 16;
- mmr_t dir_uc : 1;
- mmr_t reserved_0 : 3;
- } sh_dir_uc_err_hdr_upper_s;
-} sh_dir_uc_err_hdr_upper_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIR_COR_ERR_HDR_LOWER" */
/* Header capture register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_dir_cor_err_hdr_lower_u {
mmr_t sh_dir_cor_err_hdr_lower_regval;
struct {
@@ -22026,28 +11889,12 @@ typedef union sh_dir_cor_err_hdr_lower_u {
mmr_t valid : 1;
} sh_dir_cor_err_hdr_lower_s;
} sh_dir_cor_err_hdr_lower_u_t;
-#else
-typedef union sh_dir_cor_err_hdr_lower_u {
- mmr_t sh_dir_cor_err_hdr_lower_regval;
- struct {
- mmr_t valid : 1;
- mmr_t reserved_2 : 2;
- mmr_t write : 1;
- mmr_t reserved_1 : 2;
- mmr_t src : 14;
- mmr_t cmd : 8;
- mmr_t addr : 33;
- mmr_t reserved_0 : 3;
- } sh_dir_cor_err_hdr_lower_s;
-} sh_dir_cor_err_hdr_lower_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_DIR_COR_ERR_HDR_UPPER" */
/* Error header capture packet and protocol errors */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_dir_cor_err_hdr_upper_u {
mmr_t sh_dir_cor_err_hdr_upper_regval;
struct {
@@ -22058,25 +11905,12 @@ typedef union sh_dir_cor_err_hdr_upper_u {
mmr_t reserved_2 : 35;
} sh_dir_cor_err_hdr_upper_s;
} sh_dir_cor_err_hdr_upper_u_t;
-#else
-typedef union sh_dir_cor_err_hdr_upper_u {
- mmr_t sh_dir_cor_err_hdr_upper_regval;
- struct {
- mmr_t reserved_2 : 35;
- mmr_t echo : 9;
- mmr_t reserved_1 : 11;
- mmr_t dir_cor : 1;
- mmr_t reserved_0 : 8;
- } sh_dir_cor_err_hdr_upper_s;
-} sh_dir_cor_err_hdr_upper_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MEM_ERROR_SUMMARY" */
/* Memory error flags */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_mem_error_summary_u {
mmr_t sh_mem_error_summary_regval;
struct {
@@ -22118,56 +11952,12 @@ typedef union sh_mem_error_summary_u {
mmr_t reserved_5 : 29;
} sh_mem_error_summary_s;
} sh_mem_error_summary_u_t;
-#else
-typedef union sh_mem_error_summary_u {
- mmr_t sh_mem_error_summary_regval;
- struct {
- mmr_t reserved_5 : 29;
- mmr_t xn_pkt_size : 1;
- mmr_t pi_pkt_size : 1;
- mmr_t red_black_err_timeout : 1;
- mmr_t xn_request_overflow : 1;
- mmr_t pi_request_overflow : 1;
- mmr_t xn_reply_overflow : 1;
- mmr_t pi_reply_overflow : 1;
- mmr_t reserved_4 : 1;
- mmr_t dqrs_int_hw : 1;
- mmr_t dqrs_int_cor : 1;
- mmr_t dqrs_int_uc : 1;
- mmr_t reserved_3 : 1;
- mmr_t dqrp_int_hw : 1;
- mmr_t dqrp_int_cor : 1;
- mmr_t dqrp_int_uc : 1;
- mmr_t reserved_2 : 1;
- mmr_t dqls_int_hw : 1;
- mmr_t dqls_int_cor : 1;
- mmr_t dqls_int_uc : 1;
- mmr_t reserved_1 : 1;
- mmr_t dqlp_int_hw : 1;
- mmr_t dqlp_int_cor : 1;
- mmr_t dqlp_int_uc : 1;
- mmr_t reserved_0 : 1;
- mmr_t dir_acc : 1;
- mmr_t acy_int_hw : 1;
- mmr_t acx_int_hw : 1;
- mmr_t dqrp_dir_cor : 1;
- mmr_t dqrp_dir_uc : 1;
- mmr_t dqlp_dir_cor : 1;
- mmr_t dqlp_dir_uc : 1;
- mmr_t dqrp_dir_perr : 1;
- mmr_t dqlp_dir_perr : 1;
- mmr_t nonexist_addr : 1;
- mmr_t illegal_cmd : 1;
- } sh_mem_error_summary_s;
-} sh_mem_error_summary_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MEM_ERROR_OVERFLOW" */
/* Memory error flags */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_mem_error_overflow_u {
mmr_t sh_mem_error_overflow_regval;
struct {
@@ -22209,56 +11999,12 @@ typedef union sh_mem_error_overflow_u {
mmr_t reserved_5 : 29;
} sh_mem_error_overflow_s;
} sh_mem_error_overflow_u_t;
-#else
-typedef union sh_mem_error_overflow_u {
- mmr_t sh_mem_error_overflow_regval;
- struct {
- mmr_t reserved_5 : 29;
- mmr_t xn_pkt_size : 1;
- mmr_t pi_pkt_size : 1;
- mmr_t red_black_err_timeout : 1;
- mmr_t xn_request_overflow : 1;
- mmr_t pi_request_overflow : 1;
- mmr_t xn_reply_overflow : 1;
- mmr_t pi_reply_overflow : 1;
- mmr_t reserved_4 : 1;
- mmr_t dqrs_int_hw : 1;
- mmr_t dqrs_int_cor : 1;
- mmr_t dqrs_int_uc : 1;
- mmr_t reserved_3 : 1;
- mmr_t dqrp_int_hw : 1;
- mmr_t dqrp_int_cor : 1;
- mmr_t dqrp_int_uc : 1;
- mmr_t reserved_2 : 1;
- mmr_t dqls_int_hw : 1;
- mmr_t dqls_int_cor : 1;
- mmr_t dqls_int_uc : 1;
- mmr_t reserved_1 : 1;
- mmr_t dqlp_int_hw : 1;
- mmr_t dqlp_int_cor : 1;
- mmr_t dqlp_int_uc : 1;
- mmr_t reserved_0 : 1;
- mmr_t dir_acc : 1;
- mmr_t acy_int_hw : 1;
- mmr_t acx_int_hw : 1;
- mmr_t dqrp_dir_cor : 1;
- mmr_t dqrp_dir_uc : 1;
- mmr_t dqlp_dir_cor : 1;
- mmr_t dqlp_dir_uc : 1;
- mmr_t dqrp_dir_perr : 1;
- mmr_t dqlp_dir_perr : 1;
- mmr_t nonexist_addr : 1;
- mmr_t illegal_cmd : 1;
- } sh_mem_error_overflow_s;
-} sh_mem_error_overflow_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MEM_ERROR_MASK" */
/* Memory error flags */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_mem_error_mask_u {
mmr_t sh_mem_error_mask_regval;
struct {
@@ -22300,56 +12046,12 @@ typedef union sh_mem_error_mask_u {
mmr_t reserved_5 : 29;
} sh_mem_error_mask_s;
} sh_mem_error_mask_u_t;
-#else
-typedef union sh_mem_error_mask_u {
- mmr_t sh_mem_error_mask_regval;
- struct {
- mmr_t reserved_5 : 29;
- mmr_t xn_pkt_size : 1;
- mmr_t pi_pkt_size : 1;
- mmr_t red_black_err_timeout : 1;
- mmr_t xn_request_overflow : 1;
- mmr_t pi_request_overflow : 1;
- mmr_t xn_reply_overflow : 1;
- mmr_t pi_reply_overflow : 1;
- mmr_t reserved_4 : 1;
- mmr_t dqrs_int_hw : 1;
- mmr_t dqrs_int_cor : 1;
- mmr_t dqrs_int_uc : 1;
- mmr_t reserved_3 : 1;
- mmr_t dqrp_int_hw : 1;
- mmr_t dqrp_int_cor : 1;
- mmr_t dqrp_int_uc : 1;
- mmr_t reserved_2 : 1;
- mmr_t dqls_int_hw : 1;
- mmr_t dqls_int_cor : 1;
- mmr_t dqls_int_uc : 1;
- mmr_t reserved_1 : 1;
- mmr_t dqlp_int_hw : 1;
- mmr_t dqlp_int_cor : 1;
- mmr_t dqlp_int_uc : 1;
- mmr_t reserved_0 : 1;
- mmr_t dir_acc : 1;
- mmr_t acy_int_hw : 1;
- mmr_t acx_int_hw : 1;
- mmr_t dqrp_dir_cor : 1;
- mmr_t dqrp_dir_uc : 1;
- mmr_t dqlp_dir_cor : 1;
- mmr_t dqlp_dir_uc : 1;
- mmr_t dqrp_dir_perr : 1;
- mmr_t dqlp_dir_perr : 1;
- mmr_t nonexist_addr : 1;
- mmr_t illegal_cmd : 1;
- } sh_mem_error_mask_s;
-} sh_mem_error_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_DIMM_CFG" */
/* AC Mem Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_dimm_cfg_u {
mmr_t sh_x_dimm_cfg_regval;
struct {
@@ -22377,42 +12079,12 @@ typedef union sh_x_dimm_cfg_u {
mmr_t reserved_4 : 28;
} sh_x_dimm_cfg_s;
} sh_x_dimm_cfg_u_t;
-#else
-typedef union sh_x_dimm_cfg_u {
- mmr_t sh_x_dimm_cfg_regval;
- struct {
- mmr_t reserved_4 : 28;
- mmr_t freq : 4;
- mmr_t reserved_3 : 1;
- mmr_t dimm3_cs : 2;
- mmr_t dimm3_rev : 1;
- mmr_t dimm3_2bk : 1;
- mmr_t dimm3_size : 3;
- mmr_t reserved_2 : 1;
- mmr_t dimm2_cs : 2;
- mmr_t dimm2_rev : 1;
- mmr_t dimm2_2bk : 1;
- mmr_t dimm2_size : 3;
- mmr_t reserved_1 : 1;
- mmr_t dimm1_cs : 2;
- mmr_t dimm1_rev : 1;
- mmr_t dimm1_2bk : 1;
- mmr_t dimm1_size : 3;
- mmr_t reserved_0 : 1;
- mmr_t dimm0_cs : 2;
- mmr_t dimm0_rev : 1;
- mmr_t dimm0_2bk : 1;
- mmr_t dimm0_size : 3;
- } sh_x_dimm_cfg_s;
-} sh_x_dimm_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_DIMM_CFG" */
/* AC Mem Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_dimm_cfg_u {
mmr_t sh_y_dimm_cfg_regval;
struct {
@@ -22440,42 +12112,12 @@ typedef union sh_y_dimm_cfg_u {
mmr_t reserved_4 : 28;
} sh_y_dimm_cfg_s;
} sh_y_dimm_cfg_u_t;
-#else
-typedef union sh_y_dimm_cfg_u {
- mmr_t sh_y_dimm_cfg_regval;
- struct {
- mmr_t reserved_4 : 28;
- mmr_t freq : 4;
- mmr_t reserved_3 : 1;
- mmr_t dimm3_cs : 2;
- mmr_t dimm3_rev : 1;
- mmr_t dimm3_2bk : 1;
- mmr_t dimm3_size : 3;
- mmr_t reserved_2 : 1;
- mmr_t dimm2_cs : 2;
- mmr_t dimm2_rev : 1;
- mmr_t dimm2_2bk : 1;
- mmr_t dimm2_size : 3;
- mmr_t reserved_1 : 1;
- mmr_t dimm1_cs : 2;
- mmr_t dimm1_rev : 1;
- mmr_t dimm1_2bk : 1;
- mmr_t dimm1_size : 3;
- mmr_t reserved_0 : 1;
- mmr_t dimm0_cs : 2;
- mmr_t dimm0_rev : 1;
- mmr_t dimm0_2bk : 1;
- mmr_t dimm0_size : 3;
- } sh_y_dimm_cfg_s;
-} sh_y_dimm_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_JNR_DIMM_CFG" */
/* AC Mem Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_jnr_dimm_cfg_u {
mmr_t sh_jnr_dimm_cfg_regval;
struct {
@@ -22503,42 +12145,12 @@ typedef union sh_jnr_dimm_cfg_u {
mmr_t reserved_4 : 28;
} sh_jnr_dimm_cfg_s;
} sh_jnr_dimm_cfg_u_t;
-#else
-typedef union sh_jnr_dimm_cfg_u {
- mmr_t sh_jnr_dimm_cfg_regval;
- struct {
- mmr_t reserved_4 : 28;
- mmr_t freq : 4;
- mmr_t reserved_3 : 1;
- mmr_t dimm3_cs : 2;
- mmr_t dimm3_rev : 1;
- mmr_t dimm3_2bk : 1;
- mmr_t dimm3_size : 3;
- mmr_t reserved_2 : 1;
- mmr_t dimm2_cs : 2;
- mmr_t dimm2_rev : 1;
- mmr_t dimm2_2bk : 1;
- mmr_t dimm2_size : 3;
- mmr_t reserved_1 : 1;
- mmr_t dimm1_cs : 2;
- mmr_t dimm1_rev : 1;
- mmr_t dimm1_2bk : 1;
- mmr_t dimm1_size : 3;
- mmr_t reserved_0 : 1;
- mmr_t dimm0_cs : 2;
- mmr_t dimm0_rev : 1;
- mmr_t dimm0_2bk : 1;
- mmr_t dimm0_size : 3;
- } sh_jnr_dimm_cfg_s;
-} sh_jnr_dimm_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_PHASE_CFG" */
/* AC Phase Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_phase_cfg_u {
mmr_t sh_x_phase_cfg_regval;
struct {
@@ -22560,36 +12172,12 @@ typedef union sh_x_phase_cfg_u {
mmr_t reserved_0 : 1;
} sh_x_phase_cfg_s;
} sh_x_phase_cfg_u_t;
-#else
-typedef union sh_x_phase_cfg_u {
- mmr_t sh_x_phase_cfg_regval;
- struct {
- mmr_t reserved_0 : 1;
- mmr_t dq_sel_a : 4;
- mmr_t sel_a : 4;
- mmr_t phe_bubble : 3;
- mmr_t phd_bubble : 3;
- mmr_t phc_bubble : 3;
- mmr_t phb_bubble : 3;
- mmr_t pha_bubble : 3;
- mmr_t bubble_en : 5;
- mmr_t add_cp : 5;
- mmr_t hold_req : 5;
- mmr_t hold : 5;
- mmr_t dq_ld_b : 5;
- mmr_t dq_ld_a : 5;
- mmr_t ld_b : 5;
- mmr_t ld_a : 5;
- } sh_x_phase_cfg_s;
-} sh_x_phase_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_CFG" */
/* AC Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_cfg_u {
mmr_t sh_x_cfg_regval;
struct {
@@ -22609,34 +12197,12 @@ typedef union sh_x_cfg_u {
mmr_t clr_dir_cache : 1;
} sh_x_cfg_s;
} sh_x_cfg_u_t;
-#else
-typedef union sh_x_cfg_u {
- mmr_t sh_x_cfg_regval;
- struct {
- mmr_t clr_dir_cache : 1;
- mmr_t inv_cas_addr : 1;
- mmr_t req_cntr_val : 6;
- mmr_t req_cntr_dis : 1;
- mmr_t trcd4_en : 1;
- mmr_t trcd2_en : 1;
- mmr_t sso_wt_en : 1;
- mmr_t wt_bb_clr : 4;
- mmr_t dc_bb_clr : 4;
- mmr_t da_bb_clr : 4;
- mmr_t ta_dlys : 32;
- mmr_t dir_counter_init : 6;
- mmr_t dirc_random_replacement : 1;
- mmr_t mode_serial : 1;
- } sh_x_cfg_s;
-} sh_x_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_DQCT_CFG" */
/* AC Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_dqct_cfg_u {
mmr_t sh_x_dqct_cfg_regval;
struct {
@@ -22649,27 +12215,12 @@ typedef union sh_x_dqct_cfg_u {
mmr_t reserved_0 : 40;
} sh_x_dqct_cfg_s;
} sh_x_dqct_cfg_u_t;
-#else
-typedef union sh_x_dqct_cfg_u {
- mmr_t sh_x_dqct_cfg_regval;
- struct {
- mmr_t reserved_0 : 40;
- mmr_t mdir_rd_sel : 4;
- mmr_t dir_rd_sel : 4;
- mmr_t dta_wt_sel : 4;
- mmr_t dta_rd_sel : 4;
- mmr_t wt_sel : 4;
- mmr_t rd_sel : 4;
- } sh_x_dqct_cfg_s;
-} sh_x_dqct_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_REFRESH_CONTROL" */
/* Refresh Control Register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_refresh_control_u {
mmr_t sh_x_refresh_control_regval;
struct {
@@ -22681,26 +12232,12 @@ typedef union sh_x_refresh_control_u {
mmr_t reserved_0 : 36;
} sh_x_refresh_control_s;
} sh_x_refresh_control_u_t;
-#else
-typedef union sh_x_refresh_control_u {
- mmr_t sh_x_refresh_control_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t half_rate : 4;
- mmr_t interleave : 1;
- mmr_t hold : 6;
- mmr_t interval : 9;
- mmr_t enable : 8;
- } sh_x_refresh_control_s;
-} sh_x_refresh_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_PHASE_CFG" */
/* AC Phase Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_phase_cfg_u {
mmr_t sh_y_phase_cfg_regval;
struct {
@@ -22722,36 +12259,12 @@ typedef union sh_y_phase_cfg_u {
mmr_t reserved_0 : 1;
} sh_y_phase_cfg_s;
} sh_y_phase_cfg_u_t;
-#else
-typedef union sh_y_phase_cfg_u {
- mmr_t sh_y_phase_cfg_regval;
- struct {
- mmr_t reserved_0 : 1;
- mmr_t dq_sel_a : 4;
- mmr_t sel_a : 4;
- mmr_t phe_bubble : 3;
- mmr_t phd_bubble : 3;
- mmr_t phc_bubble : 3;
- mmr_t phb_bubble : 3;
- mmr_t pha_bubble : 3;
- mmr_t bubble_en : 5;
- mmr_t add_cp : 5;
- mmr_t hold_req : 5;
- mmr_t hold : 5;
- mmr_t dq_ld_b : 5;
- mmr_t dq_ld_a : 5;
- mmr_t ld_b : 5;
- mmr_t ld_a : 5;
- } sh_y_phase_cfg_s;
-} sh_y_phase_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_CFG" */
/* AC Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_cfg_u {
mmr_t sh_y_cfg_regval;
struct {
@@ -22771,34 +12284,12 @@ typedef union sh_y_cfg_u {
mmr_t clr_dir_cache : 1;
} sh_y_cfg_s;
} sh_y_cfg_u_t;
-#else
-typedef union sh_y_cfg_u {
- mmr_t sh_y_cfg_regval;
- struct {
- mmr_t clr_dir_cache : 1;
- mmr_t inv_cas_addr : 1;
- mmr_t req_cntr_val : 6;
- mmr_t req_cntr_dis : 1;
- mmr_t trcd4_en : 1;
- mmr_t trcd2_en : 1;
- mmr_t sso_wt_en : 1;
- mmr_t wt_bb_clr : 4;
- mmr_t dc_bb_clr : 4;
- mmr_t da_bb_clr : 4;
- mmr_t ta_dlys : 32;
- mmr_t dir_counter_init : 6;
- mmr_t dirc_random_replacement : 1;
- mmr_t mode_serial : 1;
- } sh_y_cfg_s;
-} sh_y_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_DQCT_CFG" */
/* AC Config Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_dqct_cfg_u {
mmr_t sh_y_dqct_cfg_regval;
struct {
@@ -22811,27 +12302,12 @@ typedef union sh_y_dqct_cfg_u {
mmr_t reserved_0 : 40;
} sh_y_dqct_cfg_s;
} sh_y_dqct_cfg_u_t;
-#else
-typedef union sh_y_dqct_cfg_u {
- mmr_t sh_y_dqct_cfg_regval;
- struct {
- mmr_t reserved_0 : 40;
- mmr_t mdir_rd_sel : 4;
- mmr_t dir_rd_sel : 4;
- mmr_t dta_wt_sel : 4;
- mmr_t dta_rd_sel : 4;
- mmr_t wt_sel : 4;
- mmr_t rd_sel : 4;
- } sh_y_dqct_cfg_s;
-} sh_y_dqct_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_REFRESH_CONTROL" */
/* Refresh Control Register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_refresh_control_u {
mmr_t sh_y_refresh_control_regval;
struct {
@@ -22843,26 +12319,12 @@ typedef union sh_y_refresh_control_u {
mmr_t reserved_0 : 36;
} sh_y_refresh_control_s;
} sh_y_refresh_control_u_t;
-#else
-typedef union sh_y_refresh_control_u {
- mmr_t sh_y_refresh_control_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t half_rate : 4;
- mmr_t interleave : 1;
- mmr_t hold : 6;
- mmr_t interval : 9;
- mmr_t enable : 8;
- } sh_y_refresh_control_s;
-} sh_y_refresh_control_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MEM_RED_BLACK" */
/* MD fairness watchdog timers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_mem_red_black_u {
mmr_t sh_mem_red_black_regval;
struct {
@@ -22871,22 +12333,11 @@ typedef union sh_mem_red_black_u {
mmr_t reserved_0 : 12;
} sh_mem_red_black_s;
} sh_mem_red_black_u_t;
-#else
-typedef union sh_mem_red_black_u {
- mmr_t sh_mem_red_black_regval;
- struct {
- mmr_t reserved_0 : 12;
- mmr_t err_time : 36;
- mmr_t time : 16;
- } sh_mem_red_black_s;
-} sh_mem_red_black_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MISC_MEM_CFG" */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_misc_mem_cfg_u {
mmr_t sh_misc_mem_cfg_regval;
struct {
@@ -22909,37 +12360,12 @@ typedef union sh_misc_mem_cfg_u {
mmr_t reserved_5 : 11;
} sh_misc_mem_cfg_s;
} sh_misc_mem_cfg_u_t;
-#else
-typedef union sh_misc_mem_cfg_u {
- mmr_t sh_misc_mem_cfg_regval;
- struct {
- mmr_t reserved_5 : 11;
- mmr_t alternate_xn_rp_plane : 1;
- mmr_t reserved_4 : 2;
- mmr_t disabled_victims : 6;
- mmr_t reserved_3 : 3;
- mmr_t disabled_write_tnums : 5;
- mmr_t reserved_2 : 3;
- mmr_t disabled_read_tnums : 5;
- mmr_t throttle_cnt : 8;
- mmr_t reserved_1 : 2;
- mmr_t low_victim_buffer_threshold : 6;
- mmr_t reserved_0 : 2;
- mmr_t low_write_buffer_threshold : 6;
- mmr_t xn_rd_same_as_pi : 1;
- mmr_t jnr_bypass_enable : 1;
- mmr_t spec_header_enable : 1;
- mmr_t express_header_enable : 1;
- } sh_misc_mem_cfg_s;
-} sh_misc_mem_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PIO_RQ_CRD_CTL" */
/* pio_rq Credit Circulation Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pio_rq_crd_ctl_u {
mmr_t sh_pio_rq_crd_ctl_regval;
struct {
@@ -22947,22 +12373,12 @@ typedef union sh_pio_rq_crd_ctl_u {
mmr_t reserved_0 : 58;
} sh_pio_rq_crd_ctl_s;
} sh_pio_rq_crd_ctl_u_t;
-#else
-typedef union sh_pio_rq_crd_ctl_u {
- mmr_t sh_pio_rq_crd_ctl_regval;
- struct {
- mmr_t reserved_0 : 58;
- mmr_t depth : 6;
- } sh_pio_rq_crd_ctl_s;
-} sh_pio_rq_crd_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_MD_RQ_CRD_CTL" */
/* pi_md_rq Credit Circulation Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_md_rq_crd_ctl_u {
mmr_t sh_pi_md_rq_crd_ctl_regval;
struct {
@@ -22970,22 +12386,12 @@ typedef union sh_pi_md_rq_crd_ctl_u {
mmr_t reserved_0 : 58;
} sh_pi_md_rq_crd_ctl_s;
} sh_pi_md_rq_crd_ctl_u_t;
-#else
-typedef union sh_pi_md_rq_crd_ctl_u {
- mmr_t sh_pi_md_rq_crd_ctl_regval;
- struct {
- mmr_t reserved_0 : 58;
- mmr_t depth : 6;
- } sh_pi_md_rq_crd_ctl_s;
-} sh_pi_md_rq_crd_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_PI_MD_RP_CRD_CTL" */
/* pi_md_rp Credit Circulation Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_pi_md_rp_crd_ctl_u {
mmr_t sh_pi_md_rp_crd_ctl_regval;
struct {
@@ -22993,22 +12399,12 @@ typedef union sh_pi_md_rp_crd_ctl_u {
mmr_t reserved_0 : 58;
} sh_pi_md_rp_crd_ctl_s;
} sh_pi_md_rp_crd_ctl_u_t;
-#else
-typedef union sh_pi_md_rp_crd_ctl_u {
- mmr_t sh_pi_md_rp_crd_ctl_regval;
- struct {
- mmr_t reserved_0 : 58;
- mmr_t depth : 6;
- } sh_pi_md_rp_crd_ctl_s;
-} sh_pi_md_rp_crd_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_RQ_CRD_CTL" */
/* xn_md_rq Credit Circulation Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_md_rq_crd_ctl_u {
mmr_t sh_xn_md_rq_crd_ctl_regval;
struct {
@@ -23016,22 +12412,12 @@ typedef union sh_xn_md_rq_crd_ctl_u {
mmr_t reserved_0 : 58;
} sh_xn_md_rq_crd_ctl_s;
} sh_xn_md_rq_crd_ctl_u_t;
-#else
-typedef union sh_xn_md_rq_crd_ctl_u {
- mmr_t sh_xn_md_rq_crd_ctl_regval;
- struct {
- mmr_t reserved_0 : 58;
- mmr_t depth : 6;
- } sh_xn_md_rq_crd_ctl_s;
-} sh_xn_md_rq_crd_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_XN_MD_RP_CRD_CTL" */
/* xn_md_rp Credit Circulation Control */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_xn_md_rp_crd_ctl_u {
mmr_t sh_xn_md_rp_crd_ctl_regval;
struct {
@@ -23039,22 +12425,12 @@ typedef union sh_xn_md_rp_crd_ctl_u {
mmr_t reserved_0 : 58;
} sh_xn_md_rp_crd_ctl_s;
} sh_xn_md_rp_crd_ctl_u_t;
-#else
-typedef union sh_xn_md_rp_crd_ctl_u {
- mmr_t sh_xn_md_rp_crd_ctl_regval;
- struct {
- mmr_t reserved_0 : 58;
- mmr_t depth : 6;
- } sh_xn_md_rp_crd_ctl_s;
-} sh_xn_md_rp_crd_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_TAG0" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_tag0_u {
mmr_t sh_x_tag0_regval;
struct {
@@ -23062,22 +12438,12 @@ typedef union sh_x_tag0_u {
mmr_t reserved_0 : 44;
} sh_x_tag0_s;
} sh_x_tag0_u_t;
-#else
-typedef union sh_x_tag0_u {
- mmr_t sh_x_tag0_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_x_tag0_s;
-} sh_x_tag0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_TAG1" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_tag1_u {
mmr_t sh_x_tag1_regval;
struct {
@@ -23085,22 +12451,12 @@ typedef union sh_x_tag1_u {
mmr_t reserved_0 : 44;
} sh_x_tag1_s;
} sh_x_tag1_u_t;
-#else
-typedef union sh_x_tag1_u {
- mmr_t sh_x_tag1_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_x_tag1_s;
-} sh_x_tag1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_TAG2" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_tag2_u {
mmr_t sh_x_tag2_regval;
struct {
@@ -23108,22 +12464,12 @@ typedef union sh_x_tag2_u {
mmr_t reserved_0 : 44;
} sh_x_tag2_s;
} sh_x_tag2_u_t;
-#else
-typedef union sh_x_tag2_u {
- mmr_t sh_x_tag2_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_x_tag2_s;
-} sh_x_tag2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_TAG3" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_tag3_u {
mmr_t sh_x_tag3_regval;
struct {
@@ -23131,22 +12477,12 @@ typedef union sh_x_tag3_u {
mmr_t reserved_0 : 44;
} sh_x_tag3_s;
} sh_x_tag3_u_t;
-#else
-typedef union sh_x_tag3_u {
- mmr_t sh_x_tag3_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_x_tag3_s;
-} sh_x_tag3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_TAG4" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_tag4_u {
mmr_t sh_x_tag4_regval;
struct {
@@ -23154,22 +12490,12 @@ typedef union sh_x_tag4_u {
mmr_t reserved_0 : 44;
} sh_x_tag4_s;
} sh_x_tag4_u_t;
-#else
-typedef union sh_x_tag4_u {
- mmr_t sh_x_tag4_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_x_tag4_s;
-} sh_x_tag4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_TAG5" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_tag5_u {
mmr_t sh_x_tag5_regval;
struct {
@@ -23177,22 +12503,12 @@ typedef union sh_x_tag5_u {
mmr_t reserved_0 : 44;
} sh_x_tag5_s;
} sh_x_tag5_u_t;
-#else
-typedef union sh_x_tag5_u {
- mmr_t sh_x_tag5_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_x_tag5_s;
-} sh_x_tag5_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_TAG6" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_tag6_u {
mmr_t sh_x_tag6_regval;
struct {
@@ -23200,22 +12516,12 @@ typedef union sh_x_tag6_u {
mmr_t reserved_0 : 44;
} sh_x_tag6_s;
} sh_x_tag6_u_t;
-#else
-typedef union sh_x_tag6_u {
- mmr_t sh_x_tag6_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_x_tag6_s;
-} sh_x_tag6_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_TAG7" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_tag7_u {
mmr_t sh_x_tag7_regval;
struct {
@@ -23223,22 +12529,12 @@ typedef union sh_x_tag7_u {
mmr_t reserved_0 : 44;
} sh_x_tag7_s;
} sh_x_tag7_u_t;
-#else
-typedef union sh_x_tag7_u {
- mmr_t sh_x_tag7_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_x_tag7_s;
-} sh_x_tag7_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_TAG0" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_tag0_u {
mmr_t sh_y_tag0_regval;
struct {
@@ -23246,22 +12542,12 @@ typedef union sh_y_tag0_u {
mmr_t reserved_0 : 44;
} sh_y_tag0_s;
} sh_y_tag0_u_t;
-#else
-typedef union sh_y_tag0_u {
- mmr_t sh_y_tag0_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_y_tag0_s;
-} sh_y_tag0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_TAG1" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_tag1_u {
mmr_t sh_y_tag1_regval;
struct {
@@ -23269,22 +12555,12 @@ typedef union sh_y_tag1_u {
mmr_t reserved_0 : 44;
} sh_y_tag1_s;
} sh_y_tag1_u_t;
-#else
-typedef union sh_y_tag1_u {
- mmr_t sh_y_tag1_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_y_tag1_s;
-} sh_y_tag1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_TAG2" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_tag2_u {
mmr_t sh_y_tag2_regval;
struct {
@@ -23292,22 +12568,12 @@ typedef union sh_y_tag2_u {
mmr_t reserved_0 : 44;
} sh_y_tag2_s;
} sh_y_tag2_u_t;
-#else
-typedef union sh_y_tag2_u {
- mmr_t sh_y_tag2_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_y_tag2_s;
-} sh_y_tag2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_TAG3" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_tag3_u {
mmr_t sh_y_tag3_regval;
struct {
@@ -23315,22 +12581,12 @@ typedef union sh_y_tag3_u {
mmr_t reserved_0 : 44;
} sh_y_tag3_s;
} sh_y_tag3_u_t;
-#else
-typedef union sh_y_tag3_u {
- mmr_t sh_y_tag3_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_y_tag3_s;
-} sh_y_tag3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_TAG4" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_tag4_u {
mmr_t sh_y_tag4_regval;
struct {
@@ -23338,22 +12594,12 @@ typedef union sh_y_tag4_u {
mmr_t reserved_0 : 44;
} sh_y_tag4_s;
} sh_y_tag4_u_t;
-#else
-typedef union sh_y_tag4_u {
- mmr_t sh_y_tag4_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_y_tag4_s;
-} sh_y_tag4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_TAG5" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_tag5_u {
mmr_t sh_y_tag5_regval;
struct {
@@ -23361,22 +12607,12 @@ typedef union sh_y_tag5_u {
mmr_t reserved_0 : 44;
} sh_y_tag5_s;
} sh_y_tag5_u_t;
-#else
-typedef union sh_y_tag5_u {
- mmr_t sh_y_tag5_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_y_tag5_s;
-} sh_y_tag5_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_TAG6" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_tag6_u {
mmr_t sh_y_tag6_regval;
struct {
@@ -23384,22 +12620,12 @@ typedef union sh_y_tag6_u {
mmr_t reserved_0 : 44;
} sh_y_tag6_s;
} sh_y_tag6_u_t;
-#else
-typedef union sh_y_tag6_u {
- mmr_t sh_y_tag6_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_y_tag6_s;
-} sh_y_tag6_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_TAG7" */
/* AC tag Registers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_tag7_u {
mmr_t sh_y_tag7_regval;
struct {
@@ -23407,22 +12633,12 @@ typedef union sh_y_tag7_u {
mmr_t reserved_0 : 44;
} sh_y_tag7_s;
} sh_y_tag7_u_t;
-#else
-typedef union sh_y_tag7_u {
- mmr_t sh_y_tag7_regval;
- struct {
- mmr_t reserved_0 : 44;
- mmr_t tag : 20;
- } sh_y_tag7_s;
-} sh_y_tag7_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MMRBIST_BASE" */
/* mmr/bist base address */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_mmrbist_base_u {
mmr_t sh_mmrbist_base_regval;
struct {
@@ -23431,23 +12647,12 @@ typedef union sh_mmrbist_base_u {
mmr_t reserved_1 : 14;
} sh_mmrbist_base_s;
} sh_mmrbist_base_u_t;
-#else
-typedef union sh_mmrbist_base_u {
- mmr_t sh_mmrbist_base_regval;
- struct {
- mmr_t reserved_1 : 14;
- mmr_t dword_addr : 47;
- mmr_t reserved_0 : 3;
- } sh_mmrbist_base_s;
-} sh_mmrbist_base_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MMRBIST_CTL" */
/* Bist base address */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_mmrbist_ctl_u {
mmr_t sh_mmrbist_ctl_regval;
struct {
@@ -23463,30 +12668,12 @@ typedef union sh_mmrbist_ctl_u {
mmr_t reserved_3 : 19;
} sh_mmrbist_ctl_s;
} sh_mmrbist_ctl_u_t;
-#else
-typedef union sh_mmrbist_ctl_u {
- mmr_t sh_mmrbist_ctl_regval;
- struct {
- mmr_t reserved_3 : 19;
- mmr_t reset_state : 1;
- mmr_t reserved_2 : 1;
- mmr_t mem_idle : 1;
- mmr_t fail : 1;
- mmr_t in_progress : 1;
- mmr_t reserved_1 : 1;
- mmr_t cmd : 7;
- mmr_t reserved_0 : 1;
- mmr_t block_length : 31;
- } sh_mmrbist_ctl_s;
-} sh_mmrbist_ctl_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DBUG_DATA_CFG" */
/* configuration for md debug data muxes */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dbug_data_cfg_u {
mmr_t sh_md_dbug_data_cfg_regval;
struct {
@@ -23524,52 +12711,12 @@ typedef union sh_md_dbug_data_cfg_u {
mmr_t reserved_15 : 1;
} sh_md_dbug_data_cfg_s;
} sh_md_dbug_data_cfg_u_t;
-#else
-typedef union sh_md_dbug_data_cfg_u {
- mmr_t sh_md_dbug_data_cfg_regval;
- struct {
- mmr_t reserved_15 : 1;
- mmr_t nibble7_nibble : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_chiplet : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_chiplet : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_chiplet : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_chiplet : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_chiplet : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_chiplet : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_chiplet : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_chiplet : 3;
- } sh_md_dbug_data_cfg_s;
-} sh_md_dbug_data_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DBUG_TRIGGER_CFG" */
/* configuration for md debug triggers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dbug_trigger_cfg_u {
mmr_t sh_md_dbug_trigger_cfg_regval;
struct {
@@ -23607,52 +12754,12 @@ typedef union sh_md_dbug_trigger_cfg_u {
mmr_t enable : 1;
} sh_md_dbug_trigger_cfg_s;
} sh_md_dbug_trigger_cfg_u_t;
-#else
-typedef union sh_md_dbug_trigger_cfg_u {
- mmr_t sh_md_dbug_trigger_cfg_regval;
- struct {
- mmr_t enable : 1;
- mmr_t nibble7_nibble : 3;
- mmr_t reserved_14 : 1;
- mmr_t nibble7_chiplet : 3;
- mmr_t reserved_13 : 1;
- mmr_t nibble6_nibble : 3;
- mmr_t reserved_12 : 1;
- mmr_t nibble6_chiplet : 3;
- mmr_t reserved_11 : 1;
- mmr_t nibble5_nibble : 3;
- mmr_t reserved_10 : 1;
- mmr_t nibble5_chiplet : 3;
- mmr_t reserved_9 : 1;
- mmr_t nibble4_nibble : 3;
- mmr_t reserved_8 : 1;
- mmr_t nibble4_chiplet : 3;
- mmr_t reserved_7 : 1;
- mmr_t nibble3_nibble : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble3_chiplet : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble2_nibble : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble2_chiplet : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble1_nibble : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble1_chiplet : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble0_nibble : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_chiplet : 3;
- } sh_md_dbug_trigger_cfg_s;
-} sh_md_dbug_trigger_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DBUG_COMPARE" */
/* md debug compare pattern and mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dbug_compare_u {
mmr_t sh_md_dbug_compare_regval;
struct {
@@ -23660,22 +12767,12 @@ typedef union sh_md_dbug_compare_u {
mmr_t mask : 32;
} sh_md_dbug_compare_s;
} sh_md_dbug_compare_u_t;
-#else
-typedef union sh_md_dbug_compare_u {
- mmr_t sh_md_dbug_compare_regval;
- struct {
- mmr_t mask : 32;
- mmr_t pattern : 32;
- } sh_md_dbug_compare_s;
-} sh_md_dbug_compare_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_MOD_DBUG_SEL" */
/* MD acx debug select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_mod_dbug_sel_u {
mmr_t sh_x_mod_dbug_sel_regval;
struct {
@@ -23689,28 +12786,12 @@ typedef union sh_x_mod_dbug_sel_u {
mmr_t reserved_0 : 6;
} sh_x_mod_dbug_sel_s;
} sh_x_mod_dbug_sel_u_t;
-#else
-typedef union sh_x_mod_dbug_sel_u {
- mmr_t sh_x_mod_dbug_sel_regval;
- struct {
- mmr_t reserved_0 : 6;
- mmr_t dqr_sel : 6;
- mmr_t dql_sel : 6;
- mmr_t atr_sel : 11;
- mmr_t atl_sel : 11;
- mmr_t arb_sel : 8;
- mmr_t wbq_sel : 8;
- mmr_t tag_sel : 8;
- } sh_x_mod_dbug_sel_s;
-} sh_x_mod_dbug_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_DBUG_SEL" */
/* MD acx debug select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_dbug_sel_u {
mmr_t sh_x_dbug_sel_regval;
struct {
@@ -23718,22 +12799,12 @@ typedef union sh_x_dbug_sel_u {
mmr_t reserved_0 : 40;
} sh_x_dbug_sel_s;
} sh_x_dbug_sel_u_t;
-#else
-typedef union sh_x_dbug_sel_u {
- mmr_t sh_x_dbug_sel_regval;
- struct {
- mmr_t reserved_0 : 40;
- mmr_t dbg_sel : 24;
- } sh_x_dbug_sel_s;
-} sh_x_dbug_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_LADDR_CMP" */
/* MD acx address compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_laddr_cmp_u {
mmr_t sh_x_laddr_cmp_regval;
struct {
@@ -23743,24 +12814,12 @@ typedef union sh_x_laddr_cmp_u {
mmr_t reserved_1 : 4;
} sh_x_laddr_cmp_s;
} sh_x_laddr_cmp_u_t;
-#else
-typedef union sh_x_laddr_cmp_u {
- mmr_t sh_x_laddr_cmp_regval;
- struct {
- mmr_t reserved_1 : 4;
- mmr_t mask_val : 28;
- mmr_t reserved_0 : 4;
- mmr_t cmp_val : 28;
- } sh_x_laddr_cmp_s;
-} sh_x_laddr_cmp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_RADDR_CMP" */
/* MD acx address compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_raddr_cmp_u {
mmr_t sh_x_raddr_cmp_regval;
struct {
@@ -23770,24 +12829,12 @@ typedef union sh_x_raddr_cmp_u {
mmr_t reserved_1 : 4;
} sh_x_raddr_cmp_s;
} sh_x_raddr_cmp_u_t;
-#else
-typedef union sh_x_raddr_cmp_u {
- mmr_t sh_x_raddr_cmp_regval;
- struct {
- mmr_t reserved_1 : 4;
- mmr_t mask_val : 28;
- mmr_t reserved_0 : 4;
- mmr_t cmp_val : 28;
- } sh_x_raddr_cmp_s;
-} sh_x_raddr_cmp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_TAG_CMP" */
/* MD acx tagmgr compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_tag_cmp_u {
mmr_t sh_x_tag_cmp_regval;
struct {
@@ -23797,24 +12844,12 @@ typedef union sh_x_tag_cmp_u {
mmr_t reserved_0 : 9;
} sh_x_tag_cmp_s;
} sh_x_tag_cmp_u_t;
-#else
-typedef union sh_x_tag_cmp_u {
- mmr_t sh_x_tag_cmp_regval;
- struct {
- mmr_t reserved_0 : 9;
- mmr_t src : 14;
- mmr_t addr : 33;
- mmr_t cmd : 8;
- } sh_x_tag_cmp_s;
-} sh_x_tag_cmp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_X_TAG_MASK" */
/* MD acx tagmgr mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_x_tag_mask_u {
mmr_t sh_x_tag_mask_regval;
struct {
@@ -23824,24 +12859,12 @@ typedef union sh_x_tag_mask_u {
mmr_t reserved_0 : 9;
} sh_x_tag_mask_s;
} sh_x_tag_mask_u_t;
-#else
-typedef union sh_x_tag_mask_u {
- mmr_t sh_x_tag_mask_regval;
- struct {
- mmr_t reserved_0 : 9;
- mmr_t src : 14;
- mmr_t addr : 33;
- mmr_t cmd : 8;
- } sh_x_tag_mask_s;
-} sh_x_tag_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_MOD_DBUG_SEL" */
/* MD acy debug select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_mod_dbug_sel_u {
mmr_t sh_y_mod_dbug_sel_regval;
struct {
@@ -23855,28 +12878,12 @@ typedef union sh_y_mod_dbug_sel_u {
mmr_t reserved_0 : 6;
} sh_y_mod_dbug_sel_s;
} sh_y_mod_dbug_sel_u_t;
-#else
-typedef union sh_y_mod_dbug_sel_u {
- mmr_t sh_y_mod_dbug_sel_regval;
- struct {
- mmr_t reserved_0 : 6;
- mmr_t dqr_sel : 6;
- mmr_t dql_sel : 6;
- mmr_t atr_sel : 11;
- mmr_t atl_sel : 11;
- mmr_t arb_sel : 8;
- mmr_t wbq_sel : 8;
- mmr_t tag_sel : 8;
- } sh_y_mod_dbug_sel_s;
-} sh_y_mod_dbug_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_DBUG_SEL" */
/* MD acy debug select */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_dbug_sel_u {
mmr_t sh_y_dbug_sel_regval;
struct {
@@ -23884,22 +12891,12 @@ typedef union sh_y_dbug_sel_u {
mmr_t reserved_0 : 40;
} sh_y_dbug_sel_s;
} sh_y_dbug_sel_u_t;
-#else
-typedef union sh_y_dbug_sel_u {
- mmr_t sh_y_dbug_sel_regval;
- struct {
- mmr_t reserved_0 : 40;
- mmr_t dbg_sel : 24;
- } sh_y_dbug_sel_s;
-} sh_y_dbug_sel_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_LADDR_CMP" */
/* MD acy address compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_laddr_cmp_u {
mmr_t sh_y_laddr_cmp_regval;
struct {
@@ -23909,24 +12906,12 @@ typedef union sh_y_laddr_cmp_u {
mmr_t reserved_1 : 4;
} sh_y_laddr_cmp_s;
} sh_y_laddr_cmp_u_t;
-#else
-typedef union sh_y_laddr_cmp_u {
- mmr_t sh_y_laddr_cmp_regval;
- struct {
- mmr_t reserved_1 : 4;
- mmr_t mask_val : 28;
- mmr_t reserved_0 : 4;
- mmr_t cmp_val : 28;
- } sh_y_laddr_cmp_s;
-} sh_y_laddr_cmp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_RADDR_CMP" */
/* MD acy address compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_raddr_cmp_u {
mmr_t sh_y_raddr_cmp_regval;
struct {
@@ -23936,24 +12921,12 @@ typedef union sh_y_raddr_cmp_u {
mmr_t reserved_1 : 4;
} sh_y_raddr_cmp_s;
} sh_y_raddr_cmp_u_t;
-#else
-typedef union sh_y_raddr_cmp_u {
- mmr_t sh_y_raddr_cmp_regval;
- struct {
- mmr_t reserved_1 : 4;
- mmr_t mask_val : 28;
- mmr_t reserved_0 : 4;
- mmr_t cmp_val : 28;
- } sh_y_raddr_cmp_s;
-} sh_y_raddr_cmp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_TAG_CMP" */
/* MD acy tagmgr compare */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_tag_cmp_u {
mmr_t sh_y_tag_cmp_regval;
struct {
@@ -23963,24 +12936,12 @@ typedef union sh_y_tag_cmp_u {
mmr_t reserved_0 : 9;
} sh_y_tag_cmp_s;
} sh_y_tag_cmp_u_t;
-#else
-typedef union sh_y_tag_cmp_u {
- mmr_t sh_y_tag_cmp_regval;
- struct {
- mmr_t reserved_0 : 9;
- mmr_t src : 14;
- mmr_t addr : 33;
- mmr_t cmd : 8;
- } sh_y_tag_cmp_s;
-} sh_y_tag_cmp_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_Y_TAG_MASK" */
/* MD acy tagmgr mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_y_tag_mask_u {
mmr_t sh_y_tag_mask_regval;
struct {
@@ -23990,24 +12951,12 @@ typedef union sh_y_tag_mask_u {
mmr_t reserved_0 : 9;
} sh_y_tag_mask_s;
} sh_y_tag_mask_u_t;
-#else
-typedef union sh_y_tag_mask_u {
- mmr_t sh_y_tag_mask_regval;
- struct {
- mmr_t reserved_0 : 9;
- mmr_t src : 14;
- mmr_t addr : 33;
- mmr_t cmd : 8;
- } sh_y_tag_mask_s;
-} sh_y_tag_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_JNR_DBUG_DATA_CFG" */
/* configuration for md jnr debug data muxes */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_jnr_dbug_data_cfg_u {
mmr_t sh_md_jnr_dbug_data_cfg_regval;
struct {
@@ -24029,36 +12978,12 @@ typedef union sh_md_jnr_dbug_data_cfg_u {
mmr_t reserved_7 : 33;
} sh_md_jnr_dbug_data_cfg_s;
} sh_md_jnr_dbug_data_cfg_u_t;
-#else
-typedef union sh_md_jnr_dbug_data_cfg_u {
- mmr_t sh_md_jnr_dbug_data_cfg_regval;
- struct {
- mmr_t reserved_7 : 33;
- mmr_t nibble7_sel : 3;
- mmr_t reserved_6 : 1;
- mmr_t nibble6_sel : 3;
- mmr_t reserved_5 : 1;
- mmr_t nibble5_sel : 3;
- mmr_t reserved_4 : 1;
- mmr_t nibble4_sel : 3;
- mmr_t reserved_3 : 1;
- mmr_t nibble3_sel : 3;
- mmr_t reserved_2 : 1;
- mmr_t nibble2_sel : 3;
- mmr_t reserved_1 : 1;
- mmr_t nibble1_sel : 3;
- mmr_t reserved_0 : 1;
- mmr_t nibble0_sel : 3;
- } sh_md_jnr_dbug_data_cfg_s;
-} sh_md_jnr_dbug_data_cfg_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_LAST_CREDIT" */
/* captures last credit values on reset */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_last_credit_u {
mmr_t sh_md_last_credit_regval;
struct {
@@ -24074,30 +12999,12 @@ typedef union sh_md_last_credit_u {
mmr_t reserved_4 : 26;
} sh_md_last_credit_s;
} sh_md_last_credit_u_t;
-#else
-typedef union sh_md_last_credit_u {
- mmr_t sh_md_last_credit_regval;
- struct {
- mmr_t reserved_4 : 26;
- mmr_t to_lb : 6;
- mmr_t reserved_3 : 2;
- mmr_t rp_to_xn : 6;
- mmr_t reserved_2 : 2;
- mmr_t rq_to_xn : 6;
- mmr_t reserved_1 : 2;
- mmr_t rp_to_pi : 6;
- mmr_t reserved_0 : 2;
- mmr_t rq_to_pi : 6;
- } sh_md_last_credit_s;
-} sh_md_last_credit_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MEM_CAPTURE_ADDR" */
/* Address capture address register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_mem_capture_addr_u {
mmr_t sh_mem_capture_addr_regval;
struct {
@@ -24107,24 +13014,12 @@ typedef union sh_mem_capture_addr_u {
mmr_t reserved_1 : 20;
} sh_mem_capture_addr_s;
} sh_mem_capture_addr_u_t;
-#else
-typedef union sh_mem_capture_addr_u {
- mmr_t sh_mem_capture_addr_regval;
- struct {
- mmr_t reserved_1 : 20;
- mmr_t cmd : 8;
- mmr_t addr : 33;
- mmr_t reserved_0 : 3;
- } sh_mem_capture_addr_s;
-} sh_mem_capture_addr_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MEM_CAPTURE_MASK" */
/* Address capture mask register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_mem_capture_mask_u {
mmr_t sh_mem_capture_mask_regval;
struct {
@@ -24136,26 +13031,12 @@ typedef union sh_mem_capture_mask_u {
mmr_t reserved_1 : 18;
} sh_mem_capture_mask_s;
} sh_mem_capture_mask_u_t;
-#else
-typedef union sh_mem_capture_mask_u {
- mmr_t sh_mem_capture_mask_regval;
- struct {
- mmr_t reserved_1 : 18;
- mmr_t enable_remote : 1;
- mmr_t enable_local : 1;
- mmr_t cmd : 8;
- mmr_t addr : 33;
- mmr_t reserved_0 : 3;
- } sh_mem_capture_mask_s;
-} sh_mem_capture_mask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MEM_CAPTURE_HDR" */
/* Address capture header register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_mem_capture_hdr_u {
mmr_t sh_mem_capture_hdr_regval;
struct {
@@ -24166,25 +13047,12 @@ typedef union sh_mem_capture_hdr_u {
mmr_t cntr : 6;
} sh_mem_capture_hdr_s;
} sh_mem_capture_hdr_u_t;
-#else
-typedef union sh_mem_capture_hdr_u {
- mmr_t sh_mem_capture_hdr_regval;
- struct {
- mmr_t cntr : 6;
- mmr_t src : 14;
- mmr_t cmd : 8;
- mmr_t addr : 33;
- mmr_t reserved_0 : 3;
- } sh_mem_capture_hdr_s;
-} sh_mem_capture_hdr_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_CONFIG" */
/* DQ directory config register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_config_u {
mmr_t sh_md_dqlp_mmr_dir_config_regval;
struct {
@@ -24194,276 +13062,156 @@ typedef union sh_md_dqlp_mmr_dir_config_u {
mmr_t reserved_0 : 59;
} sh_md_dqlp_mmr_dir_config_s;
} sh_md_dqlp_mmr_dir_config_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_config_u {
- mmr_t sh_md_dqlp_mmr_dir_config_regval;
- struct {
- mmr_t reserved_0 : 59;
- mmr_t en_dirpois : 1;
- mmr_t en_direcc : 1;
- mmr_t sys_size : 3;
- } sh_md_dqlp_mmr_dir_config_s;
-} sh_md_dqlp_mmr_dir_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_PRESVEC0" */
/* node [63:0] presence bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqlp_mmr_dir_presvec0_u {
- mmr_t sh_md_dqlp_mmr_dir_presvec0_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqlp_mmr_dir_presvec0_s;
-} sh_md_dqlp_mmr_dir_presvec0_u_t;
-#else
typedef union sh_md_dqlp_mmr_dir_presvec0_u {
mmr_t sh_md_dqlp_mmr_dir_presvec0_regval;
struct {
mmr_t vec : 64;
} sh_md_dqlp_mmr_dir_presvec0_s;
} sh_md_dqlp_mmr_dir_presvec0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_PRESVEC1" */
/* node [127:64] presence bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqlp_mmr_dir_presvec1_u {
- mmr_t sh_md_dqlp_mmr_dir_presvec1_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqlp_mmr_dir_presvec1_s;
-} sh_md_dqlp_mmr_dir_presvec1_u_t;
-#else
typedef union sh_md_dqlp_mmr_dir_presvec1_u {
mmr_t sh_md_dqlp_mmr_dir_presvec1_regval;
struct {
mmr_t vec : 64;
} sh_md_dqlp_mmr_dir_presvec1_s;
} sh_md_dqlp_mmr_dir_presvec1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_PRESVEC2" */
/* node [191:128] presence bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqlp_mmr_dir_presvec2_u {
- mmr_t sh_md_dqlp_mmr_dir_presvec2_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqlp_mmr_dir_presvec2_s;
-} sh_md_dqlp_mmr_dir_presvec2_u_t;
-#else
typedef union sh_md_dqlp_mmr_dir_presvec2_u {
mmr_t sh_md_dqlp_mmr_dir_presvec2_regval;
struct {
mmr_t vec : 64;
} sh_md_dqlp_mmr_dir_presvec2_s;
} sh_md_dqlp_mmr_dir_presvec2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_PRESVEC3" */
/* node [255:192] presence bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqlp_mmr_dir_presvec3_u {
- mmr_t sh_md_dqlp_mmr_dir_presvec3_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqlp_mmr_dir_presvec3_s;
-} sh_md_dqlp_mmr_dir_presvec3_u_t;
-#else
typedef union sh_md_dqlp_mmr_dir_presvec3_u {
mmr_t sh_md_dqlp_mmr_dir_presvec3_regval;
struct {
mmr_t vec : 64;
} sh_md_dqlp_mmr_dir_presvec3_s;
} sh_md_dqlp_mmr_dir_presvec3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC0" */
/* local vector for acc=0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_locvec0_u {
mmr_t sh_md_dqlp_mmr_dir_locvec0_regval;
struct {
mmr_t vec : 64;
} sh_md_dqlp_mmr_dir_locvec0_s;
} sh_md_dqlp_mmr_dir_locvec0_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_locvec0_u {
- mmr_t sh_md_dqlp_mmr_dir_locvec0_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqlp_mmr_dir_locvec0_s;
-} sh_md_dqlp_mmr_dir_locvec0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC1" */
/* local vector for acc=1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqlp_mmr_dir_locvec1_u {
- mmr_t sh_md_dqlp_mmr_dir_locvec1_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqlp_mmr_dir_locvec1_s;
-} sh_md_dqlp_mmr_dir_locvec1_u_t;
-#else
typedef union sh_md_dqlp_mmr_dir_locvec1_u {
mmr_t sh_md_dqlp_mmr_dir_locvec1_regval;
struct {
mmr_t vec : 64;
} sh_md_dqlp_mmr_dir_locvec1_s;
} sh_md_dqlp_mmr_dir_locvec1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC2" */
/* local vector for acc=2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqlp_mmr_dir_locvec2_u {
- mmr_t sh_md_dqlp_mmr_dir_locvec2_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqlp_mmr_dir_locvec2_s;
-} sh_md_dqlp_mmr_dir_locvec2_u_t;
-#else
typedef union sh_md_dqlp_mmr_dir_locvec2_u {
mmr_t sh_md_dqlp_mmr_dir_locvec2_regval;
struct {
mmr_t vec : 64;
} sh_md_dqlp_mmr_dir_locvec2_s;
} sh_md_dqlp_mmr_dir_locvec2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC3" */
/* local vector for acc=3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqlp_mmr_dir_locvec3_u {
- mmr_t sh_md_dqlp_mmr_dir_locvec3_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqlp_mmr_dir_locvec3_s;
-} sh_md_dqlp_mmr_dir_locvec3_u_t;
-#else
typedef union sh_md_dqlp_mmr_dir_locvec3_u {
mmr_t sh_md_dqlp_mmr_dir_locvec3_regval;
struct {
mmr_t vec : 64;
} sh_md_dqlp_mmr_dir_locvec3_s;
} sh_md_dqlp_mmr_dir_locvec3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC4" */
/* local vector for acc=4 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqlp_mmr_dir_locvec4_u {
- mmr_t sh_md_dqlp_mmr_dir_locvec4_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqlp_mmr_dir_locvec4_s;
-} sh_md_dqlp_mmr_dir_locvec4_u_t;
-#else
typedef union sh_md_dqlp_mmr_dir_locvec4_u {
mmr_t sh_md_dqlp_mmr_dir_locvec4_regval;
struct {
mmr_t vec : 64;
} sh_md_dqlp_mmr_dir_locvec4_s;
} sh_md_dqlp_mmr_dir_locvec4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC5" */
/* local vector for acc=5 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqlp_mmr_dir_locvec5_u {
- mmr_t sh_md_dqlp_mmr_dir_locvec5_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqlp_mmr_dir_locvec5_s;
-} sh_md_dqlp_mmr_dir_locvec5_u_t;
-#else
typedef union sh_md_dqlp_mmr_dir_locvec5_u {
mmr_t sh_md_dqlp_mmr_dir_locvec5_regval;
struct {
mmr_t vec : 64;
} sh_md_dqlp_mmr_dir_locvec5_s;
} sh_md_dqlp_mmr_dir_locvec5_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC6" */
/* local vector for acc=6 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqlp_mmr_dir_locvec6_u {
- mmr_t sh_md_dqlp_mmr_dir_locvec6_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqlp_mmr_dir_locvec6_s;
-} sh_md_dqlp_mmr_dir_locvec6_u_t;
-#else
typedef union sh_md_dqlp_mmr_dir_locvec6_u {
mmr_t sh_md_dqlp_mmr_dir_locvec6_regval;
struct {
mmr_t vec : 64;
} sh_md_dqlp_mmr_dir_locvec6_s;
} sh_md_dqlp_mmr_dir_locvec6_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_LOCVEC7" */
/* local vector for acc=7 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_locvec7_u {
mmr_t sh_md_dqlp_mmr_dir_locvec7_regval;
struct {
mmr_t vec : 64;
} sh_md_dqlp_mmr_dir_locvec7_s;
} sh_md_dqlp_mmr_dir_locvec7_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_locvec7_u {
- mmr_t sh_md_dqlp_mmr_dir_locvec7_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqlp_mmr_dir_locvec7_s;
-} sh_md_dqlp_mmr_dir_locvec7_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC0" */
/* privilege vector for acc=0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_privec0_u {
mmr_t sh_md_dqlp_mmr_dir_privec0_regval;
struct {
@@ -24472,23 +13220,12 @@ typedef union sh_md_dqlp_mmr_dir_privec0_u {
mmr_t reserved_0 : 36;
} sh_md_dqlp_mmr_dir_privec0_s;
} sh_md_dqlp_mmr_dir_privec0_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_privec0_u {
- mmr_t sh_md_dqlp_mmr_dir_privec0_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqlp_mmr_dir_privec0_s;
-} sh_md_dqlp_mmr_dir_privec0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC1" */
/* privilege vector for acc=1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_privec1_u {
mmr_t sh_md_dqlp_mmr_dir_privec1_regval;
struct {
@@ -24497,23 +13234,12 @@ typedef union sh_md_dqlp_mmr_dir_privec1_u {
mmr_t reserved_0 : 36;
} sh_md_dqlp_mmr_dir_privec1_s;
} sh_md_dqlp_mmr_dir_privec1_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_privec1_u {
- mmr_t sh_md_dqlp_mmr_dir_privec1_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqlp_mmr_dir_privec1_s;
-} sh_md_dqlp_mmr_dir_privec1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC2" */
/* privilege vector for acc=2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_privec2_u {
mmr_t sh_md_dqlp_mmr_dir_privec2_regval;
struct {
@@ -24522,23 +13248,12 @@ typedef union sh_md_dqlp_mmr_dir_privec2_u {
mmr_t reserved_0 : 36;
} sh_md_dqlp_mmr_dir_privec2_s;
} sh_md_dqlp_mmr_dir_privec2_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_privec2_u {
- mmr_t sh_md_dqlp_mmr_dir_privec2_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqlp_mmr_dir_privec2_s;
-} sh_md_dqlp_mmr_dir_privec2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC3" */
/* privilege vector for acc=3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_privec3_u {
mmr_t sh_md_dqlp_mmr_dir_privec3_regval;
struct {
@@ -24547,23 +13262,12 @@ typedef union sh_md_dqlp_mmr_dir_privec3_u {
mmr_t reserved_0 : 36;
} sh_md_dqlp_mmr_dir_privec3_s;
} sh_md_dqlp_mmr_dir_privec3_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_privec3_u {
- mmr_t sh_md_dqlp_mmr_dir_privec3_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqlp_mmr_dir_privec3_s;
-} sh_md_dqlp_mmr_dir_privec3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC4" */
/* privilege vector for acc=4 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_privec4_u {
mmr_t sh_md_dqlp_mmr_dir_privec4_regval;
struct {
@@ -24572,23 +13276,12 @@ typedef union sh_md_dqlp_mmr_dir_privec4_u {
mmr_t reserved_0 : 36;
} sh_md_dqlp_mmr_dir_privec4_s;
} sh_md_dqlp_mmr_dir_privec4_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_privec4_u {
- mmr_t sh_md_dqlp_mmr_dir_privec4_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqlp_mmr_dir_privec4_s;
-} sh_md_dqlp_mmr_dir_privec4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC5" */
/* privilege vector for acc=5 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_privec5_u {
mmr_t sh_md_dqlp_mmr_dir_privec5_regval;
struct {
@@ -24597,23 +13290,12 @@ typedef union sh_md_dqlp_mmr_dir_privec5_u {
mmr_t reserved_0 : 36;
} sh_md_dqlp_mmr_dir_privec5_s;
} sh_md_dqlp_mmr_dir_privec5_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_privec5_u {
- mmr_t sh_md_dqlp_mmr_dir_privec5_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqlp_mmr_dir_privec5_s;
-} sh_md_dqlp_mmr_dir_privec5_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC6" */
/* privilege vector for acc=6 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_privec6_u {
mmr_t sh_md_dqlp_mmr_dir_privec6_regval;
struct {
@@ -24622,23 +13304,12 @@ typedef union sh_md_dqlp_mmr_dir_privec6_u {
mmr_t reserved_0 : 36;
} sh_md_dqlp_mmr_dir_privec6_s;
} sh_md_dqlp_mmr_dir_privec6_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_privec6_u {
- mmr_t sh_md_dqlp_mmr_dir_privec6_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqlp_mmr_dir_privec6_s;
-} sh_md_dqlp_mmr_dir_privec6_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC7" */
/* privilege vector for acc=7 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_privec7_u {
mmr_t sh_md_dqlp_mmr_dir_privec7_regval;
struct {
@@ -24647,23 +13318,12 @@ typedef union sh_md_dqlp_mmr_dir_privec7_u {
mmr_t reserved_0 : 36;
} sh_md_dqlp_mmr_dir_privec7_s;
} sh_md_dqlp_mmr_dir_privec7_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_privec7_u {
- mmr_t sh_md_dqlp_mmr_dir_privec7_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqlp_mmr_dir_privec7_s;
-} sh_md_dqlp_mmr_dir_privec7_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_TIMER" */
/* MD SXRO timer */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_timer_u {
mmr_t sh_md_dqlp_mmr_dir_timer_regval;
struct {
@@ -24673,24 +13333,12 @@ typedef union sh_md_dqlp_mmr_dir_timer_u {
mmr_t reserved_0 : 42;
} sh_md_dqlp_mmr_dir_timer_s;
} sh_md_dqlp_mmr_dir_timer_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_timer_u {
- mmr_t sh_md_dqlp_mmr_dir_timer_regval;
- struct {
- mmr_t reserved_0 : 42;
- mmr_t timer_cur : 9;
- mmr_t timer_en : 1;
- mmr_t timer_div : 12;
- } sh_md_dqlp_mmr_dir_timer_s;
-} sh_md_dqlp_mmr_dir_timer_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_PIOWD_DIR_ENTRY" */
/* directory pio write data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_piowd_dir_entry_u {
mmr_t sh_md_dqlp_mmr_piowd_dir_entry_regval;
struct {
@@ -24701,25 +13349,12 @@ typedef union sh_md_dqlp_mmr_piowd_dir_entry_u {
mmr_t reserved_0 : 6;
} sh_md_dqlp_mmr_piowd_dir_entry_s;
} sh_md_dqlp_mmr_piowd_dir_entry_u_t;
-#else
-typedef union sh_md_dqlp_mmr_piowd_dir_entry_u {
- mmr_t sh_md_dqlp_mmr_piowd_dir_entry_regval;
- struct {
- mmr_t reserved_0 : 6;
- mmr_t acc : 3;
- mmr_t pri : 3;
- mmr_t dirb : 26;
- mmr_t dira : 26;
- } sh_md_dqlp_mmr_piowd_dir_entry_s;
-} sh_md_dqlp_mmr_piowd_dir_entry_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_PIOWD_DIR_ECC" */
/* directory ecc register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_piowd_dir_ecc_u {
mmr_t sh_md_dqlp_mmr_piowd_dir_ecc_regval;
struct {
@@ -24728,23 +13363,12 @@ typedef union sh_md_dqlp_mmr_piowd_dir_ecc_u {
mmr_t reserved_0 : 50;
} sh_md_dqlp_mmr_piowd_dir_ecc_s;
} sh_md_dqlp_mmr_piowd_dir_ecc_u_t;
-#else
-typedef union sh_md_dqlp_mmr_piowd_dir_ecc_u {
- mmr_t sh_md_dqlp_mmr_piowd_dir_ecc_regval;
- struct {
- mmr_t reserved_0 : 50;
- mmr_t eccb : 7;
- mmr_t ecca : 7;
- } sh_md_dqlp_mmr_piowd_dir_ecc_s;
-} sh_md_dqlp_mmr_piowd_dir_ecc_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_XPIORD_XDIR_ENTRY" */
/* x directory pio read data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_xpiord_xdir_entry_u {
mmr_t sh_md_dqlp_mmr_xpiord_xdir_entry_regval;
struct {
@@ -24757,27 +13381,12 @@ typedef union sh_md_dqlp_mmr_xpiord_xdir_entry_u {
mmr_t reserved_0 : 4;
} sh_md_dqlp_mmr_xpiord_xdir_entry_s;
} sh_md_dqlp_mmr_xpiord_xdir_entry_u_t;
-#else
-typedef union sh_md_dqlp_mmr_xpiord_xdir_entry_u {
- mmr_t sh_md_dqlp_mmr_xpiord_xdir_entry_regval;
- struct {
- mmr_t reserved_0 : 4;
- mmr_t unc : 1;
- mmr_t cor : 1;
- mmr_t acc : 3;
- mmr_t pri : 3;
- mmr_t dirb : 26;
- mmr_t dira : 26;
- } sh_md_dqlp_mmr_xpiord_xdir_entry_s;
-} sh_md_dqlp_mmr_xpiord_xdir_entry_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_XPIORD_XDIR_ECC" */
/* x directory ecc */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_xpiord_xdir_ecc_u {
mmr_t sh_md_dqlp_mmr_xpiord_xdir_ecc_regval;
struct {
@@ -24786,23 +13395,12 @@ typedef union sh_md_dqlp_mmr_xpiord_xdir_ecc_u {
mmr_t reserved_0 : 50;
} sh_md_dqlp_mmr_xpiord_xdir_ecc_s;
} sh_md_dqlp_mmr_xpiord_xdir_ecc_u_t;
-#else
-typedef union sh_md_dqlp_mmr_xpiord_xdir_ecc_u {
- mmr_t sh_md_dqlp_mmr_xpiord_xdir_ecc_regval;
- struct {
- mmr_t reserved_0 : 50;
- mmr_t eccb : 7;
- mmr_t ecca : 7;
- } sh_md_dqlp_mmr_xpiord_xdir_ecc_s;
-} sh_md_dqlp_mmr_xpiord_xdir_ecc_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_YPIORD_YDIR_ENTRY" */
/* y directory pio read data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_ypiord_ydir_entry_u {
mmr_t sh_md_dqlp_mmr_ypiord_ydir_entry_regval;
struct {
@@ -24815,27 +13413,12 @@ typedef union sh_md_dqlp_mmr_ypiord_ydir_entry_u {
mmr_t reserved_0 : 4;
} sh_md_dqlp_mmr_ypiord_ydir_entry_s;
} sh_md_dqlp_mmr_ypiord_ydir_entry_u_t;
-#else
-typedef union sh_md_dqlp_mmr_ypiord_ydir_entry_u {
- mmr_t sh_md_dqlp_mmr_ypiord_ydir_entry_regval;
- struct {
- mmr_t reserved_0 : 4;
- mmr_t unc : 1;
- mmr_t cor : 1;
- mmr_t acc : 3;
- mmr_t pri : 3;
- mmr_t dirb : 26;
- mmr_t dira : 26;
- } sh_md_dqlp_mmr_ypiord_ydir_entry_s;
-} sh_md_dqlp_mmr_ypiord_ydir_entry_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_YPIORD_YDIR_ECC" */
/* y directory ecc */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_ypiord_ydir_ecc_u {
mmr_t sh_md_dqlp_mmr_ypiord_ydir_ecc_regval;
struct {
@@ -24844,23 +13427,12 @@ typedef union sh_md_dqlp_mmr_ypiord_ydir_ecc_u {
mmr_t reserved_0 : 50;
} sh_md_dqlp_mmr_ypiord_ydir_ecc_s;
} sh_md_dqlp_mmr_ypiord_ydir_ecc_u_t;
-#else
-typedef union sh_md_dqlp_mmr_ypiord_ydir_ecc_u {
- mmr_t sh_md_dqlp_mmr_ypiord_ydir_ecc_regval;
- struct {
- mmr_t reserved_0 : 50;
- mmr_t eccb : 7;
- mmr_t ecca : 7;
- } sh_md_dqlp_mmr_ypiord_ydir_ecc_s;
-} sh_md_dqlp_mmr_ypiord_ydir_ecc_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_XCERR1" */
/* correctable dir ecc group 1 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_xcerr1_u {
mmr_t sh_md_dqlp_mmr_xcerr1_regval;
struct {
@@ -24871,25 +13443,12 @@ typedef union sh_md_dqlp_mmr_xcerr1_u {
mmr_t reserved_0 : 25;
} sh_md_dqlp_mmr_xcerr1_s;
} sh_md_dqlp_mmr_xcerr1_u_t;
-#else
-typedef union sh_md_dqlp_mmr_xcerr1_u {
- mmr_t sh_md_dqlp_mmr_xcerr1_regval;
- struct {
- mmr_t reserved_0 : 25;
- mmr_t arm : 1;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp1 : 36;
- } sh_md_dqlp_mmr_xcerr1_s;
-} sh_md_dqlp_mmr_xcerr1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_XCERR2" */
/* correctable dir ecc group 2 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_xcerr2_u {
mmr_t sh_md_dqlp_mmr_xcerr2_regval;
struct {
@@ -24899,24 +13458,12 @@ typedef union sh_md_dqlp_mmr_xcerr2_u {
mmr_t reserved_0 : 26;
} sh_md_dqlp_mmr_xcerr2_s;
} sh_md_dqlp_mmr_xcerr2_u_t;
-#else
-typedef union sh_md_dqlp_mmr_xcerr2_u {
- mmr_t sh_md_dqlp_mmr_xcerr2_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp2 : 36;
- } sh_md_dqlp_mmr_xcerr2_s;
-} sh_md_dqlp_mmr_xcerr2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_XUERR1" */
/* uncorrectable dir ecc group 1 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_xuerr1_u {
mmr_t sh_md_dqlp_mmr_xuerr1_regval;
struct {
@@ -24927,25 +13474,12 @@ typedef union sh_md_dqlp_mmr_xuerr1_u {
mmr_t reserved_0 : 25;
} sh_md_dqlp_mmr_xuerr1_s;
} sh_md_dqlp_mmr_xuerr1_u_t;
-#else
-typedef union sh_md_dqlp_mmr_xuerr1_u {
- mmr_t sh_md_dqlp_mmr_xuerr1_regval;
- struct {
- mmr_t reserved_0 : 25;
- mmr_t arm : 1;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp1 : 36;
- } sh_md_dqlp_mmr_xuerr1_s;
-} sh_md_dqlp_mmr_xuerr1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_XUERR2" */
/* uncorrectable dir ecc group 2 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_xuerr2_u {
mmr_t sh_md_dqlp_mmr_xuerr2_regval;
struct {
@@ -24955,24 +13489,12 @@ typedef union sh_md_dqlp_mmr_xuerr2_u {
mmr_t reserved_0 : 26;
} sh_md_dqlp_mmr_xuerr2_s;
} sh_md_dqlp_mmr_xuerr2_u_t;
-#else
-typedef union sh_md_dqlp_mmr_xuerr2_u {
- mmr_t sh_md_dqlp_mmr_xuerr2_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp2 : 36;
- } sh_md_dqlp_mmr_xuerr2_s;
-} sh_md_dqlp_mmr_xuerr2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_XPERR" */
/* protocol error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_xperr_u {
mmr_t sh_md_dqlp_mmr_xperr_regval;
struct {
@@ -24990,32 +13512,12 @@ typedef union sh_md_dqlp_mmr_xperr_u {
mmr_t reserved_0 : 1;
} sh_md_dqlp_mmr_xperr_s;
} sh_md_dqlp_mmr_xperr_u_t;
-#else
-typedef union sh_md_dqlp_mmr_xperr_u {
- mmr_t sh_md_dqlp_mmr_xperr_regval;
- struct {
- mmr_t reserved_0 : 1;
- mmr_t arm : 1;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t mybit : 8;
- mmr_t unc : 1;
- mmr_t cor : 1;
- mmr_t priv : 1;
- mmr_t prige : 1;
- mmr_t src : 14;
- mmr_t cmd : 8;
- mmr_t dir : 26;
- } sh_md_dqlp_mmr_xperr_s;
-} sh_md_dqlp_mmr_xperr_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_YCERR1" */
/* correctable dir ecc group 1 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_ycerr1_u {
mmr_t sh_md_dqlp_mmr_ycerr1_regval;
struct {
@@ -25026,25 +13528,12 @@ typedef union sh_md_dqlp_mmr_ycerr1_u {
mmr_t reserved_0 : 25;
} sh_md_dqlp_mmr_ycerr1_s;
} sh_md_dqlp_mmr_ycerr1_u_t;
-#else
-typedef union sh_md_dqlp_mmr_ycerr1_u {
- mmr_t sh_md_dqlp_mmr_ycerr1_regval;
- struct {
- mmr_t reserved_0 : 25;
- mmr_t arm : 1;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp1 : 36;
- } sh_md_dqlp_mmr_ycerr1_s;
-} sh_md_dqlp_mmr_ycerr1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_YCERR2" */
/* correctable dir ecc group 2 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_ycerr2_u {
mmr_t sh_md_dqlp_mmr_ycerr2_regval;
struct {
@@ -25054,24 +13543,12 @@ typedef union sh_md_dqlp_mmr_ycerr2_u {
mmr_t reserved_0 : 26;
} sh_md_dqlp_mmr_ycerr2_s;
} sh_md_dqlp_mmr_ycerr2_u_t;
-#else
-typedef union sh_md_dqlp_mmr_ycerr2_u {
- mmr_t sh_md_dqlp_mmr_ycerr2_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp2 : 36;
- } sh_md_dqlp_mmr_ycerr2_s;
-} sh_md_dqlp_mmr_ycerr2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_YUERR1" */
/* uncorrectable dir ecc group 1 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_yuerr1_u {
mmr_t sh_md_dqlp_mmr_yuerr1_regval;
struct {
@@ -25082,25 +13559,12 @@ typedef union sh_md_dqlp_mmr_yuerr1_u {
mmr_t reserved_0 : 25;
} sh_md_dqlp_mmr_yuerr1_s;
} sh_md_dqlp_mmr_yuerr1_u_t;
-#else
-typedef union sh_md_dqlp_mmr_yuerr1_u {
- mmr_t sh_md_dqlp_mmr_yuerr1_regval;
- struct {
- mmr_t reserved_0 : 25;
- mmr_t arm : 1;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp1 : 36;
- } sh_md_dqlp_mmr_yuerr1_s;
-} sh_md_dqlp_mmr_yuerr1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_YUERR2" */
/* uncorrectable dir ecc group 2 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_yuerr2_u {
mmr_t sh_md_dqlp_mmr_yuerr2_regval;
struct {
@@ -25110,24 +13574,12 @@ typedef union sh_md_dqlp_mmr_yuerr2_u {
mmr_t reserved_0 : 26;
} sh_md_dqlp_mmr_yuerr2_s;
} sh_md_dqlp_mmr_yuerr2_u_t;
-#else
-typedef union sh_md_dqlp_mmr_yuerr2_u {
- mmr_t sh_md_dqlp_mmr_yuerr2_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp2 : 36;
- } sh_md_dqlp_mmr_yuerr2_s;
-} sh_md_dqlp_mmr_yuerr2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_YPERR" */
/* protocol error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_yperr_u {
mmr_t sh_md_dqlp_mmr_yperr_regval;
struct {
@@ -25145,32 +13597,12 @@ typedef union sh_md_dqlp_mmr_yperr_u {
mmr_t reserved_0 : 1;
} sh_md_dqlp_mmr_yperr_s;
} sh_md_dqlp_mmr_yperr_u_t;
-#else
-typedef union sh_md_dqlp_mmr_yperr_u {
- mmr_t sh_md_dqlp_mmr_yperr_regval;
- struct {
- mmr_t reserved_0 : 1;
- mmr_t arm : 1;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t mybit : 8;
- mmr_t unc : 1;
- mmr_t cor : 1;
- mmr_t priv : 1;
- mmr_t prige : 1;
- mmr_t src : 14;
- mmr_t cmd : 8;
- mmr_t dir : 26;
- } sh_md_dqlp_mmr_yperr_s;
-} sh_md_dqlp_mmr_yperr_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_CMDTRIG" */
/* cmd triggers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_cmdtrig_u {
mmr_t sh_md_dqlp_mmr_dir_cmdtrig_regval;
struct {
@@ -25181,25 +13613,12 @@ typedef union sh_md_dqlp_mmr_dir_cmdtrig_u {
mmr_t reserved_0 : 32;
} sh_md_dqlp_mmr_dir_cmdtrig_s;
} sh_md_dqlp_mmr_dir_cmdtrig_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_cmdtrig_u {
- mmr_t sh_md_dqlp_mmr_dir_cmdtrig_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t cmd3 : 8;
- mmr_t cmd2 : 8;
- mmr_t cmd1 : 8;
- mmr_t cmd0 : 8;
- } sh_md_dqlp_mmr_dir_cmdtrig_s;
-} sh_md_dqlp_mmr_dir_cmdtrig_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_TBLTRIG" */
/* dir table trigger */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_tbltrig_u {
mmr_t sh_md_dqlp_mmr_dir_tbltrig_regval;
struct {
@@ -25212,27 +13631,12 @@ typedef union sh_md_dqlp_mmr_dir_tbltrig_u {
mmr_t reserved_0 : 22;
} sh_md_dqlp_mmr_dir_tbltrig_s;
} sh_md_dqlp_mmr_dir_tbltrig_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_tbltrig_u {
- mmr_t sh_md_dqlp_mmr_dir_tbltrig_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t mybit : 8;
- mmr_t dirst : 9;
- mmr_t prige : 1;
- mmr_t acc : 2;
- mmr_t cmd : 8;
- mmr_t src : 14;
- } sh_md_dqlp_mmr_dir_tbltrig_s;
-} sh_md_dqlp_mmr_dir_tbltrig_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_DIR_TBLMASK" */
/* dir table trigger mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_dir_tblmask_u {
mmr_t sh_md_dqlp_mmr_dir_tblmask_regval;
struct {
@@ -25245,27 +13649,12 @@ typedef union sh_md_dqlp_mmr_dir_tblmask_u {
mmr_t reserved_0 : 22;
} sh_md_dqlp_mmr_dir_tblmask_s;
} sh_md_dqlp_mmr_dir_tblmask_u_t;
-#else
-typedef union sh_md_dqlp_mmr_dir_tblmask_u {
- mmr_t sh_md_dqlp_mmr_dir_tblmask_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t mybit : 8;
- mmr_t dirst : 9;
- mmr_t prige : 1;
- mmr_t acc : 2;
- mmr_t cmd : 8;
- mmr_t src : 14;
- } sh_md_dqlp_mmr_dir_tblmask_s;
-} sh_md_dqlp_mmr_dir_tblmask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_XBIST_H" */
/* rising edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_xbist_h_u {
mmr_t sh_md_dqlp_mmr_xbist_h_regval;
struct {
@@ -25277,26 +13666,12 @@ typedef union sh_md_dqlp_mmr_xbist_h_u {
mmr_t reserved_1 : 21;
} sh_md_dqlp_mmr_xbist_h_s;
} sh_md_dqlp_mmr_xbist_h_u_t;
-#else
-typedef union sh_md_dqlp_mmr_xbist_h_u {
- mmr_t sh_md_dqlp_mmr_xbist_h_regval;
- struct {
- mmr_t reserved_1 : 21;
- mmr_t arm : 1;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqlp_mmr_xbist_h_s;
-} sh_md_dqlp_mmr_xbist_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_XBIST_L" */
/* falling edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_xbist_l_u {
mmr_t sh_md_dqlp_mmr_xbist_l_regval;
struct {
@@ -25307,25 +13682,12 @@ typedef union sh_md_dqlp_mmr_xbist_l_u {
mmr_t reserved_1 : 22;
} sh_md_dqlp_mmr_xbist_l_s;
} sh_md_dqlp_mmr_xbist_l_u_t;
-#else
-typedef union sh_md_dqlp_mmr_xbist_l_u {
- mmr_t sh_md_dqlp_mmr_xbist_l_regval;
- struct {
- mmr_t reserved_1 : 22;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqlp_mmr_xbist_l_s;
-} sh_md_dqlp_mmr_xbist_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_XBIST_ERR_H" */
/* rising edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_xbist_err_h_u {
mmr_t sh_md_dqlp_mmr_xbist_err_h_regval;
struct {
@@ -25336,25 +13698,12 @@ typedef union sh_md_dqlp_mmr_xbist_err_h_u {
mmr_t reserved_1 : 22;
} sh_md_dqlp_mmr_xbist_err_h_s;
} sh_md_dqlp_mmr_xbist_err_h_u_t;
-#else
-typedef union sh_md_dqlp_mmr_xbist_err_h_u {
- mmr_t sh_md_dqlp_mmr_xbist_err_h_regval;
- struct {
- mmr_t reserved_1 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqlp_mmr_xbist_err_h_s;
-} sh_md_dqlp_mmr_xbist_err_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_XBIST_ERR_L" */
/* falling edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_xbist_err_l_u {
mmr_t sh_md_dqlp_mmr_xbist_err_l_regval;
struct {
@@ -25365,25 +13714,12 @@ typedef union sh_md_dqlp_mmr_xbist_err_l_u {
mmr_t reserved_1 : 22;
} sh_md_dqlp_mmr_xbist_err_l_s;
} sh_md_dqlp_mmr_xbist_err_l_u_t;
-#else
-typedef union sh_md_dqlp_mmr_xbist_err_l_u {
- mmr_t sh_md_dqlp_mmr_xbist_err_l_regval;
- struct {
- mmr_t reserved_1 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqlp_mmr_xbist_err_l_s;
-} sh_md_dqlp_mmr_xbist_err_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_YBIST_H" */
/* rising edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_ybist_h_u {
mmr_t sh_md_dqlp_mmr_ybist_h_regval;
struct {
@@ -25395,26 +13731,12 @@ typedef union sh_md_dqlp_mmr_ybist_h_u {
mmr_t reserved_1 : 21;
} sh_md_dqlp_mmr_ybist_h_s;
} sh_md_dqlp_mmr_ybist_h_u_t;
-#else
-typedef union sh_md_dqlp_mmr_ybist_h_u {
- mmr_t sh_md_dqlp_mmr_ybist_h_regval;
- struct {
- mmr_t reserved_1 : 21;
- mmr_t arm : 1;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqlp_mmr_ybist_h_s;
-} sh_md_dqlp_mmr_ybist_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_YBIST_L" */
/* falling edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_ybist_l_u {
mmr_t sh_md_dqlp_mmr_ybist_l_regval;
struct {
@@ -25425,25 +13747,12 @@ typedef union sh_md_dqlp_mmr_ybist_l_u {
mmr_t reserved_1 : 22;
} sh_md_dqlp_mmr_ybist_l_s;
} sh_md_dqlp_mmr_ybist_l_u_t;
-#else
-typedef union sh_md_dqlp_mmr_ybist_l_u {
- mmr_t sh_md_dqlp_mmr_ybist_l_regval;
- struct {
- mmr_t reserved_1 : 22;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqlp_mmr_ybist_l_s;
-} sh_md_dqlp_mmr_ybist_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_YBIST_ERR_H" */
/* rising edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_ybist_err_h_u {
mmr_t sh_md_dqlp_mmr_ybist_err_h_regval;
struct {
@@ -25454,25 +13763,12 @@ typedef union sh_md_dqlp_mmr_ybist_err_h_u {
mmr_t reserved_1 : 22;
} sh_md_dqlp_mmr_ybist_err_h_s;
} sh_md_dqlp_mmr_ybist_err_h_u_t;
-#else
-typedef union sh_md_dqlp_mmr_ybist_err_h_u {
- mmr_t sh_md_dqlp_mmr_ybist_err_h_regval;
- struct {
- mmr_t reserved_1 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqlp_mmr_ybist_err_h_s;
-} sh_md_dqlp_mmr_ybist_err_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLP_MMR_YBIST_ERR_L" */
/* falling edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqlp_mmr_ybist_err_l_u {
mmr_t sh_md_dqlp_mmr_ybist_err_l_regval;
struct {
@@ -25483,25 +13779,12 @@ typedef union sh_md_dqlp_mmr_ybist_err_l_u {
mmr_t reserved_1 : 22;
} sh_md_dqlp_mmr_ybist_err_l_s;
} sh_md_dqlp_mmr_ybist_err_l_u_t;
-#else
-typedef union sh_md_dqlp_mmr_ybist_err_l_u {
- mmr_t sh_md_dqlp_mmr_ybist_err_l_regval;
- struct {
- mmr_t reserved_1 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqlp_mmr_ybist_err_l_s;
-} sh_md_dqlp_mmr_ybist_err_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLS_MMR_XBIST_H" */
/* rising edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqls_mmr_xbist_h_u {
mmr_t sh_md_dqls_mmr_xbist_h_regval;
struct {
@@ -25512,25 +13795,12 @@ typedef union sh_md_dqls_mmr_xbist_h_u {
mmr_t reserved_0 : 21;
} sh_md_dqls_mmr_xbist_h_s;
} sh_md_dqls_mmr_xbist_h_u_t;
-#else
-typedef union sh_md_dqls_mmr_xbist_h_u {
- mmr_t sh_md_dqls_mmr_xbist_h_regval;
- struct {
- mmr_t reserved_0 : 21;
- mmr_t arm : 1;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t pat : 40;
- } sh_md_dqls_mmr_xbist_h_s;
-} sh_md_dqls_mmr_xbist_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLS_MMR_XBIST_L" */
/* falling edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqls_mmr_xbist_l_u {
mmr_t sh_md_dqls_mmr_xbist_l_regval;
struct {
@@ -25540,24 +13810,12 @@ typedef union sh_md_dqls_mmr_xbist_l_u {
mmr_t reserved_0 : 22;
} sh_md_dqls_mmr_xbist_l_s;
} sh_md_dqls_mmr_xbist_l_u_t;
-#else
-typedef union sh_md_dqls_mmr_xbist_l_u {
- mmr_t sh_md_dqls_mmr_xbist_l_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t pat : 40;
- } sh_md_dqls_mmr_xbist_l_s;
-} sh_md_dqls_mmr_xbist_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLS_MMR_XBIST_ERR_H" */
/* rising edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqls_mmr_xbist_err_h_u {
mmr_t sh_md_dqls_mmr_xbist_err_h_regval;
struct {
@@ -25567,24 +13825,12 @@ typedef union sh_md_dqls_mmr_xbist_err_h_u {
mmr_t reserved_0 : 22;
} sh_md_dqls_mmr_xbist_err_h_s;
} sh_md_dqls_mmr_xbist_err_h_u_t;
-#else
-typedef union sh_md_dqls_mmr_xbist_err_h_u {
- mmr_t sh_md_dqls_mmr_xbist_err_h_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t pat : 40;
- } sh_md_dqls_mmr_xbist_err_h_s;
-} sh_md_dqls_mmr_xbist_err_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLS_MMR_XBIST_ERR_L" */
/* falling edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqls_mmr_xbist_err_l_u {
mmr_t sh_md_dqls_mmr_xbist_err_l_regval;
struct {
@@ -25594,24 +13840,12 @@ typedef union sh_md_dqls_mmr_xbist_err_l_u {
mmr_t reserved_0 : 22;
} sh_md_dqls_mmr_xbist_err_l_s;
} sh_md_dqls_mmr_xbist_err_l_u_t;
-#else
-typedef union sh_md_dqls_mmr_xbist_err_l_u {
- mmr_t sh_md_dqls_mmr_xbist_err_l_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t pat : 40;
- } sh_md_dqls_mmr_xbist_err_l_s;
-} sh_md_dqls_mmr_xbist_err_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLS_MMR_YBIST_H" */
/* rising edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqls_mmr_ybist_h_u {
mmr_t sh_md_dqls_mmr_ybist_h_regval;
struct {
@@ -25622,25 +13856,12 @@ typedef union sh_md_dqls_mmr_ybist_h_u {
mmr_t reserved_0 : 21;
} sh_md_dqls_mmr_ybist_h_s;
} sh_md_dqls_mmr_ybist_h_u_t;
-#else
-typedef union sh_md_dqls_mmr_ybist_h_u {
- mmr_t sh_md_dqls_mmr_ybist_h_regval;
- struct {
- mmr_t reserved_0 : 21;
- mmr_t arm : 1;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t pat : 40;
- } sh_md_dqls_mmr_ybist_h_s;
-} sh_md_dqls_mmr_ybist_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLS_MMR_YBIST_L" */
/* falling edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqls_mmr_ybist_l_u {
mmr_t sh_md_dqls_mmr_ybist_l_regval;
struct {
@@ -25650,24 +13871,12 @@ typedef union sh_md_dqls_mmr_ybist_l_u {
mmr_t reserved_0 : 22;
} sh_md_dqls_mmr_ybist_l_s;
} sh_md_dqls_mmr_ybist_l_u_t;
-#else
-typedef union sh_md_dqls_mmr_ybist_l_u {
- mmr_t sh_md_dqls_mmr_ybist_l_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t pat : 40;
- } sh_md_dqls_mmr_ybist_l_s;
-} sh_md_dqls_mmr_ybist_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLS_MMR_YBIST_ERR_H" */
/* rising edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqls_mmr_ybist_err_h_u {
mmr_t sh_md_dqls_mmr_ybist_err_h_regval;
struct {
@@ -25677,24 +13886,12 @@ typedef union sh_md_dqls_mmr_ybist_err_h_u {
mmr_t reserved_0 : 22;
} sh_md_dqls_mmr_ybist_err_h_s;
} sh_md_dqls_mmr_ybist_err_h_u_t;
-#else
-typedef union sh_md_dqls_mmr_ybist_err_h_u {
- mmr_t sh_md_dqls_mmr_ybist_err_h_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t pat : 40;
- } sh_md_dqls_mmr_ybist_err_h_s;
-} sh_md_dqls_mmr_ybist_err_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLS_MMR_YBIST_ERR_L" */
/* falling edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqls_mmr_ybist_err_l_u {
mmr_t sh_md_dqls_mmr_ybist_err_l_regval;
struct {
@@ -25704,24 +13901,12 @@ typedef union sh_md_dqls_mmr_ybist_err_l_u {
mmr_t reserved_0 : 22;
} sh_md_dqls_mmr_ybist_err_l_s;
} sh_md_dqls_mmr_ybist_err_l_u_t;
-#else
-typedef union sh_md_dqls_mmr_ybist_err_l_u {
- mmr_t sh_md_dqls_mmr_ybist_err_l_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t pat : 40;
- } sh_md_dqls_mmr_ybist_err_l_s;
-} sh_md_dqls_mmr_ybist_err_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLS_MMR_JNR_DEBUG" */
/* joiner/fct debug configuration */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqls_mmr_jnr_debug_u {
mmr_t sh_md_dqls_mmr_jnr_debug_regval;
struct {
@@ -25730,23 +13915,12 @@ typedef union sh_md_dqls_mmr_jnr_debug_u {
mmr_t reserved_0 : 62;
} sh_md_dqls_mmr_jnr_debug_s;
} sh_md_dqls_mmr_jnr_debug_u_t;
-#else
-typedef union sh_md_dqls_mmr_jnr_debug_u {
- mmr_t sh_md_dqls_mmr_jnr_debug_regval;
- struct {
- mmr_t reserved_0 : 62;
- mmr_t rw : 1;
- mmr_t px : 1;
- } sh_md_dqls_mmr_jnr_debug_s;
-} sh_md_dqls_mmr_jnr_debug_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQLS_MMR_XAMOPW_ERR" */
/* amo/partial rmw ecc error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqls_mmr_xamopw_err_u {
mmr_t sh_md_dqls_mmr_xamopw_err_regval;
struct {
@@ -25762,30 +13936,12 @@ typedef union sh_md_dqls_mmr_xamopw_err_u {
mmr_t reserved_2 : 31;
} sh_md_dqls_mmr_xamopw_err_s;
} sh_md_dqls_mmr_xamopw_err_u_t;
-#else
-typedef union sh_md_dqls_mmr_xamopw_err_u {
- mmr_t sh_md_dqls_mmr_xamopw_err_regval;
- struct {
- mmr_t reserved_2 : 31;
- mmr_t arm : 1;
- mmr_t reserved_1 : 6;
- mmr_t runc : 1;
- mmr_t rcor : 1;
- mmr_t rsyn : 8;
- mmr_t reserved_0 : 6;
- mmr_t sunc : 1;
- mmr_t scor : 1;
- mmr_t ssyn : 8;
- } sh_md_dqls_mmr_xamopw_err_s;
-} sh_md_dqls_mmr_xamopw_err_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_CONFIG" */
/* DQ directory config register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_config_u {
mmr_t sh_md_dqrp_mmr_dir_config_regval;
struct {
@@ -25795,276 +13951,156 @@ typedef union sh_md_dqrp_mmr_dir_config_u {
mmr_t reserved_0 : 59;
} sh_md_dqrp_mmr_dir_config_s;
} sh_md_dqrp_mmr_dir_config_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_config_u {
- mmr_t sh_md_dqrp_mmr_dir_config_regval;
- struct {
- mmr_t reserved_0 : 59;
- mmr_t en_dirpois : 1;
- mmr_t en_direcc : 1;
- mmr_t sys_size : 3;
- } sh_md_dqrp_mmr_dir_config_s;
-} sh_md_dqrp_mmr_dir_config_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_PRESVEC0" */
/* node [63:0] presence bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqrp_mmr_dir_presvec0_u {
- mmr_t sh_md_dqrp_mmr_dir_presvec0_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqrp_mmr_dir_presvec0_s;
-} sh_md_dqrp_mmr_dir_presvec0_u_t;
-#else
typedef union sh_md_dqrp_mmr_dir_presvec0_u {
mmr_t sh_md_dqrp_mmr_dir_presvec0_regval;
struct {
mmr_t vec : 64;
} sh_md_dqrp_mmr_dir_presvec0_s;
} sh_md_dqrp_mmr_dir_presvec0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_PRESVEC1" */
/* node [127:64] presence bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_presvec1_u {
mmr_t sh_md_dqrp_mmr_dir_presvec1_regval;
struct {
mmr_t vec : 64;
} sh_md_dqrp_mmr_dir_presvec1_s;
} sh_md_dqrp_mmr_dir_presvec1_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_presvec1_u {
- mmr_t sh_md_dqrp_mmr_dir_presvec1_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqrp_mmr_dir_presvec1_s;
-} sh_md_dqrp_mmr_dir_presvec1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_PRESVEC2" */
/* node [191:128] presence bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqrp_mmr_dir_presvec2_u {
- mmr_t sh_md_dqrp_mmr_dir_presvec2_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqrp_mmr_dir_presvec2_s;
-} sh_md_dqrp_mmr_dir_presvec2_u_t;
-#else
typedef union sh_md_dqrp_mmr_dir_presvec2_u {
mmr_t sh_md_dqrp_mmr_dir_presvec2_regval;
struct {
mmr_t vec : 64;
} sh_md_dqrp_mmr_dir_presvec2_s;
} sh_md_dqrp_mmr_dir_presvec2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_PRESVEC3" */
/* node [255:192] presence bits */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqrp_mmr_dir_presvec3_u {
- mmr_t sh_md_dqrp_mmr_dir_presvec3_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqrp_mmr_dir_presvec3_s;
-} sh_md_dqrp_mmr_dir_presvec3_u_t;
-#else
typedef union sh_md_dqrp_mmr_dir_presvec3_u {
mmr_t sh_md_dqrp_mmr_dir_presvec3_regval;
struct {
mmr_t vec : 64;
} sh_md_dqrp_mmr_dir_presvec3_s;
} sh_md_dqrp_mmr_dir_presvec3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC0" */
/* local vector for acc=0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqrp_mmr_dir_locvec0_u {
- mmr_t sh_md_dqrp_mmr_dir_locvec0_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqrp_mmr_dir_locvec0_s;
-} sh_md_dqrp_mmr_dir_locvec0_u_t;
-#else
typedef union sh_md_dqrp_mmr_dir_locvec0_u {
mmr_t sh_md_dqrp_mmr_dir_locvec0_regval;
struct {
mmr_t vec : 64;
} sh_md_dqrp_mmr_dir_locvec0_s;
} sh_md_dqrp_mmr_dir_locvec0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC1" */
/* local vector for acc=1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_locvec1_u {
mmr_t sh_md_dqrp_mmr_dir_locvec1_regval;
struct {
mmr_t vec : 64;
} sh_md_dqrp_mmr_dir_locvec1_s;
} sh_md_dqrp_mmr_dir_locvec1_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_locvec1_u {
- mmr_t sh_md_dqrp_mmr_dir_locvec1_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqrp_mmr_dir_locvec1_s;
-} sh_md_dqrp_mmr_dir_locvec1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC2" */
/* local vector for acc=2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_locvec2_u {
mmr_t sh_md_dqrp_mmr_dir_locvec2_regval;
struct {
mmr_t vec : 64;
} sh_md_dqrp_mmr_dir_locvec2_s;
} sh_md_dqrp_mmr_dir_locvec2_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_locvec2_u {
- mmr_t sh_md_dqrp_mmr_dir_locvec2_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqrp_mmr_dir_locvec2_s;
-} sh_md_dqrp_mmr_dir_locvec2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC3" */
/* local vector for acc=3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_locvec3_u {
mmr_t sh_md_dqrp_mmr_dir_locvec3_regval;
struct {
mmr_t vec : 64;
} sh_md_dqrp_mmr_dir_locvec3_s;
} sh_md_dqrp_mmr_dir_locvec3_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_locvec3_u {
- mmr_t sh_md_dqrp_mmr_dir_locvec3_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqrp_mmr_dir_locvec3_s;
-} sh_md_dqrp_mmr_dir_locvec3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC4" */
/* local vector for acc=4 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqrp_mmr_dir_locvec4_u {
- mmr_t sh_md_dqrp_mmr_dir_locvec4_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqrp_mmr_dir_locvec4_s;
-} sh_md_dqrp_mmr_dir_locvec4_u_t;
-#else
typedef union sh_md_dqrp_mmr_dir_locvec4_u {
mmr_t sh_md_dqrp_mmr_dir_locvec4_regval;
struct {
mmr_t vec : 64;
} sh_md_dqrp_mmr_dir_locvec4_s;
} sh_md_dqrp_mmr_dir_locvec4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC5" */
/* local vector for acc=5 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqrp_mmr_dir_locvec5_u {
- mmr_t sh_md_dqrp_mmr_dir_locvec5_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqrp_mmr_dir_locvec5_s;
-} sh_md_dqrp_mmr_dir_locvec5_u_t;
-#else
typedef union sh_md_dqrp_mmr_dir_locvec5_u {
mmr_t sh_md_dqrp_mmr_dir_locvec5_regval;
struct {
mmr_t vec : 64;
} sh_md_dqrp_mmr_dir_locvec5_s;
} sh_md_dqrp_mmr_dir_locvec5_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC6" */
/* local vector for acc=6 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_locvec6_u {
mmr_t sh_md_dqrp_mmr_dir_locvec6_regval;
struct {
mmr_t vec : 64;
} sh_md_dqrp_mmr_dir_locvec6_s;
} sh_md_dqrp_mmr_dir_locvec6_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_locvec6_u {
- mmr_t sh_md_dqrp_mmr_dir_locvec6_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqrp_mmr_dir_locvec6_s;
-} sh_md_dqrp_mmr_dir_locvec6_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_LOCVEC7" */
/* local vector for acc=7 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
-typedef union sh_md_dqrp_mmr_dir_locvec7_u {
- mmr_t sh_md_dqrp_mmr_dir_locvec7_regval;
- struct {
- mmr_t vec : 64;
- } sh_md_dqrp_mmr_dir_locvec7_s;
-} sh_md_dqrp_mmr_dir_locvec7_u_t;
-#else
typedef union sh_md_dqrp_mmr_dir_locvec7_u {
mmr_t sh_md_dqrp_mmr_dir_locvec7_regval;
struct {
mmr_t vec : 64;
} sh_md_dqrp_mmr_dir_locvec7_s;
} sh_md_dqrp_mmr_dir_locvec7_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC0" */
/* privilege vector for acc=0 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_privec0_u {
mmr_t sh_md_dqrp_mmr_dir_privec0_regval;
struct {
@@ -26073,23 +14109,12 @@ typedef union sh_md_dqrp_mmr_dir_privec0_u {
mmr_t reserved_0 : 36;
} sh_md_dqrp_mmr_dir_privec0_s;
} sh_md_dqrp_mmr_dir_privec0_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_privec0_u {
- mmr_t sh_md_dqrp_mmr_dir_privec0_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqrp_mmr_dir_privec0_s;
-} sh_md_dqrp_mmr_dir_privec0_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC1" */
/* privilege vector for acc=1 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_privec1_u {
mmr_t sh_md_dqrp_mmr_dir_privec1_regval;
struct {
@@ -26098,23 +14123,12 @@ typedef union sh_md_dqrp_mmr_dir_privec1_u {
mmr_t reserved_0 : 36;
} sh_md_dqrp_mmr_dir_privec1_s;
} sh_md_dqrp_mmr_dir_privec1_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_privec1_u {
- mmr_t sh_md_dqrp_mmr_dir_privec1_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqrp_mmr_dir_privec1_s;
-} sh_md_dqrp_mmr_dir_privec1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC2" */
/* privilege vector for acc=2 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_privec2_u {
mmr_t sh_md_dqrp_mmr_dir_privec2_regval;
struct {
@@ -26123,23 +14137,12 @@ typedef union sh_md_dqrp_mmr_dir_privec2_u {
mmr_t reserved_0 : 36;
} sh_md_dqrp_mmr_dir_privec2_s;
} sh_md_dqrp_mmr_dir_privec2_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_privec2_u {
- mmr_t sh_md_dqrp_mmr_dir_privec2_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqrp_mmr_dir_privec2_s;
-} sh_md_dqrp_mmr_dir_privec2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC3" */
/* privilege vector for acc=3 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_privec3_u {
mmr_t sh_md_dqrp_mmr_dir_privec3_regval;
struct {
@@ -26148,23 +14151,12 @@ typedef union sh_md_dqrp_mmr_dir_privec3_u {
mmr_t reserved_0 : 36;
} sh_md_dqrp_mmr_dir_privec3_s;
} sh_md_dqrp_mmr_dir_privec3_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_privec3_u {
- mmr_t sh_md_dqrp_mmr_dir_privec3_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqrp_mmr_dir_privec3_s;
-} sh_md_dqrp_mmr_dir_privec3_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC4" */
/* privilege vector for acc=4 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_privec4_u {
mmr_t sh_md_dqrp_mmr_dir_privec4_regval;
struct {
@@ -26173,23 +14165,12 @@ typedef union sh_md_dqrp_mmr_dir_privec4_u {
mmr_t reserved_0 : 36;
} sh_md_dqrp_mmr_dir_privec4_s;
} sh_md_dqrp_mmr_dir_privec4_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_privec4_u {
- mmr_t sh_md_dqrp_mmr_dir_privec4_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqrp_mmr_dir_privec4_s;
-} sh_md_dqrp_mmr_dir_privec4_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC5" */
/* privilege vector for acc=5 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_privec5_u {
mmr_t sh_md_dqrp_mmr_dir_privec5_regval;
struct {
@@ -26198,23 +14179,12 @@ typedef union sh_md_dqrp_mmr_dir_privec5_u {
mmr_t reserved_0 : 36;
} sh_md_dqrp_mmr_dir_privec5_s;
} sh_md_dqrp_mmr_dir_privec5_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_privec5_u {
- mmr_t sh_md_dqrp_mmr_dir_privec5_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqrp_mmr_dir_privec5_s;
-} sh_md_dqrp_mmr_dir_privec5_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC6" */
/* privilege vector for acc=6 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_privec6_u {
mmr_t sh_md_dqrp_mmr_dir_privec6_regval;
struct {
@@ -26223,23 +14193,12 @@ typedef union sh_md_dqrp_mmr_dir_privec6_u {
mmr_t reserved_0 : 36;
} sh_md_dqrp_mmr_dir_privec6_s;
} sh_md_dqrp_mmr_dir_privec6_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_privec6_u {
- mmr_t sh_md_dqrp_mmr_dir_privec6_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqrp_mmr_dir_privec6_s;
-} sh_md_dqrp_mmr_dir_privec6_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC7" */
/* privilege vector for acc=7 */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_privec7_u {
mmr_t sh_md_dqrp_mmr_dir_privec7_regval;
struct {
@@ -26248,23 +14207,12 @@ typedef union sh_md_dqrp_mmr_dir_privec7_u {
mmr_t reserved_0 : 36;
} sh_md_dqrp_mmr_dir_privec7_s;
} sh_md_dqrp_mmr_dir_privec7_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_privec7_u {
- mmr_t sh_md_dqrp_mmr_dir_privec7_regval;
- struct {
- mmr_t reserved_0 : 36;
- mmr_t out : 14;
- mmr_t in : 14;
- } sh_md_dqrp_mmr_dir_privec7_s;
-} sh_md_dqrp_mmr_dir_privec7_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_TIMER" */
/* MD SXRO timer */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_timer_u {
mmr_t sh_md_dqrp_mmr_dir_timer_regval;
struct {
@@ -26274,24 +14222,12 @@ typedef union sh_md_dqrp_mmr_dir_timer_u {
mmr_t reserved_0 : 42;
} sh_md_dqrp_mmr_dir_timer_s;
} sh_md_dqrp_mmr_dir_timer_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_timer_u {
- mmr_t sh_md_dqrp_mmr_dir_timer_regval;
- struct {
- mmr_t reserved_0 : 42;
- mmr_t timer_cur : 9;
- mmr_t timer_en : 1;
- mmr_t timer_div : 12;
- } sh_md_dqrp_mmr_dir_timer_s;
-} sh_md_dqrp_mmr_dir_timer_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_PIOWD_DIR_ENTRY" */
/* directory pio write data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_piowd_dir_entry_u {
mmr_t sh_md_dqrp_mmr_piowd_dir_entry_regval;
struct {
@@ -26302,25 +14238,12 @@ typedef union sh_md_dqrp_mmr_piowd_dir_entry_u {
mmr_t reserved_0 : 6;
} sh_md_dqrp_mmr_piowd_dir_entry_s;
} sh_md_dqrp_mmr_piowd_dir_entry_u_t;
-#else
-typedef union sh_md_dqrp_mmr_piowd_dir_entry_u {
- mmr_t sh_md_dqrp_mmr_piowd_dir_entry_regval;
- struct {
- mmr_t reserved_0 : 6;
- mmr_t acc : 3;
- mmr_t pri : 3;
- mmr_t dirb : 26;
- mmr_t dira : 26;
- } sh_md_dqrp_mmr_piowd_dir_entry_s;
-} sh_md_dqrp_mmr_piowd_dir_entry_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_PIOWD_DIR_ECC" */
/* directory ecc register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_piowd_dir_ecc_u {
mmr_t sh_md_dqrp_mmr_piowd_dir_ecc_regval;
struct {
@@ -26329,23 +14252,12 @@ typedef union sh_md_dqrp_mmr_piowd_dir_ecc_u {
mmr_t reserved_0 : 50;
} sh_md_dqrp_mmr_piowd_dir_ecc_s;
} sh_md_dqrp_mmr_piowd_dir_ecc_u_t;
-#else
-typedef union sh_md_dqrp_mmr_piowd_dir_ecc_u {
- mmr_t sh_md_dqrp_mmr_piowd_dir_ecc_regval;
- struct {
- mmr_t reserved_0 : 50;
- mmr_t eccb : 7;
- mmr_t ecca : 7;
- } sh_md_dqrp_mmr_piowd_dir_ecc_s;
-} sh_md_dqrp_mmr_piowd_dir_ecc_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_XPIORD_XDIR_ENTRY" */
/* x directory pio read data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_xpiord_xdir_entry_u {
mmr_t sh_md_dqrp_mmr_xpiord_xdir_entry_regval;
struct {
@@ -26358,27 +14270,12 @@ typedef union sh_md_dqrp_mmr_xpiord_xdir_entry_u {
mmr_t reserved_0 : 4;
} sh_md_dqrp_mmr_xpiord_xdir_entry_s;
} sh_md_dqrp_mmr_xpiord_xdir_entry_u_t;
-#else
-typedef union sh_md_dqrp_mmr_xpiord_xdir_entry_u {
- mmr_t sh_md_dqrp_mmr_xpiord_xdir_entry_regval;
- struct {
- mmr_t reserved_0 : 4;
- mmr_t unc : 1;
- mmr_t cor : 1;
- mmr_t acc : 3;
- mmr_t pri : 3;
- mmr_t dirb : 26;
- mmr_t dira : 26;
- } sh_md_dqrp_mmr_xpiord_xdir_entry_s;
-} sh_md_dqrp_mmr_xpiord_xdir_entry_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_XPIORD_XDIR_ECC" */
/* x directory ecc */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_xpiord_xdir_ecc_u {
mmr_t sh_md_dqrp_mmr_xpiord_xdir_ecc_regval;
struct {
@@ -26387,23 +14284,12 @@ typedef union sh_md_dqrp_mmr_xpiord_xdir_ecc_u {
mmr_t reserved_0 : 50;
} sh_md_dqrp_mmr_xpiord_xdir_ecc_s;
} sh_md_dqrp_mmr_xpiord_xdir_ecc_u_t;
-#else
-typedef union sh_md_dqrp_mmr_xpiord_xdir_ecc_u {
- mmr_t sh_md_dqrp_mmr_xpiord_xdir_ecc_regval;
- struct {
- mmr_t reserved_0 : 50;
- mmr_t eccb : 7;
- mmr_t ecca : 7;
- } sh_md_dqrp_mmr_xpiord_xdir_ecc_s;
-} sh_md_dqrp_mmr_xpiord_xdir_ecc_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_YPIORD_YDIR_ENTRY" */
/* y directory pio read data */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_ypiord_ydir_entry_u {
mmr_t sh_md_dqrp_mmr_ypiord_ydir_entry_regval;
struct {
@@ -26416,27 +14302,12 @@ typedef union sh_md_dqrp_mmr_ypiord_ydir_entry_u {
mmr_t reserved_0 : 4;
} sh_md_dqrp_mmr_ypiord_ydir_entry_s;
} sh_md_dqrp_mmr_ypiord_ydir_entry_u_t;
-#else
-typedef union sh_md_dqrp_mmr_ypiord_ydir_entry_u {
- mmr_t sh_md_dqrp_mmr_ypiord_ydir_entry_regval;
- struct {
- mmr_t reserved_0 : 4;
- mmr_t unc : 1;
- mmr_t cor : 1;
- mmr_t acc : 3;
- mmr_t pri : 3;
- mmr_t dirb : 26;
- mmr_t dira : 26;
- } sh_md_dqrp_mmr_ypiord_ydir_entry_s;
-} sh_md_dqrp_mmr_ypiord_ydir_entry_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_YPIORD_YDIR_ECC" */
/* y directory ecc */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_ypiord_ydir_ecc_u {
mmr_t sh_md_dqrp_mmr_ypiord_ydir_ecc_regval;
struct {
@@ -26445,23 +14316,12 @@ typedef union sh_md_dqrp_mmr_ypiord_ydir_ecc_u {
mmr_t reserved_0 : 50;
} sh_md_dqrp_mmr_ypiord_ydir_ecc_s;
} sh_md_dqrp_mmr_ypiord_ydir_ecc_u_t;
-#else
-typedef union sh_md_dqrp_mmr_ypiord_ydir_ecc_u {
- mmr_t sh_md_dqrp_mmr_ypiord_ydir_ecc_regval;
- struct {
- mmr_t reserved_0 : 50;
- mmr_t eccb : 7;
- mmr_t ecca : 7;
- } sh_md_dqrp_mmr_ypiord_ydir_ecc_s;
-} sh_md_dqrp_mmr_ypiord_ydir_ecc_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_XCERR1" */
/* correctable dir ecc group 1 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_xcerr1_u {
mmr_t sh_md_dqrp_mmr_xcerr1_regval;
struct {
@@ -26472,25 +14332,12 @@ typedef union sh_md_dqrp_mmr_xcerr1_u {
mmr_t reserved_0 : 25;
} sh_md_dqrp_mmr_xcerr1_s;
} sh_md_dqrp_mmr_xcerr1_u_t;
-#else
-typedef union sh_md_dqrp_mmr_xcerr1_u {
- mmr_t sh_md_dqrp_mmr_xcerr1_regval;
- struct {
- mmr_t reserved_0 : 25;
- mmr_t arm : 1;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp1 : 36;
- } sh_md_dqrp_mmr_xcerr1_s;
-} sh_md_dqrp_mmr_xcerr1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_XCERR2" */
/* correctable dir ecc group 2 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_xcerr2_u {
mmr_t sh_md_dqrp_mmr_xcerr2_regval;
struct {
@@ -26500,24 +14347,12 @@ typedef union sh_md_dqrp_mmr_xcerr2_u {
mmr_t reserved_0 : 26;
} sh_md_dqrp_mmr_xcerr2_s;
} sh_md_dqrp_mmr_xcerr2_u_t;
-#else
-typedef union sh_md_dqrp_mmr_xcerr2_u {
- mmr_t sh_md_dqrp_mmr_xcerr2_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp2 : 36;
- } sh_md_dqrp_mmr_xcerr2_s;
-} sh_md_dqrp_mmr_xcerr2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_XUERR1" */
/* uncorrectable dir ecc group 1 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_xuerr1_u {
mmr_t sh_md_dqrp_mmr_xuerr1_regval;
struct {
@@ -26528,25 +14363,12 @@ typedef union sh_md_dqrp_mmr_xuerr1_u {
mmr_t reserved_0 : 25;
} sh_md_dqrp_mmr_xuerr1_s;
} sh_md_dqrp_mmr_xuerr1_u_t;
-#else
-typedef union sh_md_dqrp_mmr_xuerr1_u {
- mmr_t sh_md_dqrp_mmr_xuerr1_regval;
- struct {
- mmr_t reserved_0 : 25;
- mmr_t arm : 1;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp1 : 36;
- } sh_md_dqrp_mmr_xuerr1_s;
-} sh_md_dqrp_mmr_xuerr1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_XUERR2" */
/* uncorrectable dir ecc group 2 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_xuerr2_u {
mmr_t sh_md_dqrp_mmr_xuerr2_regval;
struct {
@@ -26556,24 +14378,12 @@ typedef union sh_md_dqrp_mmr_xuerr2_u {
mmr_t reserved_0 : 26;
} sh_md_dqrp_mmr_xuerr2_s;
} sh_md_dqrp_mmr_xuerr2_u_t;
-#else
-typedef union sh_md_dqrp_mmr_xuerr2_u {
- mmr_t sh_md_dqrp_mmr_xuerr2_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp2 : 36;
- } sh_md_dqrp_mmr_xuerr2_s;
-} sh_md_dqrp_mmr_xuerr2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_XPERR" */
/* protocol error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_xperr_u {
mmr_t sh_md_dqrp_mmr_xperr_regval;
struct {
@@ -26591,32 +14401,12 @@ typedef union sh_md_dqrp_mmr_xperr_u {
mmr_t reserved_0 : 1;
} sh_md_dqrp_mmr_xperr_s;
} sh_md_dqrp_mmr_xperr_u_t;
-#else
-typedef union sh_md_dqrp_mmr_xperr_u {
- mmr_t sh_md_dqrp_mmr_xperr_regval;
- struct {
- mmr_t reserved_0 : 1;
- mmr_t arm : 1;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t mybit : 8;
- mmr_t unc : 1;
- mmr_t cor : 1;
- mmr_t priv : 1;
- mmr_t prige : 1;
- mmr_t src : 14;
- mmr_t cmd : 8;
- mmr_t dir : 26;
- } sh_md_dqrp_mmr_xperr_s;
-} sh_md_dqrp_mmr_xperr_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_YCERR1" */
/* correctable dir ecc group 1 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_ycerr1_u {
mmr_t sh_md_dqrp_mmr_ycerr1_regval;
struct {
@@ -26627,25 +14417,12 @@ typedef union sh_md_dqrp_mmr_ycerr1_u {
mmr_t reserved_0 : 25;
} sh_md_dqrp_mmr_ycerr1_s;
} sh_md_dqrp_mmr_ycerr1_u_t;
-#else
-typedef union sh_md_dqrp_mmr_ycerr1_u {
- mmr_t sh_md_dqrp_mmr_ycerr1_regval;
- struct {
- mmr_t reserved_0 : 25;
- mmr_t arm : 1;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp1 : 36;
- } sh_md_dqrp_mmr_ycerr1_s;
-} sh_md_dqrp_mmr_ycerr1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_YCERR2" */
/* correctable dir ecc group 2 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_ycerr2_u {
mmr_t sh_md_dqrp_mmr_ycerr2_regval;
struct {
@@ -26655,24 +14432,12 @@ typedef union sh_md_dqrp_mmr_ycerr2_u {
mmr_t reserved_0 : 26;
} sh_md_dqrp_mmr_ycerr2_s;
} sh_md_dqrp_mmr_ycerr2_u_t;
-#else
-typedef union sh_md_dqrp_mmr_ycerr2_u {
- mmr_t sh_md_dqrp_mmr_ycerr2_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp2 : 36;
- } sh_md_dqrp_mmr_ycerr2_s;
-} sh_md_dqrp_mmr_ycerr2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_YUERR1" */
/* uncorrectable dir ecc group 1 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_yuerr1_u {
mmr_t sh_md_dqrp_mmr_yuerr1_regval;
struct {
@@ -26683,25 +14448,12 @@ typedef union sh_md_dqrp_mmr_yuerr1_u {
mmr_t reserved_0 : 25;
} sh_md_dqrp_mmr_yuerr1_s;
} sh_md_dqrp_mmr_yuerr1_u_t;
-#else
-typedef union sh_md_dqrp_mmr_yuerr1_u {
- mmr_t sh_md_dqrp_mmr_yuerr1_regval;
- struct {
- mmr_t reserved_0 : 25;
- mmr_t arm : 1;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp1 : 36;
- } sh_md_dqrp_mmr_yuerr1_s;
-} sh_md_dqrp_mmr_yuerr1_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_YUERR2" */
/* uncorrectable dir ecc group 2 error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_yuerr2_u {
mmr_t sh_md_dqrp_mmr_yuerr2_regval;
struct {
@@ -26711,24 +14463,12 @@ typedef union sh_md_dqrp_mmr_yuerr2_u {
mmr_t reserved_0 : 26;
} sh_md_dqrp_mmr_yuerr2_s;
} sh_md_dqrp_mmr_yuerr2_u_t;
-#else
-typedef union sh_md_dqrp_mmr_yuerr2_u {
- mmr_t sh_md_dqrp_mmr_yuerr2_regval;
- struct {
- mmr_t reserved_0 : 26;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t grp2 : 36;
- } sh_md_dqrp_mmr_yuerr2_s;
-} sh_md_dqrp_mmr_yuerr2_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_YPERR" */
/* protocol error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_yperr_u {
mmr_t sh_md_dqrp_mmr_yperr_regval;
struct {
@@ -26746,32 +14486,12 @@ typedef union sh_md_dqrp_mmr_yperr_u {
mmr_t reserved_0 : 1;
} sh_md_dqrp_mmr_yperr_s;
} sh_md_dqrp_mmr_yperr_u_t;
-#else
-typedef union sh_md_dqrp_mmr_yperr_u {
- mmr_t sh_md_dqrp_mmr_yperr_regval;
- struct {
- mmr_t reserved_0 : 1;
- mmr_t arm : 1;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t mybit : 8;
- mmr_t unc : 1;
- mmr_t cor : 1;
- mmr_t priv : 1;
- mmr_t prige : 1;
- mmr_t src : 14;
- mmr_t cmd : 8;
- mmr_t dir : 26;
- } sh_md_dqrp_mmr_yperr_s;
-} sh_md_dqrp_mmr_yperr_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_CMDTRIG" */
/* cmd triggers */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_cmdtrig_u {
mmr_t sh_md_dqrp_mmr_dir_cmdtrig_regval;
struct {
@@ -26782,25 +14502,12 @@ typedef union sh_md_dqrp_mmr_dir_cmdtrig_u {
mmr_t reserved_0 : 32;
} sh_md_dqrp_mmr_dir_cmdtrig_s;
} sh_md_dqrp_mmr_dir_cmdtrig_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_cmdtrig_u {
- mmr_t sh_md_dqrp_mmr_dir_cmdtrig_regval;
- struct {
- mmr_t reserved_0 : 32;
- mmr_t cmd3 : 8;
- mmr_t cmd2 : 8;
- mmr_t cmd1 : 8;
- mmr_t cmd0 : 8;
- } sh_md_dqrp_mmr_dir_cmdtrig_s;
-} sh_md_dqrp_mmr_dir_cmdtrig_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_TBLTRIG" */
/* dir table trigger */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_tbltrig_u {
mmr_t sh_md_dqrp_mmr_dir_tbltrig_regval;
struct {
@@ -26813,27 +14520,12 @@ typedef union sh_md_dqrp_mmr_dir_tbltrig_u {
mmr_t reserved_0 : 22;
} sh_md_dqrp_mmr_dir_tbltrig_s;
} sh_md_dqrp_mmr_dir_tbltrig_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_tbltrig_u {
- mmr_t sh_md_dqrp_mmr_dir_tbltrig_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t mybit : 8;
- mmr_t dirst : 9;
- mmr_t prige : 1;
- mmr_t acc : 2;
- mmr_t cmd : 8;
- mmr_t src : 14;
- } sh_md_dqrp_mmr_dir_tbltrig_s;
-} sh_md_dqrp_mmr_dir_tbltrig_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_DIR_TBLMASK" */
/* dir table trigger mask */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_dir_tblmask_u {
mmr_t sh_md_dqrp_mmr_dir_tblmask_regval;
struct {
@@ -26846,27 +14538,12 @@ typedef union sh_md_dqrp_mmr_dir_tblmask_u {
mmr_t reserved_0 : 22;
} sh_md_dqrp_mmr_dir_tblmask_s;
} sh_md_dqrp_mmr_dir_tblmask_u_t;
-#else
-typedef union sh_md_dqrp_mmr_dir_tblmask_u {
- mmr_t sh_md_dqrp_mmr_dir_tblmask_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t mybit : 8;
- mmr_t dirst : 9;
- mmr_t prige : 1;
- mmr_t acc : 2;
- mmr_t cmd : 8;
- mmr_t src : 14;
- } sh_md_dqrp_mmr_dir_tblmask_s;
-} sh_md_dqrp_mmr_dir_tblmask_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_XBIST_H" */
/* rising edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_xbist_h_u {
mmr_t sh_md_dqrp_mmr_xbist_h_regval;
struct {
@@ -26878,26 +14555,12 @@ typedef union sh_md_dqrp_mmr_xbist_h_u {
mmr_t reserved_1 : 21;
} sh_md_dqrp_mmr_xbist_h_s;
} sh_md_dqrp_mmr_xbist_h_u_t;
-#else
-typedef union sh_md_dqrp_mmr_xbist_h_u {
- mmr_t sh_md_dqrp_mmr_xbist_h_regval;
- struct {
- mmr_t reserved_1 : 21;
- mmr_t arm : 1;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqrp_mmr_xbist_h_s;
-} sh_md_dqrp_mmr_xbist_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_XBIST_L" */
/* falling edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_xbist_l_u {
mmr_t sh_md_dqrp_mmr_xbist_l_regval;
struct {
@@ -26908,25 +14571,12 @@ typedef union sh_md_dqrp_mmr_xbist_l_u {
mmr_t reserved_1 : 22;
} sh_md_dqrp_mmr_xbist_l_s;
} sh_md_dqrp_mmr_xbist_l_u_t;
-#else
-typedef union sh_md_dqrp_mmr_xbist_l_u {
- mmr_t sh_md_dqrp_mmr_xbist_l_regval;
- struct {
- mmr_t reserved_1 : 22;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqrp_mmr_xbist_l_s;
-} sh_md_dqrp_mmr_xbist_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_XBIST_ERR_H" */
/* rising edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_xbist_err_h_u {
mmr_t sh_md_dqrp_mmr_xbist_err_h_regval;
struct {
@@ -26937,25 +14587,12 @@ typedef union sh_md_dqrp_mmr_xbist_err_h_u {
mmr_t reserved_1 : 22;
} sh_md_dqrp_mmr_xbist_err_h_s;
} sh_md_dqrp_mmr_xbist_err_h_u_t;
-#else
-typedef union sh_md_dqrp_mmr_xbist_err_h_u {
- mmr_t sh_md_dqrp_mmr_xbist_err_h_regval;
- struct {
- mmr_t reserved_1 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqrp_mmr_xbist_err_h_s;
-} sh_md_dqrp_mmr_xbist_err_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_XBIST_ERR_L" */
/* falling edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_xbist_err_l_u {
mmr_t sh_md_dqrp_mmr_xbist_err_l_regval;
struct {
@@ -26966,25 +14603,12 @@ typedef union sh_md_dqrp_mmr_xbist_err_l_u {
mmr_t reserved_1 : 22;
} sh_md_dqrp_mmr_xbist_err_l_s;
} sh_md_dqrp_mmr_xbist_err_l_u_t;
-#else
-typedef union sh_md_dqrp_mmr_xbist_err_l_u {
- mmr_t sh_md_dqrp_mmr_xbist_err_l_regval;
- struct {
- mmr_t reserved_1 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqrp_mmr_xbist_err_l_s;
-} sh_md_dqrp_mmr_xbist_err_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_YBIST_H" */
/* rising edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_ybist_h_u {
mmr_t sh_md_dqrp_mmr_ybist_h_regval;
struct {
@@ -26996,26 +14620,12 @@ typedef union sh_md_dqrp_mmr_ybist_h_u {
mmr_t reserved_1 : 21;
} sh_md_dqrp_mmr_ybist_h_s;
} sh_md_dqrp_mmr_ybist_h_u_t;
-#else
-typedef union sh_md_dqrp_mmr_ybist_h_u {
- mmr_t sh_md_dqrp_mmr_ybist_h_regval;
- struct {
- mmr_t reserved_1 : 21;
- mmr_t arm : 1;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqrp_mmr_ybist_h_s;
-} sh_md_dqrp_mmr_ybist_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_YBIST_L" */
/* falling edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_ybist_l_u {
mmr_t sh_md_dqrp_mmr_ybist_l_regval;
struct {
@@ -27026,25 +14636,12 @@ typedef union sh_md_dqrp_mmr_ybist_l_u {
mmr_t reserved_1 : 22;
} sh_md_dqrp_mmr_ybist_l_s;
} sh_md_dqrp_mmr_ybist_l_u_t;
-#else
-typedef union sh_md_dqrp_mmr_ybist_l_u {
- mmr_t sh_md_dqrp_mmr_ybist_l_regval;
- struct {
- mmr_t reserved_1 : 22;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqrp_mmr_ybist_l_s;
-} sh_md_dqrp_mmr_ybist_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_YBIST_ERR_H" */
/* rising edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_ybist_err_h_u {
mmr_t sh_md_dqrp_mmr_ybist_err_h_regval;
struct {
@@ -27055,25 +14652,12 @@ typedef union sh_md_dqrp_mmr_ybist_err_h_u {
mmr_t reserved_1 : 22;
} sh_md_dqrp_mmr_ybist_err_h_s;
} sh_md_dqrp_mmr_ybist_err_h_u_t;
-#else
-typedef union sh_md_dqrp_mmr_ybist_err_h_u {
- mmr_t sh_md_dqrp_mmr_ybist_err_h_regval;
- struct {
- mmr_t reserved_1 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqrp_mmr_ybist_err_h_s;
-} sh_md_dqrp_mmr_ybist_err_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRP_MMR_YBIST_ERR_L" */
/* falling edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrp_mmr_ybist_err_l_u {
mmr_t sh_md_dqrp_mmr_ybist_err_l_regval;
struct {
@@ -27084,25 +14668,12 @@ typedef union sh_md_dqrp_mmr_ybist_err_l_u {
mmr_t reserved_1 : 22;
} sh_md_dqrp_mmr_ybist_err_l_s;
} sh_md_dqrp_mmr_ybist_err_l_u_t;
-#else
-typedef union sh_md_dqrp_mmr_ybist_err_l_u {
- mmr_t sh_md_dqrp_mmr_ybist_err_l_regval;
- struct {
- mmr_t reserved_1 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t reserved_0 : 8;
- mmr_t pat : 32;
- } sh_md_dqrp_mmr_ybist_err_l_s;
-} sh_md_dqrp_mmr_ybist_err_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRS_MMR_XBIST_H" */
/* rising edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrs_mmr_xbist_h_u {
mmr_t sh_md_dqrs_mmr_xbist_h_regval;
struct {
@@ -27113,25 +14684,12 @@ typedef union sh_md_dqrs_mmr_xbist_h_u {
mmr_t reserved_0 : 21;
} sh_md_dqrs_mmr_xbist_h_s;
} sh_md_dqrs_mmr_xbist_h_u_t;
-#else
-typedef union sh_md_dqrs_mmr_xbist_h_u {
- mmr_t sh_md_dqrs_mmr_xbist_h_regval;
- struct {
- mmr_t reserved_0 : 21;
- mmr_t arm : 1;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t pat : 40;
- } sh_md_dqrs_mmr_xbist_h_s;
-} sh_md_dqrs_mmr_xbist_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRS_MMR_XBIST_L" */
/* falling edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrs_mmr_xbist_l_u {
mmr_t sh_md_dqrs_mmr_xbist_l_regval;
struct {
@@ -27141,24 +14699,12 @@ typedef union sh_md_dqrs_mmr_xbist_l_u {
mmr_t reserved_0 : 22;
} sh_md_dqrs_mmr_xbist_l_s;
} sh_md_dqrs_mmr_xbist_l_u_t;
-#else
-typedef union sh_md_dqrs_mmr_xbist_l_u {
- mmr_t sh_md_dqrs_mmr_xbist_l_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t pat : 40;
- } sh_md_dqrs_mmr_xbist_l_s;
-} sh_md_dqrs_mmr_xbist_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRS_MMR_XBIST_ERR_H" */
/* rising edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrs_mmr_xbist_err_h_u {
mmr_t sh_md_dqrs_mmr_xbist_err_h_regval;
struct {
@@ -27168,24 +14714,12 @@ typedef union sh_md_dqrs_mmr_xbist_err_h_u {
mmr_t reserved_0 : 22;
} sh_md_dqrs_mmr_xbist_err_h_s;
} sh_md_dqrs_mmr_xbist_err_h_u_t;
-#else
-typedef union sh_md_dqrs_mmr_xbist_err_h_u {
- mmr_t sh_md_dqrs_mmr_xbist_err_h_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t pat : 40;
- } sh_md_dqrs_mmr_xbist_err_h_s;
-} sh_md_dqrs_mmr_xbist_err_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRS_MMR_XBIST_ERR_L" */
/* falling edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrs_mmr_xbist_err_l_u {
mmr_t sh_md_dqrs_mmr_xbist_err_l_regval;
struct {
@@ -27195,24 +14729,12 @@ typedef union sh_md_dqrs_mmr_xbist_err_l_u {
mmr_t reserved_0 : 22;
} sh_md_dqrs_mmr_xbist_err_l_s;
} sh_md_dqrs_mmr_xbist_err_l_u_t;
-#else
-typedef union sh_md_dqrs_mmr_xbist_err_l_u {
- mmr_t sh_md_dqrs_mmr_xbist_err_l_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t pat : 40;
- } sh_md_dqrs_mmr_xbist_err_l_s;
-} sh_md_dqrs_mmr_xbist_err_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRS_MMR_YBIST_H" */
/* rising edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrs_mmr_ybist_h_u {
mmr_t sh_md_dqrs_mmr_ybist_h_regval;
struct {
@@ -27223,25 +14745,12 @@ typedef union sh_md_dqrs_mmr_ybist_h_u {
mmr_t reserved_0 : 21;
} sh_md_dqrs_mmr_ybist_h_s;
} sh_md_dqrs_mmr_ybist_h_u_t;
-#else
-typedef union sh_md_dqrs_mmr_ybist_h_u {
- mmr_t sh_md_dqrs_mmr_ybist_h_regval;
- struct {
- mmr_t reserved_0 : 21;
- mmr_t arm : 1;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t pat : 40;
- } sh_md_dqrs_mmr_ybist_h_s;
-} sh_md_dqrs_mmr_ybist_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRS_MMR_YBIST_L" */
/* falling edge bist/fill pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrs_mmr_ybist_l_u {
mmr_t sh_md_dqrs_mmr_ybist_l_regval;
struct {
@@ -27251,24 +14760,12 @@ typedef union sh_md_dqrs_mmr_ybist_l_u {
mmr_t reserved_0 : 22;
} sh_md_dqrs_mmr_ybist_l_s;
} sh_md_dqrs_mmr_ybist_l_u_t;
-#else
-typedef union sh_md_dqrs_mmr_ybist_l_u {
- mmr_t sh_md_dqrs_mmr_ybist_l_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t rot : 1;
- mmr_t inv : 1;
- mmr_t pat : 40;
- } sh_md_dqrs_mmr_ybist_l_s;
-} sh_md_dqrs_mmr_ybist_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRS_MMR_YBIST_ERR_H" */
/* rising edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrs_mmr_ybist_err_h_u {
mmr_t sh_md_dqrs_mmr_ybist_err_h_regval;
struct {
@@ -27278,24 +14775,12 @@ typedef union sh_md_dqrs_mmr_ybist_err_h_u {
mmr_t reserved_0 : 22;
} sh_md_dqrs_mmr_ybist_err_h_s;
} sh_md_dqrs_mmr_ybist_err_h_u_t;
-#else
-typedef union sh_md_dqrs_mmr_ybist_err_h_u {
- mmr_t sh_md_dqrs_mmr_ybist_err_h_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t pat : 40;
- } sh_md_dqrs_mmr_ybist_err_h_s;
-} sh_md_dqrs_mmr_ybist_err_h_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRS_MMR_YBIST_ERR_L" */
/* falling edge bist error pattern */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrs_mmr_ybist_err_l_u {
mmr_t sh_md_dqrs_mmr_ybist_err_l_regval;
struct {
@@ -27305,24 +14790,12 @@ typedef union sh_md_dqrs_mmr_ybist_err_l_u {
mmr_t reserved_0 : 22;
} sh_md_dqrs_mmr_ybist_err_l_s;
} sh_md_dqrs_mmr_ybist_err_l_u_t;
-#else
-typedef union sh_md_dqrs_mmr_ybist_err_l_u {
- mmr_t sh_md_dqrs_mmr_ybist_err_l_regval;
- struct {
- mmr_t reserved_0 : 22;
- mmr_t more : 1;
- mmr_t val : 1;
- mmr_t pat : 40;
- } sh_md_dqrs_mmr_ybist_err_l_s;
-} sh_md_dqrs_mmr_ybist_err_l_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRS_MMR_JNR_DEBUG" */
/* joiner/fct debug configuration */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrs_mmr_jnr_debug_u {
mmr_t sh_md_dqrs_mmr_jnr_debug_regval;
struct {
@@ -27331,23 +14804,12 @@ typedef union sh_md_dqrs_mmr_jnr_debug_u {
mmr_t reserved_0 : 62;
} sh_md_dqrs_mmr_jnr_debug_s;
} sh_md_dqrs_mmr_jnr_debug_u_t;
-#else
-typedef union sh_md_dqrs_mmr_jnr_debug_u {
- mmr_t sh_md_dqrs_mmr_jnr_debug_regval;
- struct {
- mmr_t reserved_0 : 62;
- mmr_t rw : 1;
- mmr_t px : 1;
- } sh_md_dqrs_mmr_jnr_debug_s;
-} sh_md_dqrs_mmr_jnr_debug_u_t;
-#endif
/* ==================================================================== */
/* Register "SH_MD_DQRS_MMR_YAMOPW_ERR" */
/* amo/partial rmw ecc error register */
/* ==================================================================== */
-#ifdef LITTLE_ENDIAN
typedef union sh_md_dqrs_mmr_yamopw_err_u {
mmr_t sh_md_dqrs_mmr_yamopw_err_regval;
struct {
@@ -27363,23 +14825,5 @@ typedef union sh_md_dqrs_mmr_yamopw_err_u {
mmr_t reserved_2 : 31;
} sh_md_dqrs_mmr_yamopw_err_s;
} sh_md_dqrs_mmr_yamopw_err_u_t;
-#else
-typedef union sh_md_dqrs_mmr_yamopw_err_u {
- mmr_t sh_md_dqrs_mmr_yamopw_err_regval;
- struct {
- mmr_t reserved_2 : 31;
- mmr_t arm : 1;
- mmr_t reserved_1 : 6;
- mmr_t runc : 1;
- mmr_t rcor : 1;
- mmr_t rsyn : 8;
- mmr_t reserved_0 : 6;
- mmr_t sunc : 1;
- mmr_t scor : 1;
- mmr_t ssyn : 8;
- } sh_md_dqrs_mmr_yamopw_err_s;
-} sh_md_dqrs_mmr_yamopw_err_u_t;
-#endif
-
#endif /* _ASM_IA64_SN_SN2_SHUB_MMR_T_H */
diff --git a/include/asm-ia64/spinlock.h b/include/asm-ia64/spinlock.h
index 6ab675570740..d2bcd9b20784 100644
--- a/include/asm-ia64/spinlock.h
+++ b/include/asm-ia64/spinlock.h
@@ -166,7 +166,7 @@ do { \
#define _raw_write_lock(l) \
({ \
__u64 ia64_val, ia64_set_val = ia64_dep_mi(-1, 0, 31, 1); \
- __u32 ia64_write_lock_ptr = (__u32 *) (l); \
+ __u32 *ia64_write_lock_ptr = (__u32 *) (l); \
do { \
while (*ia64_write_lock_ptr) \
ia64_barrier(); \
diff --git a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h
index fb463bda10de..7516e2945ecd 100644
--- a/include/asm-m68k/processor.h
+++ b/include/asm-m68k/processor.h
@@ -56,7 +56,6 @@ extern inline void wrusp(unsigned long usp) {
/*
* Bus types
*/
-#define EISA_bus 0
#define MCA_bus 0
struct task_work {
diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h
index dfb43563e1cc..8d9c02cafc01 100644
--- a/include/asm-m68k/signal.h
+++ b/include/asm-m68k/signal.h
@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-m68knommu/processor.h b/include/asm-m68knommu/processor.h
index 547a96604b46..736e3192f464 100644
--- a/include/asm-m68knommu/processor.h
+++ b/include/asm-m68knommu/processor.h
@@ -58,7 +58,6 @@ extern inline void wrusp(unsigned long usp)
/*
* Bus types
*/
-#define EISA_bus 0
#define MCA_bus 0
/*
diff --git a/include/asm-m68knommu/signal.h b/include/asm-m68knommu/signal.h
index 4b4f4b4058f1..486cbb0dc088 100644
--- a/include/asm-m68knommu/signal.h
+++ b/include/asm-m68knommu/signal.h
@@ -68,7 +68,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index c08e0bf6e76c..33e8cc7c721d 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -135,12 +135,6 @@ extern unsigned int vced_count, vcei_count;
/*
* Bus types (default is ISA, but people can check others with these..)
*/
-#ifdef CONFIG_EISA
-extern int EISA_bus;
-#else
-#define EISA_bus (0)
-#endif
-
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-mips/signal.h b/include/asm-mips/signal.h
index 40d73cc2a1e0..994987db61be 100644
--- a/include/asm-mips/signal.h
+++ b/include/asm-mips/signal.h
@@ -59,7 +59,7 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h
index ded1c4904510..4779a6efeb91 100644
--- a/include/asm-parisc/processor.h
+++ b/include/asm-parisc/processor.h
@@ -101,12 +101,6 @@ extern struct cpuinfo_parisc cpu_data[NR_CPUS];
#define CPU_HVERSION ((boot_cpu_data.hversion >> 4) & 0x0FFF)
-#ifdef CONFIG_EISA
-extern int EISA_bus;
-#else
-#define EISA_bus 0
-#endif
-
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-parisc/signal.h b/include/asm-parisc/signal.h
index 5ab02aef6dea..cd4beefef333 100644
--- a/include/asm-parisc/signal.h
+++ b/include/asm-parisc/signal.h
@@ -42,7 +42,7 @@
/* These should not be considered constants from userland. */
#define SIGRTMIN 37
-#define SIGRTMAX (_NSIG-1) /* it's 44 under HP/UX */
+#define SIGRTMAX _NSIG /* it's 44 under HP/UX */
/*
* SA_FLAGS values:
diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h
index 3a893e9d6b47..2a5437042ad8 100644
--- a/include/asm-ppc/processor.h
+++ b/include/asm-ppc/processor.h
@@ -803,7 +803,6 @@ extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
/*
* Bus types
*/
-#define EISA_bus 0
#define MCA_bus 0
#define MCA_bus__is_a_macro
diff --git a/include/asm-ppc/signal.h b/include/asm-ppc/signal.h
index f692baff3a44..b0528fcbe985 100644
--- a/include/asm-ppc/signal.h
+++ b/include/asm-ppc/signal.h
@@ -61,7 +61,7 @@ typedef struct {
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-ppc/time.h b/include/asm-ppc/time.h
index ff2939bcbcf9..67188ec06a7a 100644
--- a/include/asm-ppc/time.h
+++ b/include/asm-ppc/time.h
@@ -97,6 +97,13 @@ extern __inline__ unsigned long get_rtcl(void) {
return rtcl;
}
+extern __inline__ unsigned long get_rtcu(void)
+{
+ unsigned long rtcu;
+ asm volatile("mfrtcu %0" : "=r" (rtcu));
+ return rtcu;
+}
+
extern __inline__ unsigned get_native_tbl(void) {
if (__USE_RTC())
return get_rtcl();
@@ -140,6 +147,7 @@ extern __inline__ unsigned binary_tbl(void) {
#endif
/* Use mulhwu to scale processor timebase to timeval */
+/* Specifically, this computes (x * y) / 2^32. -- paulus */
#define mulhwu(x,y) \
({unsigned z; asm ("mulhwu %0,%1,%2" : "=r" (z) : "r" (x), "r" (y)); z;})
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h
index 7d0246bd87cb..f878c5b05d42 100644
--- a/include/asm-ppc64/processor.h
+++ b/include/asm-ppc64/processor.h
@@ -612,8 +612,6 @@ extern long kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
/*
* Bus types
*/
-#define EISA_bus 0
-#define EISA_bus__is_a_macro /* for versions in ksyms.c */
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-ppc64/signal.h b/include/asm-ppc64/signal.h
index 97ed18c9bb60..d0baf44cc89a 100644
--- a/include/asm-ppc64/signal.h
+++ b/include/asm-ppc64/signal.h
@@ -57,7 +57,7 @@ typedef struct {
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-s390/signal.h b/include/asm-s390/signal.h
index fe2263b3ee0d..f273cdcd1cf6 100644
--- a/include/asm-s390/signal.h
+++ b/include/asm-s390/signal.h
@@ -78,7 +78,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h
index 99661c8d8cb0..1308d81838fd 100644
--- a/include/asm-sh/processor.h
+++ b/include/asm-sh/processor.h
@@ -169,8 +169,6 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
/*
* Bus types
*/
-#define EISA_bus 0
-#define EISA_bus__is_a_macro /* for versions in ksyms.c */
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-sh/signal.h b/include/asm-sh/signal.h
index 2f8118eb0cb5..51a5f0691ee5 100644
--- a/include/asm-sh/signal.h
+++ b/include/asm-sh/signal.h
@@ -57,7 +57,7 @@ typedef struct {
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-sparc/processor.h b/include/asm-sparc/processor.h
index c2b7125aa005..3f3bf3ca874c 100644
--- a/include/asm-sparc/processor.h
+++ b/include/asm-sparc/processor.h
@@ -27,7 +27,6 @@
/*
* Bus types
*/
-#define EISA_bus 0
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-sparc/signal.h b/include/asm-sparc/signal.h
index 4e455b7add4a..6813baae27c6 100644
--- a/include/asm-sparc/signal.h
+++ b/include/asm-sparc/signal.h
@@ -89,7 +89,7 @@
#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
#define SIGRTMIN 32
-#define SIGRTMAX (__NEW_NSIG - 1)
+#define SIGRTMAX __NEW_NSIG
#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
#define _NSIG __NEW_NSIG
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h
index bec2ef59d771..416fad2ef1b1 100644
--- a/include/asm-sparc64/processor.h
+++ b/include/asm-sparc64/processor.h
@@ -22,7 +22,6 @@
#include <asm/page.h>
/* Bus types */
-#define EISA_bus 0
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
index 63ac2e389367..f2101925bb74 100644
--- a/include/asm-sparc64/signal.h
+++ b/include/asm-sparc64/signal.h
@@ -89,7 +89,7 @@
#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
#define SIGRTMIN 32
-#define SIGRTMAX (__NEW_NSIG - 1)
+#define SIGRTMAX __NEW_NSIG
#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
#define _NSIG __NEW_NSIG
diff --git a/include/asm-v850/processor.h b/include/asm-v850/processor.h
index 025202b4df7e..b28582ecce02 100644
--- a/include/asm-v850/processor.h
+++ b/include/asm-v850/processor.h
@@ -52,8 +52,6 @@
/*
* Bus types
*/
-#define EISA_bus 0
-#define EISA_bus__is_a_macro /* for versions in ksyms.c */
#define MCA_bus 0
#define MCA_bus__is_a_macro /* for versions in ksyms.c */
diff --git a/include/asm-v850/signal.h b/include/asm-v850/signal.h
index c33b1db71749..407db875899c 100644
--- a/include/asm-v850/signal.h
+++ b/include/asm-v850/signal.h
@@ -71,7 +71,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index 7b4430ce23a0..805b7c03dbbc 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -160,7 +160,6 @@ static inline void clear_in_cr4 (unsigned long mask)
/*
* Bus types
*/
-#define EISA_bus 0
#define MCA_bus 0
#define MCA_bus__is_a_macro
diff --git a/include/asm-x86_64/signal.h b/include/asm-x86_64/signal.h
index bd1f350f1ba6..21c4bf716666 100644
--- a/include/asm-x86_64/signal.h
+++ b/include/asm-x86_64/signal.h
@@ -77,7 +77,7 @@ typedef unsigned long sigset_t;
/* These should not be considered constants from userland. */
#define SIGRTMIN 32
-#define SIGRTMAX (_NSIG-1)
+#define SIGRTMAX _NSIG
/*
* SA_FLAGS values:
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 6ad6d20d3778..0ac6a27ea0db 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -20,7 +20,6 @@
#ifndef __LINUX_BIO_H
#define __LINUX_BIO_H
-#include <linux/kdev_t.h>
#include <linux/highmem.h>
#include <linux/mempool.h>
diff --git a/include/linux/compiler-gcc+.h b/include/linux/compiler-gcc+.h
new file mode 100644
index 000000000000..f6ae9e76b825
--- /dev/null
+++ b/include/linux/compiler-gcc+.h
@@ -0,0 +1,14 @@
+/* Never include this file directly. Include <linux/compiler.h> instead. */
+
+/*
+ * These definitions are for Ueber-GCC: always newer than the latest
+ * version and hence sporting everything plus a kitchen-sink.
+ */
+#include <linux/compiler-gcc.h>
+
+#define inline __inline__ __attribute__((always_inline))
+#define __inline__ __inline__ __attribute__((always_inline))
+#define __inline __inline__ __attribute__((always_inline))
+#define __deprecated __attribute__((deprecated))
+#define __attribute_used__ __attribute__((__used__))
+#define __attribute_pure__ __attribute__((pure))
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
new file mode 100644
index 000000000000..152734055403
--- /dev/null
+++ b/include/linux/compiler-gcc.h
@@ -0,0 +1,17 @@
+/* Never include this file directly. Include <linux/compiler.h> instead. */
+
+/*
+ * Common definitions for all gcc versions go here.
+ */
+
+
+/* Optimization barrier */
+/* The "volatile" is due to gcc bugs */
+#define barrier() __asm__ __volatile__("": : :"memory")
+
+/* This macro obfuscates arithmetic on a variable address so that gcc
+ shouldn't recognize the original var, and make assumptions about it */
+#define RELOC_HIDE(ptr, off) \
+ ({ unsigned long __ptr; \
+ __asm__ ("" : "=g"(__ptr) : "0"(ptr)); \
+ (typeof(ptr)) (__ptr + (off)); })
diff --git a/include/linux/compiler-gcc2.h b/include/linux/compiler-gcc2.h
new file mode 100644
index 000000000000..6f4f9d526abe
--- /dev/null
+++ b/include/linux/compiler-gcc2.h
@@ -0,0 +1,23 @@
+/* Never include this file directly. Include <linux/compiler.h> instead. */
+
+/* These definitions are for GCC v2.x. */
+
+/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
+ a mechanism by which the user can annotate likely branch directions and
+ expect the blocks to be reordered appropriately. Define __builtin_expect
+ to nothing for earlier compilers. */
+#include <linux/compiler-gcc.h>
+
+#if __GNUC_MINOR__ < 96
+# define __builtin_expect(x, expected_value) (x)
+#endif
+
+#define __attribute_used__ __attribute__((__unused__))
+
+/*
+ * The attribute `pure' is not implemented in GCC versions earlier
+ * than 2.96.
+ */
+#if __GNUC_MINOR__ >= 96
+# define __attribute_pure__ __attribute__((pure))
+#endif
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h
new file mode 100644
index 000000000000..4eac3db89fda
--- /dev/null
+++ b/include/linux/compiler-gcc3.h
@@ -0,0 +1,22 @@
+/* Never include this file directly. Include <linux/compiler.h> instead. */
+
+/* These definitions are for GCC v3.x. */
+#include <linux/compiler-gcc.h>
+
+#if __GNUC_MINOR__ >= 1
+# define inline __inline__ __attribute__((always_inline))
+# define __inline__ __inline__ __attribute__((always_inline))
+# define __inline __inline__ __attribute__((always_inline))
+#endif
+
+#if __GNUC_MINOR__ > 0
+# define __deprecated __attribute__((deprecated))
+#endif
+
+#if __GNUC_MINOR__ >= 3
+# define __attribute_used__ __attribute__((__used__))
+#else
+# define __attribute_used__ __attribute__((__unused__))
+#endif
+
+#define __attribute_pure__ __attribute__((pure))
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h
new file mode 100644
index 000000000000..1d1c3ceaff4e
--- /dev/null
+++ b/include/linux/compiler-intel.h
@@ -0,0 +1,24 @@
+/* Never include this file directly. Include <linux/compiler.h> instead. */
+
+#ifdef __ECC
+
+/* Some compiler specific definitions are overwritten here
+ * for Intel ECC compiler
+ */
+
+#include <asm/intrinsics.h>
+
+/* Intel ECC compiler doesn't support gcc specific asm stmts.
+ * It uses intrinsics to do the equivalent things.
+ */
+#undef barrier
+#undef RELOC_HIDE
+
+#define barrier() __memory_barrier()
+
+#define RELOC_HIDE(ptr, off) \
+ ({ unsigned long __ptr; \
+ __ptr = (unsigned long) (ptr); \
+ (typeof(ptr)) (__ptr + (off)); })
+
+#endif
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 356428f649fc..528641f69043 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -2,28 +2,36 @@
#define __LINUX_COMPILER_H
#ifdef __CHECKER__
- #define __user __attribute__((noderef, address_space(1)))
- #define __kernel /* default address space */
+# define __user __attribute__((noderef, address_space(1)))
+# define __kernel /* default address space */
#else
- #define __user
- #define __kernel
+# define __user
+# define __kernel
#endif
-#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
-#define inline __inline__ __attribute__((always_inline))
-#define __inline__ __inline__ __attribute__((always_inline))
-#define __inline __inline__ __attribute__((always_inline))
+#if __GNUC__ > 3
+# include <linux/compiler-gcc+.h> /* catch-all for GCC 4, 5, etc. */
+#elif __GNUC__ == 3
+# include <linux/compiler-gcc3.h>
+#elif __GNUC__ == 2
+# include <linux/compiler-gcc2.h>
+#else
+# error Sorry, your compiler is too old/not recognized.
#endif
-/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
- a mechanism by which the user can annotate likely branch directions and
- expect the blocks to be reordered appropriately. Define __builtin_expect
- to nothing for earlier compilers. */
-
-#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
-#define __builtin_expect(x, expected_value) (x)
+/* Intel compiler defines __GNUC__. So we will overwrite implementations
+ * coming from above header files here
+ */
+#ifdef __INTEL_COMPILER
+# include <linux/compiler-intel.h>
#endif
+/*
+ * Generic compiler-dependent macros required for kernel
+ * build go below this comment. Actual compiler/compiler version
+ * specific implementations come from the above header files
+ */
+
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
@@ -33,10 +41,8 @@
* Usage is:
* int __deprecated foo(void)
*/
-#if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3
-#define __deprecated __attribute__((deprecated))
-#else
-#define __deprecated
+#ifndef __deprecated
+# define __deprecated /* unimplemented */
#endif
/*
@@ -50,10 +56,8 @@
* In prior versions of gcc, such functions and data would be emitted, but
* would be warned about except with attribute((unused)).
*/
-#if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || __GNUC__ > 3
-#define __attribute_used__ __attribute__((__used__))
-#else
-#define __attribute_used__ __attribute__((__unused__))
+#ifndef __attribute_used__
+# define __attribute_used__ /* unimplemented */
#endif
/*
@@ -65,19 +69,21 @@
* elimination and loop optimization just as an arithmetic operator
* would be.
* [...]
- * The attribute `pure' is not implemented in GCC versions earlier
- * than 2.96.
*/
-#if (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || __GNUC__ > 2
-#define __attribute_pure__ __attribute__((pure))
-#else
-#define __attribute_pure__ /* unimplemented */
+#ifndef __attribute_pure__
+# define __attribute_pure__ /* unimplemented */
+#endif
+
+/* Optimization barrier */
+#ifndef barrier
+# define barrier() __memory_barrier()
#endif
-/* This macro obfuscates arithmetic on a variable address so that gcc
- shouldn't recognize the original var, and make assumptions about it */
-#define RELOC_HIDE(ptr, off) \
+#ifndef RELOC_HIDE
+# define RELOC_HIDE(ptr, off) \
({ unsigned long __ptr; \
- __asm__ ("" : "=g"(__ptr) : "0"(ptr)); \
+ __ptr = (unsigned long) (ptr); \
(typeof(ptr)) (__ptr + (off)); })
+#endif
+
#endif /* __LINUX_COMPILER_H */
diff --git a/include/linux/console.h b/include/linux/console.h
index 414ebe159d67..cdff9de7ee71 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -15,7 +15,6 @@
#define _LINUX_CONSOLE_H_ 1
#include <linux/types.h>
-#include <linux/kdev_t.h>
#include <linux/spinlock.h>
struct vc_data;
diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h
index f12addd1daeb..16c78f54f427 100644
--- a/include/linux/devfs_fs_kernel.h
+++ b/include/linux/devfs_fs_kernel.h
@@ -4,7 +4,6 @@
#include <linux/fs.h>
#include <linux/config.h>
#include <linux/spinlock.h>
-#include <linux/kdev_t.h>
#include <linux/types.h>
#include <asm/semaphore.h>
diff --git a/include/linux/eisa.h b/include/linux/eisa.h
index 2ef648847879..dc76d57b10d0 100644
--- a/include/linux/eisa.h
+++ b/include/linux/eisa.h
@@ -1,6 +1,19 @@
#ifndef _LINUX_EISA_H
#define _LINUX_EISA_H
+#include <linux/ioport.h>
+#include <linux/device.h>
+
+#ifdef CONFIG_EISA
+# ifdef CONFIG_EISA_ALWAYS
+# define EISA_bus 1
+# else
+ extern int EISA_bus;
+# endif
+#else
+# define EISA_bus 0
+#endif
+
#define EISA_SIG_LEN 8
#define EISA_MAX_SLOTS 8
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index e43d670c1371..cbd038b665e8 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -15,7 +15,6 @@ typedef int (elevator_queue_empty_fn) (request_queue_t *);
typedef void (elevator_remove_req_fn) (request_queue_t *, struct request *);
typedef void (elevator_requeue_req_fn) (request_queue_t *, struct request *);
typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *);
-typedef struct list_head *(elevator_get_sort_head_fn) (request_queue_t *, struct request *);
typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
typedef int (elevator_may_queue_fn) (request_queue_t *, int);
diff --git a/include/linux/ftape.h b/include/linux/ftape.h
index 99b3535a4e20..e21d4b442843 100644
--- a/include/linux/ftape.h
+++ b/include/linux/ftape.h
@@ -199,8 +199,6 @@ typedef union {
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define NR_ITEMS(x) (int)(sizeof(x)/ sizeof(*x))
-extern int ftape_init(void);
-
#endif /* __KERNEL__ */
#endif
diff --git a/include/linux/input.h b/include/linux/input.h
index da49f7ee0f18..c98e6fc575fe 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -751,7 +751,7 @@ struct ff_effect {
#define LONG(x) ((x)/BITS_PER_LONG)
#define INPUT_KEYCODE(dev, scancode) ((dev->keycodesize == 1) ? ((u8*)dev->keycode)[scancode] : \
- ((dev->keycodesize == 1) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
+ ((dev->keycodesize == 2) ? ((u16*)dev->keycode)[scancode] : (((u32*)dev->keycode)[scancode])))
#define init_input_dev(dev) do { INIT_LIST_HEAD(&((dev)->h_list)); INIT_LIST_HEAD(&((dev)->node)); } while (0)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index b2d17ea0dac0..6403c9ef2210 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -15,10 +15,6 @@
#include <asm/byteorder.h>
#include <asm/bug.h>
-/* Optimization barrier */
-/* The "volatile" is due to gcc bugs */
-#define barrier() __asm__ __volatile__("": : :"memory")
-
#define INT_MAX ((int)(~0U>>1))
#define INT_MIN (-INT_MAX - 1)
#define UINT_MAX (~0U)
diff --git a/include/linux/llc.h b/include/linux/llc.h
index 77ac5d9df544..c9085baaf74d 100644
--- a/include/linux/llc.h
+++ b/include/linux/llc.h
@@ -79,13 +79,5 @@ enum llc_sockopts {
#define LLC_SAP_DYN_TRIES 4
#define llc_ui_skb_cb(__skb) ((struct sockaddr_llc *)&((__skb)->cb[0]))
-
-#ifdef CONFIG_LLC_UI
-extern int llc_ui_init(void);
-extern void llc_ui_exit(void);
-#else
-#define llc_ui_init()
-#define llc_ui_exit()
-#endif
#endif /* __KERNEL__ */
#endif /* __LINUX_LLC_H */
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index d3af91351521..6b7f9c1fa5cd 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -36,8 +36,6 @@
#define TUN_MINOR 200
-extern int misc_init(void);
-
struct miscdevice
{
int minor;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0175e588f33b..a69f0c920d20 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -502,7 +502,11 @@ extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr);
extern void dev_add_pack(struct packet_type *pt);
extern void dev_remove_pack(struct packet_type *pt);
extern void __dev_remove_pack(struct packet_type *pt);
-extern int dev_get(const char *name);
+extern int __dev_get(const char *name);
+static inline int __deprecated dev_get(const char *name)
+{
+ return __dev_get(name);
+}
extern struct net_device *dev_get_by_flags(unsigned short flags,
unsigned short mask);
extern struct net_device *__dev_get_by_flags(unsigned short flags,
diff --git a/include/linux/netfilter_ipv4/ipt_physdev.h b/include/linux/netfilter_ipv4/ipt_physdev.h
index 01684a12d672..7538c8655ec0 100644
--- a/include/linux/netfilter_ipv4/ipt_physdev.h
+++ b/include/linux/netfilter_ipv4/ipt_physdev.h
@@ -13,12 +13,12 @@
#define IPT_PHYSDEV_OP_MASK (0x20 - 1)
struct ipt_physdev_info {
- u_int8_t invert;
- u_int8_t bitmask;
char physindev[IFNAMSIZ];
char in_mask[IFNAMSIZ];
char physoutdev[IFNAMSIZ];
char out_mask[IFNAMSIZ];
+ u_int8_t invert;
+ u_int8_t bitmask;
};
#endif /*_IPT_PHYSDEV_H*/
diff --git a/include/linux/nls.h b/include/linux/nls.h
index 2ab6466f8043..1c657d4f0cf3 100644
--- a/include/linux/nls.h
+++ b/include/linux/nls.h
@@ -8,6 +8,7 @@ typedef __u16 wchar_t;
struct nls_table {
char *charset;
+ char *alias;
int (*uni2char) (wchar_t uni, unsigned char *out, int boundlen);
int (*char2uni) (const unsigned char *rawstring, int boundlen,
wchar_t *uni);
@@ -32,5 +33,7 @@ extern int utf8_mbstowcs(wchar_t *, const __u8 *, int);
extern int utf8_wctomb(__u8 *, wchar_t, int);
extern int utf8_wcstombs(__u8 *, const wchar_t *, int);
+#define MODULE_ALIAS_NLS(name) MODULE_ALIAS("nls_" __stringify(name))
+
#endif /* _LINUX_NLS_H */
diff --git a/include/linux/pnpbios.h b/include/linux/pnpbios.h
index 5b0e599dd5e2..0720cd72d63a 100644
--- a/include/linux/pnpbios.h
+++ b/include/linux/pnpbios.h
@@ -26,7 +26,7 @@
#ifdef __KERNEL__
#include <linux/types.h>
-#include <linux/pci.h>
+#include <linux/pnp.h>
/*
* Return codes
@@ -131,13 +131,7 @@ struct pnp_bios_node {
#ifdef CONFIG_PNPBIOS
/* non-exported */
-extern int pnpbios_dont_use_current_config;
extern struct pnp_dev_node_info node_info;
-extern void *pnpbios_kmalloc(size_t size, int f);
-extern int pnpbios_init (void);
-extern int pnpbios_interface_attach_device(struct pnp_bios_node * node);
-extern int pnpbios_proc_init (void);
-extern void pnpbios_proc_exit (void);
extern int pnp_bios_dev_node_info (struct pnp_dev_node_info *data);
extern int pnp_bios_get_dev_node (u8 *nodenum, char config, struct pnp_bios_node *data);
diff --git a/include/linux/random.h b/include/linux/random.h
index ca0e460941a5..9ccb52fa0a01 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -42,7 +42,6 @@ struct rand_pool_info {
#ifdef __KERNEL__
-extern void rand_initialize(void);
extern void rand_initialize_irq(int irq);
extern void batch_entropy_store(u32 a, u32 b, int num);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 3c6e3129144d..1618ae7f42d4 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -281,7 +281,9 @@ struct signal_struct {
#define MAX_RT_PRIO MAX_USER_RT_PRIO
#define MAX_PRIO (MAX_RT_PRIO + 40)
-
+
+#define rt_task(p) ((p)->prio < MAX_RT_PRIO)
+
/*
* Some day this will be a full-fledged user tracking system..
*/
@@ -340,7 +342,9 @@ struct task_struct {
prio_array_t *array;
unsigned long sleep_avg;
- unsigned long last_run;
+ long interactive_credit;
+ unsigned long long timestamp;
+ int activated;
unsigned long policy;
cpumask_t cpus_allowed;
@@ -360,7 +364,7 @@ struct task_struct {
unsigned long personality;
int did_exec:1;
pid_t pid;
- pid_t pgrp;
+ pid_t __pgrp; /* Accessed via process_group() */
pid_t tty_old_pgrp;
pid_t session;
pid_t tgid;
@@ -375,7 +379,7 @@ struct task_struct {
struct task_struct *parent; /* parent process */
struct list_head children; /* list of my children */
struct list_head sibling; /* linkage in my parent's children list */
- struct task_struct *group_leader;
+ struct task_struct *group_leader; /* threadgroup leader */
/* PID/PID hash table linkage. */
struct pid_link pids[PIDTYPE_MAX];
@@ -461,6 +465,11 @@ struct task_struct {
siginfo_t *last_siginfo; /* For ptrace use. */
};
+static inline pid_t process_group(struct task_struct *tsk)
+{
+ return tsk->group_leader->__pgrp;
+}
+
extern void __put_task_struct(struct task_struct *tsk);
#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)
#define put_task_struct(tsk) \
@@ -499,6 +508,8 @@ static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask)
}
#endif
+extern unsigned long long sched_clock(void);
+
#ifdef CONFIG_NUMA
extern void sched_balance_exec(void);
extern void node_nr_running_init(void);
diff --git a/include/linux/serio.h b/include/linux/serio.h
index f1c67ff70f2a..66fdaf9b1be5 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -65,7 +65,9 @@ void serio_rescan(struct serio *serio);
irqreturn_t serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags, struct pt_regs *regs);
void serio_register_port(struct serio *serio);
+void serio_register_slave_port(struct serio *serio);
void serio_unregister_port(struct serio *serio);
+void serio_unregister_slave_port(struct serio *serio);
void serio_register_device(struct serio_dev *dev);
void serio_unregister_device(struct serio_dev *dev);
@@ -104,6 +106,7 @@ static __inline__ void serio_cleanup(struct serio *serio)
#define SERIO_RS232 0x02000000UL
#define SERIO_HIL_MLC 0x03000000UL
#define SERIO_PC9800 0x04000000UL
+#define SERIO_PS_PSTHRU 0x05000000UL
#define SERIO_PROTO 0xFFUL
#define SERIO_MSC 0x01
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 4b5f057f8bfb..de8758a5e709 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -306,7 +306,7 @@ extern void skb_under_panic(struct sk_buff *skb, int len,
*
* Returns true if the queue is empty, false otherwise.
*/
-static inline int skb_queue_empty(struct sk_buff_head *list)
+static inline int skb_queue_empty(const struct sk_buff_head *list)
{
return list->next == (struct sk_buff *)list;
}
@@ -357,7 +357,7 @@ static inline void kfree_skb_fast(struct sk_buff *skb)
* one of multiple shared copies of the buffer. Cloned buffers are
* shared data so must not be written to under normal circumstances.
*/
-static inline int skb_cloned(struct sk_buff *skb)
+static inline int skb_cloned(const struct sk_buff *skb)
{
return skb->cloned && atomic_read(&skb_shinfo(skb)->dataref) != 1;
}
@@ -369,7 +369,7 @@ static inline int skb_cloned(struct sk_buff *skb)
* Returns true if more than one person has a reference to this
* buffer.
*/
-static inline int skb_shared(struct sk_buff *skb)
+static inline int skb_shared(const struct sk_buff *skb)
{
return atomic_read(&skb->users) != 1;
}
@@ -477,7 +477,7 @@ static inline struct sk_buff *skb_peek_tail(struct sk_buff_head *list_)
*
* Return the length of an &sk_buff queue.
*/
-static inline __u32 skb_queue_len(struct sk_buff_head *list_)
+static inline __u32 skb_queue_len(const struct sk_buff_head *list_)
{
return list_->qlen;
}
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 147e5bf40cbf..1f3517e965f3 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -3,7 +3,6 @@
#include <linux/config.h>
#include <linux/spinlock.h>
-#include <linux/kdev_t.h>
#include <linux/linkage.h>
#include <linux/mmzone.h>
#include <linux/list.h>
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 205e27af55a2..c575197f00b3 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -351,7 +351,6 @@ extern void console_init(void);
extern int lp_init(void);
extern int pty_init(void);
-extern void tty_init(void);
extern int mxser_init(void);
extern int moxa_init(void);
extern int ip2_init(void);
diff --git a/include/linux/usb.h b/include/linux/usb.h
index a20b33d953aa..5575ebfb276d 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -80,7 +80,6 @@ struct usb_host_interface {
* @act_altsetting: index of current altsetting. this number is always
* less than num_altsetting. after the device is configured, each
* interface uses its default setting of zero.
- * @max_altsetting: the max number of altsettings for this interface.
* @driver: the USB driver that is bound to this interface.
* @minor: the minor number assigned to this interface, if this
* interface is bound to a driver that uses the USB major number.
@@ -118,7 +117,6 @@ struct usb_interface {
unsigned act_altsetting; /* active alternate setting */
unsigned num_altsetting; /* number of alternate settings */
- unsigned max_altsetting; /* total memory allocated */
struct usb_driver *driver; /* driver */
int minor; /* minor number this interface is bound to */
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
index c98a95dbe250..da2d9749baf6 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb_gadget.h
@@ -72,9 +72,9 @@ struct usb_request {
unsigned length;
dma_addr_t dma;
- unsigned no_interrupt : 1,
- zero : 1,
- short_not_ok : 1;
+ unsigned no_interrupt:1;
+ unsigned zero:1;
+ unsigned short_not_ok:1;
void (*complete)(struct usb_ep *ep,
struct usb_request *req);
@@ -122,9 +122,11 @@ struct usb_ep_ops {
/**
* struct usb_ep - device side representation of USB endpoint
* @name:identifier for the endpoint, such as "ep-a" or "ep9in-bulk"
+ * @ops: Function pointers used to access hardware-specific operations.
* @ep_list:the gadget's ep_list holds all of its endpoints
- * @maxpacket:the maximum packet size used on this endpoint, as
- * configured when the endpoint was enabled.
+ * @maxpacket:The maximum packet size used on this endpoint. The initial
+ * value can sometimes be reduced (hardware allowing), according to
+ * the endpoint descriptor used to configure the endpoint.
* @driver_data:for use by the gadget driver. all other fields are
* read-only to gadget drivers.
*
@@ -138,7 +140,7 @@ struct usb_ep {
const char *name;
const struct usb_ep_ops *ops;
struct list_head ep_list;
- unsigned maxpacket : 16;
+ unsigned maxpacket:16;
};
/*-------------------------------------------------------------------------*/
@@ -443,18 +445,21 @@ struct usb_gadget_ops {
/**
* struct usb_gadget - represents a usb slave device
+ * @ops: Function pointers used to access hardware-specific operations.
* @ep0: Endpoint zero, used when reading or writing responses to
* driver setup() requests
* @ep_list: List of other endpoints supported by the device.
* @speed: Speed of current connection to USB host.
* @name: Identifies the controller hardware type. Used in diagnostics
* and sometimes configuration.
+ * @dev: Driver model state for this abstract device.
*
* Gadgets have a mostly-portable "gadget driver" implementing device
- * functions, handling all usb configurations and interfaces. They
- * also have a hardware-specific driver (accessed through ops vectors),
- * which insulates the gadget driver from hardware details and packages
- * the hardware endpoints through generic i/o queues.
+ * functions, handling all usb configurations and interfaces. Gadget
+ * drivers talk to hardware-specific code indirectly, through ops vectors.
+ * That insulates the gadget driver from hardware details, and packages
+ * the hardware endpoints through generic i/o queues. The "usb_gadget"
+ * and "usb_ep" interfaces provide that insulation from the hardware.
*
* Except for the driver data, all fields in this structure are
* read-only to the gadget driver. That driver data is part of the
@@ -469,10 +474,6 @@ struct usb_gadget {
struct list_head ep_list; /* of usb_ep */
enum usb_device_speed speed;
const char *name;
-
- /* use this to allocate dma-coherent buffers or set up
- * dma mappings. or print diagnostics, etc.
- */
struct device dev;
};
@@ -576,6 +577,7 @@ usb_gadget_clear_selfpowered (struct usb_gadget *gadget)
* Called in a context that permits sleeping.
* @suspend: Invoked on USB suspend. May be called in_interrupt.
* @resume: Invoked on USB resume. May be called in_interrupt.
+ * @driver: Driver model state for this driver.
*
* Devices are disabled till a gadget driver successfully bind()s, which
* means the driver will handle setup() requests needed to enumerate (and
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 373e58fee2d4..1424811e1eab 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -84,7 +84,6 @@ int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *,
void __user *, size_t *);
void page_writeback_init(void);
-void balance_dirty_pages(struct address_space *mapping);
void balance_dirty_pages_ratelimited(struct address_space *mapping);
int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0);
int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
diff --git a/include/net/llc.h b/include/net/llc.h
new file mode 100644
index 000000000000..bf3882be3529
--- /dev/null
+++ b/include/net/llc.h
@@ -0,0 +1,91 @@
+#ifndef LLC_H
+#define LLC_H
+/*
+ * Copyright (c) 1997 by Procom Technology, Inc.
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ *
+ * This program can be redistributed or modified under the terms of the
+ * GNU General Public License as published by the Free Software Foundation.
+ * This program is distributed without any warranty or implied warranty
+ * of merchantability or fitness for a particular purpose.
+ *
+ * See the GNU General Public License for more details.
+ */
+
+#include <linux/if.h>
+#include <linux/if_ether.h>
+#include <linux/list.h>
+#include <linux/spinlock.h>
+
+struct net_device;
+struct packet_type;
+struct sk_buff;
+
+struct llc_addr {
+ unsigned char lsap;
+ unsigned char mac[IFHWADDRLEN];
+};
+
+#define LLC_SAP_STATE_INACTIVE 1
+#define LLC_SAP_STATE_ACTIVE 2
+
+/**
+ * struct llc_sap - Defines the SAP component
+ *
+ * @station - station this sap belongs to
+ * @state - sap state
+ * @p_bit - only lowest-order bit used
+ * @f_bit - only lowest-order bit used
+ * @laddr - SAP value in this 'lsap'
+ * @node - entry in station sap_list
+ * @sk_list - LLC sockets this one manages
+ */
+struct llc_sap {
+ unsigned char state;
+ unsigned char p_bit;
+ unsigned char f_bit;
+ int (*rcv_func)(struct sk_buff *skb,
+ struct net_device *dev,
+ struct packet_type *pt);
+ struct llc_addr laddr;
+ struct list_head node;
+ struct {
+ rwlock_t lock;
+ struct hlist_head list;
+ } sk_list;
+};
+
+#define LLC_DEST_INVALID 0 /* Invalid LLC PDU type */
+#define LLC_DEST_SAP 1 /* Type 1 goes here */
+#define LLC_DEST_CONN 2 /* Type 2 goes here */
+
+extern struct list_head llc_sap_list;
+extern rwlock_t llc_sap_list_lock;
+extern unsigned char llc_station_mac_sa[ETH_ALEN];
+
+extern int llc_rcv(struct sk_buff *skb, struct net_device *dev,
+ struct packet_type *pt);
+
+extern int llc_mac_hdr_init(struct sk_buff *skb,
+ unsigned char *sa, unsigned char *da);
+
+extern void llc_add_pack(int type, void (*handler)(struct llc_sap *sap,
+ struct sk_buff *skb));
+extern void llc_remove_pack(int type);
+
+extern void llc_set_station_handler(void (*handler)(struct sk_buff *skb));
+
+extern struct llc_sap *llc_sap_open(unsigned char lsap,
+ int (*rcv)(struct sk_buff *skb,
+ struct net_device *dev,
+ struct packet_type *pt));
+extern void llc_sap_close(struct llc_sap *sap);
+
+extern struct llc_sap *llc_sap_find(unsigned char sap_value);
+
+extern int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb,
+ unsigned char *dmac, unsigned char dsap);
+
+extern int llc_station_init(void);
+extern void llc_station_exit(void);
+#endif /* LLC_H */
diff --git a/include/net/llc_actn.h b/include/net/llc_actn.h
deleted file mode 100644
index 3619601c4c81..000000000000
--- a/include/net/llc_actn.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef LLC_ACTN_H
-#define LLC_ACTN_H
-/*
- * Copyright (c) 1997 by Procom Technology,Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *
- * This program can be redistributed or modified under the terms of the
- * GNU General Public License as published by the Free Software Foundation.
- * This program is distributed without any warranty or implied warranty
- * of merchantability or fitness for a particular purpose.
- *
- * See the GNU General Public License for more details.
- */
-/* Station component state transition actions */
-#define LLC_STATION_AC_START_ACK_TMR 1
-#define LLC_STATION_AC_SET_RETRY_CNT_0 2
-#define LLC_STATION_AC_INC_RETRY_CNT_BY_1 3
-#define LLC_STATION_AC_SET_XID_R_CNT_0 4
-#define LLC_STATION_AC_INC_XID_R_CNT_BY_1 5
-#define LLC_STATION_AC_SEND_NULL_DSAP_XID_C 6
-#define LLC_STATION_AC_SEND_XID_R 7
-#define LLC_STATION_AC_SEND_TEST_R 8
-#define LLC_STATION_AC_REPORT_STATUS 9
-
-/* All station state event action functions look like this */
-typedef int (*llc_station_action_t)(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_station_ac_start_ack_timer(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_station_ac_set_retry_cnt_0(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_station_ac_inc_retry_cnt_by_1(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_station_ac_set_xid_r_cnt_0(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_station_ac_inc_xid_r_cnt_by_1(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_station_ac_send_null_dsap_xid_c(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_station_ac_send_xid_r(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_station_ac_send_test_r(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_station_ac_report_status(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_station_ac_report_status(struct llc_station *station,
- struct sk_buff *skb);
-extern void llc_station_ack_tmr_cb(unsigned long timeout_data);
-#endif /* LLC_ACTN_H */
diff --git a/include/net/llc_conn.h b/include/net/llc_conn.h
index 3cefd5ce2642..06fb01bccdbf 100644
--- a/include/net/llc_conn.h
+++ b/include/net/llc_conn.h
@@ -15,6 +15,14 @@
#include <net/llc_if.h>
#include <linux/llc.h>
+#define LLC_EVENT 1
+#define LLC_PACKET 2
+
+#define LLC_P_TIME 2
+#define LLC_ACK_TIME 1
+#define LLC_REJ_TIME 3
+#define LLC_BUSY_TIME 3
+
struct llc_timer {
struct timer_list timer;
u16 expire; /* timer expire time */
@@ -69,6 +77,16 @@ struct llc_opt {
#define llc_sk(__sk) ((struct llc_opt *)(__sk)->sk_protinfo)
+static __inline__ void llc_set_backlog_type(struct sk_buff *skb, char type)
+{
+ skb->cb[sizeof(skb->cb) - 1] = type;
+}
+
+static __inline__ char llc_backlog_type(struct sk_buff *skb)
+{
+ return skb->cb[sizeof(skb->cb) - 1];
+}
+
extern struct sock *llc_sk_alloc(int family, int priority);
extern void llc_sk_free(struct sock *sk);
@@ -90,9 +108,10 @@ extern struct sock *llc_lookup_established(struct llc_sap *sap,
struct llc_addr *laddr);
extern struct sock *llc_lookup_listener(struct llc_sap *sap,
struct llc_addr *laddr);
-extern struct sock *llc_lookup_dgram(struct llc_sap *sap,
- struct llc_addr *laddr);
-extern void llc_save_primitive(struct sk_buff* skb, u8 prim);
+extern void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk);
+extern void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk);
+
extern u8 llc_data_accept_state(u8 state);
extern void llc_build_offset_table(void);
+extern int llc_release_sockets(struct llc_sap *sap);
#endif /* LLC_CONN_H */
diff --git a/include/net/llc_evnt.h b/include/net/llc_evnt.h
deleted file mode 100644
index 429adcb480e3..000000000000
--- a/include/net/llc_evnt.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef LLC_EVNT_H
-#define LLC_EVNT_H
-/*
- * Copyright (c) 1997 by Procom Technology,Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *
- * This program can be redistributed or modified under the terms of the
- * GNU General Public License as published by the Free Software Foundation.
- * This program is distributed without any warranty or implied warranty
- * of merchantability or fitness for a particular purpose.
- *
- * See the GNU General Public License for more details.
- */
-/* Station component state transition events */
-/* Types of events (possible values in 'ev->type') */
-#define LLC_STATION_EV_TYPE_SIMPLE 1
-#define LLC_STATION_EV_TYPE_CONDITION 2
-#define LLC_STATION_EV_TYPE_PRIM 3
-#define LLC_STATION_EV_TYPE_PDU 4 /* command/response PDU */
-#define LLC_STATION_EV_TYPE_ACK_TMR 5
-#define LLC_STATION_EV_TYPE_RPT_STATUS 6
-
-/* Events */
-#define LLC_STATION_EV_ENABLE_WITH_DUP_ADDR_CHECK 1
-#define LLC_STATION_EV_ENABLE_WITHOUT_DUP_ADDR_CHECK 2
-#define LLC_STATION_EV_ACK_TMR_EXP_LT_RETRY_CNT_MAX_RETRY 3
-#define LLC_STATION_EV_ACK_TMR_EXP_EQ_RETRY_CNT_MAX_RETRY 4
-#define LLC_STATION_EV_RX_NULL_DSAP_XID_C 5
-#define LLC_STATION_EV_RX_NULL_DSAP_0_XID_R_XID_R_CNT_EQ 6
-#define LLC_STATION_EV_RX_NULL_DSAP_1_XID_R_XID_R_CNT_EQ 7
-#define LLC_STATION_EV_RX_NULL_DSAP_TEST_C 8
-#define LLC_STATION_EV_DISABLE_REQ 9
-
-struct llc_station_state_ev {
- u8 type;
- u8 prim;
- u8 prim_type;
- u8 reason;
- struct list_head node; /* node in station->ev_q.list */
-};
-
-static __inline__ struct llc_station_state_ev *
- llc_station_ev(struct sk_buff *skb)
-{
- return (struct llc_station_state_ev *)skb->cb;
-}
-
-typedef int (*llc_station_ev_t)(struct llc_station *station,
- struct sk_buff *skb);
-
-extern int llc_stat_ev_enable_with_dup_addr_check(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_stat_ev_enable_without_dup_addr_check(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_stat_ev_ack_tmr_exp_lt_retry_cnt_max_retry(struct llc_station *
- station,
- struct sk_buff *skb);
-extern int llc_stat_ev_ack_tmr_exp_eq_retry_cnt_max_retry(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_stat_ev_rx_null_dsap_xid_c(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_stat_ev_rx_null_dsap_0_xid_r_xid_r_cnt_eq(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_stat_ev_rx_null_dsap_1_xid_r_xid_r_cnt_eq(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_stat_ev_rx_null_dsap_test_c(struct llc_station *station,
- struct sk_buff *skb);
-extern int llc_stat_ev_disable_req(struct llc_station *station,
- struct sk_buff *skb);
-#endif /* LLC_EVNT_H */
diff --git a/include/net/llc_if.h b/include/net/llc_if.h
index a72591707e20..090eaa0d71f9 100644
--- a/include/net/llc_if.h
+++ b/include/net/llc_if.h
@@ -16,6 +16,7 @@
#include <linux/if.h>
#include <linux/if_arp.h>
#include <linux/llc.h>
+#include <net/llc.h>
#define LLC_DATAUNIT_PRIM 1
#define LLC_CONN_PRIM 2
@@ -60,29 +61,41 @@
#define LLC_STATUS_CONFLICT 7 /* disconnect conn */
#define LLC_STATUS_RESET_DONE 8 /* */
-/* Structures and types */
-/* SAP/MAC Address pair */
-struct llc_addr {
- u8 lsap;
- u8 mac[IFHWADDRLEN];
-};
+extern u8 llc_mac_null_var[IFHWADDRLEN];
-struct llc_sap;
+/**
+ * llc_mac_null - determines if a address is a null mac address
+ * @mac: Mac address to test if null.
+ *
+ * Determines if a given address is a null mac address. Returns 0 if the
+ * address is not a null mac, 1 if the address is a null mac.
+ */
+static __inline__ int llc_mac_null(u8 *mac)
+{
+ return !memcmp(mac, llc_mac_null_var, IFHWADDRLEN);
+}
+
+static __inline__ int llc_addrany(struct llc_addr *addr)
+{
+ return llc_mac_null(addr->mac) && !addr->lsap;
+}
-extern struct llc_sap *llc_sap_open(u8 lsap,
- int (*func)(struct sk_buff *skb,
- struct net_device *dev,
- struct packet_type *pt));
-extern void llc_sap_close(struct llc_sap *sap);
+/**
+ * llc_mac_match - determines if two mac addresses are the same
+ * @mac1: First mac address to compare.
+ * @mac2: Second mac address to compare.
+ *
+ * Determines if two given mac address are the same. Returns 0 if there
+ * is not a complete match up to len, 1 if a complete match up to len is
+ * found.
+ */
+static __inline__ int llc_mac_match(u8 *mac1, u8 *mac2)
+{
+ return !memcmp(mac1, mac2, IFHWADDRLEN);
+}
extern int llc_establish_connection(struct sock *sk, u8 *lmac,
u8 *dmac, u8 dsap);
extern int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb);
-extern void llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb,
- u8 *dmac, u8 dsap);
-extern void llc_build_and_send_xid_pkt(struct llc_sap *sap, struct sk_buff *skb,
- u8 *dmac, u8 dsap);
-extern void llc_build_and_send_test_pkt(struct llc_sap *sap, struct sk_buff *skb,
- u8 *dmac, u8 dsap);
extern int llc_send_disc(struct sock *sk);
#endif /* LLC_IF_H */
diff --git a/include/net/llc_mac.h b/include/net/llc_mac.h
deleted file mode 100644
index ded7c830b8a8..000000000000
--- a/include/net/llc_mac.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef LLC_MAC_H
-#define LLC_MAC_H
-/*
- * Copyright (c) 1997 by Procom Technology, Inc.
- * 2001, 2002 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *
- * This program can be redistributed or modified under the terms of the
- * GNU General Public License as published by the Free Software Foundation.
- * This program is distributed without any warranty or implied warranty
- * of merchantability or fitness for a particular purpose.
- *
- * See the GNU General Public License for more details.
- */
-extern int llc_rcv(struct sk_buff *skb, struct net_device *dev,
- struct packet_type *pt);
-extern u16 lan_hdrs_init(struct sk_buff *skb, u8 *sa, u8 *da);
-extern int llc_conn_rcv(struct sock *sk, struct sk_buff *skb);
-
-static __inline__ void llc_set_backlog_type(struct sk_buff *skb, char type)
-{
- skb->cb[sizeof(skb->cb) - 1] = type;
-}
-
-static __inline__ char llc_backlog_type(struct sk_buff *skb)
-{
- return skb->cb[sizeof(skb->cb) - 1];
-}
-
-extern u8 llc_mac_null_var[IFHWADDRLEN];
-
-/**
- * llc_mac_null - determines if a address is a null mac address
- * @mac: Mac address to test if null.
- *
- * Determines if a given address is a null mac address. Returns 0 if the
- * address is not a null mac, 1 if the address is a null mac.
- */
-static __inline__ int llc_mac_null(u8 *mac)
-{
- return !memcmp(mac, llc_mac_null_var, IFHWADDRLEN);
-}
-
-static __inline__ int llc_addrany(struct llc_addr *addr)
-{
- return llc_mac_null(addr->mac) && !addr->lsap;
-}
-
-/**
- * llc_mac_match - determines if two mac addresses are the same
- * @mac1: First mac address to compare.
- * @mac2: Second mac address to compare.
- *
- * Determines if two given mac address are the same. Returns 0 if there
- * is not a complete match up to len, 1 if a complete match up to len is
- * found.
- */
-static __inline__ int llc_mac_match(u8 *mac1, u8 *mac2)
-{
- return !memcmp(mac1, mac2, IFHWADDRLEN);
-}
-#endif /* LLC_MAC_H */
diff --git a/include/net/llc_main.h b/include/net/llc_main.h
deleted file mode 100644
index 0e0d39742a2e..000000000000
--- a/include/net/llc_main.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef LLC_MAIN_H
-#define LLC_MAIN_H
-/*
- * Copyright (c) 1997 by Procom Technology, Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *
- * This program can be redistributed or modified under the terms of the
- * GNU General Public License as published by the Free Software Foundation.
- * This program is distributed without any warranty or implied warranty
- * of merchantability or fitness for a particular purpose.
- *
- * See the GNU General Public License for more details.
- */
-#define LLC_EVENT 1
-#define LLC_PACKET 2
-#define LLC_TYPE_1 1
-#define LLC_TYPE_2 2
-#define LLC_P_TIME 2
-#define LLC_ACK_TIME 1
-#define LLC_REJ_TIME 3
-#define LLC_BUSY_TIME 3
-#define LLC_DEST_INVALID 0 /* Invalid LLC PDU type */
-#define LLC_DEST_SAP 1 /* Type 1 goes here */
-#define LLC_DEST_CONN 2 /* Type 2 goes here */
-
-/**
- * struct llc_station - LLC station component
- *
- * SAP and connection resource manager, one per adapter.
- *
- * @state - state of station
- * @xid_r_count - XID response PDU counter
- * @mac_sa - MAC source address
- * @sap_list - list of related SAPs
- * @ev_q - events entering state mach.
- * @mac_pdu_q - PDUs ready to send to MAC
- */
-struct llc_station {
- u8 state;
- u8 xid_r_count;
- struct timer_list ack_timer;
- u8 retry_count;
- u8 maximum_retry;
- u8 mac_sa[6];
- struct {
- rwlock_t lock;
- struct list_head list;
- } sap_list;
- struct {
- struct sk_buff_head list;
- spinlock_t lock;
- } ev_q;
- struct sk_buff_head mac_pdu_q;
-};
-
-extern struct llc_sap *llc_sap_alloc(void);
-extern void llc_sap_save(struct llc_sap *sap);
-extern void llc_free_sap(struct llc_sap *sap);
-extern struct llc_sap *llc_sap_find(u8 lsap);
-extern void llc_station_state_process(struct llc_station *station,
- struct sk_buff *skb);
-extern void llc_station_send_pdu(struct llc_station *station,
- struct sk_buff *skb);
-extern struct sk_buff *llc_alloc_frame(void);
-
-extern struct llc_station llc_main_station;
-#endif /* LLC_MAIN_H */
diff --git a/include/net/llc_pdu.h b/include/net/llc_pdu.h
index 235e6c0bc17e..644f9edc2bae 100644
--- a/include/net/llc_pdu.h
+++ b/include/net/llc_pdu.h
@@ -2,7 +2,7 @@
#define LLC_PDU_H
/*
* Copyright (c) 1997 by Procom Technology,Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
@@ -11,7 +11,10 @@
*
* See the GNU General Public License for more details.
*/
-/* LLC PDU structure */
+
+#include <linux/if_ether.h>
+#include <linux/if_tr.h>
+
/* Lengths of frame formats */
#define LLC_PDU_LEN_I 4 /* header and 2 control bytes */
#define LLC_PDU_LEN_S 4
@@ -198,7 +201,7 @@ struct llc_pdu_sn {
u8 ctrl_2;
};
-static __inline__ struct llc_pdu_sn *llc_pdu_sn_hdr(struct sk_buff *skb)
+static inline struct llc_pdu_sn *llc_pdu_sn_hdr(struct sk_buff *skb)
{
return (struct llc_pdu_sn *)skb->nh.raw;
}
@@ -210,16 +213,146 @@ struct llc_pdu_un {
u8 ctrl_1;
};
-static __inline__ struct llc_pdu_un *llc_pdu_un_hdr(struct sk_buff *skb)
+static inline struct llc_pdu_un *llc_pdu_un_hdr(struct sk_buff *skb)
{
return (struct llc_pdu_un *)skb->nh.raw;
}
-static __inline__ void *llc_set_pdu_hdr(struct sk_buff *skb, void *ptr)
+static inline void *llc_set_pdu_hdr(struct sk_buff *skb, void *ptr)
{
return skb->nh.raw = ptr;
}
+/**
+ * llc_pdu_header_init - initializes pdu header
+ * @skb: input skb that header must be set into it.
+ * @type: type of PDU (U, I or S).
+ * @ssap: source sap.
+ * @dsap: destination sap.
+ * @cr: command/response bit (0 or 1).
+ *
+ * This function sets DSAP, SSAP and command/Response bit in LLC header.
+ */
+static inline void llc_pdu_header_init(struct sk_buff *skb, u8 type,
+ u8 ssap, u8 dsap, u8 cr)
+{
+ const int hlen = type == LLC_PDU_TYPE_U ? 3 : 4;
+ struct llc_pdu_un *pdu = llc_set_pdu_hdr(skb, skb_push(skb, hlen));
+ pdu->dsap = dsap;
+ pdu->ssap = ssap;
+ pdu->ssap |= cr;
+}
+
+/**
+ * llc_pdu_decode_sa - extracs source address (MAC) of input frame
+ * @skb: input skb that source address must be extracted from it.
+ * @sa: pointer to source address (6 byte array).
+ *
+ * This function extracts source address(MAC) of input frame.
+ */
+static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa)
+{
+ if (skb->protocol == ntohs(ETH_P_802_2))
+ memcpy(sa, ((struct ethhdr *)skb->mac.raw)->h_source, ETH_ALEN);
+ else if (skb->protocol == ntohs(ETH_P_TR_802_2))
+ memcpy(sa, ((struct trh_hdr *)skb->mac.raw)->saddr, ETH_ALEN);
+}
+
+/**
+ * llc_pdu_decode_da - extracts dest address of input frame
+ * @skb: input skb that destination address must be extracted from it
+ * @sa: pointer to destination address (6 byte array).
+ *
+ * This function extracts destination address(MAC) of input frame.
+ */
+static inline void llc_pdu_decode_da(struct sk_buff *skb, u8 *da)
+{
+ if (skb->protocol == ntohs(ETH_P_802_2))
+ memcpy(da, ((struct ethhdr *)skb->mac.raw)->h_dest, ETH_ALEN);
+ else if (skb->protocol == ntohs(ETH_P_TR_802_2))
+ memcpy(da, ((struct trh_hdr *)skb->mac.raw)->daddr, ETH_ALEN);
+}
+
+/**
+ * llc_pdu_decode_ssap - extracts source SAP of input frame
+ * @skb: input skb that source SAP must be extracted from it.
+ * @ssap: source SAP (output argument).
+ *
+ * This function extracts source SAP of input frame. Right bit of SSAP is
+ * command/response bit.
+ */
+static inline void llc_pdu_decode_ssap(struct sk_buff *skb, u8 *ssap)
+{
+ *ssap = llc_pdu_un_hdr(skb)->ssap & 0xFE;
+}
+
+/**
+ * llc_pdu_decode_dsap - extracts dest SAP of input frame
+ * @skb: input skb that destination SAP must be extracted from it.
+ * @dsap: destination SAP (output argument).
+ *
+ * This function extracts destination SAP of input frame. right bit of
+ * DSAP designates individual/group SAP.
+ */
+static inline void llc_pdu_decode_dsap(struct sk_buff *skb, u8 *dsap)
+{
+ *dsap = llc_pdu_un_hdr(skb)->dsap & 0xFE;
+}
+
+/**
+ * llc_pdu_init_as_ui_cmd - sets LLC header as UI PDU
+ * @skb: input skb that header must be set into it.
+ *
+ * This function sets third byte of LLC header as a UI PDU.
+ */
+static inline void llc_pdu_init_as_ui_cmd(struct sk_buff *skb)
+{
+ struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
+
+ pdu->ctrl_1 = LLC_PDU_TYPE_U;
+ pdu->ctrl_1 |= LLC_1_PDU_CMD_UI;
+}
+
+/**
+ * llc_pdu_init_as_test_cmd - sets PDU as TEST
+ * @skb - Address of the skb to build
+ *
+ * Sets a PDU as TEST
+ */
+static inline void llc_pdu_init_as_test_cmd(struct sk_buff *skb)
+{
+ struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
+
+ pdu->ctrl_1 = LLC_PDU_TYPE_U;
+ pdu->ctrl_1 |= LLC_1_PDU_CMD_TEST;
+ pdu->ctrl_1 |= LLC_U_PF_BIT_MASK;
+}
+
+/**
+ * llc_pdu_init_as_test_rsp - build TEST response PDU
+ * @skb: Address of the skb to build
+ * @ev_skb: The received TEST command PDU frame
+ *
+ * Builds a pdu frame as a TEST response.
+ */
+static inline void llc_pdu_init_as_test_rsp(struct sk_buff *skb,
+ struct sk_buff *ev_skb)
+{
+ struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
+
+ pdu->ctrl_1 = LLC_PDU_TYPE_U;
+ pdu->ctrl_1 |= LLC_1_PDU_CMD_TEST;
+ pdu->ctrl_1 |= LLC_U_PF_BIT_MASK;
+ if (ev_skb->protocol == ntohs(ETH_P_802_2)) {
+ struct llc_pdu_un *ev_pdu = llc_pdu_un_hdr(ev_skb);
+ int dsize;
+
+ dsize = ntohs(((struct ethhdr *)ev_skb->mac.raw)->h_proto) - 3;
+ memcpy(((u8 *)pdu) + 3, ((u8 *)ev_pdu) + 3, dsize);
+ skb_put(skb, dsize);
+ }
+}
+
/* LLC Type 1 XID command/response information fields format */
struct llc_xid_info {
u8 fmt_id; /* always 0x18 for LLC */
@@ -227,6 +360,54 @@ struct llc_xid_info {
u8 rw; /* sender receive window */
};
+/**
+ * llc_pdu_init_as_xid_cmd - sets bytes 3, 4 & 5 of LLC header as XID
+ * @skb: input skb that header must be set into it.
+ *
+ * This function sets third,fourth,fifth and sixth bytes of LLC header as
+ * a XID PDU.
+ */
+static inline void llc_pdu_init_as_xid_cmd(struct sk_buff *skb,
+ u8 svcs_supported, u8 rx_window)
+{
+ struct llc_xid_info *xid_info;
+ struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
+
+ pdu->ctrl_1 = LLC_PDU_TYPE_U;
+ pdu->ctrl_1 |= LLC_1_PDU_CMD_XID;
+ pdu->ctrl_1 |= LLC_U_PF_BIT_MASK;
+ xid_info = (struct llc_xid_info *)(((u8 *)&pdu->ctrl_1) + 1);
+ xid_info->fmt_id = LLC_XID_FMT_ID; /* 0x81 */
+ xid_info->type = svcs_supported;
+ xid_info->rw = rx_window << 1; /* size of receive window */
+ skb_put(skb, 3);
+}
+
+/**
+ * llc_pdu_init_as_xid_rsp - builds XID response PDU
+ * @skb: Address of the skb to build
+ * @svcs_supported: The class of the LLC (I or II)
+ * @rx_window: The size of the receive window of the LLC
+ *
+ * Builds a pdu frame as an XID response.
+ */
+static inline void llc_pdu_init_as_xid_rsp(struct sk_buff *skb,
+ u8 svcs_supported, u8 rx_window)
+{
+ struct llc_xid_info *xid_info;
+ struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
+
+ pdu->ctrl_1 = LLC_PDU_TYPE_U;
+ pdu->ctrl_1 |= LLC_1_PDU_CMD_XID;
+ pdu->ctrl_1 |= LLC_U_PF_BIT_MASK;
+
+ xid_info = (struct llc_xid_info *)(((u8 *)&pdu->ctrl_1) + 1);
+ xid_info->fmt_id = LLC_XID_FMT_ID;
+ xid_info->type = svcs_supported;
+ xid_info->rw = rx_window << 1;
+ skb_put(skb, 3);
+}
+
/* LLC Type 2 FRMR response information field format */
struct llc_frmr_info {
u16 rej_pdu_ctrl; /* bits 1-8 if U-PDU */
@@ -239,17 +420,6 @@ extern void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 type);
extern void llc_pdu_set_pf_bit(struct sk_buff *skb, u8 bit_value);
extern void llc_pdu_decode_pf_bit(struct sk_buff *skb, u8 *pf_bit);
extern void llc_pdu_decode_cr_bit(struct sk_buff *skb, u8 *cr_bit);
-extern void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa);
-extern void llc_pdu_decode_da(struct sk_buff *skb, u8 *ds);
-extern void llc_pdu_decode_dsap(struct sk_buff *skb, u8 *dsap);
-extern void llc_pdu_decode_ssap(struct sk_buff *skb, u8 *ssap);
-extern void llc_decode_pdu_type(struct sk_buff *skb, u8 *destination);
-extern void llc_pdu_header_init(struct sk_buff *skb, u8 pdu_type, u8 ssap,
- u8 dsap, u8 cr);
-extern void llc_pdu_init_as_ui_cmd(struct sk_buff *skb);
-extern void llc_pdu_init_as_xid_cmd(struct sk_buff *skb, u8 svcs_supported,
- u8 rx_window);
-extern void llc_pdu_init_as_test_cmd(struct sk_buff *skb);
extern void llc_pdu_init_as_disc_cmd(struct sk_buff *skb, u8 p_bit);
extern void llc_pdu_init_as_i_cmd(struct sk_buff *skb, u8 p_bit, u8 ns, u8 nr);
extern void llc_pdu_init_as_rej_cmd(struct sk_buff *skb, u8 p_bit, u8 nr);
@@ -257,10 +427,6 @@ extern void llc_pdu_init_as_rnr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr);
extern void llc_pdu_init_as_rr_cmd(struct sk_buff *skb, u8 p_bit, u8 nr);
extern void llc_pdu_init_as_sabme_cmd(struct sk_buff *skb, u8 p_bit);
extern void llc_pdu_init_as_dm_rsp(struct sk_buff *skb, u8 f_bit);
-extern void llc_pdu_init_as_xid_rsp(struct sk_buff *skb, u8 svcs_supported,
- u8 rx_window);
-extern void llc_pdu_init_as_test_rsp(struct sk_buff *skb,
- struct sk_buff *ev_skb);
extern void llc_pdu_init_as_frmr_rsp(struct sk_buff *skb,
struct llc_pdu_sn *prev_pdu,
u8 f_bit, u8 vs, u8 vr, u8 vzyxw);
diff --git a/include/net/llc_s_st.h b/include/net/llc_s_st.h
index 525415ebae92..567c681f1f3e 100644
--- a/include/net/llc_s_st.h
+++ b/include/net/llc_s_st.h
@@ -11,10 +11,7 @@
*
* See the GNU General Public License for more details.
*/
-/* Defines SAP component states */
-#define LLC_SAP_STATE_INACTIVE 1
-#define LLC_SAP_STATE_ACTIVE 2
#define LLC_NR_SAP_STATES 2 /* size of state table */
/* structures and types */
diff --git a/include/net/llc_sap.h b/include/net/llc_sap.h
index b46c85389388..dc60acce8e55 100644
--- a/include/net/llc_sap.h
+++ b/include/net/llc_sap.h
@@ -2,7 +2,7 @@
#define LLC_SAP_H
/*
* Copyright (c) 1997 by Procom Technology,Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
*
* This program can be redistributed or modified under the terms of the
* GNU General Public License as published by the Free Software Foundation.
@@ -11,37 +11,20 @@
*
* See the GNU General Public License for more details.
*/
-#include <linux/skbuff.h>
-#include <net/llc_if.h>
-/**
- * struct llc_sap - Defines the SAP component
- *
- * @station - station this sap belongs to
- * @state - sap state
- * @p_bit - only lowest-order bit used
- * @f_bit - only lowest-order bit used
- * @laddr - SAP value in this 'lsap'
- * @node - entry in station sap_list
- * @sk_list - LLC sockets this one manages
- */
-struct llc_sap {
- struct llc_station *station;
- u8 state;
- u8 p_bit;
- u8 f_bit;
- int (*rcv_func)(struct sk_buff *skb,
- struct net_device *dev,
- struct packet_type *pt);
- struct llc_addr laddr;
- struct list_head node;
- struct {
- rwlock_t lock;
- struct hlist_head list;
- } sk_list;
-};
+struct llc_sap;
+struct sk_buff;
-extern void llc_sap_assign_sock(struct llc_sap *sap, struct sock *sk);
-extern void llc_sap_unassign_sock(struct llc_sap *sap, struct sock *sk);
extern void llc_sap_state_process(struct llc_sap *sap, struct sk_buff *skb);
extern void llc_sap_rtn_pdu(struct llc_sap *sap, struct sk_buff *skb);
+extern void llc_save_primitive(struct sk_buff* skb, unsigned char prim);
+extern struct sk_buff *llc_alloc_frame(void);
+
+extern void llc_build_and_send_test_pkt(struct llc_sap *sap,
+ struct sk_buff *skb,
+ unsigned char *dmac,
+ unsigned char dsap);
+extern void llc_build_and_send_xid_pkt(struct llc_sap *sap,
+ struct sk_buff *skb,
+ unsigned char *dmac,
+ unsigned char dsap);
#endif /* LLC_SAP_H */
diff --git a/include/net/llc_stat.h b/include/net/llc_stat.h
deleted file mode 100644
index f8d0bb0a9c75..000000000000
--- a/include/net/llc_stat.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef LLC_STAT_H
-#define LLC_STAT_H
-/*
- * Copyright (c) 1997 by Procom Technology,Inc.
- * 2001 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *
- * This program can be redistributed or modified under the terms of the
- * GNU General Public License as published by the Free Software Foundation.
- * This program is distributed without any warranty or implied warranty
- * of merchantability or fitness for a particular purpose.
- *
- * See the GNU General Public License for more details.
- */
-/* Station component state table */
-/* Station component states */
-#define LLC_STATION_STATE_DOWN 1 /* initial state */
-#define LLC_STATION_STATE_DUP_ADDR_CHK 2
-#define LLC_STATION_STATE_UP 3
-
-#define LLC_NBR_STATION_STATES 3 /* size of state table */
-
-/* Station component state table structure */
-struct llc_station_state_trans {
- llc_station_ev_t ev;
- u8 next_state;
- llc_station_action_t *ev_actions;
-};
-
-struct llc_station_state {
- u8 curr_state;
- struct llc_station_state_trans **transitions;
-};
-
-extern struct llc_station_state llc_station_state_table[LLC_NBR_STATION_STATES];
-#endif /* LLC_STAT_H */
diff --git a/include/net/syncppp.h b/include/net/syncppp.h
index 07214226b4e3..f2032606419e 100644
--- a/include/net/syncppp.h
+++ b/include/net/syncppp.h
@@ -57,8 +57,11 @@ struct ppp_device
struct sppp sppp; /* Synchronous PPP */
};
-#define sppp_of(dev) \
- (&((struct ppp_device *)(*(unsigned long *)((dev)->priv)))->sppp)
+static inline struct sppp *sppp_of(struct net_device *dev)
+{
+ struct ppp_device *ppp = dev->priv;
+ return &ppp->sppp;
+}
#define PP_KEEPALIVE 0x01 /* use keepalive protocol */
#define PP_CISCO 0x02 /* use Cisco protocol instead of PPP */
diff --git a/init/main.c b/init/main.c
index d857325e3dc8..13eff1cdd527 100644
--- a/init/main.c
+++ b/init/main.c
@@ -542,12 +542,16 @@ static void do_pre_smp_initcalls(void)
spawn_ksoftirqd();
}
+static void run_init_process(char *init_filename)
+{
+ argv_init[0] = init_filename;
+ execve(init_filename, argv_init, envp_init);
+}
+
extern void prepare_namespace(void);
static int init(void * unused)
{
- static char * argv_sh[] = { "sh", NULL, };
-
lock_kernel();
/*
* Tell the world that we're going to be the grim
@@ -592,10 +596,12 @@ static int init(void * unused)
*/
if (execute_command)
- execve(execute_command,argv_init,envp_init);
- execve("/sbin/init",argv_init,envp_init);
- execve("/etc/init",argv_init,envp_init);
- execve("/bin/init",argv_init,envp_init);
- execve("/bin/sh",argv_sh,envp_init);
+ run_init_process(execute_command);
+
+ run_init_process("/sbin/init");
+ run_init_process("/etc/init");
+ run_init_process("/bin/init");
+ run_init_process("/bin/sh");
+
panic("No init found. Try passing init= option to kernel.");
}
diff --git a/ipc/sem.c b/ipc/sem.c
index 81aa6977c993..828962a4ade6 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -1038,8 +1038,10 @@ retry_undos:
* allocated an undo structure, it was invalidated by an RMID
* and now a new array with received the same id. Check and retry.
*/
- if (un && un->semid == -1)
+ if (un && un->semid == -1) {
+ sem_unlock(sma);
goto retry_undos;
+ }
error = -EFBIG;
if (max >= sma->sem_nsems)
goto out_unlock_free;
diff --git a/kernel/configs.c b/kernel/configs.c
index 6a5c0c9d9176..57f54451edbe 100644
--- a/kernel/configs.c
+++ b/kernel/configs.c
@@ -47,7 +47,7 @@
/**************************************************/
/* globals and useful constants */
-static const char IKCONFIG_VERSION[] = "0.6";
+static const char IKCONFIG_VERSION[] __initdata = "0.7";
static ssize_t
ikconfig_read_current(struct file *file, char __user *buf,
@@ -72,32 +72,6 @@ static struct file_operations ikconfig_file_ops = {
.read = ikconfig_read_current,
};
-
-/***************************************************/
-/* build_info_show: let people read the info */
-/* we have on the tools used to build this kernel */
-
-static int build_info_show(struct seq_file *seq, void *v)
-{
- seq_printf(seq,
- "Kernel: %s\nCompiler: %s\nVersion_in_Makefile: %s\n",
- ikconfig_build_info, LINUX_COMPILER, UTS_RELEASE);
- return 0;
-}
-
-static int build_info_open(struct inode *inode, struct file *file)
-{
- return single_open(file, build_info_show, PDE(inode)->data);
-}
-
-static struct file_operations build_info_file_ops = {
- .owner = THIS_MODULE,
- .open = build_info_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
-
/***************************************************/
/* ikconfig_init: start up everything we need to */
@@ -112,26 +86,12 @@ static int __init ikconfig_init(void)
entry = create_proc_entry("config.gz", S_IFREG | S_IRUGO,
&proc_root);
if (!entry)
- goto leave;
+ return -ENOMEM;
entry->proc_fops = &ikconfig_file_ops;
entry->size = kernel_config_data_size;
- /* create the "build_info" file */
- entry = create_proc_entry("config_build_info",
- S_IFREG | S_IRUGO, &proc_root);
- if (!entry)
- goto leave_gz;
- entry->proc_fops = &build_info_file_ops;
-
return 0;
-
-leave_gz:
- /* remove the file from proc */
- remove_proc_entry("config.gz", &proc_root);
-
-leave:
- return -ENOMEM;
}
/***************************************************/
@@ -139,9 +99,7 @@ leave:
static void __exit ikconfig_cleanup(void)
{
- /* remove the files */
remove_proc_entry("config.gz", &proc_root);
- remove_proc_entry("config_build_info", &proc_root);
}
module_init(ikconfig_init);
diff --git a/kernel/exit.c b/kernel/exit.c
index b6174f82adf9..c565fd69d559 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -152,7 +152,7 @@ static int will_become_orphaned_pgrp(int pgrp, task_t *ignored_task)
|| p->state >= TASK_ZOMBIE
|| p->real_parent->pid == 1)
continue;
- if (p->real_parent->pgrp != pgrp
+ if (process_group(p->real_parent) != pgrp
&& p->real_parent->session == p->session) {
ret = 0;
break;
@@ -247,9 +247,9 @@ void __set_special_pids(pid_t session, pid_t pgrp)
curr->session = session;
attach_pid(curr, PIDTYPE_SID, session);
}
- if (curr->pgrp != pgrp) {
+ if (process_group(curr) != pgrp) {
detach_pid(curr, PIDTYPE_PGID);
- curr->pgrp = pgrp;
+ curr->group_leader->__pgrp = pgrp;
attach_pid(curr, PIDTYPE_PGID, pgrp);
}
}
@@ -508,9 +508,9 @@ static inline void reparent_thread(task_t *p, task_t *father, int traced)
* than we are, and it was the only connection
* outside, so the child pgrp is now orphaned.
*/
- if ((p->pgrp != father->pgrp) &&
+ if ((process_group(p) != process_group(father)) &&
(p->session == father->session)) {
- int pgrp = p->pgrp;
+ int pgrp = process_group(p);
if (will_become_orphaned_pgrp(pgrp, NULL) && has_stopped_jobs(pgrp)) {
__kill_pg_info(SIGHUP, (void *)1, pgrp);
@@ -618,12 +618,12 @@ static void exit_notify(struct task_struct *tsk)
t = tsk->real_parent;
- if ((t->pgrp != tsk->pgrp) &&
+ if ((process_group(t) != process_group(tsk)) &&
(t->session == tsk->session) &&
- will_become_orphaned_pgrp(tsk->pgrp, tsk) &&
- has_stopped_jobs(tsk->pgrp)) {
- __kill_pg_info(SIGHUP, (void *)1, tsk->pgrp);
- __kill_pg_info(SIGCONT, (void *)1, tsk->pgrp);
+ will_become_orphaned_pgrp(process_group(tsk), tsk) &&
+ has_stopped_jobs(process_group(tsk))) {
+ __kill_pg_info(SIGHUP, (void *)1, process_group(tsk));
+ __kill_pg_info(SIGCONT, (void *)1, process_group(tsk));
}
/* Let father know we died
@@ -813,10 +813,10 @@ static int eligible_child(pid_t pid, int options, task_t *p)
if (p->pid != pid)
return 0;
} else if (!pid) {
- if (p->pgrp != current->pgrp)
+ if (process_group(p) != process_group(current))
return 0;
} else if (pid != -1) {
- if (p->pgrp != -pid)
+ if (process_group(p) != -pid)
return 0;
}
diff --git a/kernel/fork.c b/kernel/fork.c
index 37d79b4e16e6..f2d3115483da 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -305,7 +305,7 @@ out:
return retval;
fail_nomem:
retval = -ENOMEM;
- fail:
+fail:
vm_unacct_memory(charge);
goto out;
}
@@ -499,7 +499,7 @@ static int copy_mm(unsigned long clone_flags, struct task_struct * tsk)
goto fail_nomem;
if (init_new_context(tsk,mm))
- goto free_pt;
+ goto fail_nocontext;
retval = dup_mmap(mm, oldmm);
if (retval)
@@ -514,6 +514,15 @@ free_pt:
mmput(mm);
fail_nomem:
return retval;
+
+fail_nocontext:
+ /*
+ * If init_new_context() failed, we cannot use mmput() to free the mm
+ * because it calls destroy_context()
+ */
+ mm_free_pgd(mm);
+ free_mm(mm);
+ return retval;
}
static inline struct fs_struct *__copy_fs_struct(struct fs_struct *old)
@@ -925,7 +934,7 @@ struct task_struct *copy_process(unsigned long clone_flags,
*/
p->first_time_slice = 1;
current->time_slice >>= 1;
- p->last_run = jiffies;
+ p->timestamp = sched_clock();
if (!current->time_slice) {
/*
* This case is rare, it happens when the parent has only
@@ -1004,7 +1013,7 @@ struct task_struct *copy_process(unsigned long clone_flags,
attach_pid(p, PIDTYPE_PID, p->pid);
if (thread_group_leader(p)) {
attach_pid(p, PIDTYPE_TGID, p->tgid);
- attach_pid(p, PIDTYPE_PGID, p->pgrp);
+ attach_pid(p, PIDTYPE_PGID, process_group(p));
attach_pid(p, PIDTYPE_SID, p->session);
if (p->pid)
__get_cpu_var(process_counts)++;
diff --git a/kernel/ksyms.c b/kernel/ksyms.c
index 9f61a0496c2a..9da2940ac0e6 100644
--- a/kernel/ksyms.c
+++ b/kernel/ksyms.c
@@ -348,8 +348,6 @@ EXPORT_SYMBOL(lock_page);
EXPORT_SYMBOL(unlock_page);
/* device registration */
-EXPORT_SYMBOL(register_chrdev);
-EXPORT_SYMBOL(unregister_chrdev);
EXPORT_SYMBOL(register_blkdev);
EXPORT_SYMBOL(unregister_blkdev);
EXPORT_SYMBOL(tty_register_driver);
diff --git a/kernel/pid.c b/kernel/pid.c
index 00413e3967b9..713f54eaeda9 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -250,13 +250,13 @@ void switch_exec_pids(task_t *leader, task_t *thread)
attach_pid(thread, PIDTYPE_PID, thread->pid);
attach_pid(thread, PIDTYPE_TGID, thread->tgid);
- attach_pid(thread, PIDTYPE_PGID, thread->pgrp);
+ attach_pid(thread, PIDTYPE_PGID, leader->__pgrp);
attach_pid(thread, PIDTYPE_SID, thread->session);
list_add_tail(&thread->tasks, &init_task.tasks);
attach_pid(leader, PIDTYPE_PID, leader->pid);
attach_pid(leader, PIDTYPE_TGID, leader->tgid);
- attach_pid(leader, PIDTYPE_PGID, leader->pgrp);
+ attach_pid(leader, PIDTYPE_PGID, leader->__pgrp);
attach_pid(leader, PIDTYPE_SID, leader->session);
}
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index d9be410a9e62..64940545cb84 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -344,6 +344,7 @@ static inline struct task_struct * good_sigevent(sigevent_t * event)
return NULL;
if ((event->sigev_notify & ~SIGEV_NONE & MIPS_SIGEV) &&
+ event->sigev_signo &&
((unsigned) (event->sigev_signo > SIGRTMAX)))
return NULL;
diff --git a/kernel/sched.c b/kernel/sched.c
index 9dc251a8d8a5..b35f717d1b58 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -14,6 +14,7 @@
* an array-switch method of distributing timeslices
* and per-CPU runqueues. Cleanups and useful suggestions
* by Davide Libenzi, preemptible kernel bits by Robert Love.
+ * 2003-09-03 Interactivity tuning by Con Kolivas.
*/
#include <linux/mm.h>
@@ -59,6 +60,14 @@
#define USER_PRIO(p) ((p)-MAX_RT_PRIO)
#define TASK_USER_PRIO(p) USER_PRIO((p)->static_prio)
#define MAX_USER_PRIO (USER_PRIO(MAX_PRIO))
+#define AVG_TIMESLICE (MIN_TIMESLICE + ((MAX_TIMESLICE - MIN_TIMESLICE) *\
+ (MAX_PRIO-1-NICE_TO_PRIO(0))/(MAX_USER_PRIO - 1)))
+
+/*
+ * Some helpers for converting nanosecond timing to jiffy resolution
+ */
+#define NS_TO_JIFFIES(TIME) ((TIME) / (1000000000 / HZ))
+#define JIFFIES_TO_NS(TIME) ((TIME) * (1000000000 / HZ))
/*
* These are the 'tuning knobs' of the scheduler:
@@ -69,14 +78,18 @@
*/
#define MIN_TIMESLICE ( 10 * HZ / 1000)
#define MAX_TIMESLICE (200 * HZ / 1000)
-#define CHILD_PENALTY 50
+#define ON_RUNQUEUE_WEIGHT 30
+#define CHILD_PENALTY 95
#define PARENT_PENALTY 100
#define EXIT_WEIGHT 3
#define PRIO_BONUS_RATIO 25
+#define MAX_BONUS (MAX_USER_PRIO * PRIO_BONUS_RATIO / 100)
#define INTERACTIVE_DELTA 2
-#define MAX_SLEEP_AVG (10*HZ)
-#define STARVATION_LIMIT (10*HZ)
+#define MAX_SLEEP_AVG (AVG_TIMESLICE * MAX_BONUS)
+#define STARVATION_LIMIT (MAX_SLEEP_AVG)
+#define NS_MAX_SLEEP_AVG (JIFFIES_TO_NS(MAX_SLEEP_AVG))
#define NODE_THRESHOLD 125
+#define CREDIT_LIMIT 100
/*
* If a task is 'interactive' then we reinsert it in the active
@@ -106,6 +119,19 @@
* too hard.
*/
+#define CURRENT_BONUS(p) \
+ (NS_TO_JIFFIES((p)->sleep_avg) * MAX_BONUS / \
+ MAX_SLEEP_AVG)
+
+#ifdef CONFIG_SMP
+#define TIMESLICE_GRANULARITY(p) (MIN_TIMESLICE * \
+ (1 << (((MAX_BONUS - CURRENT_BONUS(p)) ? : 1) - 1)) * \
+ num_online_cpus())
+#else
+#define TIMESLICE_GRANULARITY(p) (MIN_TIMESLICE * \
+ (1 << (((MAX_BONUS - CURRENT_BONUS(p)) ? : 1) - 1)))
+#endif
+
#define SCALE(v1,v1_max,v2_max) \
(v1) * (v2_max) / (v1_max)
@@ -116,6 +142,19 @@
#define TASK_INTERACTIVE(p) \
((p)->prio <= (p)->static_prio - DELTA(p))
+#define JUST_INTERACTIVE_SLEEP(p) \
+ (JIFFIES_TO_NS(MAX_SLEEP_AVG * \
+ (MAX_BONUS / 2 + DELTA((p)) + 1) / MAX_BONUS - 1))
+
+#define HIGH_CREDIT(p) \
+ ((p)->interactive_credit > CREDIT_LIMIT)
+
+#define LOW_CREDIT(p) \
+ ((p)->interactive_credit < -CREDIT_LIMIT)
+
+#define TASK_PREEMPTS_CURR(p, rq) \
+ ((p)->prio < (rq)->curr->prio)
+
/*
* BASE_TIMESLICE scales user-nice values [ -20 ... 19 ]
* to time slice values.
@@ -180,7 +219,6 @@ static DEFINE_PER_CPU(struct runqueue, runqueues);
#define this_rq() (&__get_cpu_var(runqueues))
#define task_rq(p) cpu_rq(task_cpu(p))
#define cpu_curr(cpu) (cpu_rq(cpu)->curr)
-#define rt_task(p) ((p)->prio < MAX_RT_PRIO)
/*
* Default context-switch locking:
@@ -320,8 +358,7 @@ static int effective_prio(task_t *p)
if (rt_task(p))
return p->prio;
- bonus = MAX_USER_PRIO*PRIO_BONUS_RATIO*p->sleep_avg/MAX_SLEEP_AVG/100 -
- MAX_USER_PRIO*PRIO_BONUS_RATIO/100/2;
+ bonus = CURRENT_BONUS(p) - MAX_BONUS / 2;
prio = p->static_prio - bonus;
if (prio < MAX_RT_PRIO)
@@ -340,6 +377,82 @@ static inline void __activate_task(task_t *p, runqueue_t *rq)
nr_running_inc(rq);
}
+static void recalc_task_prio(task_t *p, unsigned long long now)
+{
+ unsigned long long __sleep_time = now - p->timestamp;
+ unsigned long sleep_time;
+
+ if (__sleep_time > NS_MAX_SLEEP_AVG)
+ sleep_time = NS_MAX_SLEEP_AVG;
+ else
+ sleep_time = (unsigned long)__sleep_time;
+
+ if (likely(sleep_time > 0)) {
+ /*
+ * User tasks that sleep a long time are categorised as
+ * idle and will get just interactive status to stay active &
+ * prevent them suddenly becoming cpu hogs and starving
+ * other processes.
+ */
+ if (p->mm && p->activated != -1 &&
+ sleep_time > JUST_INTERACTIVE_SLEEP(p)){
+ p->sleep_avg = JIFFIES_TO_NS(MAX_SLEEP_AVG -
+ AVG_TIMESLICE);
+ if (!HIGH_CREDIT(p))
+ p->interactive_credit++;
+ } else {
+ /*
+ * The lower the sleep avg a task has the more
+ * rapidly it will rise with sleep time.
+ */
+ sleep_time *= (MAX_BONUS - CURRENT_BONUS(p)) ? : 1;
+
+ /*
+ * Tasks with low interactive_credit are limited to
+ * one timeslice worth of sleep avg bonus.
+ */
+ if (LOW_CREDIT(p) &&
+ sleep_time > JIFFIES_TO_NS(task_timeslice(p)))
+ sleep_time =
+ JIFFIES_TO_NS(task_timeslice(p));
+
+ /*
+ * Non high_credit tasks waking from uninterruptible
+ * sleep are limited in their sleep_avg rise as they
+ * are likely to be cpu hogs waiting on I/O
+ */
+ if (p->activated == -1 && !HIGH_CREDIT(p) && p->mm){
+ if (p->sleep_avg >= JUST_INTERACTIVE_SLEEP(p))
+ sleep_time = 0;
+ else if (p->sleep_avg + sleep_time >=
+ JUST_INTERACTIVE_SLEEP(p)){
+ p->sleep_avg =
+ JUST_INTERACTIVE_SLEEP(p);
+ sleep_time = 0;
+ }
+ }
+
+ /*
+ * This code gives a bonus to interactive tasks.
+ *
+ * The boost works by updating the 'average sleep time'
+ * value here, based on ->timestamp. The more time a task
+ * spends sleeping, the higher the average gets - and the
+ * higher the priority boost gets as well.
+ */
+ p->sleep_avg += sleep_time;
+
+ if (p->sleep_avg > NS_MAX_SLEEP_AVG){
+ p->sleep_avg = NS_MAX_SLEEP_AVG;
+ if (!HIGH_CREDIT(p))
+ p->interactive_credit++;
+ }
+ }
+ }
+
+ p->prio = effective_prio(p);
+}
+
/*
* activate_task - move a task to the runqueue and do priority recalculation
*
@@ -348,34 +461,33 @@ static inline void __activate_task(task_t *p, runqueue_t *rq)
*/
static inline void activate_task(task_t *p, runqueue_t *rq)
{
- long sleep_time = jiffies - p->last_run - 1;
+ unsigned long long now = sched_clock();
- if (sleep_time > 0) {
- int sleep_avg;
+ recalc_task_prio(p, now);
+ /*
+ * This checks to make sure it's not an uninterruptible task
+ * that is now waking up.
+ */
+ if (!p->activated){
/*
- * This code gives a bonus to interactive tasks.
- *
- * The boost works by updating the 'average sleep time'
- * value here, based on ->last_run. The more time a task
- * spends sleeping, the higher the average gets - and the
- * higher the priority boost gets as well.
+ * Tasks which were woken up by interrupts (ie. hw events)
+ * are most likely of interactive nature. So we give them
+ * the credit of extending their sleep time to the period
+ * of time they spend on the runqueue, waiting for execution
+ * on a CPU, first time around:
*/
- sleep_avg = p->sleep_avg + sleep_time;
-
+ if (in_interrupt())
+ p->activated = 2;
+ else
/*
- * 'Overflow' bonus ticks go to the waker as well, so the
- * ticks are not lost. This has the effect of further
- * boosting tasks that are related to maximum-interactive
- * tasks.
+ * Normal first-time wakeups get a credit too for on-runqueue
+ * time, but it will be weighted down:
*/
- if (sleep_avg > MAX_SLEEP_AVG)
- sleep_avg = MAX_SLEEP_AVG;
- if (p->sleep_avg != sleep_avg) {
- p->sleep_avg = sleep_avg;
- p->prio = effective_prio(p);
+ p->activated = 1;
}
- }
+ p->timestamp = now;
+
__activate_task(p, rq);
}
@@ -496,13 +608,19 @@ repeat_lock_task:
task_rq_unlock(rq, &flags);
goto repeat_lock_task;
}
- if (old_state == TASK_UNINTERRUPTIBLE)
+ if (old_state == TASK_UNINTERRUPTIBLE){
rq->nr_uninterruptible--;
+ /*
+ * Tasks on involuntary sleep don't earn
+ * sleep_avg beyond just interactive state.
+ */
+ p->activated = -1;
+ }
if (sync)
__activate_task(p, rq);
else {
activate_task(p, rq);
- if (p->prio < rq->curr->prio)
+ if (TASK_PREEMPTS_CURR(p, rq))
resched_task(rq->curr);
}
success = 1;
@@ -551,8 +669,14 @@ void wake_up_forked_process(task_t * p)
* and children as well, to keep max-interactive tasks
* from forking tasks that are max-interactive.
*/
- current->sleep_avg = current->sleep_avg * PARENT_PENALTY / 100;
- p->sleep_avg = p->sleep_avg * CHILD_PENALTY / 100;
+ current->sleep_avg = JIFFIES_TO_NS(CURRENT_BONUS(current) *
+ PARENT_PENALTY / 100 * MAX_SLEEP_AVG / MAX_BONUS);
+
+ p->sleep_avg = JIFFIES_TO_NS(CURRENT_BONUS(p) *
+ CHILD_PENALTY / 100 * MAX_SLEEP_AVG / MAX_BONUS);
+
+ p->interactive_credit = 0;
+
p->prio = effective_prio(p);
set_task_cpu(p, smp_processor_id());
@@ -593,8 +717,9 @@ void sched_exit(task_t * p)
* the sleep_avg of the parent as well.
*/
if (p->sleep_avg < p->parent->sleep_avg)
- p->parent->sleep_avg = (p->parent->sleep_avg * EXIT_WEIGHT +
- p->sleep_avg) / (EXIT_WEIGHT + 1);
+ p->parent->sleep_avg = p->parent->sleep_avg /
+ (EXIT_WEIGHT + 1) * EXIT_WEIGHT + p->sleep_avg /
+ (EXIT_WEIGHT + 1);
}
/**
@@ -960,10 +1085,10 @@ static inline runqueue_t *find_busiest_queue(runqueue_t *this_rq, int this_cpu,
if (likely(!busiest))
goto out;
- *imbalance = (max_load - nr_running) / 2;
+ *imbalance = max_load - nr_running;
/* It needs an at least ~25% imbalance to trigger balancing. */
- if (!idle && (*imbalance < (max_load + 3)/4)) {
+ if (!idle && ((*imbalance)*4 < max_load)) {
busiest = NULL;
goto out;
}
@@ -973,7 +1098,7 @@ static inline runqueue_t *find_busiest_queue(runqueue_t *this_rq, int this_cpu,
* Make sure nothing changed since we checked the
* runqueue length.
*/
- if (busiest->nr_running <= nr_running + 1) {
+ if (busiest->nr_running <= nr_running) {
spin_unlock(&busiest->lock);
busiest = NULL;
}
@@ -996,13 +1121,31 @@ static inline void pull_task(runqueue_t *src_rq, prio_array_t *src_array, task_t
* Note that idle threads have a prio of MAX_PRIO, for this test
* to be always true for them.
*/
- if (p->prio < this_rq->curr->prio)
+ if (TASK_PREEMPTS_CURR(p, this_rq))
set_need_resched();
- else {
- if (p->prio == this_rq->curr->prio &&
- p->time_slice > this_rq->curr->time_slice)
- set_need_resched();
- }
+}
+
+/*
+ * Previously:
+ *
+ * #define CAN_MIGRATE_TASK(p,rq,this_cpu) \
+ * ((!idle || (NS_TO_JIFFIES(now - (p)->timestamp) > \
+ * cache_decay_ticks)) && !task_running(rq, p) && \
+ * cpu_isset(this_cpu, (p)->cpus_allowed))
+ */
+
+static inline int
+can_migrate_task(task_t *tsk, runqueue_t *rq, int this_cpu, int idle)
+{
+ unsigned long delta = sched_clock() - tsk->timestamp;
+
+ if (!idle && (delta <= JIFFIES_TO_NS(cache_decay_ticks)))
+ return 0;
+ if (task_running(rq, tsk))
+ return 0;
+ if (!cpu_isset(this_cpu, tsk->cpus_allowed))
+ return 0;
+ return 1;
}
/*
@@ -1026,6 +1169,12 @@ static void load_balance(runqueue_t *this_rq, int idle, cpumask_t cpumask)
goto out;
/*
+ * We only want to steal a number of tasks equal to 1/2 the imbalance,
+ * otherwise we'll just shift the imbalance to the new queue:
+ */
+ imbalance /= 2;
+
+ /*
* We first consider expired tasks. Those will likely not be
* executed in the near future, and they are most likely to
* be cache-cold, thus switching CPUs has the least effect
@@ -1064,14 +1213,9 @@ skip_queue:
* 3) are cache-hot on their current CPU.
*/
-#define CAN_MIGRATE_TASK(p,rq,this_cpu) \
- ((idle || (jiffies - (p)->last_run > cache_decay_ticks)) && \
- !task_running(rq, p) && \
- cpu_isset(this_cpu, (p)->cpus_allowed))
-
curr = curr->prev;
- if (!CAN_MIGRATE_TASK(tmp, busiest, this_cpu)) {
+ if (!can_migrate_task(tmp, busiest, this_cpu, idle)) {
if (curr != head)
goto skip_queue;
idx++;
@@ -1233,14 +1377,11 @@ void scheduler_tick(int user_ticks, int sys_ticks)
spin_lock(&rq->lock);
/*
* The task was running during this tick - update the
- * time slice counter and the sleep average. Note: we
- * do not update a thread's priority until it either
- * goes to sleep or uses up its timeslice. This makes
- * it possible for interactive tasks to use up their
- * timeslices at their highest priority levels.
+ * time slice counter. Note: we do not update a thread's
+ * priority until it either goes to sleep or uses up its
+ * timeslice. This makes it possible for interactive tasks
+ * to use up their timeslices at their highest priority levels.
*/
- if (p->sleep_avg)
- p->sleep_avg--;
if (unlikely(rt_task(p))) {
/*
* RR tasks need a special form of timeslice management.
@@ -1264,12 +1405,39 @@ void scheduler_tick(int user_ticks, int sys_ticks)
p->time_slice = task_timeslice(p);
p->first_time_slice = 0;
+ if (!rq->expired_timestamp)
+ rq->expired_timestamp = jiffies;
if (!TASK_INTERACTIVE(p) || EXPIRED_STARVING(rq)) {
- if (!rq->expired_timestamp)
- rq->expired_timestamp = jiffies;
enqueue_task(p, rq->expired);
} else
enqueue_task(p, rq->active);
+ } else {
+ /*
+ * Prevent a too long timeslice allowing a task to monopolize
+ * the CPU. We do this by splitting up the timeslice into
+ * smaller pieces.
+ *
+ * Note: this does not mean the task's timeslices expire or
+ * get lost in any way, they just might be preempted by
+ * another task of equal priority. (one with higher
+ * priority would have preempted this task already.) We
+ * requeue this task to the end of the list on this priority
+ * level, which is in essence a round-robin of tasks with
+ * equal priority.
+ *
+ * This only applies to tasks in the interactive
+ * delta range with at least TIMESLICE_GRANULARITY to requeue.
+ */
+ if (TASK_INTERACTIVE(p) && !((task_timeslice(p) -
+ p->time_slice) % TIMESLICE_GRANULARITY(p)) &&
+ (p->time_slice >= TIMESLICE_GRANULARITY(p)) &&
+ (p->array == rq->active)) {
+
+ dequeue_task(p, rq->active);
+ set_tsk_need_resched(p);
+ p->prio = effective_prio(p);
+ enqueue_task(p, rq->active);
+ }
}
out_unlock:
spin_unlock(&rq->lock);
@@ -1288,6 +1456,8 @@ asmlinkage void schedule(void)
runqueue_t *rq;
prio_array_t *array;
struct list_head *queue;
+ unsigned long long now;
+ unsigned long run_time;
int idx;
/*
@@ -1308,7 +1478,20 @@ need_resched:
rq = this_rq();
release_kernel_lock(prev);
- prev->last_run = jiffies;
+ now = sched_clock();
+ if (likely(now - prev->timestamp < NS_MAX_SLEEP_AVG))
+ run_time = now - prev->timestamp;
+ else
+ run_time = NS_MAX_SLEEP_AVG;
+
+ /*
+ * Tasks with interactive credits get charged less run_time
+ * at high sleep_avg to delay them losing their interactive
+ * status
+ */
+ if (HIGH_CREDIT(prev))
+ run_time /= (CURRENT_BONUS(prev) ? : 1);
+
spin_lock_irq(&rq->lock);
/*
@@ -1358,12 +1541,33 @@ pick_next_task:
queue = array->queue + idx;
next = list_entry(queue->next, task_t, run_list);
+ if (next->activated > 0) {
+ unsigned long long delta = now - next->timestamp;
+
+ if (next->activated == 1)
+ delta = delta * (ON_RUNQUEUE_WEIGHT * 128 / 100) / 128;
+
+ array = next->array;
+ dequeue_task(next, array);
+ recalc_task_prio(next, next->timestamp + delta);
+ enqueue_task(next, array);
+ }
+ next->activated = 0;
switch_tasks:
prefetch(next);
clear_tsk_need_resched(prev);
RCU_qsctr(task_cpu(prev))++;
+ prev->sleep_avg -= run_time;
+ if ((long)prev->sleep_avg <= 0){
+ prev->sleep_avg = 0;
+ if (!(HIGH_CREDIT(prev) || LOW_CREDIT(prev)))
+ prev->interactive_credit--;
+ }
+ prev->timestamp = now;
+
if (likely(prev != next)) {
+ next->timestamp = now;
rq->nr_switches++;
rq->curr = next;
@@ -1603,6 +1807,7 @@ void set_user_nice(task_t *p, long nice)
unsigned long flags;
prio_array_t *array;
runqueue_t *rq;
+ int old_prio, new_prio, delta;
if (TASK_NICE(p) == nice || nice < -20 || nice > 19)
return;
@@ -1611,6 +1816,12 @@ void set_user_nice(task_t *p, long nice)
* the task might be in the middle of scheduling on another CPU.
*/
rq = task_rq_lock(p, &flags);
+ /*
+ * The RT priorities are set via setscheduler(), but we still
+ * allow the 'normal' nice value to be set - but as expected
+ * it wont have any effect on scheduling until the task is
+ * not SCHED_NORMAL:
+ */
if (rt_task(p)) {
p->static_prio = NICE_TO_PRIO(nice);
goto out_unlock;
@@ -1618,16 +1829,20 @@ void set_user_nice(task_t *p, long nice)
array = p->array;
if (array)
dequeue_task(p, array);
+
+ old_prio = p->prio;
+ new_prio = NICE_TO_PRIO(nice);
+ delta = new_prio - old_prio;
p->static_prio = NICE_TO_PRIO(nice);
- p->prio = NICE_TO_PRIO(nice);
+ p->prio += delta;
+
if (array) {
enqueue_task(p, array);
/*
- * If the task is running and lowered its priority,
- * or increased its priority then reschedule its CPU:
+ * If the task increased its priority or is running and
+ * lowered its priority, then reschedule its CPU:
*/
- if ((NICE_TO_PRIO(nice) < p->static_prio) ||
- task_running(rq, p))
+ if (delta < 0 || (delta > 0 && task_running(rq, p)))
resched_task(rq->curr);
}
out_unlock:
@@ -2384,6 +2599,12 @@ static void move_task_away(struct task_struct *p, int dest_cpu)
local_irq_restore(flags);
}
+typedef struct {
+ int cpu;
+ struct completion startup_done;
+ task_t *task;
+} migration_startup_t;
+
/*
* migration_thread - this is a highprio system thread that performs
* thread migration by bumping thread off CPU then 'pushing' onto
@@ -2393,20 +2614,21 @@ static int migration_thread(void * data)
{
/* Marking "param" __user is ok, since we do a set_fs(KERNEL_DS); */
struct sched_param __user param = { .sched_priority = MAX_RT_PRIO-1 };
- int cpu = (long) data;
+ migration_startup_t *startup = data;
+ int cpu = startup->cpu;
runqueue_t *rq;
int ret;
+ startup->task = current;
+ complete(&startup->startup_done);
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ schedule();
+
+ BUG_ON(smp_processor_id() != cpu);
+
daemonize("migration/%d", cpu);
set_fs(KERNEL_DS);
- /*
- * Either we are running on the right CPU, or there's a a
- * migration thread on this CPU, guaranteed (we're started
- * serially).
- */
- set_cpus_allowed(current, cpumask_of_cpu(cpu));
-
ret = setscheduler(0, SCHED_FIFO, &param);
rq = this_rq();
@@ -2445,13 +2667,30 @@ static int migration_call(struct notifier_block *nfb,
unsigned long action,
void *hcpu)
{
+ long cpu = (long) hcpu;
+ migration_startup_t startup;
+
switch (action) {
case CPU_ONLINE:
- printk("Starting migration thread for cpu %li\n",
- (long)hcpu);
- kernel_thread(migration_thread, hcpu, CLONE_KERNEL);
- while (!cpu_rq((long)hcpu)->migration_thread)
+
+ printk("Starting migration thread for cpu %li\n", cpu);
+
+ startup.cpu = cpu;
+ startup.task = NULL;
+ init_completion(&startup.startup_done);
+
+ kernel_thread(migration_thread, &startup, CLONE_KERNEL);
+ wait_for_completion(&startup.startup_done);
+ wait_task_inactive(startup.task);
+
+ startup.task->thread_info->cpu = cpu;
+ startup.task->cpus_allowed = cpumask_of_cpu(cpu);
+
+ wake_up_process(startup.task);
+
+ while (!cpu_rq(cpu)->migration_thread)
yield();
+
break;
}
return NOTIFY_OK;
@@ -2574,6 +2813,8 @@ void __might_sleep(char *file, int line)
prev_jiffy = jiffies;
printk(KERN_ERR "Debug: sleeping function called from invalid"
" context at %s:%d\n", file, line);
+ printk("in_atomic():%d, irqs_disabled():%d\n",
+ in_atomic(), irqs_disabled());
dump_stack();
}
#endif
diff --git a/kernel/signal.c b/kernel/signal.c
index 72333be1fd42..852da1a009da 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1139,7 +1139,7 @@ kill_proc_info(int sig, struct siginfo *info, pid_t pid)
static int kill_something_info(int sig, struct siginfo *info, int pid)
{
if (!pid) {
- return kill_pg_info(sig, info, current->pgrp);
+ return kill_pg_info(sig, info, process_group(current));
} else if (pid == -1) {
int retval = 0, count = 0;
struct task_struct * p;
@@ -1798,7 +1798,7 @@ relock:
/* signals can be posted during this window */
- if (is_orphaned_pgrp(current->pgrp))
+ if (is_orphaned_pgrp(process_group(current)))
goto relock;
spin_lock_irq(&current->sighand->siglock);
diff --git a/kernel/sys.c b/kernel/sys.c
index b172afa53be1..9eda26d6745c 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -290,7 +290,7 @@ asmlinkage long sys_setpriority(int which, int who, int niceval)
break;
case PRIO_PGRP:
if (!who)
- who = current->pgrp;
+ who = process_group(current);
for_each_task_pid(who, PIDTYPE_PGID, p, l, pid)
error = set_one_prio(p, niceval, error);
break;
@@ -346,7 +346,7 @@ asmlinkage long sys_getpriority(int which, int who)
break;
case PRIO_PGRP:
if (!who)
- who = current->pgrp;
+ who = process_group(current);
for_each_task_pid(who, PIDTYPE_PGID, p, l, pid) {
niceval = 20 - task_nice(p);
if (niceval > retval)
@@ -982,11 +982,12 @@ ok_pgid:
if (err)
goto out;
- if (p->pgrp != pgid) {
+ if (process_group(p) != pgid) {
detach_pid(p, PIDTYPE_PGID);
- p->pgrp = pgid;
+ p->group_leader->__pgrp = pgid;
attach_pid(p, PIDTYPE_PGID, pgid);
}
+
err = 0;
out:
/* All paths lead to here, thus we are safe. -DaveM */
@@ -997,7 +998,7 @@ out:
asmlinkage long sys_getpgid(pid_t pid)
{
if (!pid) {
- return current->pgrp;
+ return process_group(current);
} else {
int retval;
struct task_struct *p;
@@ -1009,7 +1010,7 @@ asmlinkage long sys_getpgid(pid_t pid)
if (p) {
retval = security_task_getpgid(p);
if (!retval)
- retval = p->pgrp;
+ retval = process_group(p);
}
read_unlock(&tasklist_lock);
return retval;
@@ -1019,7 +1020,7 @@ asmlinkage long sys_getpgid(pid_t pid)
asmlinkage long sys_getpgrp(void)
{
/* SMP - assuming writes are word atomic this is fine */
- return current->pgrp;
+ return process_group(current);
}
asmlinkage long sys_getsid(pid_t pid)
@@ -1062,7 +1063,7 @@ asmlinkage long sys_setsid(void)
__set_special_pids(current->pid, current->pid);
current->tty = NULL;
current->tty_old_pgrp = 0;
- err = current->pgrp;
+ err = process_group(current);
out:
write_unlock_irq(&tasklist_lock);
return err;
diff --git a/mm/memory.c b/mm/memory.c
index 980953dbbfb4..be552e3cffbd 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1655,6 +1655,8 @@ int make_pages_present(unsigned long addr, unsigned long end)
len = (end+PAGE_SIZE-1)/PAGE_SIZE-addr/PAGE_SIZE;
ret = get_user_pages(current, current->mm, addr,
len, write, 0, NULL, NULL);
+ if (ret < 0)
+ return ret;
return ret == len ? 0 : -1;
}
diff --git a/mm/mlock.c b/mm/mlock.c
index 21c8fbfa53a5..6f026bdd68e5 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -13,21 +13,24 @@ static int mlock_fixup(struct vm_area_struct * vma,
unsigned long start, unsigned long end, unsigned int newflags)
{
struct mm_struct * mm = vma->vm_mm;
- int pages, error;
+ int pages;
+ int ret = 0;
if (newflags == vma->vm_flags)
- return 0;
+ goto out;
if (start != vma->vm_start) {
- error = split_vma(mm, vma, start, 1);
- if (error)
- return -EAGAIN;
+ if (split_vma(mm, vma, start, 1)) {
+ ret = -EAGAIN;
+ goto out;
+ }
}
if (end != vma->vm_end) {
- error = split_vma(mm, vma, end, 0);
- if (error)
- return -EAGAIN;
+ if (split_vma(mm, vma, end, 0)) {
+ ret = -EAGAIN;
+ goto out;
+ }
}
spin_lock(&mm->page_table_lock);
@@ -40,11 +43,12 @@ static int mlock_fixup(struct vm_area_struct * vma,
pages = (end - start) >> PAGE_SHIFT;
if (newflags & VM_LOCKED) {
pages = -pages;
- make_pages_present(start, end);
+ ret = make_pages_present(start, end);
}
vma->vm_mm->locked_vm -= pages;
- return 0;
+out:
+ return ret;
}
static int do_mlock(unsigned long start, size_t len, int on)
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 80047ad9a25e..327700df7e33 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -111,6 +111,7 @@ get_dirty_limits(struct page_state *ps, long *pbackground, long *pdirty)
int unmapped_ratio;
long background;
long dirty;
+ struct task_struct *tsk;
get_page_state(ps);
@@ -129,7 +130,8 @@ get_dirty_limits(struct page_state *ps, long *pbackground, long *pdirty)
background = (background_ratio * total_pages) / 100;
dirty = (dirty_ratio * total_pages) / 100;
- if (current->flags & PF_LESS_THROTTLE) {
+ tsk = current;
+ if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk)) {
background += background / 4;
dirty += dirty / 4;
}
@@ -144,7 +146,7 @@ get_dirty_limits(struct page_state *ps, long *pbackground, long *pdirty)
* If we're over `background_thresh' then pdflush is woken to perform some
* writeout.
*/
-void balance_dirty_pages(struct address_space *mapping)
+static void balance_dirty_pages(struct address_space *mapping)
{
struct page_state ps;
long nr_reclaimable;
@@ -219,6 +221,10 @@ void balance_dirty_pages_ratelimited(struct address_space *mapping)
if (dirty_exceeded)
ratelimit = 8;
+ /*
+ * Check the rate limiting. Also, we do not want to throttle real-time
+ * tasks in balance_dirty_pages(). Period.
+ */
if (get_cpu_var(ratelimits)++ >= ratelimit) {
__get_cpu_var(ratelimits) = 0;
put_cpu_var(ratelimits);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4051a19b0ab5..4ac2982747c9 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -520,7 +520,8 @@ static struct page *buffered_rmqueue(struct zone *zone, int order, int cold)
*
* Herein lies the mysterious "incremental min". That's the
*
- * min += z->pages_low;
+ * local_low = z->pages_low;
+ * min += local_low;
*
* thing. The intent here is to provide additional protection to low zones for
* allocation requests which _could_ use higher zones. So a GFP_HIGHMEM
@@ -538,10 +539,11 @@ __alloc_pages(unsigned int gfp_mask, unsigned int order,
unsigned long min;
struct zone **zones, *classzone;
struct page *page;
+ struct reclaim_state reclaim_state;
+ struct task_struct *p = current;
int i;
int cold;
int do_retry;
- struct reclaim_state reclaim_state;
might_sleep_if(wait);
@@ -558,8 +560,17 @@ __alloc_pages(unsigned int gfp_mask, unsigned int order,
min = 1UL << order;
for (i = 0; zones[i] != NULL; i++) {
struct zone *z = zones[i];
+ unsigned long local_low;
+
+ /*
+ * This is the fabled 'incremental min'. We let real-time tasks
+ * dip their real-time paws a little deeper into reserves.
+ */
+ local_low = z->pages_low;
+ if (rt_task(p))
+ local_low >>= 1;
+ min += local_low;
- min += z->pages_low;
if (z->free_pages >= min ||
(!wait && z->free_pages >= z->pages_high)) {
page = buffered_rmqueue(z, order, cold);
@@ -582,6 +593,8 @@ __alloc_pages(unsigned int gfp_mask, unsigned int order,
local_min = z->pages_min;
if (gfp_mask & __GFP_HIGH)
local_min >>= 2;
+ if (rt_task(p))
+ local_min >>= 1;
min += local_min;
if (z->free_pages >= min ||
(!wait && z->free_pages >= z->pages_high)) {
@@ -595,7 +608,7 @@ __alloc_pages(unsigned int gfp_mask, unsigned int order,
/* here we're in the low on memory slow path */
rebalance:
- if ((current->flags & (PF_MEMALLOC | PF_MEMDIE)) && !in_interrupt()) {
+ if ((p->flags & (PF_MEMALLOC | PF_MEMDIE)) && !in_interrupt()) {
/* go through the zonelist yet again, ignoring mins */
for (i = 0; zones[i] != NULL; i++) {
struct zone *z = zones[i];
@@ -611,14 +624,14 @@ rebalance:
if (!wait)
goto nopage;
- current->flags |= PF_MEMALLOC;
+ p->flags |= PF_MEMALLOC;
reclaim_state.reclaimed_slab = 0;
- current->reclaim_state = &reclaim_state;
+ p->reclaim_state = &reclaim_state;
try_to_free_pages(classzone, gfp_mask, order);
- current->reclaim_state = NULL;
- current->flags &= ~PF_MEMALLOC;
+ p->reclaim_state = NULL;
+ p->flags &= ~PF_MEMALLOC;
/* go through the zonelist yet one more time */
min = 1UL << order;
@@ -658,7 +671,7 @@ nopage:
if (!(gfp_mask & __GFP_NOWARN)) {
printk("%s: page allocation failure."
" order:%d, mode:0x%x\n",
- current->comm, order, gfp_mask);
+ p->comm, order, gfp_mask);
}
return NULL;
got_pg:
diff --git a/mm/slab.c b/mm/slab.c
index 34b62ca48429..2f73bad2c440 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -293,6 +293,10 @@ struct kmem_cache_s {
atomic_t freehit;
atomic_t freemiss;
#endif
+#if DEBUG
+ int dbghead;
+ int reallen;
+#endif
};
#define CFLGS_OFF_SLAB (0x80000000UL)
@@ -356,32 +360,68 @@ struct kmem_cache_s {
#define POISON_AFTER 0x6b /* for use-after-free poisoning */
#define POISON_END 0xa5 /* end-byte of poisoning */
+/* memory layout of objects:
+ * 0 : objp
+ * 0 .. cachep->dbghead - BYTES_PER_WORD - 1: padding. This ensures that
+ * the end of an object is aligned with the end of the real
+ * allocation. Catches writes behind the end of the allocation.
+ * cachep->dbghead - BYTES_PER_WORD .. cachep->dbghead - 1:
+ * redzone word.
+ * cachep->dbghead: The real object.
+ * cachep->objsize - 2* BYTES_PER_WORD: redzone word [BYTES_PER_WORD long]
+ * cachep->objsize - 1* BYTES_PER_WORD: last caller address [BYTES_PER_WORD long]
+ */
static inline int obj_dbghead(kmem_cache_t *cachep)
{
- if (cachep->flags & SLAB_RED_ZONE)
- return BYTES_PER_WORD;
- return 0;
+ return cachep->dbghead;
}
-static inline int obj_dbglen(kmem_cache_t *cachep)
+static inline int obj_reallen(kmem_cache_t *cachep)
{
- int len = 0;
+ return cachep->reallen;
+}
- if (cachep->flags & SLAB_RED_ZONE) {
- len += 2*BYTES_PER_WORD;
- }
- if (cachep->flags & SLAB_STORE_USER) {
- len += BYTES_PER_WORD;
- }
- return len;
+static unsigned long *dbg_redzone1(kmem_cache_t *cachep, void *objp)
+{
+ BUG_ON(!(cachep->flags & SLAB_RED_ZONE));
+ return (unsigned long*) (objp+obj_dbghead(cachep)-BYTES_PER_WORD);
+}
+
+static unsigned long *dbg_redzone2(kmem_cache_t *cachep, void *objp)
+{
+ BUG_ON(!(cachep->flags & SLAB_RED_ZONE));
+ if (cachep->flags & SLAB_STORE_USER)
+ return (unsigned long*) (objp+cachep->objsize-2*BYTES_PER_WORD);
+ return (unsigned long*) (objp+cachep->objsize-BYTES_PER_WORD);
+}
+
+static void **dbg_userword(kmem_cache_t *cachep, void *objp)
+{
+ BUG_ON(!(cachep->flags & SLAB_STORE_USER));
+ return (void**)(objp+cachep->objsize-BYTES_PER_WORD);
}
#else
static inline int obj_dbghead(kmem_cache_t *cachep)
{
return 0;
}
-static inline int obj_dbglen(kmem_cache_t *cachep)
+static inline int obj_reallen(kmem_cache_t *cachep)
+{
+ return cachep->objsize;
+}
+static inline unsigned long *dbg_redzone1(kmem_cache_t *cachep, void *objp)
+{
+ BUG();
+ return 0;
+}
+static inline unsigned long *dbg_redzone2(kmem_cache_t *cachep, void *objp)
+{
+ BUG();
+ return 0;
+}
+static inline void **dbg_userword(kmem_cache_t *cachep, void *objp)
{
+ BUG();
return 0;
}
#endif
@@ -804,7 +844,7 @@ static inline void kmem_freepages (kmem_cache_t *cachep, void *addr)
#ifdef CONFIG_DEBUG_PAGEALLOC
static void store_stackinfo(kmem_cache_t *cachep, unsigned long *addr, unsigned long caller)
{
- int size = cachep->objsize-obj_dbglen(cachep);
+ int size = obj_reallen(cachep);
addr = (unsigned long *)&((char*)addr)[obj_dbghead(cachep)];
@@ -836,7 +876,7 @@ static void store_stackinfo(kmem_cache_t *cachep, unsigned long *addr, unsigned
static void poison_obj(kmem_cache_t *cachep, void *addr, unsigned char val)
{
- int size = cachep->objsize-obj_dbglen(cachep);
+ int size = obj_reallen(cachep);
addr = &((char*)addr)[obj_dbghead(cachep)];
memset(addr, val, size);
@@ -858,47 +898,42 @@ static void *scan_poisoned_obj(unsigned char* addr, unsigned int size)
return NULL;
}
-static void check_poison_obj(kmem_cache_t *cachep, void *addr)
+static void check_poison_obj(kmem_cache_t *cachep, void *objp)
{
void *end;
- int size = cachep->objsize-obj_dbglen(cachep);
+ void *realobj;
+ int size = obj_reallen(cachep);
- addr = &((char*)addr)[obj_dbghead(cachep)];
+ realobj = objp+obj_dbghead(cachep);
- end = scan_poisoned_obj(addr, size);
+ end = scan_poisoned_obj(realobj, size);
if (end) {
int s;
printk(KERN_ERR "Slab corruption: start=%p, expend=%p, "
- "problemat=%p\n", addr, addr+size-1, end);
+ "problemat=%p\n", realobj, realobj+size-1, end);
if (cachep->flags & SLAB_STORE_USER) {
- void *pc;
-
- if (cachep->flags & SLAB_RED_ZONE)
- pc = *(void**)(addr+size+BYTES_PER_WORD);
- else
- pc = *(void**)(addr+size);
- printk(KERN_ERR "Last user: [<%p>]", pc);
- print_symbol("(%s)", (unsigned long)pc);
+ printk(KERN_ERR "Last user: [<%p>]", *dbg_userword(cachep, objp));
+ print_symbol("(%s)", (unsigned long)*dbg_userword(cachep, objp));
printk("\n");
}
printk(KERN_ERR "Data: ");
for (s = 0; s < size; s++) {
- if (((char*)addr)[s] == POISON_BEFORE)
+ if (((char*)realobj)[s] == POISON_BEFORE)
printk(".");
- else if (((char*)addr)[s] == POISON_AFTER)
+ else if (((char*)realobj)[s] == POISON_AFTER)
printk("*");
else
- printk("%02X ", ((unsigned char*)addr)[s]);
+ printk("%02X ", ((unsigned char*)realobj)[s]);
}
printk("\n");
printk(KERN_ERR "Next: ");
for (; s < size + 32; s++) {
- if (((char*)addr)[s] == POISON_BEFORE)
+ if (((char*)realobj)[s] == POISON_BEFORE)
printk(".");
- else if (((char*)addr)[s] == POISON_AFTER)
+ else if (((char*)realobj)[s] == POISON_AFTER)
printk("*");
else
- printk("%02X ", ((unsigned char*)addr)[s]);
+ printk("%02X ", ((unsigned char*)realobj)[s]);
}
printk("\n");
slab_error(cachep, "object was modified after freeing");
@@ -916,7 +951,6 @@ static void slab_destroy (kmem_cache_t *cachep, struct slab *slabp)
int i;
for (i = 0; i < cachep->num; i++) {
void *objp = slabp->s_mem + cachep->objsize * i;
- int objlen = cachep->objsize;
if (cachep->flags & SLAB_POISON) {
#ifdef CONFIG_DEBUG_PAGEALLOC
@@ -928,21 +962,16 @@ static void slab_destroy (kmem_cache_t *cachep, struct slab *slabp)
check_poison_obj(cachep, objp);
#endif
}
- if (cachep->flags & SLAB_STORE_USER)
- objlen -= BYTES_PER_WORD;
-
if (cachep->flags & SLAB_RED_ZONE) {
- if (*((unsigned long*)(objp)) != RED_INACTIVE)
+ if (*dbg_redzone1(cachep, objp) != RED_INACTIVE)
slab_error(cachep, "start of a freed object "
"was overwritten");
- if (*((unsigned long*)(objp + objlen - BYTES_PER_WORD))
- != RED_INACTIVE)
+ if (*dbg_redzone2(cachep, objp) != RED_INACTIVE)
slab_error(cachep, "end of a freed object "
"was overwritten");
- objp += BYTES_PER_WORD;
}
if (cachep->dtor && !(cachep->flags & SLAB_POISON))
- (cachep->dtor)(objp, cachep, 0);
+ (cachep->dtor)(objp+obj_dbghead(cachep), cachep, 0);
}
#else
if (cachep->dtor) {
@@ -1020,10 +1049,6 @@ kmem_cache_create (const char *name, size_t size, size_t offset,
}
#if FORCED_DEBUG
-#ifdef CONFIG_DEBUG_PAGEALLOC
- if (size < PAGE_SIZE-3*BYTES_PER_WORD && size > 128)
- size = PAGE_SIZE-3*BYTES_PER_WORD;
-#endif
/*
* Enable redzoning and last user accounting, except
* - for caches with forced alignment: redzoning would violate the
@@ -1054,6 +1079,9 @@ kmem_cache_create (const char *name, size_t size, size_t offset,
goto opps;
memset(cachep, 0, sizeof(kmem_cache_t));
+#if DEBUG
+ cachep->reallen = size;
+#endif
/* Check that size is in terms of words. This is needed to avoid
* unaligned accesses for some archs when redzoning is used, and makes
* sure any on-slab bufctl's are also correctly aligned.
@@ -1071,12 +1099,20 @@ kmem_cache_create (const char *name, size_t size, size_t offset,
* when redzoning.
*/
flags &= ~SLAB_HWCACHE_ALIGN;
- size += 2*BYTES_PER_WORD; /* words for redzone */
+ /* add space for red zone words */
+ cachep->dbghead += BYTES_PER_WORD;
+ size += 2*BYTES_PER_WORD;
}
if (flags & SLAB_STORE_USER) {
flags &= ~SLAB_HWCACHE_ALIGN;
- size += BYTES_PER_WORD; /* word for kfree caller address */
+ size += BYTES_PER_WORD; /* add space */
}
+#if FORCED_DEBUG && defined(CONFIG_DEBUG_PAGEALLOC)
+ if (size > 128 && cachep->reallen > L1_CACHE_BYTES && size < PAGE_SIZE) {
+ cachep->dbghead += PAGE_SIZE - size;
+ size = PAGE_SIZE;
+ }
+#endif
#endif
align = BYTES_PER_WORD;
if (flags & SLAB_HWCACHE_ALIGN)
@@ -1444,20 +1480,15 @@ static void cache_init_objs (kmem_cache_t * cachep,
for (i = 0; i < cachep->num; i++) {
void* objp = slabp->s_mem+cachep->objsize*i;
#if DEBUG
- int objlen = cachep->objsize;
/* need to poison the objs? */
if (cachep->flags & SLAB_POISON)
poison_obj(cachep, objp, POISON_BEFORE);
- if (cachep->flags & SLAB_STORE_USER) {
- objlen -= BYTES_PER_WORD;
- ((unsigned long*)(objp+objlen))[0] = 0;
- }
+ if (cachep->flags & SLAB_STORE_USER)
+ *dbg_userword(cachep, objp) = NULL;
if (cachep->flags & SLAB_RED_ZONE) {
- *((unsigned long*)(objp)) = RED_INACTIVE;
- objp += BYTES_PER_WORD;
- objlen -= 2* BYTES_PER_WORD;
- *((unsigned long*)(objp + objlen)) = RED_INACTIVE;
+ *dbg_redzone1(cachep, objp) = RED_INACTIVE;
+ *dbg_redzone2(cachep, objp) = RED_INACTIVE;
}
/*
* Constructors are not allowed to allocate memory from
@@ -1465,14 +1496,13 @@ static void cache_init_objs (kmem_cache_t * cachep,
* Otherwise, deadlock. They must also be threaded.
*/
if (cachep->ctor && !(cachep->flags & SLAB_POISON))
- cachep->ctor(objp, cachep, ctor_flags);
+ cachep->ctor(objp+obj_dbghead(cachep), cachep, ctor_flags);
if (cachep->flags & SLAB_RED_ZONE) {
- if (*((unsigned long*)(objp + objlen)) != RED_INACTIVE)
+ if (*dbg_redzone2(cachep, objp) != RED_INACTIVE)
slab_error(cachep, "constructor overwrote the"
" end of an object");
- objp -= BYTES_PER_WORD;
- if (*((unsigned long*)(objp)) != RED_INACTIVE)
+ if (*dbg_redzone1(cachep, objp) != RED_INACTIVE)
slab_error(cachep, "constructor overwrote the"
" start of an object");
}
@@ -1623,9 +1653,9 @@ static inline void *cache_free_debugcheck (kmem_cache_t * cachep, void * objp, v
#if DEBUG
struct page *page;
unsigned int objnr;
- int objlen = cachep->objsize;
struct slab *slabp;
+ objp -= obj_dbghead(cachep);
kfree_debugcheck(objp);
page = virt_to_page(objp);
@@ -1638,21 +1668,18 @@ static inline void *cache_free_debugcheck (kmem_cache_t * cachep, void * objp, v
}
slabp = GET_PAGE_SLAB(page);
- if (cachep->flags & SLAB_STORE_USER) {
- objlen -= BYTES_PER_WORD;
- }
if (cachep->flags & SLAB_RED_ZONE) {
- objp -= BYTES_PER_WORD;
- if (xchg((unsigned long *)objp, RED_INACTIVE) != RED_ACTIVE)
- slab_error(cachep, "double free, or memory before"
- " object was overwritten");
- if (xchg((unsigned long *)(objp+objlen-BYTES_PER_WORD), RED_INACTIVE) != RED_ACTIVE)
- slab_error(cachep, "double free, or memory after "
+ if (*dbg_redzone1(cachep, objp) != RED_ACTIVE || *dbg_redzone2(cachep, objp) != RED_ACTIVE) {
+ slab_error(cachep, "double free, or memory outside"
" object was overwritten");
+ printk(KERN_ERR "%p: redzone 1: 0x%lx, redzone 2: 0x%lx.\n",
+ objp, *dbg_redzone1(cachep, objp), *dbg_redzone2(cachep, objp));
+ }
+ *dbg_redzone1(cachep, objp) = RED_INACTIVE;
+ *dbg_redzone2(cachep, objp) = RED_INACTIVE;
}
- if (cachep->flags & SLAB_STORE_USER) {
- *((void**)(objp+objlen)) = caller;
- }
+ if (cachep->flags & SLAB_STORE_USER)
+ *dbg_userword(cachep, objp) = caller;
objnr = (objp-slabp->s_mem)/cachep->objsize;
@@ -1825,8 +1852,6 @@ cache_alloc_debugcheck_after(kmem_cache_t *cachep,
unsigned long flags, void *objp, void *caller)
{
#if DEBUG
- int objlen = cachep->objsize;
-
if (!objp)
return objp;
if (cachep->flags & SLAB_POISON) {
@@ -1840,24 +1865,20 @@ cache_alloc_debugcheck_after(kmem_cache_t *cachep,
#endif
poison_obj(cachep, objp, POISON_BEFORE);
}
- if (cachep->flags & SLAB_STORE_USER) {
- objlen -= BYTES_PER_WORD;
- *((void **)(objp+objlen)) = caller;
- }
+ if (cachep->flags & SLAB_STORE_USER)
+ *dbg_userword(cachep, objp) = caller;
if (cachep->flags & SLAB_RED_ZONE) {
- /* Set alloc red-zone, and check old one. */
- if (xchg((unsigned long *)objp, RED_ACTIVE) != RED_INACTIVE) {
- slab_error(cachep, "memory before object was "
- "overwritten");
- }
- if (xchg((unsigned long *)(objp+objlen - BYTES_PER_WORD),
- RED_ACTIVE) != RED_INACTIVE) {
- slab_error(cachep, "memory after object was "
- "overwritten");
+ if (*dbg_redzone1(cachep, objp) != RED_INACTIVE || *dbg_redzone2(cachep, objp) != RED_INACTIVE) {
+ slab_error(cachep, "double free, or memory outside"
+ " object was overwritten");
+ printk(KERN_ERR "%p: redzone 1: 0x%lx, redzone 2: 0x%lx.\n",
+ objp, *dbg_redzone1(cachep, objp), *dbg_redzone2(cachep, objp));
}
- objp += BYTES_PER_WORD;
+ *dbg_redzone1(cachep, objp) = RED_ACTIVE;
+ *dbg_redzone2(cachep, objp) = RED_ACTIVE;
}
+ objp += obj_dbghead(cachep);
if (cachep->ctor && cachep->flags & SLAB_POISON) {
unsigned long ctor_flags = SLAB_CTOR_CONSTRUCTOR;
@@ -2175,7 +2196,7 @@ free_percpu(const void *objp)
unsigned int kmem_cache_size(kmem_cache_t *cachep)
{
- return cachep->objsize-obj_dbglen(cachep);
+ return obj_reallen(cachep);
}
kmem_cache_t * kmem_find_general_cachep (size_t size, int gfpflags)
@@ -2763,12 +2784,17 @@ void ptrinfo(unsigned long addr)
if (objnr >= c->num) {
printk("Bad obj number.\n");
} else {
- kernel_map_pages(virt_to_page(objp), c->objsize/PAGE_SIZE, 1);
+ kernel_map_pages(virt_to_page(objp),
+ c->objsize/PAGE_SIZE, 1);
+
+ if (c->flags & SLAB_RED_ZONE)
+ printk("redzone: 0x%lx/0x%lx.\n",
+ *dbg_redzone1(c, objp),
+ *dbg_redzone2(c, objp));
- printk("redzone: %lxh/%lxh/%lxh.\n",
- ((unsigned long*)objp)[0],
- ((unsigned long*)(objp+c->objsize))[-2],
- ((unsigned long*)(objp+c->objsize))[-1]);
+ if (c->flags & SLAB_STORE_USER)
+ printk("Last user: %p.\n",
+ *dbg_userword(c, objp));
}
spin_unlock_irqrestore(&c->spinlock, flags);
diff --git a/net/802/p8022.c b/net/802/p8022.c
index 3fff5ad047e0..5ae63416df6d 100644
--- a/net/802/p8022.c
+++ b/net/802/p8022.c
@@ -22,8 +22,8 @@
#include <linux/mm.h>
#include <linux/in.h>
#include <linux/init.h>
+#include <net/llc.h>
#include <net/p8022.h>
-#include <net/llc_sap.h>
static int p8022_request(struct datalink_proto *dl, struct sk_buff *skb,
unsigned char *dest)
diff --git a/net/802/psnap.c b/net/802/psnap.c
index c689454484b1..f243d37dba35 100644
--- a/net/802/psnap.c
+++ b/net/802/psnap.c
@@ -15,9 +15,8 @@
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <net/datalink.h>
+#include <net/llc.h>
#include <net/psnap.h>
-#include <net/llc_if.h>
-#include <net/llc_sap.h>
#include <linux/mm.h>
#include <linux/in.h>
#include <linux/init.h>
diff --git a/net/Kconfig b/net/Kconfig
index 7d76574a9cc3..d6e91d248835 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -370,24 +370,11 @@ config ATM_BR2684_IPFILTER
config VLAN_8021Q
tristate "802.1Q VLAN Support"
-config LLC
- tristate "ANSI/IEEE 802.2 - aka LLC (IPX, Appletalk, Token Ring)"
- help
- This is a Logical Link Layer protocol used for Appletalk, IPX,
- Token Ring devices, the linux-sna.org project and in the future by
- NetBEUI. It originally came from Procom Inc. that released the code
- for 2.0.36 and was heavily modified to work with 2.{4,5}.
- Select this if you want to have support for those protocols or if
- you want to have the sockets interface for LLC.
-
-
-config LLC_UI
- bool "LLC sockets interface"
- depends on LLC
+source "net/llc/Kconfig"
config IPX
tristate "The IPX protocol"
- depends on LLC
+ select LLC
---help---
This is support for the Novell networking protocol, IPX, commonly
used for local networks of Windows machines. You need it if you
@@ -424,7 +411,7 @@ source "net/ipx/Kconfig"
config ATALK
tristate "Appletalk protocol support"
- depends on LLC
+ select LLC
---help---
AppleTalk is the protocol that Apple computers can use to communicate
on a network. If your Linux box is connected to such a network and you
@@ -479,9 +466,8 @@ config X25
using the X.21 protocol (not yet supported by Linux) or one can do
X.25 over a standard telephone line using an ordinary modem (say Y
to "X.25 async driver" below) or over Ethernet using an ordinary
- Ethernet card and either the 802.2 LLC protocol (say Y to "802.2
- LLC" below) or LAPB over Ethernet (say Y to "LAPB Data Link Driver"
- and "LAPB over Ethernet driver" below).
+ Ethernet card and the LAPB over Ethernet (say Y to "LAPB Data Link
+ Driver" and "LAPB over Ethernet driver" below).
If you want to compile this driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 39f87d4d2948..5f8139b157a8 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -93,6 +93,7 @@ static void unlink_clip_vcc(struct clip_vcc *clip_vcc)
printk(KERN_CRIT "!clip_vcc->entry (clip_vcc %p)\n",clip_vcc);
return;
}
+ spin_lock_bh(&entry->neigh->dev->xmit_lock); /* block clip_start_xmit() */
entry->neigh->used = jiffies;
for (walk = &entry->vccs; *walk; walk = &(*walk)->next)
if (*walk == clip_vcc) {
@@ -102,17 +103,20 @@ static void unlink_clip_vcc(struct clip_vcc *clip_vcc)
clip_vcc->entry = NULL;
if (clip_vcc->xoff)
netif_wake_queue(entry->neigh->dev);
- if (entry->vccs) return;
+ if (entry->vccs)
+ goto out;
entry->expires = jiffies-1;
/* force resolution or expiration */
error = neigh_update(entry->neigh,NULL,NUD_NONE,0,0);
if (error)
printk(KERN_CRIT "unlink_clip_vcc: "
"neigh_update failed with %d\n",error);
- return;
+ goto out;
}
printk(KERN_CRIT "ATMARP: unlink_clip_vcc failed (entry %p, vcc "
"0x%p)\n",entry,clip_vcc);
+out:
+ spin_unlock_bh(&entry->neigh->dev->xmit_lock);
}
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index 81fc01a99dd8..19704fd1528e 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -574,7 +574,7 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock)
__bnep_link_session(s);
- err = kernel_thread(bnep_session, s, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ err = kernel_thread(bnep_session, s, CLONE_KERNEL);
if (err < 0) {
/* Session thread start failed, gotta cleanup. */
unregister_netdev(dev);
diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c
index 2f0785fa7ffc..392a53714c7d 100644
--- a/net/bluetooth/bnep/sock.c
+++ b/net/bluetooth/bnep/sock.c
@@ -189,6 +189,7 @@ static int bnep_sock_create(struct socket *sock, int protocol)
static struct net_proto_family bnep_sock_family_ops = {
.family = PF_BLUETOOTH,
+ .owner = THIS_MODULE,
.create = bnep_sock_create
};
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 5d88ff009753..148be892afe6 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -1957,7 +1957,7 @@ int __init rfcomm_init(void)
{
l2cap_load();
- kernel_thread(rfcomm_run, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ kernel_thread(rfcomm_run, NULL, CLONE_KERNEL);
BT_INFO("RFCOMM ver %s", VERSION);
diff --git a/net/core/dev.c b/net/core/dev.c
index b389bff2887a..46e9fd7edecd 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -470,10 +470,10 @@ struct net_device *dev_get_by_name(const char *name)
* to be sure the name is not allocated or removed during the test the
* caller must hold the rtnl semaphore.
*
- * This function primarily exists for back compatibility with older
+ * This function exists only for back compatibility with older
* drivers.
*/
-int dev_get(const char *name)
+int __dev_get(const char *name)
{
struct net_device *dev;
@@ -698,7 +698,13 @@ void netdev_state_change(struct net_device *dev)
void dev_load(const char *name)
{
- if (!dev_get(name) && capable(CAP_SYS_MODULE))
+ struct net_device *dev;
+
+ read_lock(&dev_base_lock);
+ dev = __dev_get_by_name(name);
+ read_unlock(&dev_base_lock);
+
+ if (!dev && capable(CAP_SYS_MODULE))
request_module("%s", name);
}
diff --git a/net/core/wireless.c b/net/core/wireless.c
index 2eab6303519e..cef3d72fdecb 100644
--- a/net/core/wireless.c
+++ b/net/core/wireless.c
@@ -495,15 +495,10 @@ static struct file_operations wireless_seq_fops = {
int __init wireless_proc_init(void)
{
- struct proc_dir_entry *p;
- int rc = 0;
+ if (!proc_net_fops_create("wireless", S_IRUGO, &wireless_seq_fops))
+ return -ENOMEM;
- p = create_proc_entry("wireless", S_IRUGO, proc_net);
- if (p)
- p->proc_fops = &wireless_seq_fops;
- else
- rc = -ENOMEM;
- return rc;
+ return 0;
}
#endif /* CONFIG_PROC_FS */
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 0478ef892750..d663d87975ca 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -280,8 +280,10 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
.nl_u = { .ip4_u = {
.daddr = IGMPV3_ALL_MCR } },
.proto = IPPROTO_IGMP };
- if (ip_route_output_key(&rt, &fl))
+ if (ip_route_output_key(&rt, &fl)) {
+ kfree_skb(skb);
return 0;
+ }
}
if (rt->rt_src == 0) {
ip_rt_put(rt);
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 0ba3da70f438..4f72c48780d6 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -50,6 +50,7 @@
#include <linux/route.h>
#include <linux/udp.h>
#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
#include <linux/major.h>
#include <linux/root_dev.h>
#include <net/arp.h>
@@ -1092,43 +1093,45 @@ static int __init ic_dynamic(void)
#ifdef CONFIG_PROC_FS
-static int pnp_get_info(char *buffer, char **start,
- off_t offset, int length)
+static int pnp_seq_show(struct seq_file *seq, void *v)
{
- int len;
- int i;
+ int i;
if (ic_proto_used & IC_PROTO)
- sprintf(buffer, "#PROTO: %s\n",
- (ic_proto_used & IC_RARP) ? "RARP"
- : (ic_proto_used & IC_USE_DHCP) ? "DHCP" : "BOOTP");
+ seq_printf(seq, "#PROTO: %s\n",
+ (ic_proto_used & IC_RARP) ? "RARP"
+ : (ic_proto_used & IC_USE_DHCP) ? "DHCP" : "BOOTP");
else
- strcpy(buffer, "#MANUAL\n");
- len = strlen(buffer);
+ seq_puts(seq, "#MANUAL\n");
if (ic_domain[0])
- len += sprintf(buffer + len,
- "domain %s\n", ic_domain);
+ seq_printf(seq,
+ "domain %s\n", ic_domain);
for (i = 0; i < CONF_NAMESERVERS_MAX; i++) {
if (ic_nameservers[i] != INADDR_NONE)
- len += sprintf(buffer + len,
- "nameserver %u.%u.%u.%u\n",
- NIPQUAD(ic_nameservers[i]));
+ seq_printf(seq,
+ "nameserver %u.%u.%u.%u\n",
+ NIPQUAD(ic_nameservers[i]));
}
if (ic_servaddr != INADDR_NONE)
- len += sprintf(buffer + len,
- "bootserver %u.%u.%u.%u\n",
- NIPQUAD(ic_servaddr));
-
- if (offset > len)
- offset = len;
- *start = buffer + offset;
+ seq_printf(seq,
+ "bootserver %u.%u.%u.%u\n",
+ NIPQUAD(ic_servaddr));
+ return 0;
+}
- if (offset + length > len)
- length = len - offset;
- return length;
+static int pnp_seq_open(struct inode *indoe, struct file *file)
+{
+ return single_open(file, pnp_seq_show, NULL);
}
+static struct file_operations pnp_seq_fops = {
+ .owner = THIS_MODULE,
+ .open = pnp_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
+};
#endif /* CONFIG_PROC_FS */
/*
@@ -1140,7 +1143,7 @@ static int __init ip_auto_config(void)
unsigned long jiff;
#ifdef CONFIG_PROC_FS
- proc_net_create("pnp", 0, pnp_get_info);
+ proc_net_fops_create("pnp", S_IRUGO, &pnp_seq_fops);
#endif /* CONFIG_PROC_FS */
if (!ic_enable)
@@ -1153,7 +1156,7 @@ static int __init ip_auto_config(void)
/* Give hardware a chance to settle */
jiff = jiffies + CONF_PRE_OPEN;
while (time_before(jiffies, jiff))
- ;
+ cpu_relax();
/* Setup all network devices */
if (ic_open_devs() < 0)
@@ -1162,7 +1165,7 @@ static int __init ip_auto_config(void)
/* Give drivers a chance to settle */
jiff = jiffies + CONF_POST_OPEN;
while (time_before(jiffies, jiff))
- ;
+ cpu_relax();
/*
* If the config information is insufficient (e.g., our IP address or
diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c
index 9242eef96bcf..ac32e1eda5bc 100644
--- a/net/ipv4/ipvs/ip_vs_app.c
+++ b/net/ipv4/ipvs/ip_vs_app.c
@@ -35,6 +35,7 @@
#include <asm/system.h>
#include <linux/stat.h>
#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
#include <net/ip_vs.h>
@@ -213,18 +214,14 @@ int register_ip_vs_app(struct ip_vs_app *app)
*/
void unregister_ip_vs_app(struct ip_vs_app *app)
{
- struct ip_vs_app *inc;
- struct list_head *l = &app->incs_list;
+ struct ip_vs_app *inc, *nxt;
down(&__ip_vs_app_mutex);
- while (l->next != l) {
- inc = list_entry(l->next, struct ip_vs_app, a_list);
+ list_for_each_entry_safe(inc, nxt, &app->incs_list, a_list) {
ip_vs_app_inc_release(inc);
}
- list_del(&app->a_list);
-
up(&__ip_vs_app_mutex);
/* decrease the module use count */
@@ -238,13 +235,11 @@ void unregister_ip_vs_app(struct ip_vs_app *app)
*/
struct ip_vs_app *ip_vs_app_get_by_name(char *appname)
{
- struct list_head *p;
struct ip_vs_app *app, *a = NULL;
down(&__ip_vs_app_mutex);
- list_for_each (p, &ip_vs_app_list) {
- app = list_entry(p, struct ip_vs_app, a_list);
+ list_for_each_entry(ent, &ip_vs_app_list, a_list) {
if (strcmp(app->name, appname))
continue;
@@ -480,55 +475,99 @@ int ip_vs_app_pkt_in(struct ip_vs_conn *cp, struct sk_buff *skb)
}
+#ifdef CONFIG_PROC_FS
/*
* /proc/net/ip_vs_app entry function
*/
-static int
-ip_vs_app_getinfo(char *buffer, char **start, off_t offset, int length)
+
+static struct ip_vs_app *ip_vs_app_idx(loff_t pos)
{
- off_t pos=0;
- int len=0;
- char temp[64];
struct ip_vs_app *app, *inc;
- struct list_head *e, *i;
- pos = 64;
- if (pos > offset) {
- len += sprintf(buffer+len, "%-63s\n",
- "prot port usecnt name");
+ list_for_each_entry(app, &ip_vs_app_list, a_list) {
+ list_for_each_entry(inc, &app->incs_list, a_list) {
+ if (pos-- == 0)
+ return inc;
+ }
}
+ return NULL;
+}
+
+static void *ip_vs_app_seq_start(struct seq_file *seq, loff_t *pos)
+{
down(&__ip_vs_app_mutex);
- list_for_each (e, &ip_vs_app_list) {
+
+ return *pos ? ip_vs_app_idx(*pos - 1) : SEQ_START_TOKEN;
+}
+
+static void *ip_vs_app_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ struct ip_vs_app *inc, *app;
+ struct list_head *e;
+
+ ++*pos;
+ if (v == SEQ_START_TOKEN)
+ return ip_vs_app_idx(0);
+
+ inc = v;
+ app = inc->app;
+
+ if ((e = inc->a_list.next) != &app->incs_list)
+ return list_entry(e, struct ip_vs_app, a_list);
+
+ /* go on to next application */
+ for (e = app->a_list.next; e != &ip_vs_app_list; e = e->next) {
app = list_entry(e, struct ip_vs_app, a_list);
- list_for_each (i, &app->incs_list) {
- inc = list_entry(i, struct ip_vs_app, a_list);
-
- pos += 64;
- if (pos <= offset)
- continue;
- sprintf(temp, "%-3s %-7u %-6d %-17s",
- ip_vs_proto_name(inc->protocol),
- ntohs(inc->port),
- atomic_read(&inc->usecnt),
- inc->name);
- len += sprintf(buffer+len, "%-63s\n", temp);
- if (pos >= offset+length)
- goto done;
+ list_for_each_entry(inc, &app->incs_list, a_list) {
+ return inc;
}
}
- done:
+ return NULL;
+}
+
+static void ip_vs_app_seq_stop(struct seq_file *seq, void *v)
+{
up(&__ip_vs_app_mutex);
+}
+
+static int ip_vs_app_seq_show(struct seq_file *seq, void *v)
+{
+ if (v == SEQ_START_TOKEN)
+ seq_puts(seq, "prot port usecnt name\n");
+ else {
+ const struct ip_vs_app *inc = v;
+
+ seq_printf(seq, "%-3s %-7u %-6d %-17s\n",
+ ip_vs_proto_name(inc->protocol),
+ ntohs(inc->port),
+ atomic_read(&inc->usecnt),
+ inc->name);
+ }
+ return 0;
+}
+
+static struct seq_operations ip_vs_app_seq_ops = {
+ .start = ip_vs_app_seq_start,
+ .next = ip_vs_app_seq_next,
+ .stop = ip_vs_app_seq_stop,
+ .show = ip_vs_app_seq_show,
+};
- *start = buffer+len-(pos-offset); /* Start of wanted data */
- len = pos-offset;
- if (len > length)
- len = length;
- if (len < 0)
- len = 0;
- return len;
+static int ip_vs_app_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &ip_vs_app_seq_ops);
}
+static struct file_operations ip_vs_app_fops = {
+ .owner = THIS_MODULE,
+ .open = ip_vs_app_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+#endif
+
/*
* Replace a segment of data with a new segment
@@ -577,7 +616,7 @@ int ip_vs_skb_replace(struct sk_buff *skb, int pri,
int ip_vs_app_init(void)
{
/* we will replace it with proc_net_ipvs_create() soon */
- proc_net_create("ip_vs_app", 0, ip_vs_app_getinfo);
+ proc_net_fops_create("ip_vs_app", 0, &ip_vs_app_fops);
return 0;
}
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
index 808cc7cc8444..ca7c79f71941 100644
--- a/net/ipv4/ipvs/ip_vs_conn.c
+++ b/net/ipv4/ipvs/ip_vs_conn.c
@@ -30,6 +30,7 @@
#include <linux/compiler.h>
#include <linux/vmalloc.h>
#include <linux/proc_fs.h> /* for proc_net_* */
+#include <linux/seq_file.h>
#include <linux/jhash.h>
#include <linux/random.h>
@@ -188,15 +189,12 @@ static inline struct ip_vs_conn *__ip_vs_conn_in_get
{
unsigned hash;
struct ip_vs_conn *cp;
- struct list_head *l,*e;
hash = ip_vs_conn_hashkey(protocol, s_addr, s_port);
- l = &ip_vs_conn_tab[hash];
ct_read_lock(hash);
- for (e=l->next; e!=l; e=e->next) {
- cp = list_entry(e, struct ip_vs_conn, c_list);
+ list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
if (s_addr==cp->caddr && s_port==cp->cport &&
d_port==cp->vport && d_addr==cp->vaddr &&
protocol==cp->protocol) {
@@ -242,18 +240,15 @@ struct ip_vs_conn *ip_vs_conn_out_get
{
unsigned hash;
struct ip_vs_conn *cp, *ret=NULL;
- struct list_head *l,*e;
/*
* Check for "full" addressed entries
*/
hash = ip_vs_conn_hashkey(protocol, d_addr, d_port);
- l = &ip_vs_conn_tab[hash];
ct_read_lock(hash);
- for (e=l->next; e!=l; e=e->next) {
- cp = list_entry(e, struct ip_vs_conn, c_list);
+ list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
if (d_addr == cp->caddr && d_port == cp->cport &&
s_port == cp->dport && s_addr == cp->daddr &&
protocol == cp->protocol) {
@@ -615,61 +610,112 @@ ip_vs_conn_new(int proto, __u32 caddr, __u16 cport, __u32 vaddr, __u16 vport,
/*
* /proc/net/ip_vs_conn entries
*/
-static int
-ip_vs_conn_getinfo(char *buffer, char **start, off_t offset, int length)
+#ifdef CONFIG_PROC_FS
+
+static void *ip_vs_conn_array(struct seq_file *seq, loff_t pos)
{
- off_t pos=0;
- int idx, len=0;
- char temp[70];
+ int idx;
struct ip_vs_conn *cp;
- struct list_head *l, *e;
-
- pos = 128;
- if (pos > offset) {
- len += sprintf(buffer+len, "%-127s\n",
- "Pro FromIP FPrt ToIP TPrt DestIP DPrt State Expires");
+
+ for(idx = 0; idx < IP_VS_CONN_TAB_SIZE; idx++) {
+ ct_read_lock_bh(idx);
+ list_for_each_entry(cp, &ip_vs_conn_tab[idx], c_list) {
+ if (pos-- == 0) {
+ seq->private = &ip_vs_conn_tab[idx];
+ return cp;
+ }
+ }
+ ct_read_unlock_bh(idx);
}
- for(idx = 0; idx < IP_VS_CONN_TAB_SIZE; idx++) {
- /*
- * Lock is actually only need in next loop
- * we are called from uspace: must stop bh.
- */
+ return NULL;
+}
+
+static void *ip_vs_conn_seq_start(struct seq_file *seq, loff_t *pos)
+{
+ seq->private = NULL;
+ return *pos ? ip_vs_conn_array(seq, *pos - 1) :SEQ_START_TOKEN;
+}
+
+static void *ip_vs_conn_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ struct ip_vs_conn *cp = v;
+ struct list_head *e, *l = seq->private;
+ int idx;
+
+ ++*pos;
+ if (v == SEQ_START_TOKEN)
+ return ip_vs_conn_array(seq, 0);
+
+ /* more on same hash chain? */
+ if ((e = cp->c_list.next) != l)
+ return list_entry(e, struct ip_vs_conn, c_list);
+
+ idx = l - ip_vs_conn_tab;
+ ct_read_unlock_bh(idx);
+
+ while (++idx < IP_VS_CONN_TAB_SIZE) {
ct_read_lock_bh(idx);
+ list_for_each_entry(cp, &ip_vs_conn_tab[idx], c_list) {
+ seq->private = &ip_vs_conn_tab[idx];
+ return cp;
+ }
+ ct_read_unlock_bh(idx);
+ }
+ seq->private = NULL;
+ return NULL;
+}
- l = &ip_vs_conn_tab[idx];
- for (e=l->next; e!=l; e=e->next) {
- cp = list_entry(e, struct ip_vs_conn, c_list);
- pos += 128;
- if (pos <= offset)
- continue;
- sprintf(temp,
- "%-3s %08X %04X %08X %04X %08X %04X %-11s %7lu",
+static void ip_vs_conn_seq_stop(struct seq_file *seq, void *v)
+{
+ struct list_head *l = seq->private;
+
+ if (l)
+ ct_read_unlock(l - ip_vs_conn_tab);
+}
+
+static int ip_vs_conn_seq_show(struct seq_file *seq, void *v)
+{
+
+ if (v == SEQ_START_TOKEN)
+ seq_puts(seq,
+ "Pro FromIP FPrt ToIP TPrt DestIP DPrt State Expires\n");
+ else {
+ const struct ip_vs_conn *cp = v;
+
+ seq_printf(seq,
+ "%-3s %08X %04X %08X %04X %08X %04X %-11s %7lu\n",
ip_vs_proto_name(cp->protocol),
ntohl(cp->caddr), ntohs(cp->cport),
ntohl(cp->vaddr), ntohs(cp->vport),
ntohl(cp->daddr), ntohs(cp->dport),
ip_vs_state_name(cp->protocol, cp->state),
(cp->timer.expires-jiffies)/HZ);
- len += sprintf(buffer+len, "%-127s\n", temp);
- if (pos >= offset+length) {
- ct_read_unlock_bh(idx);
- goto done;
- }
- }
- ct_read_unlock_bh(idx);
}
+ return 0;
+}
+
+static struct seq_operations ip_vs_conn_seq_ops = {
+ .start = ip_vs_conn_seq_start,
+ .next = ip_vs_conn_seq_next,
+ .stop = ip_vs_conn_seq_stop,
+ .show = ip_vs_conn_seq_show,
+};
- done:
- *start = buffer+len-(pos-offset); /* Start of wanted data */
- len = pos-offset;
- if (len > length)
- len = length;
- if (len < 0)
- len = 0;
- return len;
+static int ip_vs_conn_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &ip_vs_conn_seq_ops);
}
+static struct file_operations ip_vs_conn_fops = {
+ .owner = THIS_MODULE,
+ .open = ip_vs_conn_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+#endif
+
/*
* Randomly drop connection entries before running out of memory
@@ -687,7 +733,7 @@ static inline int todrop_entry(struct ip_vs_conn *cp)
/* if the conn entry hasn't lasted for 60 seconds, don't drop it.
This will leave enough time for normal connection to get
through. */
- if (cp->timeout+jiffies-cp->timer.expires < 60*HZ)
+ if (time_before(cp->timeout + jiffies, cp->timer.expires + 60*HZ))
return 0;
/* Don't drop the entry if its number of incoming packets is not
@@ -707,7 +753,6 @@ void ip_vs_random_dropentry(void)
{
int idx;
struct ip_vs_conn *cp;
- struct list_head *l,*e;
struct ip_vs_conn *ct;
/*
@@ -721,9 +766,7 @@ void ip_vs_random_dropentry(void)
*/
ct_write_lock(hash);
- l = &ip_vs_conn_tab[hash];
- for (e=l->next; e!=l; e=e->next) {
- cp = list_entry(e, struct ip_vs_conn, c_list);
+ list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
if (!cp->cport && !(cp->flags & IP_VS_CONN_F_NO_CPORT))
/* connection template */
continue;
@@ -775,7 +818,6 @@ static void ip_vs_conn_flush(void)
{
int idx;
struct ip_vs_conn *cp;
- struct list_head *l,*e;
struct ip_vs_conn *ct;
flush_again:
@@ -785,9 +827,7 @@ static void ip_vs_conn_flush(void)
*/
ct_write_lock_bh(idx);
- l = &ip_vs_conn_tab[idx];
- for (e=l->next; e!=l; e=e->next) {
- cp = list_entry(e, struct ip_vs_conn, c_list);
+ list_for_each_entry(cp, &ip_vs_conn_tab[idx], c_list) {
atomic_inc(&cp->refcnt);
ct_write_unlock(idx);
@@ -848,7 +888,7 @@ int ip_vs_conn_init(void)
__ip_vs_conntbl_lock_array[idx].l = RW_LOCK_UNLOCKED;
}
- proc_net_create("ip_vs_conn", 0, ip_vs_conn_getinfo);
+ proc_net_fops_create("ip_vs_conn", 0, &ip_vs_conn_fops);
/* calculate the random value for connection hash */
get_random_bytes(&ip_vs_conn_rnd, sizeof(ip_vs_conn_rnd));
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 166e3be72987..c2ac8f318373 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -31,6 +31,8 @@
#include <linux/proc_fs.h>
#include <linux/timer.h>
#include <linux/swap.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
@@ -46,7 +48,7 @@
static DECLARE_MUTEX(__ip_vs_mutex);
/* lock for service table */
-rwlock_t __ip_vs_svc_lock = RW_LOCK_UNLOCKED;
+static rwlock_t __ip_vs_svc_lock = RW_LOCK_UNLOCKED;
/* lock for table with the real services */
static rwlock_t __ip_vs_rs_lock = RW_LOCK_UNLOCKED;
@@ -361,14 +363,11 @@ __ip_vs_service_get(__u16 protocol, __u32 vaddr, __u16 vport)
{
unsigned hash;
struct ip_vs_service *svc;
- struct list_head *l,*e;
/* Check for "full" addressed entries */
hash = ip_vs_svc_hashkey(protocol, vaddr, vport);
- l = &ip_vs_svc_table[hash];
- for (e=l->next; e!=l; e=e->next) {
- svc = list_entry(e, struct ip_vs_service, s_list);
+ list_for_each_entry(svc, &ip_vs_svc_table[hash], s_list){
if ((svc->addr == vaddr)
&& (svc->port == vport)
&& (svc->protocol == protocol)) {
@@ -389,14 +388,11 @@ static __inline__ struct ip_vs_service *__ip_vs_svc_fwm_get(__u32 fwmark)
{
unsigned hash;
struct ip_vs_service *svc;
- struct list_head *l,*e;
/* Check for fwmark addressed entries */
hash = ip_vs_svc_fwm_hashkey(fwmark);
- l = &ip_vs_svc_fwm_table[hash];
- for (e=l->next; e!=l; e=e->next) {
- svc = list_entry(e, struct ip_vs_service, f_list);
+ list_for_each_entry(svc, &ip_vs_svc_fwm_table[hash], f_list) {
if (svc->fwmark == fwmark) {
/* HIT */
atomic_inc(&svc->usecnt);
@@ -533,7 +529,6 @@ ip_vs_lookup_real_service(__u16 protocol, __u32 daddr, __u16 dport)
{
unsigned hash;
struct ip_vs_dest *dest;
- struct list_head *l,*e;
/*
* Check for "full" addressed entries
@@ -541,11 +536,8 @@ ip_vs_lookup_real_service(__u16 protocol, __u32 daddr, __u16 dport)
*/
hash = ip_vs_rs_hashkey(daddr, dport);
- l = &ip_vs_rtable[hash];
-
read_lock(&__ip_vs_rs_lock);
- for (e=l->next; e!=l; e=e->next) {
- dest = list_entry(e, struct ip_vs_dest, d_list);
+ list_for_each_entry(dest, &ip_vs_rtable[hash], d_list) {
if ((dest->addr == daddr)
&& (dest->port == dport)
&& ((dest->protocol == protocol) ||
@@ -567,14 +559,11 @@ static struct ip_vs_dest *
ip_vs_lookup_dest(struct ip_vs_service *svc, __u32 daddr, __u16 dport)
{
struct ip_vs_dest *dest;
- struct list_head *l, *e;
/*
* Find the destination for the given service
*/
- l = &svc->destinations;
- for (e=l->next; e!=l; e=e->next) {
- dest = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(dest, &svc->destinations, n_list) {
if ((dest->addr == daddr) && (dest->port == dport)) {
/* HIT */
return dest;
@@ -598,16 +587,12 @@ ip_vs_lookup_dest(struct ip_vs_service *svc, __u32 daddr, __u16 dport)
static struct ip_vs_dest *
ip_vs_trash_get_dest(struct ip_vs_service *svc, __u32 daddr, __u16 dport)
{
- struct ip_vs_dest *dest;
- struct list_head *l, *e;
+ struct ip_vs_dest *dest, *nxt;
/*
* Find the destination in trash
*/
- l = &ip_vs_dest_trash;
-
- for (e=l->next; e!=l; e=e->next) {
- dest = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry_safe(dest, nxt, &ip_vs_dest_trash, n_list) {
IP_VS_DBG(3, "Destination %u/%u.%u.%u.%u:%u still in trash, "
"refcnt=%d\n",
dest->vfwmark,
@@ -632,7 +617,6 @@ ip_vs_trash_get_dest(struct ip_vs_service *svc, __u32 daddr, __u16 dport)
"from trash\n",
dest->vfwmark,
NIPQUAD(dest->addr), ntohs(dest->port));
- e = e->prev;
list_del(&dest->n_list);
ip_vs_dst_reset(dest);
__ip_vs_unbind_svc(dest);
@@ -655,13 +639,9 @@ ip_vs_trash_get_dest(struct ip_vs_service *svc, __u32 daddr, __u16 dport)
*/
static void ip_vs_trash_cleanup(void)
{
- struct ip_vs_dest *dest;
- struct list_head *l;
-
- l = &ip_vs_dest_trash;
+ struct ip_vs_dest *dest, *nxt;
- while (l->next != l) {
- dest = list_entry(l->next, struct ip_vs_dest, n_list);
+ list_for_each_entry_safe(dest, nxt, &ip_vs_dest_trash, n_list) {
list_del(&dest->n_list);
ip_vs_dst_reset(dest);
__ip_vs_unbind_svc(dest);
@@ -1196,8 +1176,7 @@ ip_vs_edit_service(struct ip_vs_service *svc, struct ip_vs_service_user *u)
*/
static void __ip_vs_del_service(struct ip_vs_service *svc)
{
- struct list_head *l;
- struct ip_vs_dest *dest;
+ struct ip_vs_dest *dest, *nxt;
struct ip_vs_scheduler *old_sched;
ip_vs_num_services--;
@@ -1218,9 +1197,7 @@ static void __ip_vs_del_service(struct ip_vs_service *svc)
/*
* Unlink the whole destination list
*/
- l = &svc->destinations;
- while (l->next != l) {
- dest = list_entry(l->next, struct ip_vs_dest, n_list);
+ list_for_each_entry_safe(dest, nxt, &svc->destinations, n_list) {
__ip_vs_unlink_dest(svc, dest, 0);
__ip_vs_del_dest(dest);
}
@@ -1277,16 +1254,13 @@ static int ip_vs_del_service(struct ip_vs_service *svc)
static int ip_vs_flush(void)
{
int idx;
- struct ip_vs_service *svc;
- struct list_head *l;
+ struct ip_vs_service *svc, *nxt;
/*
* Flush the service table hashed by <protocol,addr,port>
*/
for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) {
- l = &ip_vs_svc_table[idx];
- while (l->next != l) {
- svc = list_entry(l->next,struct ip_vs_service,s_list);
+ list_for_each_entry_safe(svc, nxt, &ip_vs_svc_table[idx], s_list) {
write_lock_bh(&__ip_vs_svc_lock);
ip_vs_svc_unhash(svc);
/*
@@ -1302,9 +1276,8 @@ static int ip_vs_flush(void)
* Flush the service table hashed by fwmark
*/
for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) {
- l = &ip_vs_svc_fwm_table[idx];
- while (l->next != l) {
- svc = list_entry(l->next,struct ip_vs_service,f_list);
+ list_for_each_entry_safe(svc, nxt,
+ &ip_vs_svc_fwm_table[idx], f_list) {
write_lock_bh(&__ip_vs_svc_lock);
ip_vs_svc_unhash(svc);
/*
@@ -1334,12 +1307,10 @@ ip_vs_zero_stats(struct ip_vs_stats *stats)
static int ip_vs_zero_service(struct ip_vs_service *svc)
{
- struct list_head *l;
struct ip_vs_dest *dest;
write_lock_bh(&__ip_vs_svc_lock);
- list_for_each (l, &svc->destinations) {
- dest = list_entry(l, struct ip_vs_dest, n_list);
+ list_for_each_entry(dest, &svc->destinations, n_list) {
ip_vs_zero_stats(&dest->stats);
}
ip_vs_zero_stats(&svc->stats);
@@ -1350,19 +1321,16 @@ static int ip_vs_zero_service(struct ip_vs_service *svc)
static int ip_vs_zero_all(void)
{
int idx;
- struct list_head *l;
struct ip_vs_service *svc;
for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) {
- list_for_each (l, &ip_vs_svc_table[idx]) {
- svc = list_entry(l, struct ip_vs_service, s_list);
+ list_for_each_entry(svc, &ip_vs_svc_table[idx], s_list) {
ip_vs_zero_service(svc);
}
}
for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) {
- list_for_each (l, &ip_vs_svc_fwm_table[idx]) {
- svc = list_entry(l, struct ip_vs_service, f_list);
+ list_for_each_entry(svc, &ip_vs_svc_fwm_table[idx], f_list) {
ip_vs_zero_service(svc);
}
}
@@ -1507,207 +1475,253 @@ static struct ip_vs_sysctl_table ipv4_vs_table = {
{0}}
};
+#ifdef CONFIG_PROC_FS
+
+struct ip_vs_iter {
+ struct list_head *table;
+ int bucket;
+};
/*
* Write the contents of the VS rule table to a PROCfs file.
* (It is kept just for backward compatibility)
*/
-static inline char *ip_vs_fwd_name(unsigned flags)
+static inline const char *ip_vs_fwd_name(unsigned flags)
{
- char *fwd;
-
switch (flags & IP_VS_CONN_F_FWD_MASK) {
case IP_VS_CONN_F_LOCALNODE:
- fwd = "Local";
- break;
+ return "Local";
case IP_VS_CONN_F_TUNNEL:
- fwd = "Tunnel";
- break;
+ return "Tunnel";
case IP_VS_CONN_F_DROUTE:
- fwd = "Route";
- break;
+ return "Route";
default:
- fwd = "Masq";
+ return "Masq";
}
- return fwd;
}
-static inline int sprintf_dest(char *str, struct ip_vs_dest *dest)
-{
- return sprintf(str, " -> %08X:%04X %-7s %-6d %-10d %-10d",
- ntohl(dest->addr), ntohs(dest->port),
- ip_vs_fwd_name(atomic_read(&dest->conn_flags)),
- atomic_read(&dest->weight),
- atomic_read(&dest->activeconns),
- atomic_read(&dest->inactconns));
-}
-static int ip_vs_get_info(char *buf, char **start, off_t offset, int length)
+/* Get the Nth entry in the two lists */
+static struct ip_vs_service *ip_vs_info_array(struct seq_file *seq, loff_t pos)
{
- int len=0;
- off_t pos=0;
- char temp[64], temp2[32];
+ struct ip_vs_iter *iter = seq->private;
int idx;
struct ip_vs_service *svc;
- struct ip_vs_dest *dest;
- struct list_head *l, *e, *p, *q;
-
- /*
- * Note: since the length of the buffer is usually the multiple
- * of 512, it is good to use fixed record of the divisor of 512,
- * so that records won't be truncated at buffer boundary.
- */
- pos = 192;
- if (pos > offset) {
- sprintf(temp,
- "IP Virtual Server version %d.%d.%d (size=%d)",
- NVERSION(IP_VS_VERSION_CODE), IP_VS_CONN_TAB_SIZE);
- len += sprintf(buf+len, "%-63s\n", temp);
- len += sprintf(buf+len, "%-63s\n",
- "Prot LocalAddress:Port Scheduler Flags");
- len += sprintf(buf+len, "%-63s\n",
- " -> RemoteAddress:Port Forward Weight ActiveConn InActConn");
- }
-
- read_lock_bh(&__ip_vs_svc_lock);
- /* print the service table hashed by <protocol,addr,port> */
+ /* look in hash by protocol */
for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) {
- l = &ip_vs_svc_table[idx];
- for (e=l->next; e!=l; e=e->next) {
- svc = list_entry(e, struct ip_vs_service, s_list);
- pos += 64;
- if (pos > offset) {
- if (svc->flags & IP_VS_SVC_F_PERSISTENT)
- sprintf(temp2, "persistent %d %08X",
- svc->timeout,
- ntohl(svc->netmask));
- else
- temp2[0] = '\0';
-
- sprintf(temp, "%s %08X:%04X %s %s",
- ip_vs_proto_name(svc->protocol),
- ntohl(svc->addr),
- ntohs(svc->port),
- svc->scheduler->name, temp2);
- len += sprintf(buf+len, "%-63s\n", temp);
- if (len >= length)
- goto done;
- }
-
- p = &svc->destinations;
- for (q=p->next; q!=p; q=q->next) {
- dest = list_entry(q, struct ip_vs_dest, n_list);
- pos += 64;
- if (pos <= offset)
- continue;
- sprintf_dest(temp, dest);
- len += sprintf(buf+len, "%-63s\n", temp);
- if (len >= length)
- goto done;
+ list_for_each_entry(svc, &ip_vs_svc_table[idx], s_list) {
+ if (pos-- == 0){
+ iter->table = ip_vs_svc_table;
+ iter->bucket = idx;
+ return svc;
}
}
}
- /* print the service table hashed by fwmark */
+ /* keep looking in fwmark */
for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) {
- l = &ip_vs_svc_fwm_table[idx];
- for (e=l->next; e!=l; e=e->next) {
- svc = list_entry(e, struct ip_vs_service, f_list);
- pos += 64;
- if (pos > offset) {
- if (svc->flags & IP_VS_SVC_F_PERSISTENT)
- sprintf(temp2, "persistent %d %08X",
- svc->timeout,
- ntohl(svc->netmask));
- else
- temp2[0] = '\0';
-
- sprintf(temp, "FWM %08X %s %s",
- svc->fwmark,
- svc->scheduler->name, temp2);
- len += sprintf(buf+len, "%-63s\n", temp);
- if (len >= length)
- goto done;
+ list_for_each_entry(svc, &ip_vs_svc_fwm_table[idx], f_list) {
+ if (pos-- == 0) {
+ iter->table = ip_vs_svc_fwm_table;
+ iter->bucket = idx;
+ return svc;
}
+ }
+ }
- p = &svc->destinations;
- for (q=p->next; q!=p; q=q->next) {
- dest = list_entry(q, struct ip_vs_dest, n_list);
- pos += 64;
- if (pos <= offset)
- continue;
- sprintf_dest(temp, dest);
- len += sprintf(buf+len, "%-63s\n", temp);
- if (len >= length)
- goto done;
+ return NULL;
+}
+
+static void *ip_vs_info_seq_start(struct seq_file *seq, loff_t *pos)
+{
+
+ read_lock_bh(&__ip_vs_svc_lock);
+ return *pos ? ip_vs_info_array(seq, *pos - 1) : SEQ_START_TOKEN;
+}
+
+
+static void *ip_vs_info_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ struct list_head *e;
+ struct ip_vs_iter *iter;
+ struct ip_vs_service *svc;
+
+ ++*pos;
+ if (v == SEQ_START_TOKEN)
+ return ip_vs_info_array(seq,0);
+
+ svc = v;
+ iter = seq->private;
+
+ if (iter->table == ip_vs_svc_table) {
+ /* next service in table hashed by protocol */
+ if ((e = svc->s_list.next) != &ip_vs_svc_table[iter->bucket])
+ return list_entry(e, struct ip_vs_service, s_list);
+
+
+ while (++iter->bucket < IP_VS_SVC_TAB_SIZE) {
+ list_for_each_entry(svc,&ip_vs_svc_table[iter->bucket],
+ s_list) {
+ return svc;
}
}
+
+ iter->table = ip_vs_svc_fwm_table;
+ iter->bucket = -1;
+ goto scan_fwmark;
}
- done:
+ /* next service in hashed by fwmark */
+ if ((e = svc->f_list.next) != &ip_vs_svc_fwm_table[iter->bucket])
+ return list_entry(e, struct ip_vs_service, f_list);
+
+ scan_fwmark:
+ while (++iter->bucket < IP_VS_SVC_TAB_SIZE) {
+ list_for_each_entry(svc, &ip_vs_svc_fwm_table[iter->bucket],
+ f_list)
+ return svc;
+ }
+
+ return NULL;
+}
+
+static void ip_vs_info_seq_stop(struct seq_file *seq, void *v)
+{
read_unlock_bh(&__ip_vs_svc_lock);
+}
+
- *start = buf+len-(pos-offset); /* Start of wanted data */
- len = pos-offset;
- if (len > length)
- len = length;
- if (len < 0)
- len = 0;
- return len;
+static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
+{
+ if (v == SEQ_START_TOKEN) {
+ seq_printf(seq,
+ "IP Virtual Server version %d.%d.%d (size=%d)\n",
+ NVERSION(IP_VS_VERSION_CODE), IP_VS_CONN_TAB_SIZE);
+ seq_puts(seq,
+ "Prot LocalAddress:Port Scheduler Flags\n");
+ seq_puts(seq,
+ " -> RemoteAddress:Port Forward Weight ActiveConn InActConn\n");
+ } else {
+ const struct ip_vs_service *svc = v;
+ const struct ip_vs_iter *iter = seq->private;
+ const struct ip_vs_dest *dest;
+
+ if (iter->table == ip_vs_svc_table)
+ seq_printf(seq, "%s %08X:%04X %s ",
+ ip_vs_proto_name(svc->protocol),
+ ntohl(svc->addr),
+ ntohs(svc->port),
+ svc->scheduler->name);
+ else
+ seq_printf(seq, "FWM %08X %s ",
+ svc->fwmark, svc->scheduler->name);
+
+ if (svc->flags & IP_VS_SVC_F_PERSISTENT)
+ seq_printf(seq, "persistent %d %08X\n",
+ svc->timeout,
+ ntohl(svc->netmask));
+ else
+ seq_putc(seq, '\n');
+
+ list_for_each_entry(dest, &svc->destinations, n_list) {
+ seq_printf(seq,
+ " -> %08X:%04X %-7s %-6d %-10d %-10d\n",
+ ntohl(dest->addr), ntohs(dest->port),
+ ip_vs_fwd_name(atomic_read(&dest->conn_flags)),
+ atomic_read(&dest->weight),
+ atomic_read(&dest->activeconns),
+ atomic_read(&dest->inactconns));
+ }
+ }
+ return 0;
}
+static struct seq_operations ip_vs_info_seq_ops = {
+ .start = ip_vs_info_seq_start,
+ .next = ip_vs_info_seq_next,
+ .stop = ip_vs_info_seq_stop,
+ .show = ip_vs_info_seq_show,
+};
+
+static int ip_vs_info_open(struct inode *inode, struct file *file)
+{
+ struct seq_file *seq;
+ int rc = -ENOMEM;
+ struct ip_vs_iter *s = kmalloc(sizeof(*s), GFP_KERNEL);
+
+ if (!s)
+ goto out;
+
+ rc = seq_open(file, &ip_vs_info_seq_ops);
+ if (rc)
+ goto out_kfree;
+
+ seq = file->private_data;
+ seq->private = s;
+ memset(s, 0, sizeof(*s));
+out:
+ return rc;
+out_kfree:
+ kfree(s);
+ goto out;
+}
+
+static struct file_operations ip_vs_info_fops = {
+ .owner = THIS_MODULE,
+ .open = ip_vs_info_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release_private,
+};
+
+#endif
struct ip_vs_stats ip_vs_stats;
-static int
-ip_vs_stats_get_info(char *buf, char **start, off_t offset, int length)
+#ifdef CONFIG_PROC_FS
+static int ip_vs_stats_show(struct seq_file *seq, void *v)
{
- int len=0;
- off_t pos=0;
- char temp[64];
-
- pos += 320;
- if (pos > offset) {
- len += sprintf(buf+len, "%-63s\n%-63s\n",
-/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */
- " Total Incoming Outgoing Incoming Outgoing",
- " Conns Packets Packets Bytes Bytes");
-
- spin_lock_bh(&ip_vs_stats.lock);
- sprintf(temp, "%8X %8X %8X %8X%08X %8X%08X",
- ip_vs_stats.conns,
- ip_vs_stats.inpkts,
- ip_vs_stats.outpkts,
- (__u32)(ip_vs_stats.inbytes>>32),
- (__u32)ip_vs_stats.inbytes,
- (__u32)(ip_vs_stats.outbytes>>32),
- (__u32)ip_vs_stats.outbytes);
- len += sprintf(buf+len, "%-62s\n\n", temp);
-
- len += sprintf(buf+len, "%-63s\n",
-/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */
- " Conns/s Pkts/s Pkts/s Bytes/s Bytes/s");
- sprintf(temp, "%8X %8X %8X %16X %16X",
+
+/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */
+ seq_puts(seq,
+ " Total Incoming Outgoing Incoming Outgoing\n");
+ seq_printf(seq,
+ " Conns Packets Packets Bytes Bytes\n");
+
+ spin_lock_bh(&ip_vs_stats.lock);
+ seq_printf(seq, "%8X %8X %8X %16LX %16LX\n\n", ip_vs_stats.conns,
+ ip_vs_stats.inpkts, ip_vs_stats.outpkts,
+ ip_vs_stats.inbytes, ip_vs_stats.outbytes);
+
+/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */
+ seq_puts(seq,
+ " Conns/s Pkts/s Pkts/s Bytes/s Bytes/s\n");
+ seq_printf(seq,"%8X %8X %8X %16X %16X\n",
ip_vs_stats.cps,
ip_vs_stats.inpps,
ip_vs_stats.outpps,
ip_vs_stats.inbps,
ip_vs_stats.outbps);
- len += sprintf(buf+len, "%-63s\n", temp);
+ spin_unlock_bh(&ip_vs_stats.lock);
- spin_unlock_bh(&ip_vs_stats.lock);
- }
+ return 0;
+}
- *start = buf+len-(pos-offset); /* Start of wanted data */
- len = pos-offset;
- if (len > length)
- len = length;
- if (len < 0)
- len = 0;
- return len;
+static int ip_vs_stats_seq_open(struct inode *inode, struct file *file)
+{
+ return single_open(file, ip_vs_stats_show, NULL);
}
+static struct file_operations ip_vs_stats_fops = {
+ .owner = THIS_MODULE,
+ .open = ip_vs_stats_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
+};
+
+#endif
/*
* Set timeout values for tcp tcpfin udp in the timeout_table.
@@ -1912,19 +1926,17 @@ ip_vs_copy_service(struct ip_vs_service_entry *dst, struct ip_vs_service *src)
static inline int
__ip_vs_get_service_entries(const struct ip_vs_get_services *get,
- struct ip_vs_get_services *uptr)
+ struct ip_vs_get_services __user *uptr)
{
int idx, count=0;
struct ip_vs_service *svc;
- struct list_head *l;
struct ip_vs_service_entry entry;
int ret = 0;
for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) {
- list_for_each (l, &ip_vs_svc_table[idx]) {
+ list_for_each_entry(svc, &ip_vs_svc_table[idx], s_list) {
if (count >= get->num_services)
goto out;
- svc = list_entry(l, struct ip_vs_service, s_list);
ip_vs_copy_service(&entry, svc);
if (copy_to_user(&uptr->entrytable[count],
&entry, sizeof(entry))) {
@@ -1936,10 +1948,9 @@ __ip_vs_get_service_entries(const struct ip_vs_get_services *get,
}
for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) {
- list_for_each (l, &ip_vs_svc_fwm_table[idx]) {
+ list_for_each_entry(svc, &ip_vs_svc_fwm_table[idx], f_list) {
if (count >= get->num_services)
goto out;
- svc = list_entry(l, struct ip_vs_service, f_list);
ip_vs_copy_service(&entry, svc);
if (copy_to_user(&uptr->entrytable[count],
&entry, sizeof(entry))) {
@@ -1955,7 +1966,7 @@ __ip_vs_get_service_entries(const struct ip_vs_get_services *get,
static inline int
__ip_vs_get_dest_entries(const struct ip_vs_get_dests *get,
- struct ip_vs_get_dests *uptr)
+ struct ip_vs_get_dests __user *uptr)
{
struct ip_vs_service *svc;
int ret = 0;
@@ -1968,14 +1979,12 @@ __ip_vs_get_dest_entries(const struct ip_vs_get_dests *get,
if (svc) {
int count = 0;
struct ip_vs_dest *dest;
- struct list_head *l, *e;
struct ip_vs_dest_entry entry;
- l = &svc->destinations;
- for (e=l->next; e!=l; e=e->next) {
+ list_for_each_entry(dest, &svc->destinations, n_list) {
if (count >= get->num_dests)
break;
- dest = list_entry(e, struct ip_vs_dest, n_list);
+
entry.addr = dest->addr;
entry.port = dest->port;
entry.conn_flags = atomic_read(&dest->conn_flags);
@@ -2034,7 +2043,7 @@ static unsigned char get_arglen[GET_CMDID(IP_VS_SO_GET_MAX)+1] = {
};
static int
-do_ip_vs_get_ctl(struct sock *sk, int cmd, void *user, int *len)
+do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
{
unsigned char arg[128];
int ret = 0;
@@ -2195,8 +2204,8 @@ int ip_vs_control_init(void)
return ret;
}
- proc_net_create("ip_vs", 0, ip_vs_get_info);
- proc_net_create("ip_vs_stats", 0, ip_vs_stats_get_info);
+ proc_net_fops_create("ip_vs", 0, &ip_vs_info_fops);
+ proc_net_fops_create("ip_vs_stats",0, &ip_vs_stats_fops);
ipv4_vs_table.sysctl_header =
register_sysctl_table(ipv4_vs_table.root_dir, 0);
diff --git a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c
index 3be60a13a048..1fcc770b2a4a 100644
--- a/net/ipv4/ipvs/ip_vs_lblc.c
+++ b/net/ipv4/ipvs/ip_vs_lblc.c
@@ -246,15 +246,12 @@ ip_vs_lblc_get(struct ip_vs_lblc_table *tbl, __u32 addr)
{
unsigned hash;
struct ip_vs_lblc_entry *en;
- struct list_head *l,*e;
hash = ip_vs_lblc_hashkey(addr);
- l = &tbl->bucket[hash];
read_lock(&tbl->lock);
- for (e=l->next; e!=l; e=e->next) {
- en = list_entry(e, struct ip_vs_lblc_entry, list);
+ list_for_each_entry(en, &tbl->bucket[hash], list) {
if (en->addr == addr) {
/* HIT */
read_unlock(&tbl->lock);
@@ -274,14 +271,11 @@ ip_vs_lblc_get(struct ip_vs_lblc_table *tbl, __u32 addr)
static void ip_vs_lblc_flush(struct ip_vs_lblc_table *tbl)
{
int i;
- struct list_head *l;
- struct ip_vs_lblc_entry *en;
+ struct ip_vs_lblc_entry *en, *nxt;
for (i=0; i<IP_VS_LBLC_TAB_SIZE; i++) {
write_lock(&tbl->lock);
- for (l=&tbl->bucket[i]; l->next!=l; ) {
- en = list_entry(l->next,
- struct ip_vs_lblc_entry, list);
+ list_for_each_entry_safe(en, nxt, &tbl->bucket[i], list) {
ip_vs_lblc_free(en);
atomic_dec(&tbl->entries);
}
@@ -294,21 +288,17 @@ static inline void ip_vs_lblc_full_check(struct ip_vs_lblc_table *tbl)
{
unsigned long now = jiffies;
int i, j;
- struct list_head *l, *e;
- struct ip_vs_lblc_entry *en;
+ struct ip_vs_lblc_entry *en, *nxt;
for (i=0, j=tbl->rover; i<IP_VS_LBLC_TAB_SIZE; i++) {
j = (j + 1) & IP_VS_LBLC_TAB_MASK;
- e = l = &tbl->bucket[j];
+
write_lock(&tbl->lock);
- while (e->next != l) {
- en = list_entry(e->next,
- struct ip_vs_lblc_entry, list);
- if ((now - en->lastuse) <
- sysctl_ip_vs_lblc_expiration) {
- e = e->next;
+ list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) {
+ if (time_before(now,
+ en->lastuse + sysctl_ip_vs_lblc_expiration))
continue;
- }
+
ip_vs_lblc_free(en);
atomic_dec(&tbl->entries);
}
@@ -335,8 +325,7 @@ static void ip_vs_lblc_check_expire(unsigned long data)
unsigned long now = jiffies;
int goal;
int i, j;
- struct list_head *l, *e;
- struct ip_vs_lblc_entry *en;
+ struct ip_vs_lblc_entry *en, *nxt;
tbl = (struct ip_vs_lblc_table *)data;
@@ -358,15 +347,12 @@ static void ip_vs_lblc_check_expire(unsigned long data)
for (i=0, j=tbl->rover; i<IP_VS_LBLC_TAB_SIZE; i++) {
j = (j + 1) & IP_VS_LBLC_TAB_MASK;
- e = l = &tbl->bucket[j];
+
write_lock(&tbl->lock);
- while (e->next != l) {
- en = list_entry(e->next,
- struct ip_vs_lblc_entry, list);
- if ((now - en->lastuse) < ENTRY_TIMEOUT) {
- e = e->next;
+ list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) {
+ if (time_before(now, en->lastuse + ENTRY_TIMEOUT))
continue;
- }
+
ip_vs_lblc_free(en);
atomic_dec(&tbl->entries);
goal--;
@@ -452,7 +438,6 @@ static int ip_vs_lblc_update_svc(struct ip_vs_service *svc)
static inline struct ip_vs_dest *
__ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
{
- register struct list_head *l, *e;
struct ip_vs_dest *dest, *least;
int loh, doh;
@@ -473,10 +458,7 @@ __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* The server with weight=0 is quiesced and will not receive any
* new connection.
*/
-
- l = &svc->destinations;
- for (e=l->next; e!=l; e=e->next) {
- least = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(least, &svc->destinations, n_list) {
if (least->flags & IP_VS_DEST_F_OVERLOAD)
continue;
if (atomic_read(&least->weight) > 0) {
@@ -491,9 +473,7 @@ __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* Find the destination with the least load.
*/
nextstage:
- for (e=e->next; e!=l; e=e->next) {
- dest = list_entry(e, struct ip_vs_dest, n_list);
-
+ list_for_each_entry(dest, &svc->destinations, n_list) {
if (dest->flags & IP_VS_DEST_F_OVERLOAD)
continue;
@@ -525,12 +505,9 @@ static inline int
is_overloaded(struct ip_vs_dest *dest, struct ip_vs_service *svc)
{
if (atomic_read(&dest->activeconns) > atomic_read(&dest->weight)) {
- register struct list_head *l, *e;
struct ip_vs_dest *d;
- l = &svc->destinations;
- for (e=l->next; e!=l; e=e->next) {
- d = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(d, &svc->destinations, n_list) {
if (atomic_read(&d->activeconns)*2
< atomic_read(&d->weight)) {
return 1;
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c
index bf449d48b3f0..f09cd84e75b0 100644
--- a/net/ipv4/ipvs/ip_vs_lblcr.c
+++ b/net/ipv4/ipvs/ip_vs_lblcr.c
@@ -432,15 +432,12 @@ ip_vs_lblcr_get(struct ip_vs_lblcr_table *tbl, __u32 addr)
{
unsigned hash;
struct ip_vs_lblcr_entry *en;
- struct list_head *l,*e;
hash = ip_vs_lblcr_hashkey(addr);
- l = &tbl->bucket[hash];
read_lock(&tbl->lock);
- for (e=l->next; e!=l; e=e->next) {
- en = list_entry(e, struct ip_vs_lblcr_entry, list);
+ list_for_each_entry(en, &tbl->bucket[hash], list) {
if (en->addr == addr) {
/* HIT */
read_unlock(&tbl->lock);
@@ -460,14 +457,11 @@ ip_vs_lblcr_get(struct ip_vs_lblcr_table *tbl, __u32 addr)
static void ip_vs_lblcr_flush(struct ip_vs_lblcr_table *tbl)
{
int i;
- struct list_head *l;
- struct ip_vs_lblcr_entry *en;
+ struct ip_vs_lblcr_entry *en, *nxt;
for (i=0; i<IP_VS_LBLCR_TAB_SIZE; i++) {
write_lock(&tbl->lock);
- for (l=&tbl->bucket[i]; l->next!=l; ) {
- en = list_entry(l->next,
- struct ip_vs_lblcr_entry, list);
+ list_for_each_entry_safe(en, nxt, &tbl->bucket[i], list) {
ip_vs_lblcr_free(en);
atomic_dec(&tbl->entries);
}
@@ -480,21 +474,17 @@ static inline void ip_vs_lblcr_full_check(struct ip_vs_lblcr_table *tbl)
{
unsigned long now = jiffies;
int i, j;
- struct list_head *l, *e;
- struct ip_vs_lblcr_entry *en;
+ struct ip_vs_lblcr_entry *en, *nxt;
for (i=0, j=tbl->rover; i<IP_VS_LBLCR_TAB_SIZE; i++) {
j = (j + 1) & IP_VS_LBLCR_TAB_MASK;
- e = l = &tbl->bucket[j];
+
write_lock(&tbl->lock);
- while (e->next != l) {
- en = list_entry(e->next,
- struct ip_vs_lblcr_entry, list);
- if ((now - en->lastuse) <
- sysctl_ip_vs_lblcr_expiration) {
- e = e->next;
+ list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) {
+ if (time_after(en->lastuse+sysctl_ip_vs_lblcr_expiration,
+ now))
continue;
- }
+
ip_vs_lblcr_free(en);
atomic_dec(&tbl->entries);
}
@@ -521,8 +511,7 @@ static void ip_vs_lblcr_check_expire(unsigned long data)
unsigned long now = jiffies;
int goal;
int i, j;
- struct list_head *l, *e;
- struct ip_vs_lblcr_entry *en;
+ struct ip_vs_lblcr_entry *en, *nxt;
tbl = (struct ip_vs_lblcr_table *)data;
@@ -544,15 +533,12 @@ static void ip_vs_lblcr_check_expire(unsigned long data)
for (i=0, j=tbl->rover; i<IP_VS_LBLCR_TAB_SIZE; i++) {
j = (j + 1) & IP_VS_LBLCR_TAB_MASK;
- e = l = &tbl->bucket[j];
+
write_lock(&tbl->lock);
- while (e->next != l) {
- en = list_entry(e->next,
- struct ip_vs_lblcr_entry, list);
- if ((now - en->lastuse) < ENTRY_TIMEOUT) {
- e = e->next;
+ list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) {
+ if (time_before(now, en->lastuse+ENTRY_TIMEOUT))
continue;
- }
+
ip_vs_lblcr_free(en);
atomic_dec(&tbl->entries);
goal--;
@@ -583,7 +569,6 @@ ip_vs_lblcr_getinfo(char *buffer, char **start, off_t offset, int length)
struct ip_vs_lblcr_table *tbl;
unsigned long now = jiffies;
int i;
- struct list_head *l, *e;
struct ip_vs_lblcr_entry *en;
tbl = lblcr_table_list;
@@ -593,13 +578,11 @@ ip_vs_lblcr_getinfo(char *buffer, char **start, off_t offset, int length)
len += size;
for (i=0; i<IP_VS_LBLCR_TAB_SIZE; i++) {
- l = &tbl->bucket[i];
read_lock_bh(&tbl->lock);
- for (e=l->next; e!=l; e=e->next) {
+ list_for_each_entry(en, &tbl->bucket[i], list) {
char tbuf[16];
struct ip_vs_dest_list *d;
- en = list_entry(e, struct ip_vs_lblcr_entry, list);
sprintf(tbuf, "%u.%u.%u.%u", NIPQUAD(en->addr));
size = sprintf(buffer+len, "%8lu %-16s ",
now-en->lastuse, tbuf);
@@ -708,7 +691,6 @@ static int ip_vs_lblcr_update_svc(struct ip_vs_service *svc)
static inline struct ip_vs_dest *
__ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
{
- register struct list_head *l, *e;
struct ip_vs_dest *dest, *least;
int loh, doh;
@@ -729,10 +711,7 @@ __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* The server with weight=0 is quiesced and will not receive any
* new connection.
*/
-
- l = &svc->destinations;
- for (e=l->next; e!=l; e=e->next) {
- least = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(least, &svc->destinations, n_list) {
if (least->flags & IP_VS_DEST_F_OVERLOAD)
continue;
@@ -748,8 +727,7 @@ __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* Find the destination with the least load.
*/
nextstage:
- for (e=e->next; e!=l; e=e->next) {
- dest = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(dest, &svc->destinations, n_list) {
if (dest->flags & IP_VS_DEST_F_OVERLOAD)
continue;
@@ -781,12 +759,9 @@ static inline int
is_overloaded(struct ip_vs_dest *dest, struct ip_vs_service *svc)
{
if (atomic_read(&dest->activeconns) > atomic_read(&dest->weight)) {
- register struct list_head *l, *e;
struct ip_vs_dest *d;
- l = &svc->destinations;
- for (e=l->next; e!=l; e=e->next) {
- d = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(d, &svc->destinations, n_list) {
if (atomic_read(&d->activeconns)*2
< atomic_read(&d->weight)) {
return 1;
diff --git a/net/ipv4/ipvs/ip_vs_lc.c b/net/ipv4/ipvs/ip_vs_lc.c
index 13b61dfd0590..f56088aca250 100644
--- a/net/ipv4/ipvs/ip_vs_lc.c
+++ b/net/ipv4/ipvs/ip_vs_lc.c
@@ -65,7 +65,6 @@ ip_vs_lc_dest_overhead(struct ip_vs_dest *dest)
static struct ip_vs_dest *
ip_vs_lc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
{
- struct list_head *l, *e;
struct ip_vs_dest *dest, *least;
unsigned int loh, doh;
@@ -80,9 +79,7 @@ ip_vs_lc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* served, but no new connection is assigned to the server.
*/
- l = &svc->destinations;
- for (e=l->next; e!=l; e=e->next) {
- least = list_entry (e, struct ip_vs_dest, n_list);
+ list_for_each_entry(least, &svc->destinations, n_list) {
if (least->flags & IP_VS_DEST_F_OVERLOAD)
continue;
if (atomic_read(&least->weight) > 0) {
@@ -96,8 +93,7 @@ ip_vs_lc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* Find the destination with the least load.
*/
nextstage:
- for (e=e->next; e!=l; e=e->next) {
- dest = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(dest, &svc->destinations, n_list) {
if ((dest->flags & IP_VS_DEST_F_OVERLOAD) ||
atomic_read(&dest->weight) == 0)
continue;
diff --git a/net/ipv4/ipvs/ip_vs_nq.c b/net/ipv4/ipvs/ip_vs_nq.c
index 23828fcd37d8..41731200f4ca 100644
--- a/net/ipv4/ipvs/ip_vs_nq.c
+++ b/net/ipv4/ipvs/ip_vs_nq.c
@@ -81,7 +81,6 @@ ip_vs_nq_dest_overhead(struct ip_vs_dest *dest)
static struct ip_vs_dest *
ip_vs_nq_schedule(struct ip_vs_service *svc, struct iphdr *iph)
{
- register struct list_head *l, *e;
struct ip_vs_dest *dest, *least;
unsigned int loh, doh;
@@ -100,9 +99,7 @@ ip_vs_nq_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* new connections.
*/
- l = &svc->destinations;
- for (e=l->next; e!=l; e=e->next) {
- least = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(least, &svc->destinations, n_list) {
if (!(least->flags & IP_VS_DEST_F_OVERLOAD) &&
atomic_read(&least->weight) > 0) {
loh = ip_vs_nq_dest_overhead(least);
@@ -120,8 +117,7 @@ ip_vs_nq_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* Find the destination with the least load.
*/
nextstage:
- for (e=e->next; e!=l; e=e->next) {
- dest = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(dest, &svc->destinations, n_list) {
if (dest->flags & IP_VS_DEST_F_OVERLOAD)
continue;
diff --git a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c
index 00c9107b8585..f5f3765c6a0b 100644
--- a/net/ipv4/ipvs/ip_vs_proto_tcp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c
@@ -479,22 +479,19 @@ static inline __u16 tcp_app_hashkey(__u16 port)
static int tcp_register_app(struct ip_vs_app *inc)
{
struct ip_vs_app *i;
- struct list_head *t, *p;
__u16 hash, port = inc->port;
int ret = 0;
hash = tcp_app_hashkey(port);
- t = &tcp_apps[hash];
spin_lock_bh(&tcp_app_lock);
- for (p = t->next; p != t; p = p->next) {
- i = list_entry(p, struct ip_vs_app, p_list);
+ list_for_each_entry(i, &tcp_apps[hash], p_list) {
if (i->port == port) {
ret = -EEXIST;
goto out;
}
}
- list_add(&inc->p_list, t);
+ list_add(&inc->p_list, &tcp_apps[hash]);
atomic_inc(&ip_vs_protocol_tcp.appcnt);
out:
@@ -516,7 +513,6 @@ tcp_unregister_app(struct ip_vs_app *inc)
static int
tcp_app_conn_bind(struct ip_vs_conn *cp)
{
- struct list_head *t, *p;
int hash;
struct ip_vs_app *inc;
int result = 0;
@@ -527,11 +523,9 @@ tcp_app_conn_bind(struct ip_vs_conn *cp)
/* Lookup application incarnations and bind the right one */
hash = tcp_app_hashkey(cp->vport);
- t = &tcp_apps[hash];
spin_lock(&tcp_app_lock);
- for (p = t->next; p != t; p = p->next) {
- inc = list_entry(p, struct ip_vs_app, p_list);
+ list_for_each_entry(inc, &tcp_apps[hash], p_list) {
if (inc->port == cp->vport) {
if (unlikely(!ip_vs_app_inc_get(inc)))
break;
diff --git a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c
index c2cad339364b..593c48b9efcc 100644
--- a/net/ipv4/ipvs/ip_vs_proto_udp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_udp.c
@@ -245,22 +245,20 @@ static inline __u16 udp_app_hashkey(__u16 port)
static int udp_register_app(struct ip_vs_app *inc)
{
struct ip_vs_app *i;
- struct list_head *t, *p;
__u16 hash, port = inc->port;
int ret = 0;
hash = udp_app_hashkey(port);
- t = &udp_apps[hash];
+
spin_lock_bh(&udp_app_lock);
- for (p = t->next; p != t; p = p->next) {
- i = list_entry(p, struct ip_vs_app, p_list);
+ list_for_each_entry(i, &udp_apps[hash], p_list) {
if (i->port == port) {
ret = -EEXIST;
goto out;
}
}
- list_add(&inc->p_list, t);
+ list_add(&inc->p_list, &udp_apps[hash]);
atomic_inc(&ip_vs_protocol_udp.appcnt);
out:
@@ -281,7 +279,6 @@ udp_unregister_app(struct ip_vs_app *inc)
static int udp_app_conn_bind(struct ip_vs_conn *cp)
{
- struct list_head *t, *p;
int hash;
struct ip_vs_app *inc;
int result = 0;
@@ -292,11 +289,9 @@ static int udp_app_conn_bind(struct ip_vs_conn *cp)
/* Lookup application incarnations and bind the right one */
hash = udp_app_hashkey(cp->vport);
- t = &udp_apps[hash];
spin_lock(&udp_app_lock);
- for (p = t->next; p != t; p = p->next) {
- inc = list_entry(p, struct ip_vs_app, p_list);
+ list_for_each_entry(inc, &udp_apps[hash], p_list) {
if (inc->port == cp->vport) {
if (unlikely(!ip_vs_app_inc_get(inc)))
break;
diff --git a/net/ipv4/ipvs/ip_vs_rr.c b/net/ipv4/ipvs/ip_vs_rr.c
index 6401222c2324..ce8202086a08 100644
--- a/net/ipv4/ipvs/ip_vs_rr.c
+++ b/net/ipv4/ipvs/ip_vs_rr.c
@@ -57,7 +57,7 @@ static int ip_vs_rr_update_svc(struct ip_vs_service *svc)
static struct ip_vs_dest *
ip_vs_rr_schedule(struct ip_vs_service *svc, struct iphdr *iph)
{
- register struct list_head *p, *q;
+ struct list_head *p, *q;
struct ip_vs_dest *dest;
IP_VS_DBG(6, "ip_vs_rr_schedule(): Scheduling...\n");
@@ -73,12 +73,12 @@ ip_vs_rr_schedule(struct ip_vs_service *svc, struct iphdr *iph)
continue;
}
+
dest = list_entry(q, struct ip_vs_dest, n_list);
if (!(dest->flags & IP_VS_DEST_F_OVERLOAD) &&
atomic_read(&dest->weight) > 0)
/* HIT */
goto out;
- q = q->next;
} while (q != p);
write_unlock(&svc->sched_lock);
return NULL;
diff --git a/net/ipv4/ipvs/ip_vs_sched.c b/net/ipv4/ipvs/ip_vs_sched.c
index 32c70b893882..06d19d66e256 100644
--- a/net/ipv4/ipvs/ip_vs_sched.c
+++ b/net/ipv4/ipvs/ip_vs_sched.c
@@ -106,18 +106,13 @@ int ip_vs_unbind_scheduler(struct ip_vs_service *svc)
static struct ip_vs_scheduler *ip_vs_sched_getbyname(const char *sched_name)
{
struct ip_vs_scheduler *sched;
- struct list_head *l, *e;
IP_VS_DBG(2, "ip_vs_sched_getbyname(): sched_name \"%s\"\n",
sched_name);
- l = &ip_vs_schedulers;
-
read_lock_bh(&__ip_vs_sched_lock);
- for (e=l->next; e!=l; e=e->next) {
- sched = list_entry(e, struct ip_vs_scheduler, n_list);
-
+ list_for_each_entry(sched, &ip_vs_schedulers, n_list) {
/*
* Test and get the modules atomically
*/
diff --git a/net/ipv4/ipvs/ip_vs_sed.c b/net/ipv4/ipvs/ip_vs_sed.c
index b0684065fef8..a57b455a422b 100644
--- a/net/ipv4/ipvs/ip_vs_sed.c
+++ b/net/ipv4/ipvs/ip_vs_sed.c
@@ -85,7 +85,6 @@ ip_vs_sed_dest_overhead(struct ip_vs_dest *dest)
static struct ip_vs_dest *
ip_vs_sed_schedule(struct ip_vs_service *svc, struct iphdr *iph)
{
- register struct list_head *l, *e;
struct ip_vs_dest *dest, *least;
unsigned int loh, doh;
@@ -104,9 +103,7 @@ ip_vs_sed_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* new connections.
*/
- l = &svc->destinations;
- for (e=l->next; e!=l; e=e->next) {
- least = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(least, &svc->destinations, n_list) {
if (!(least->flags & IP_VS_DEST_F_OVERLOAD) &&
atomic_read(&least->weight) > 0) {
loh = ip_vs_sed_dest_overhead(least);
@@ -119,9 +116,7 @@ ip_vs_sed_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* Find the destination with the least load.
*/
nextstage:
- for (e=e->next; e!=l; e=e->next) {
- dest = list_entry(e, struct ip_vs_dest, n_list);
-
+ list_for_each_entry(dest, &svc->destinations, n_list) {
if (dest->flags & IP_VS_DEST_F_OVERLOAD)
continue;
doh = ip_vs_sed_dest_overhead(dest);
diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c
index 02b7e01ba411..fcb7ec350a90 100644
--- a/net/ipv4/ipvs/ip_vs_sync.c
+++ b/net/ipv4/ipvs/ip_vs_sync.c
@@ -206,8 +206,8 @@ get_curr_sync_buff(unsigned long time)
struct ip_vs_sync_buff *sb;
spin_lock_bh(&curr_sb_lock);
- if (curr_sb &&
- (jiffies - curr_sb->firstuse > time || time == 0)) {
+ if (curr_sb && (time == 0 ||
+ time_before(jiffies - curr_sb->firstuse, time))) {
sb = curr_sb;
curr_sb = NULL;
} else
diff --git a/net/ipv4/ipvs/ip_vs_wlc.c b/net/ipv4/ipvs/ip_vs_wlc.c
index 9ba05f2ad458..1a0a46d44896 100644
--- a/net/ipv4/ipvs/ip_vs_wlc.c
+++ b/net/ipv4/ipvs/ip_vs_wlc.c
@@ -73,7 +73,6 @@ ip_vs_wlc_dest_overhead(struct ip_vs_dest *dest)
static struct ip_vs_dest *
ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
{
- register struct list_head *l, *e;
struct ip_vs_dest *dest, *least;
unsigned int loh, doh;
@@ -92,9 +91,7 @@ ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* new connections.
*/
- l = &svc->destinations;
- for (e=l->next; e!=l; e=e->next) {
- least = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(least, &svc->destinations, n_list) {
if (!(least->flags & IP_VS_DEST_F_OVERLOAD) &&
atomic_read(&least->weight) > 0) {
loh = ip_vs_wlc_dest_overhead(least);
@@ -107,9 +104,7 @@ ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph)
* Find the destination with the least load.
*/
nextstage:
- for (e=e->next; e!=l; e=e->next) {
- dest = list_entry(e, struct ip_vs_dest, n_list);
-
+ list_for_each_entry(dest, &svc->destinations, n_list) {
if (dest->flags & IP_VS_DEST_F_OVERLOAD)
continue;
doh = ip_vs_wlc_dest_overhead(dest);
diff --git a/net/ipv4/ipvs/ip_vs_wrr.c b/net/ipv4/ipvs/ip_vs_wrr.c
index 8dc38ca2158c..7ec189990b6d 100644
--- a/net/ipv4/ipvs/ip_vs_wrr.c
+++ b/net/ipv4/ipvs/ip_vs_wrr.c
@@ -56,25 +56,22 @@ static int gcd(int a, int b)
static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc)
{
- register struct list_head *l, *e;
struct ip_vs_dest *dest;
int weight;
int g = 1;
- l = &svc->destinations;
- for (e=l->next; e!=l; e=e->next) {
- dest = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(dest, &svc->destinations, n_list) {
weight = atomic_read(&dest->weight);
if (weight > 0) {
g = weight;
- break;
+ goto search_gcd;
}
}
- if (e == l)
- return g;
- for (e=e->next; e!=l; e=e->next) {
- dest = list_entry(e, struct ip_vs_dest, n_list);
+ return g;
+
+ search_gcd:
+ list_for_each_entry(dest, &svc->destinations, n_list) {
weight = atomic_read(&dest->weight);
if (weight > 0)
g = gcd(weight, g);
@@ -89,13 +86,10 @@ static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc)
*/
static int ip_vs_wrr_max_weight(struct ip_vs_service *svc)
{
- register struct list_head *l, *e;
struct ip_vs_dest *dest;
int weight = 0;
- l = &svc->destinations;
- for (e=l->next; e!=l; e=e->next) {
- dest = list_entry(e, struct ip_vs_dest, n_list);
+ list_for_each_entry(dest, &svc->destinations, n_list) {
if (atomic_read(&dest->weight) > weight)
weight = atomic_read(&dest->weight);
}
diff --git a/net/ipv4/netfilter/ip_nat_snmp_basic.c b/net/ipv4/netfilter/ip_nat_snmp_basic.c
index 0e3028dcb176..acf849290280 100644
--- a/net/ipv4/netfilter/ip_nat_snmp_basic.c
+++ b/net/ipv4/netfilter/ip_nat_snmp_basic.c
@@ -51,9 +51,9 @@
#include <linux/netfilter_ipv4/ip_nat.h>
#include <linux/netfilter_ipv4/ip_nat_helper.h>
#include <linux/ip.h>
+#include <net/checksum.h>
#include <net/udp.h>
#include <asm/uaccess.h>
-#include <asm/checksum.h>
MODULE_LICENSE("GPL");
MODULE_AUTHOR("James Morris <jmorris@intercode.com.au>");
diff --git a/net/ipv4/netfilter/ipt_physdev.c b/net/ipv4/netfilter/ipt_physdev.c
index 714fb0681813..8f5dadc8dc1a 100644
--- a/net/ipv4/netfilter/ipt_physdev.c
+++ b/net/ipv4/netfilter/ipt_physdev.c
@@ -23,7 +23,7 @@ match(const struct sk_buff *skb,
int i;
static const char nulldevname[IFNAMSIZ];
const struct ipt_physdev_info *info = matchinfo;
- unsigned long ret;
+ unsigned int ret;
const char *indev, *outdev;
struct nf_bridge_info *nf_bridge;
@@ -65,10 +65,10 @@ match(const struct sk_buff *skb,
if (!(info->bitmask & IPT_PHYSDEV_OP_IN))
goto match_outdev;
indev = nf_bridge->physindev ? nf_bridge->physindev->name : nulldevname;
- for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
- ret |= (((const unsigned long *)indev)[i]
- ^ ((const unsigned long *)info->physindev)[i])
- & ((const unsigned long *)info->in_mask)[i];
+ for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned int); i++) {
+ ret |= (((const unsigned int *)indev)[i]
+ ^ ((const unsigned int *)info->physindev)[i])
+ & ((const unsigned int *)info->in_mask)[i];
}
if ((ret == 0) ^ !(info->invert & IPT_PHYSDEV_OP_IN))
@@ -79,10 +79,10 @@ match_outdev:
return MATCH;
outdev = nf_bridge->physoutdev ?
nf_bridge->physoutdev->name : nulldevname;
- for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) {
- ret |= (((const unsigned long *)outdev)[i]
- ^ ((const unsigned long *)info->physoutdev)[i])
- & ((const unsigned long *)info->out_mask)[i];
+ for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned int); i++) {
+ ret |= (((const unsigned int *)outdev)[i]
+ ^ ((const unsigned int *)info->physoutdev)[i])
+ & ((const unsigned int *)info->out_mask)[i];
}
return (ret != 0) ^ !(info->invert & IPT_PHYSDEV_OP_OUT);
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index a9235cb9964f..7a77127456be 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -213,7 +213,7 @@ extern struct sock *tcp_v6_lookup(struct in6_addr *saddr, u16 sport,
int dif);
#endif
-static int tcpdiag_get_exact(struct sk_buff *in_skb, struct nlmsghdr *nlh)
+static int tcpdiag_get_exact(struct sk_buff *in_skb, const struct nlmsghdr *nlh)
{
int err;
struct sock *sk;
@@ -272,7 +272,7 @@ out:
return err;
}
-int bitstring_match(u32 *a1, u32 *a2, int bits)
+static int bitstring_match(const u32 *a1, const u32 *a2, int bits)
{
int words = bits >> 5;
@@ -299,12 +299,12 @@ int bitstring_match(u32 *a1, u32 *a2, int bits)
}
-int tcpdiag_bc_run(char *bc, int len, struct sock *sk)
+static int tcpdiag_bc_run(const void *bc, int len, struct sock *sk)
{
while (len > 0) {
int yes = 1;
struct inet_opt *inet = inet_sk(sk);
- struct tcpdiag_bc_op *op = (struct tcpdiag_bc_op*)bc;
+ const struct tcpdiag_bc_op *op = bc;
switch (op->code) {
case TCPDIAG_BC_NOP:
@@ -385,10 +385,10 @@ int tcpdiag_bc_run(char *bc, int len, struct sock *sk)
return (len == 0);
}
-int valid_cc(char *bc, int len, int cc)
+static int valid_cc(const void *bc, int len, int cc)
{
while (len >= 0) {
- struct tcpdiag_bc_op *op = (struct tcpdiag_bc_op*)bc;
+ const struct tcpdiag_bc_op *op = bc;
if (cc > len)
return 0;
@@ -402,9 +402,9 @@ int valid_cc(char *bc, int len, int cc)
return 0;
}
-int tcpdiag_bc_audit(char *bytecode, int bytecode_len)
+static int tcpdiag_bc_audit(const void *bytecode, int bytecode_len)
{
- char *bc = bytecode;
+ const unsigned char *bc = bytecode;
int len = bytecode_len;
while (len > 0) {
@@ -442,7 +442,7 @@ int tcpdiag_bc_audit(char *bytecode, int bytecode_len)
}
-int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb)
+static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb)
{
int i, num;
int s_i, s_num;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 863fd9cf0485..6fe13db937fa 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -384,6 +384,7 @@ static void udp_flush_pending_frames(struct sock *sk)
struct udp_opt *up = udp_sk(sk);
if (up->pending) {
+ up->len = 0;
up->pending = 0;
ip_flush_pending_frames(sk);
}
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index a7086a23b262..2ee6d5e55734 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -704,6 +704,7 @@ static void udp_v6_flush_pending_frames(struct sock *sk)
struct udp_opt *up = udp_sk(sk);
if (up->pending) {
+ up->len = 0;
up->pending = 0;
ip6_flush_pending_frames(sk);
}
diff --git a/net/irda/discovery.c b/net/irda/discovery.c
index ec95289016be..d200fec00303 100644
--- a/net/irda/discovery.c
+++ b/net/irda/discovery.c
@@ -32,6 +32,7 @@
#include <linux/string.h>
#include <linux/socket.h>
+#include <linux/seq_file.h>
#include <net/irda/irda.h>
#include <net/irda/irlmp.h>
@@ -349,70 +350,131 @@ __u32 irlmp_find_device(hashbin_t *cachelog, char *name, __u32 *saddr)
return 0;
}
-/*
- * Function proc_discovery_read (buf, start, offset, len, unused)
- *
- * Print discovery information in /proc file system
- *
- */
-int discovery_proc_read(char *buf, char **start, off_t offset, int length,
- int unused)
-{
- discovery_t *discovery;
+#ifdef CONFIG_PROC_FS
+struct discovery_iter_state {
unsigned long flags;
- hashbin_t *cachelog = irlmp->cachelog;
- int len = 0;
+};
- if (!irlmp)
- return len;
+static inline discovery_t *discovery_seq_idx(loff_t pos)
- len = sprintf(buf, "IrLMP: Discovery log:\n\n");
-
- spin_lock_irqsave(&cachelog->hb_spinlock, flags);
+{
+ discovery_t *discovery;
- discovery = (discovery_t *) hashbin_get_first(cachelog);
- while (( discovery != NULL) && (len < length)) {
- len += sprintf(buf+len, "nickname: %s,", discovery->data.info);
+ for (discovery = (discovery_t *) hashbin_get_first(irlmp->cachelog);
+ discovery != NULL;
+ discovery = (discovery_t *) hashbin_get_next(irlmp->cachelog)) {
+ if (pos-- == 0)
+ break;
+ }
- len += sprintf(buf+len, " hint: 0x%02x%02x",
- discovery->data.hints[0],
- discovery->data.hints[1]);
+ return discovery;
+}
+
+static void *discovery_seq_start(struct seq_file *seq, loff_t *pos)
+{
+ struct discovery_iter_state *iter = seq->private;
+
+ spin_lock_irqsave(&irlmp->cachelog->hb_spinlock, iter->flags);
+ return *pos ? discovery_seq_idx(*pos - 1) : SEQ_START_TOKEN;
+}
+
+static void *discovery_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ ++*pos;
+ return (v == SEQ_START_TOKEN)
+ ? (void *) hashbin_get_first(irlmp->cachelog)
+ : (void *) hashbin_get_next(irlmp->cachelog);
+}
+
+static void discovery_seq_stop(struct seq_file *seq, void *v)
+{
+ struct discovery_iter_state *iter = seq->private;
+ spin_unlock_irqrestore(&irlmp->cachelog->hb_spinlock, iter->flags);
+}
+
+static int discovery_seq_show(struct seq_file *seq, void *v)
+{
+ if (v == SEQ_START_TOKEN)
+ seq_puts(seq, "IrLMP: Discovery log:\n\n");
+ else {
+ const discovery_t *discovery = v;
+
+ seq_printf(seq, "nickname: %s, hint: 0x%02x%02x",
+ discovery->data.info,
+ discovery->data.hints[0],
+ discovery->data.hints[1]);
#if 0
if ( discovery->data.hints[0] & HINT_PNP)
- len += sprintf( buf+len, "PnP Compatible ");
+ seq_puts(seq, "PnP Compatible ");
if ( discovery->data.hints[0] & HINT_PDA)
- len += sprintf( buf+len, "PDA/Palmtop ");
+ seq_puts(seq, "PDA/Palmtop ");
if ( discovery->data.hints[0] & HINT_COMPUTER)
- len += sprintf( buf+len, "Computer ");
+ seq_puts(seq, "Computer ");
if ( discovery->data.hints[0] & HINT_PRINTER)
- len += sprintf( buf+len, "Printer ");
+ seq_puts(seq, "Printer ");
if ( discovery->data.hints[0] & HINT_MODEM)
- len += sprintf( buf+len, "Modem ");
+ seq_puts(seq, "Modem ");
if ( discovery->data.hints[0] & HINT_FAX)
- len += sprintf( buf+len, "Fax ");
+ seq_puts(seq, "Fax ");
if ( discovery->data.hints[0] & HINT_LAN)
- len += sprintf( buf+len, "LAN Access ");
+ seq_puts(seq, "LAN Access ");
if ( discovery->data.hints[1] & HINT_TELEPHONY)
- len += sprintf( buf+len, "Telephony ");
+ seq_puts(seq, "Telephony ");
if ( discovery->data.hints[1] & HINT_FILE_SERVER)
- len += sprintf( buf+len, "File Server ");
+ seq_puts(seq, "File Server ");
if ( discovery->data.hints[1] & HINT_COMM)
- len += sprintf( buf+len, "IrCOMM ");
+ seq_puts(seq, "IrCOMM ");
if ( discovery->data.hints[1] & HINT_OBEX)
- len += sprintf( buf+len, "IrOBEX ");
+ seq_puts(seq, "IrOBEX ");
#endif
- len += sprintf(buf+len, ", saddr: 0x%08x",
- discovery->data.saddr);
-
- len += sprintf(buf+len, ", daddr: 0x%08x\n",
+ seq_printf(seq,", saddr: 0x%08x, daddr: 0x%08x\n\n",
+ discovery->data.saddr,
discovery->data.daddr);
- len += sprintf(buf+len, "\n");
-
- discovery = (discovery_t *) hashbin_get_next(cachelog);
+ seq_putc(seq, '\n');
}
- spin_unlock_irqrestore(&cachelog->hb_spinlock, flags);
+ return 0;
+}
- return len;
+static struct seq_operations discovery_seq_ops = {
+ .start = discovery_seq_start,
+ .next = discovery_seq_next,
+ .stop = discovery_seq_stop,
+ .show = discovery_seq_show,
+};
+
+static int discovery_seq_open(struct inode *inode, struct file *file)
+{
+ struct seq_file *seq;
+ int rc = -ENOMEM;
+ struct discovery_iter_state *s;
+
+ ASSERT(irlmp != NULL, return -EINVAL;);
+
+ s = kmalloc(sizeof(*s), GFP_KERNEL);
+ if (!s)
+ goto out;
+
+ rc = seq_open(file, &discovery_seq_ops);
+ if (rc)
+ goto out_kfree;
+
+ seq = file->private_data;
+ seq->private = s;
+ memset(s, 0, sizeof(*s));
+out:
+ return rc;
+out_kfree:
+ kfree(s);
+ goto out;
}
+
+struct file_operations discovery_seq_fops = {
+ .owner = THIS_MODULE,
+ .open = discovery_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release_private,
+};
+#endif
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c
index 552a105d7a9c..431aef2c6799 100644
--- a/net/irda/ircomm/ircomm_core.c
+++ b/net/irda/ircomm/ircomm_core.c
@@ -33,6 +33,7 @@
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
#include <linux/init.h>
#include <net/irda/irda.h>
@@ -53,9 +54,16 @@ static void ircomm_control_indication(struct ircomm_cb *self,
struct sk_buff *skb, int clen);
#ifdef CONFIG_PROC_FS
-static int ircomm_proc_read(char *buf, char **start, off_t offset, int len);
-
extern struct proc_dir_entry *proc_irda;
+static int ircomm_seq_open(struct inode *, struct file *);
+
+static struct file_operations ircomm_proc_fops = {
+ .owner = THIS_MODULE,
+ .open = ircomm_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release_private,
+};
#endif /* CONFIG_PROC_FS */
hashbin_t *ircomm = NULL;
@@ -69,7 +77,11 @@ int __init ircomm_init(void)
}
#ifdef CONFIG_PROC_FS
- create_proc_info_entry("ircomm", 0, proc_irda, ircomm_proc_read);
+ { struct proc_dir_entry *ent;
+ ent = create_proc_entry("ircomm", 0, proc_irda);
+ if (ent)
+ ent->proc_fops = &ircomm_proc_fops;
+ }
#endif /* CONFIG_PROC_FS */
MESSAGE("IrCOMM protocol (Dag Brattli)\n");
@@ -496,49 +508,98 @@ void ircomm_flow_request(struct ircomm_cb *self, LOCAL_FLOW flow)
EXPORT_SYMBOL(ircomm_flow_request);
#ifdef CONFIG_PROC_FS
-/*
- * Function ircomm_proc_read (buf, start, offset, len, unused)
- *
- *
- *
- */
-int ircomm_proc_read(char *buf, char **start, off_t offset, int len)
-{
- struct ircomm_cb *self;
+struct ircomm_iter_state {
unsigned long flags;
-
- len = 0;
-
- spin_lock_irqsave(&ircomm->hb_spinlock, flags);
-
- self = (struct ircomm_cb *) hashbin_get_first(ircomm);
- while (self != NULL) {
- ASSERT(self->magic == IRCOMM_MAGIC, break;);
-
- if(self->line < 0x10)
- len += sprintf(buf+len, "ircomm%d", self->line);
- else
- len += sprintf(buf+len, "irlpt%d", self->line - 0x10);
- len += sprintf(buf+len, " state: %s, ",
- ircomm_state[ self->state]);
- len += sprintf(buf+len,
- "slsap_sel: %#02x, dlsap_sel: %#02x, mode:",
- self->slsap_sel, self->dlsap_sel);
- if(self->service_type & IRCOMM_3_WIRE_RAW)
- len += sprintf(buf+len, " 3-wire-raw");
- if(self->service_type & IRCOMM_3_WIRE)
- len += sprintf(buf+len, " 3-wire");
- if(self->service_type & IRCOMM_9_WIRE)
- len += sprintf(buf+len, " 9-wire");
- if(self->service_type & IRCOMM_CENTRONICS)
- len += sprintf(buf+len, " Centronics");
- len += sprintf(buf+len, "\n");
-
- self = (struct ircomm_cb *) hashbin_get_next(ircomm);
- }
- spin_unlock_irqrestore(&ircomm->hb_spinlock, flags);
-
- return len;
+};
+
+static void *ircomm_seq_start(struct seq_file *seq, loff_t *pos)
+{
+ struct ircomm_iter_state *iter = seq->private;
+ struct ircomm_cb *self;
+ loff_t off = 0;
+
+ spin_lock_irqsave(&ircomm->hb_spinlock, iter->flags);
+
+ for (self = (struct ircomm_cb *) hashbin_get_first(ircomm);
+ self != NULL;
+ self = (struct ircomm_cb *) hashbin_get_next(ircomm)) {
+ if (off++ == *pos)
+ break;
+
+ }
+ return self;
+}
+
+static void *ircomm_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ ++*pos;
+
+ return (void *) hashbin_get_next(ircomm);
+}
+
+static void ircomm_seq_stop(struct seq_file *seq, void *v)
+{
+ struct ircomm_iter_state *iter = seq->private;
+ spin_unlock_irqrestore(&ircomm->hb_spinlock, iter->flags);
+}
+
+static int ircomm_seq_show(struct seq_file *seq, void *v)
+{
+ const struct ircomm_cb *self = v;
+
+ ASSERT(self->magic == IRCOMM_MAGIC, return -EINVAL; );
+
+ if(self->line < 0x10)
+ seq_printf(seq, "ircomm%d", self->line);
+ else
+ seq_printf(seq, "irlpt%d", self->line - 0x10);
+
+ seq_printf(seq,
+ " state: %s, slsap_sel: %#02x, dlsap_sel: %#02x, mode:",
+ ircomm_state[ self->state],
+ self->slsap_sel, self->dlsap_sel);
+
+ if(self->service_type & IRCOMM_3_WIRE_RAW)
+ seq_printf(seq, " 3-wire-raw");
+ if(self->service_type & IRCOMM_3_WIRE)
+ seq_printf(seq, " 3-wire");
+ if(self->service_type & IRCOMM_9_WIRE)
+ seq_printf(seq, " 9-wire");
+ if(self->service_type & IRCOMM_CENTRONICS)
+ seq_printf(seq, " Centronics");
+ seq_putc(seq, '\n');
+
+ return 0;
+}
+
+static struct seq_operations ircomm_seq_ops = {
+ .start = ircomm_seq_start,
+ .next = ircomm_seq_next,
+ .stop = ircomm_seq_stop,
+ .show = ircomm_seq_show,
+};
+
+static int ircomm_seq_open(struct inode *inode, struct file *file)
+{
+ struct seq_file *seq;
+ int rc = -ENOMEM;
+ struct ircomm_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL);
+
+ if (!s)
+ goto out;
+
+ rc = seq_open(file, &ircomm_seq_ops);
+ if (rc)
+ goto out_kfree;
+
+ seq = file->private_data;
+ seq->private = s;
+ memset(s, 0, sizeof(*s));
+out:
+ return rc;
+out_kfree:
+ kfree(s);
+ goto out;
}
#endif /* CONFIG_PROC_FS */
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index 0cc455440fc1..a2d2f87b5bbf 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -29,6 +29,7 @@
#include <linux/skbuff.h>
#include <linux/string.h>
#include <linux/init.h>
+#include <linux/seq_file.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
@@ -970,35 +971,67 @@ void iriap_watchdog_timer_expired(void *data)
#ifdef CONFIG_PROC_FS
-static char *ias_value_types[] = {
+static const char *ias_value_types[] = {
"IAS_MISSING",
"IAS_INTEGER",
"IAS_OCT_SEQ",
"IAS_STRING"
};
-int irias_proc_read(char *buf, char **start, off_t offset, int len)
+struct irias_iter_state {
+ unsigned long flags;
+};
+
+static inline struct ias_object *irias_seq_idx(loff_t pos)
{
struct ias_object *obj;
- struct ias_attrib *attrib;
- unsigned long flags;
- ASSERT( irias_objects != NULL, return 0;);
+ for (obj = (struct ias_object *) hashbin_get_first(irias_objects);
+ obj; obj = (struct ias_object *) hashbin_get_next(irias_objects)) {
+ if (pos-- == 0)
+ break;
+ }
+
+ return obj;
+}
+
+static void *irias_seq_start(struct seq_file *seq, loff_t *pos)
+{
+ struct irias_iter_state *iter = seq->private;
+
+ spin_lock_irqsave(&irias_objects->hb_spinlock, iter->flags);
+
+ return *pos ? irias_seq_idx(*pos - 1) : SEQ_START_TOKEN;
+}
+
+static void *irias_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ ++*pos;
+
+ return (v == SEQ_START_TOKEN)
+ ? (void *) hashbin_get_first(irias_objects)
+ : (void *) hashbin_get_next(irias_objects);
+}
- len = 0;
+static void irias_seq_stop(struct seq_file *seq, void *v)
+{
+ struct irias_iter_state *iter = seq->private;
- len += sprintf(buf+len, "LM-IAS Objects:\n");
+ spin_unlock_irqrestore(&irias_objects->hb_spinlock, iter->flags);
+}
- spin_lock_irqsave(&irias_objects->hb_spinlock, flags);
+static int irias_seq_show(struct seq_file *seq, void *v)
+{
+ if (v == SEQ_START_TOKEN)
+ seq_puts(seq, "LM-IAS Objects:\n");
+ else {
+ struct ias_object *obj = v;
+ struct ias_attrib *attrib;
- /* List all irias_objects */
- obj = (struct ias_object *) hashbin_get_first(irias_objects);
- while ( obj != NULL) {
- ASSERT(obj->magic == IAS_OBJECT_MAGIC, return 0;);
+ ASSERT(obj->magic == IAS_OBJECT_MAGIC, return -EINVAL;);
- len += sprintf(buf+len, "name: %s, ", obj->name);
- len += sprintf(buf+len, "id=%d", obj->id);
- len += sprintf(buf+len, "\n");
+ seq_printf(seq, "name: %s, id=%d\n",
+ obj->name, obj->id);
/* Careful for priority inversions here !
* All other uses of attrib spinlock are independent of
@@ -1006,48 +1039,83 @@ int irias_proc_read(char *buf, char **start, off_t offset, int len)
spin_lock(&obj->attribs->hb_spinlock);
/* List all attributes for this object */
- attrib = (struct ias_attrib *)
- hashbin_get_first(obj->attribs);
- while (attrib != NULL) {
- ASSERT(attrib->magic == IAS_ATTRIB_MAGIC, return 0;);
+ for (attrib = (struct ias_attrib *) hashbin_get_first(obj->attribs);
+ attrib != NULL;
+ attrib = (struct ias_attrib *) hashbin_get_next(obj->attribs)) {
+
+ ASSERT(attrib->magic == IAS_ATTRIB_MAGIC, break; );
- len += sprintf(buf+len, " - Attribute name: \"%s\", ",
- attrib->name);
- len += sprintf(buf+len, "value[%s]: ",
- ias_value_types[attrib->value->type]);
+ seq_printf(seq, " - Attribute name: \"%s\", ",
+ attrib->name);
+ seq_printf(seq, "value[%s]: ",
+ ias_value_types[attrib->value->type]);
switch (attrib->value->type) {
case IAS_INTEGER:
- len += sprintf(buf+len, "%d\n",
- attrib->value->t.integer);
+ seq_printf(seq, "%d\n",
+ attrib->value->t.integer);
break;
case IAS_STRING:
- len += sprintf(buf+len, "\"%s\"\n",
- attrib->value->t.string);
+ seq_printf(seq, "\"%s\"\n",
+ attrib->value->t.string);
break;
case IAS_OCT_SEQ:
- len += sprintf(buf+len, "octet sequence (%d bytes)\n", attrib->value->len);
+ seq_printf(seq, "octet sequence (%d bytes)\n",
+ attrib->value->len);
break;
case IAS_MISSING:
- len += sprintf(buf+len, "missing\n");
+ seq_puts(seq, "missing\n");
break;
default:
- IRDA_DEBUG(0, "%s(), Unknown value type!\n",
- __FUNCTION__);
- return -1;
+ seq_printf(seq, "type %d?\n",
+ attrib->value->type);
}
- len += sprintf(buf+len, "\n");
+ seq_putc(seq, '\n');
- attrib = (struct ias_attrib *)
- hashbin_get_next(obj->attribs);
}
spin_unlock(&obj->attribs->hb_spinlock);
-
- obj = (struct ias_object *) hashbin_get_next(irias_objects);
}
- spin_unlock_irqrestore(&irias_objects->hb_spinlock, flags);
- return len;
+ return 0;
}
+static struct seq_operations irias_seq_ops = {
+ .start = irias_seq_start,
+ .next = irias_seq_next,
+ .stop = irias_seq_stop,
+ .show = irias_seq_show,
+};
+
+static int irias_seq_open(struct inode *inode, struct file *file)
+{
+ struct seq_file *seq;
+ int rc = -ENOMEM;
+ struct irias_iter_state *s;
+
+ ASSERT( irias_objects != NULL, return -EINVAL;);
+ s = kmalloc(sizeof(*s), GFP_KERNEL);
+ if (!s)
+ goto out;
+
+ rc = seq_open(file, &irias_seq_ops);
+ if (rc)
+ goto out_kfree;
+ seq = file->private_data;
+ seq->private = s;
+ memset(s, 0, sizeof(*s));
+out:
+ return rc;
+out_kfree:
+ kfree(s);
+ goto out;
+}
+
+struct file_operations irias_seq_fops = {
+ .owner = THIS_MODULE,
+ .open = irias_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release_private,
+};
+
#endif /* PROC_FS */
diff --git a/net/irda/irlap.c b/net/irda/irlap.c
index d2c9a9b494bd..743b758613da 100644
--- a/net/irda/irlap.c
+++ b/net/irda/irlap.c
@@ -37,6 +37,7 @@
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/random.h>
+#include <linux/seq_file.h>
#include <net/irda/irda.h>
#include <net/irda/irda_device.h>
@@ -72,11 +73,6 @@ static char *lap_reasons[] = {
};
#endif /* CONFIG_IRDA_DEBUG */
-#ifdef CONFIG_PROC_FS
-int irlap_proc_read(char *, char **, off_t, int);
-
-#endif /* CONFIG_PROC_FS */
-
int __init irlap_init(void)
{
/* Check if the compiler did its job properly.
@@ -1096,100 +1092,163 @@ void irlap_apply_connection_parameters(struct irlap_cb *self, int now)
}
#ifdef CONFIG_PROC_FS
-/*
- * Function irlap_proc_read (buf, start, offset, len, unused)
- *
- * Give some info to the /proc file system
- *
- */
-int irlap_proc_read(char *buf, char **start, off_t offset, int len)
-{
- struct irlap_cb *self;
+struct irlap_iter_state {
+ int id;
unsigned long flags;
- int i = 0;
+};
- spin_lock_irqsave(&irlap->hb_spinlock, flags);
+static void *irlap_seq_start(struct seq_file *seq, loff_t *pos)
+{
+ struct irlap_iter_state *iter = seq->private;
+ struct irlap_cb *self;
- len = 0;
+ /* Protect our access to the tsap list */
+ spin_lock_irqsave(&irlap->hb_spinlock, iter->flags);
+ iter->id = 0;
- self = (struct irlap_cb *) hashbin_get_first(irlap);
- while (self != NULL) {
- ASSERT(self != NULL, break;);
- ASSERT(self->magic == LAP_MAGIC, break;);
+ for (self = (struct irlap_cb *) hashbin_get_first(irlap);
+ self; self = (struct irlap_cb *) hashbin_get_next(irlap)) {
+ if (iter->id == *pos)
+ break;
+ ++iter->id;
+ }
+
+ return self;
+}
- len += sprintf(buf+len, "irlap%d ", i++);
- len += sprintf(buf+len, "state: %s\n",
- irlap_state[self->state]);
+static void *irlap_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ struct irlap_iter_state *iter = seq->private;
- len += sprintf(buf+len, " device name: %s, ",
- (self->netdev) ? self->netdev->name : "bug");
- len += sprintf(buf+len, "hardware name: %s\n", self->hw_name);
+ ++*pos;
+ ++iter->id;
+ return (void *) hashbin_get_next(irlap);
+}
- len += sprintf(buf+len, " caddr: %#02x, ", self->caddr);
- len += sprintf(buf+len, "saddr: %#08x, ", self->saddr);
- len += sprintf(buf+len, "daddr: %#08x\n", self->daddr);
+static void irlap_seq_stop(struct seq_file *seq, void *v)
+{
+ struct irlap_iter_state *iter = seq->private;
+ spin_unlock_irqrestore(&irlap->hb_spinlock, iter->flags);
+}
- len += sprintf(buf+len, " win size: %d, ",
- self->window_size);
- len += sprintf(buf+len, "win: %d, ", self->window);
+static int irlap_seq_show(struct seq_file *seq, void *v)
+{
+ const struct irlap_iter_state *iter = seq->private;
+ const struct irlap_cb *self = v;
+
+ ASSERT(self->magic == LAP_MAGIC, return -EINVAL;);
+
+ seq_printf(seq, "irlap%d ", iter->id);
+ seq_printf(seq, "state: %s\n",
+ irlap_state[self->state]);
+
+ seq_printf(seq, " device name: %s, ",
+ (self->netdev) ? self->netdev->name : "bug");
+ seq_printf(seq, "hardware name: %s\n", self->hw_name);
+
+ seq_printf(seq, " caddr: %#02x, ", self->caddr);
+ seq_printf(seq, "saddr: %#08x, ", self->saddr);
+ seq_printf(seq, "daddr: %#08x\n", self->daddr);
+
+ seq_printf(seq, " win size: %d, ",
+ self->window_size);
+ seq_printf(seq, "win: %d, ", self->window);
#ifdef CONFIG_IRDA_DYNAMIC_WINDOW
- len += sprintf(buf+len, "line capacity: %d, ",
- self->line_capacity);
- len += sprintf(buf+len, "bytes left: %d\n", self->bytes_left);
+ seq_printf(seq, "line capacity: %d, ",
+ self->line_capacity);
+ seq_printf(seq, "bytes left: %d\n", self->bytes_left);
#endif /* CONFIG_IRDA_DYNAMIC_WINDOW */
- len += sprintf(buf+len, " tx queue len: %d ",
- skb_queue_len(&self->txq));
- len += sprintf(buf+len, "win queue len: %d ",
- skb_queue_len(&self->wx_list));
- len += sprintf(buf+len, "rbusy: %s", self->remote_busy ?
- "TRUE" : "FALSE");
- len += sprintf(buf+len, " mbusy: %s\n", self->media_busy ?
- "TRUE" : "FALSE");
-
- len += sprintf(buf+len, " retrans: %d ", self->retry_count);
- len += sprintf(buf+len, "vs: %d ", self->vs);
- len += sprintf(buf+len, "vr: %d ", self->vr);
- len += sprintf(buf+len, "va: %d\n", self->va);
-
- len += sprintf(buf+len, " qos\tbps\tmaxtt\tdsize\twinsize\taddbofs\tmintt\tldisc\tcomp\n");
-
- len += sprintf(buf+len, " tx\t%d\t",
- self->qos_tx.baud_rate.value);
- len += sprintf(buf+len, "%d\t",
- self->qos_tx.max_turn_time.value);
- len += sprintf(buf+len, "%d\t",
- self->qos_tx.data_size.value);
- len += sprintf(buf+len, "%d\t",
- self->qos_tx.window_size.value);
- len += sprintf(buf+len, "%d\t",
- self->qos_tx.additional_bofs.value);
- len += sprintf(buf+len, "%d\t",
- self->qos_tx.min_turn_time.value);
- len += sprintf(buf+len, "%d\t",
- self->qos_tx.link_disc_time.value);
- len += sprintf(buf+len, "\n");
-
- len += sprintf(buf+len, " rx\t%d\t",
- self->qos_rx.baud_rate.value);
- len += sprintf(buf+len, "%d\t",
- self->qos_rx.max_turn_time.value);
- len += sprintf(buf+len, "%d\t",
- self->qos_rx.data_size.value);
- len += sprintf(buf+len, "%d\t",
- self->qos_rx.window_size.value);
- len += sprintf(buf+len, "%d\t",
- self->qos_rx.additional_bofs.value);
- len += sprintf(buf+len, "%d\t",
- self->qos_rx.min_turn_time.value);
- len += sprintf(buf+len, "%d\t",
- self->qos_rx.link_disc_time.value);
- len += sprintf(buf+len, "\n");
-
- self = (struct irlap_cb *) hashbin_get_next(irlap);
+ seq_printf(seq, " tx queue len: %d ",
+ skb_queue_len(&self->txq));
+ seq_printf(seq, "win queue len: %d ",
+ skb_queue_len(&self->wx_list));
+ seq_printf(seq, "rbusy: %s", self->remote_busy ?
+ "TRUE" : "FALSE");
+ seq_printf(seq, " mbusy: %s\n", self->media_busy ?
+ "TRUE" : "FALSE");
+
+ seq_printf(seq, " retrans: %d ", self->retry_count);
+ seq_printf(seq, "vs: %d ", self->vs);
+ seq_printf(seq, "vr: %d ", self->vr);
+ seq_printf(seq, "va: %d\n", self->va);
+
+ seq_printf(seq, " qos\tbps\tmaxtt\tdsize\twinsize\taddbofs\tmintt\tldisc\tcomp\n");
+
+ seq_printf(seq, " tx\t%d\t",
+ self->qos_tx.baud_rate.value);
+ seq_printf(seq, "%d\t",
+ self->qos_tx.max_turn_time.value);
+ seq_printf(seq, "%d\t",
+ self->qos_tx.data_size.value);
+ seq_printf(seq, "%d\t",
+ self->qos_tx.window_size.value);
+ seq_printf(seq, "%d\t",
+ self->qos_tx.additional_bofs.value);
+ seq_printf(seq, "%d\t",
+ self->qos_tx.min_turn_time.value);
+ seq_printf(seq, "%d\t",
+ self->qos_tx.link_disc_time.value);
+ seq_printf(seq, "\n");
+
+ seq_printf(seq, " rx\t%d\t",
+ self->qos_rx.baud_rate.value);
+ seq_printf(seq, "%d\t",
+ self->qos_rx.max_turn_time.value);
+ seq_printf(seq, "%d\t",
+ self->qos_rx.data_size.value);
+ seq_printf(seq, "%d\t",
+ self->qos_rx.window_size.value);
+ seq_printf(seq, "%d\t",
+ self->qos_rx.additional_bofs.value);
+ seq_printf(seq, "%d\t",
+ self->qos_rx.min_turn_time.value);
+ seq_printf(seq, "%d\n",
+ self->qos_rx.link_disc_time.value);
+
+ return 0;
+}
+
+static struct seq_operations irlap_seq_ops = {
+ .start = irlap_seq_start,
+ .next = irlap_seq_next,
+ .stop = irlap_seq_stop,
+ .show = irlap_seq_show,
+};
+
+static int irlap_seq_open(struct inode *inode, struct file *file)
+{
+ struct seq_file *seq;
+ int rc = -ENOMEM;
+ struct irlap_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL);
+
+ if (!s)
+ goto out;
+
+ if (irlap == NULL) {
+ rc = -EINVAL;
+ goto out_kfree;
}
- spin_unlock_irqrestore(&irlap->hb_spinlock, flags);
- return len;
+ rc = seq_open(file, &irlap_seq_ops);
+ if (rc)
+ goto out_kfree;
+
+ seq = file->private_data;
+ seq->private = s;
+ memset(s, 0, sizeof(*s));
+out:
+ return rc;
+out_kfree:
+ kfree(s);
+ goto out;
}
+struct file_operations irlap_seq_fops = {
+ .owner = THIS_MODULE,
+ .open = irlap_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release_private,
+};
+
#endif /* CONFIG_PROC_FS */
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c
index 856c3c63cfe4..97d2f1729b6c 100644
--- a/net/irda/irlap_frame.c
+++ b/net/irda/irlap_frame.c
@@ -159,9 +159,9 @@ static void irlap_recv_snrm_cmd(struct irlap_cb *self, struct sk_buff *skb,
{
struct snrm_frame *frame;
- frame = (struct snrm_frame *) skb->data;
+ if (pskb_may_pull(skb,sizeof(struct snrm_frame))) {
+ frame = (struct snrm_frame *) skb->data;
- if (skb->len >= sizeof(struct snrm_frame)) {
/* Copy the new connection address ignoring the C/R bit */
info->caddr = frame->ncaddr & 0xFE;
@@ -402,6 +402,11 @@ static void irlap_recv_discovery_xid_rsp(struct irlap_cb *self,
ASSERT(self != NULL, return;);
ASSERT(self->magic == LAP_MAGIC, return;);
+ if (!pskb_may_pull(skb, sizeof(struct xid_frame))) {
+ ERROR("%s: frame to short!\n", __FUNCTION__);
+ return;
+ }
+
xid = (struct xid_frame *) skb->data;
info->daddr = le32_to_cpu(xid->saddr);
@@ -469,6 +474,11 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,
__u8 *discovery_info;
char *text;
+ if (!pskb_may_pull(skb, sizeof(struct xid_frame))) {
+ ERROR("%s: frame to short!\n", __FUNCTION__);
+ return;
+ }
+
xid = (struct xid_frame *) skb->data;
info->daddr = le32_to_cpu(xid->saddr);
@@ -507,7 +517,8 @@ static void irlap_recv_discovery_xid_cmd(struct irlap_cb *self,
*/
if (info->s == 0xff) {
/* Check if things are sane at this point... */
- if((discovery_info == NULL) || (skb->len < 3)) {
+ if((discovery_info == NULL) ||
+ !pskb_may_pull(skb, 3)) {
ERROR("%s: discovery frame to short!\n", __FUNCTION__);
return;
}
@@ -1150,6 +1161,11 @@ static void irlap_recv_frmr_frame(struct irlap_cb *self, struct sk_buff *skb,
ASSERT(skb != NULL, return;);
ASSERT(info != NULL, return;);
+ if (!pskb_may_pull(skb, 4)) {
+ ERROR("%s: frame to short!\n", __FUNCTION__);
+ return;
+ }
+
frame = skb->data;
info->nr = frame[2] >> 5; /* Next to receive */
@@ -1234,6 +1250,10 @@ static void irlap_recv_test_frame(struct irlap_cb *self, struct sk_buff *skb,
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
+ if (!pskb_may_pull(skb, sizeof(*frame))) {
+ ERROR("%s: frame to short!\n", __FUNCTION__);
+ return;
+ }
frame = (struct test_frame *) skb->data;
/* Broadcast frames must carry saddr and daddr fields */
@@ -1302,15 +1322,9 @@ int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev,
dev_kfree_skb(skb);
return -1;
}
- if (skb_is_nonlinear(skb))
- if (skb_linearize(skb, GFP_ATOMIC) != 0) {
- ERROR("%s: can't linearize skb!\n", __FUNCTION__);
- dev_kfree_skb(skb);
- return -1;
- }
/* Check if frame is large enough for parsing */
- if (skb->len < 2) {
+ if (!pskb_may_pull(skb, 2)) {
ERROR("%s: frame to short!\n", __FUNCTION__);
dev_kfree_skb(skb);
return -1;
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c
index 2241e7b2be00..7e663c2a2d00 100644
--- a/net/irda/irlmp.c
+++ b/net/irda/irlmp.c
@@ -33,6 +33,7 @@
#include <linux/init.h>
#include <linux/kmod.h>
#include <linux/random.h>
+#include <linux/seq_file.h>
#include <net/irda/irda.h>
#include <net/irda/timer.h>
@@ -63,9 +64,6 @@ char *lmp_reasons[] = {
};
__u8 *irlmp_hint_to_service(__u8 *hint);
-#ifdef CONFIG_PROC_FS
-int irlmp_proc_read(char *buf, char **start, off_t offst, int len);
-#endif
/*
* Function irlmp_init (void)
@@ -1780,81 +1778,190 @@ __u32 irlmp_get_daddr(struct lsap_cb *self)
}
#ifdef CONFIG_PROC_FS
-/*
- * Function irlmp_proc_read (buf, start, offset, len, unused)
- *
- * Give some info to the /proc file system
- *
- */
-int irlmp_proc_read(char *buf, char **start, off_t offset, int len)
-{
- struct lsap_cb *self;
- struct lap_cb *lap;
+
+struct irlmp_iter_state {
unsigned long flags;
+ hashbin_t *hashbin;
+};
- ASSERT(irlmp != NULL, return 0;);
+#define LSAP_START_TOKEN ((void *)1)
+#define LINK_START_TOKEN ((void *)2)
+
+static void *irlmp_seq_hb_idx(struct irlmp_iter_state *iter,
+ hashbin_t *bin, loff_t *off)
+{
+ void *element;
+
+ spin_lock_irqsave(&bin->hb_spinlock, iter->flags);
+ for (element = hashbin_get_first(bin);
+ element != NULL;
+ element = hashbin_get_next(bin)) {
+ if (!off || *off-- == 0) {
+ /* NB: hashbin left locked */
+ iter->hashbin = bin;
+ return element;
+ }
+ }
+ spin_unlock_irqrestore(&bin->hb_spinlock, iter->flags);
+ return NULL;
+}
- len = 0;
- len += sprintf( buf+len, "Unconnected LSAPs:\n");
- spin_lock_irqsave(&irlmp->unconnected_lsaps->hb_spinlock, flags);
- self = (struct lsap_cb *) hashbin_get_first( irlmp->unconnected_lsaps);
- while (self != NULL) {
- ASSERT(self->magic == LMP_LSAP_MAGIC, break;);
- len += sprintf(buf+len, "lsap state: %s, ",
- irlsap_state[ self->lsap_state]);
- len += sprintf(buf+len,
- "slsap_sel: %#02x, dlsap_sel: %#02x, ",
- self->slsap_sel, self->dlsap_sel);
- len += sprintf(buf+len, "(%s)", self->notify.name);
- len += sprintf(buf+len, "\n");
-
- self = (struct lsap_cb *) hashbin_get_next(
- irlmp->unconnected_lsaps);
+static void *irlmp_seq_start(struct seq_file *seq, loff_t *pos)
+{
+ struct irlmp_iter_state *iter = seq->private;
+ void *v;
+ loff_t off = *pos;
+
+ iter->hashbin = NULL;
+ if (off-- == 0)
+ return LSAP_START_TOKEN;
+
+ v = irlmp_seq_hb_idx(iter, irlmp->unconnected_lsaps, &off);
+ if (v)
+ return v;
+
+ if (off-- == 0)
+ return LINK_START_TOKEN;
+
+ return irlmp_seq_hb_idx(iter, irlmp->links, &off);
+}
+
+static void *irlmp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ struct irlmp_iter_state *iter = seq->private;
+
+ ++*pos;
+
+ if (v == LSAP_START_TOKEN) {
+ v = irlmp_seq_hb_idx(iter, irlmp->unconnected_lsaps, NULL);
+ return v ? v : LINK_START_TOKEN;
}
- spin_unlock_irqrestore(&irlmp->unconnected_lsaps->hb_spinlock, flags);
- len += sprintf(buf+len, "\nRegistred Link Layers:\n");
- spin_lock_irqsave(&irlmp->links->hb_spinlock, flags);
- lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
- while (lap != NULL) {
- len += sprintf(buf+len, "lap state: %s, ",
- irlmp_state[lap->lap_state]);
+ if (v == LINK_START_TOKEN)
+ return irlmp_seq_hb_idx(iter, irlmp->links, NULL);
+
+ ASSERT( iter->hashbin != NULL, return NULL; );
+
+ v = hashbin_get_next(iter->hashbin);
+ if (v)
+ return v;
+
+ spin_unlock_irqrestore(&iter->hashbin->hb_spinlock, iter->flags);
- len += sprintf(buf+len, "saddr: %#08x, daddr: %#08x, ",
- lap->saddr, lap->daddr);
- len += sprintf(buf+len, "num lsaps: %d",
- HASHBIN_GET_SIZE(lap->lsaps));
- len += sprintf(buf+len, "\n");
+ if (iter->hashbin == irlmp->unconnected_lsaps) {
+ iter->hashbin = NULL;
+ return LINK_START_TOKEN;
+ }
+ return NULL;
+}
+
+static void irlmp_seq_stop(struct seq_file *seq, void *v)
+{
+ struct irlmp_iter_state *iter = seq->private;
+
+ if (iter->hashbin)
+ spin_unlock_irqrestore(&iter->hashbin->hb_spinlock, iter->flags);
+
+}
+
+static int irlmp_seq_show(struct seq_file *seq, void *v)
+{
+ const struct irlmp_iter_state *iter = seq->private;
+ struct lsap_cb *self = v;
+
+ if (v == LSAP_START_TOKEN)
+ seq_puts(seq, "Unconnected LSAPs:\n");
+ else if (v == LINK_START_TOKEN)
+ seq_puts(seq, "\nRegistered Link Layers:\n");
+ else if (iter->hashbin == irlmp->unconnected_lsaps) {
+ self = v;
+ ASSERT(self->magic == LMP_LSAP_MAGIC, return -EINVAL; );
+ seq_printf(seq, "lsap state: %s, ",
+ irlsap_state[ self->lsap_state]);
+ seq_printf(seq,
+ "slsap_sel: %#02x, dlsap_sel: %#02x, ",
+ self->slsap_sel, self->dlsap_sel);
+ seq_printf(seq, "(%s)", self->notify.name);
+ seq_printf(seq, "\n");
+ } else if (iter->hashbin == irlmp->links) {
+ struct lap_cb *lap = v;
+
+ seq_printf(seq, "lap state: %s, ",
+ irlmp_state[lap->lap_state]);
+
+ seq_printf(seq, "saddr: %#08x, daddr: %#08x, ",
+ lap->saddr, lap->daddr);
+ seq_printf(seq, "num lsaps: %d",
+ HASHBIN_GET_SIZE(lap->lsaps));
+ seq_printf(seq, "\n");
/* Careful for priority inversions here !
* All other uses of attrib spinlock are independent of
* the object spinlock, so we are safe. Jean II */
spin_lock(&lap->lsaps->hb_spinlock);
- len += sprintf(buf+len, "\n Connected LSAPs:\n");
- self = (struct lsap_cb *) hashbin_get_first(lap->lsaps);
- while (self != NULL) {
+ seq_printf(seq, "\n Connected LSAPs:\n");
+ for (self = (struct lsap_cb *) hashbin_get_first(lap->lsaps);
+ self != NULL;
+ self = (struct lsap_cb *)hashbin_get_next(lap->lsaps)) {
ASSERT(self->magic == LMP_LSAP_MAGIC, break;);
- len += sprintf(buf+len, " lsap state: %s, ",
- irlsap_state[ self->lsap_state]);
- len += sprintf(buf+len,
- "slsap_sel: %#02x, dlsap_sel: %#02x, ",
- self->slsap_sel, self->dlsap_sel);
- len += sprintf(buf+len, "(%s)", self->notify.name);
- len += sprintf(buf+len, "\n");
-
- self = (struct lsap_cb *) hashbin_get_next(
- lap->lsaps);
+ seq_printf(seq, " lsap state: %s, ",
+ irlsap_state[ self->lsap_state]);
+ seq_printf(seq,
+ "slsap_sel: %#02x, dlsap_sel: %#02x, ",
+ self->slsap_sel, self->dlsap_sel);
+ seq_printf(seq, "(%s)", self->notify.name);
+ seq_putc(seq, '\n');
+
}
spin_unlock(&lap->lsaps->hb_spinlock);
- len += sprintf(buf+len, "\n");
+ seq_putc(seq, '\n');
+ } else
+ return -EINVAL;
- lap = (struct lap_cb *) hashbin_get_next(irlmp->links);
- }
- spin_unlock_irqrestore(&irlmp->links->hb_spinlock, flags);
+ return 0;
+}
+
+static struct seq_operations irlmp_seq_ops = {
+ .start = irlmp_seq_start,
+ .next = irlmp_seq_next,
+ .stop = irlmp_seq_stop,
+ .show = irlmp_seq_show,
+};
- return len;
+static int irlmp_seq_open(struct inode *inode, struct file *file)
+{
+ struct seq_file *seq;
+ int rc = -ENOMEM;
+ struct irlmp_iter_state *s;
+
+ ASSERT(irlmp != NULL, return -EINVAL;);
+
+ s = kmalloc(sizeof(*s), GFP_KERNEL);
+ if (!s)
+ goto out;
+
+ rc = seq_open(file, &irlmp_seq_ops);
+ if (rc)
+ goto out_kfree;
+
+ seq = file->private_data;
+ seq->private = s;
+ memset(s, 0, sizeof(*s));
+out:
+ return rc;
+out_kfree:
+ kfree(s);
+ goto out;
}
+struct file_operations irlmp_seq_fops = {
+ .owner = THIS_MODULE,
+ .open = irlmp_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release_private,
+};
+
#endif /* PROC_FS */
diff --git a/net/irda/irproc.c b/net/irda/irproc.c
index 6373aba599b1..c244da5f015e 100644
--- a/net/irda/irproc.c
+++ b/net/irda/irproc.c
@@ -25,6 +25,7 @@
#include <linux/miscdevice.h>
#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
#include <linux/module.h>
#include <linux/init.h>
@@ -32,25 +33,25 @@
#include <net/irda/irlap.h>
#include <net/irda/irlmp.h>
-extern int irlap_proc_read(char *buf, char **start, off_t offset, int len);
-extern int irlmp_proc_read(char *buf, char **start, off_t offset, int len);
-extern int irttp_proc_read(char *buf, char **start, off_t offset, int len);
-extern int irias_proc_read(char *buf, char **start, off_t offset, int len);
-extern int discovery_proc_read(char *buf, char **start, off_t offset, int len);
+extern struct file_operations discovery_seq_fops;
+extern struct file_operations irlap_seq_fops;
+extern struct file_operations irlmp_seq_fops;
+extern struct file_operations irttp_seq_fops;
+extern struct file_operations irias_seq_fops;
struct irda_entry {
- char *name;
- int (*fn)(char*, char**, off_t, int);
+ const char *name;
+ struct file_operations *fops;
};
struct proc_dir_entry *proc_irda;
-static struct irda_entry dir[] = {
- {"discovery", discovery_proc_read},
- {"irttp", irttp_proc_read},
- {"irlmp", irlmp_proc_read},
- {"irlap", irlap_proc_read},
- {"irias", irias_proc_read},
+static struct irda_entry irda_dirs[] = {
+ {"discovery", &discovery_seq_fops},
+ {"irttp", &irttp_seq_fops},
+ {"irlmp", &irlmp_seq_fops},
+ {"irlap", &irlap_seq_fops},
+ {"irias", &irias_seq_fops},
};
/*
@@ -64,15 +65,15 @@ void __init irda_proc_register(void)
int i;
struct proc_dir_entry *d;
- proc_irda = proc_mkdir("net/irda", NULL);
+ proc_irda = proc_mkdir("irda", proc_net);
if (proc_irda == NULL)
return;
proc_irda->owner = THIS_MODULE;
- for (i=0; i<ARRAY_SIZE(dir); i++) {
- d = create_proc_info_entry(dir[i].name,0,proc_irda,dir[i].fn);
- if (d)
- d->owner = THIS_MODULE;
+ for (i=0; i<ARRAY_SIZE(irda_dirs); i++) {
+ d = create_proc_entry(irda_dirs[i].name, 0, proc_irda);
+ if (d)
+ d->proc_fops = irda_dirs[i].fops;
}
}
@@ -87,10 +88,10 @@ void __exit irda_proc_unregister(void)
int i;
if (proc_irda) {
- for (i=0; i<ARRAY_SIZE(dir); i++)
- remove_proc_entry(dir[i].name, proc_irda);
+ for (i=0; i<ARRAY_SIZE(irda_dirs); i++)
+ remove_proc_entry(irda_dirs[i].name, proc_irda);
- remove_proc_entry("net/irda", NULL);
+ remove_proc_entry("irda", proc_net);
proc_irda = NULL;
}
}
diff --git a/net/irda/irttp.c b/net/irda/irttp.c
index e4ddcc586ef0..3ba9512aa220 100644
--- a/net/irda/irttp.c
+++ b/net/irda/irttp.c
@@ -27,6 +27,7 @@
#include <linux/config.h>
#include <linux/skbuff.h>
#include <linux/init.h>
+#include <linux/seq_file.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
@@ -1767,71 +1768,127 @@ void irttp_run_rx_queue(struct tsap_cb *self)
}
#ifdef CONFIG_PROC_FS
-/*
- * Function irttp_proc_read (buf, start, offset, len, unused)
- *
- * Give some info to the /proc file system
- */
-int irttp_proc_read(char *buf, char **start, off_t offset, int len)
-{
- struct tsap_cb *self;
+struct irttp_iter_state {
+ int id;
unsigned long flags;
- int i = 0;
-
- ASSERT(irttp != NULL, return 0;);
+};
- len = 0;
+static void *irttp_seq_start(struct seq_file *seq, loff_t *pos)
+{
+ struct irttp_iter_state *iter = seq->private;
+ struct tsap_cb *self;
/* Protect our access to the tsap list */
- spin_lock_irqsave(&irttp->tsaps->hb_spinlock, flags);
+ spin_lock_irqsave(&irttp->tsaps->hb_spinlock, iter->flags);
+ iter->id = 0;
- self = (struct tsap_cb *) hashbin_get_first(irttp->tsaps);
- while (self != NULL) {
- if (!self || self->magic != TTP_TSAP_MAGIC)
+ for (self = (struct tsap_cb *) hashbin_get_first(irttp->tsaps);
+ self != NULL;
+ self = (struct tsap_cb *) hashbin_get_next(irttp->tsaps)) {
+ if (iter->id == *pos)
break;
-
- len += sprintf(buf+len, "TSAP %d, ", i++);
- len += sprintf(buf+len, "stsap_sel: %02x, ",
- self->stsap_sel);
- len += sprintf(buf+len, "dtsap_sel: %02x\n",
- self->dtsap_sel);
- len += sprintf(buf+len, " connected: %s, ",
- self->connected? "TRUE":"FALSE");
- len += sprintf(buf+len, "avail credit: %d, ",
- self->avail_credit);
- len += sprintf(buf+len, "remote credit: %d, ",
- self->remote_credit);
- len += sprintf(buf+len, "send credit: %d\n",
- self->send_credit);
- len += sprintf(buf+len, " tx packets: %ld, ",
- self->stats.tx_packets);
- len += sprintf(buf+len, "rx packets: %ld, ",
- self->stats.rx_packets);
- len += sprintf(buf+len, "tx_queue len: %d ",
- skb_queue_len(&self->tx_queue));
- len += sprintf(buf+len, "rx_queue len: %d\n",
- skb_queue_len(&self->rx_queue));
- len += sprintf(buf+len, " tx_sdu_busy: %s, ",
- self->tx_sdu_busy? "TRUE":"FALSE");
- len += sprintf(buf+len, "rx_sdu_busy: %s\n",
- self->rx_sdu_busy? "TRUE":"FALSE");
- len += sprintf(buf+len, " max_seg_size: %d, ",
- self->max_seg_size);
- len += sprintf(buf+len, "tx_max_sdu_size: %d, ",
- self->tx_max_sdu_size);
- len += sprintf(buf+len, "rx_max_sdu_size: %d\n",
- self->rx_max_sdu_size);
-
- len += sprintf(buf+len, " Used by (%s)\n",
- self->notify.name);
-
- len += sprintf(buf+len, "\n");
-
- self = (struct tsap_cb *) hashbin_get_next(irttp->tsaps);
+ ++iter->id;
}
- spin_unlock_irqrestore(&irttp->tsaps->hb_spinlock, flags);
+
+ return self;
+}
- return len;
+static void *irttp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
+{
+ struct irttp_iter_state *iter = seq->private;
+
+ ++*pos;
+ ++iter->id;
+ return (void *) hashbin_get_next(irttp->tsaps);
}
+static void irttp_seq_stop(struct seq_file *seq, void *v)
+{
+ struct irttp_iter_state *iter = seq->private;
+ spin_unlock_irqrestore(&irttp->tsaps->hb_spinlock, iter->flags);
+}
+
+static int irttp_seq_show(struct seq_file *seq, void *v)
+{
+ const struct irttp_iter_state *iter = seq->private;
+ const struct tsap_cb *self = v;
+
+ seq_printf(seq, "TSAP %d, ", iter->id);
+ seq_printf(seq, "stsap_sel: %02x, ",
+ self->stsap_sel);
+ seq_printf(seq, "dtsap_sel: %02x\n",
+ self->dtsap_sel);
+ seq_printf(seq, " connected: %s, ",
+ self->connected? "TRUE":"FALSE");
+ seq_printf(seq, "avail credit: %d, ",
+ self->avail_credit);
+ seq_printf(seq, "remote credit: %d, ",
+ self->remote_credit);
+ seq_printf(seq, "send credit: %d\n",
+ self->send_credit);
+ seq_printf(seq, " tx packets: %ld, ",
+ self->stats.tx_packets);
+ seq_printf(seq, "rx packets: %ld, ",
+ self->stats.rx_packets);
+ seq_printf(seq, "tx_queue len: %d ",
+ skb_queue_len(&self->tx_queue));
+ seq_printf(seq, "rx_queue len: %d\n",
+ skb_queue_len(&self->rx_queue));
+ seq_printf(seq, " tx_sdu_busy: %s, ",
+ self->tx_sdu_busy? "TRUE":"FALSE");
+ seq_printf(seq, "rx_sdu_busy: %s\n",
+ self->rx_sdu_busy? "TRUE":"FALSE");
+ seq_printf(seq, " max_seg_size: %d, ",
+ self->max_seg_size);
+ seq_printf(seq, "tx_max_sdu_size: %d, ",
+ self->tx_max_sdu_size);
+ seq_printf(seq, "rx_max_sdu_size: %d\n",
+ self->rx_max_sdu_size);
+
+ seq_printf(seq, " Used by (%s)\n\n",
+ self->notify.name);
+ return 0;
+}
+
+static struct seq_operations irttp_seq_ops = {
+ .start = irttp_seq_start,
+ .next = irttp_seq_next,
+ .stop = irttp_seq_stop,
+ .show = irttp_seq_show,
+};
+
+static int irttp_seq_open(struct inode *inode, struct file *file)
+{
+ struct seq_file *seq;
+ int rc = -ENOMEM;
+ struct irttp_iter_state *s;
+
+ ASSERT(irttp != NULL, return -EINVAL;);
+
+ s = kmalloc(sizeof(*s), GFP_KERNEL);
+ if (!s)
+ goto out;
+
+ rc = seq_open(file, &irttp_seq_ops);
+ if (rc)
+ goto out_kfree;
+
+ seq = file->private_data;
+ seq->private = s;
+ memset(s, 0, sizeof(*s));
+out:
+ return rc;
+out_kfree:
+ kfree(s);
+ goto out;
+}
+
+struct file_operations irttp_seq_fops = {
+ .owner = THIS_MODULE,
+ .open = irttp_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release_private,
+};
+
#endif /* PROC_FS */
diff --git a/net/llc/Kconfig b/net/llc/Kconfig
new file mode 100644
index 000000000000..b91c65108162
--- /dev/null
+++ b/net/llc/Kconfig
@@ -0,0 +1,10 @@
+config LLC
+ tristate
+ depends on NET
+
+config LLC2
+ tristate "ANSI/IEEE 802.2 LLC type 2 Support"
+ select LLC
+ help
+ This is a Logical Link Layer type 2, connection oriented support.
+ Select this if you want to have support for PF_LLC sockets.
diff --git a/net/llc/Makefile b/net/llc/Makefile
index 73a77522723f..5ebd4ed2bd42 100644
--- a/net/llc/Makefile
+++ b/net/llc/Makefile
@@ -2,7 +2,7 @@
# Makefile for the Linux 802.2 LLC (fully-functional) layer.
#
# Copyright (c) 1997 by Procom Technology,Inc.
-# 2001, 2002 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+# 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
#
# This program can be redistributed or modified under the terms of the
# GNU General Public License as published by the Free Software Foundation.
@@ -14,7 +14,11 @@
obj-$(CONFIG_LLC) += llc.o
-llc-y := llc_if.o llc_c_ev.o llc_c_ac.o llc_mac.o llc_sap.o llc_s_st.o \
- llc_main.o llc_s_ac.o llc_conn.o llc_c_st.o llc_stat.o llc_actn.o \
- llc_s_ev.o llc_evnt.o llc_pdu.o llc_proc.o
-llc-$(CONFIG_LLC_UI) += af_llc.o
+llc-y := llc_core.o llc_input.o llc_output.o
+
+obj-$(CONFIG_LLC2) += llc2.o
+
+llc2-y := llc_if.o llc_c_ev.o llc_c_ac.o llc_conn.o llc_c_st.o llc_pdu.o \
+ llc_sap.o llc_s_ac.o llc_s_ev.o llc_s_st.o af_llc.o llc_station.o
+
+llc2-$(CONFIG_PROC_FS) += llc_proc.o
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index ff2710542e4b..693f2a5f457c 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -24,13 +24,13 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/tcp.h>
+#include <linux/rtnetlink.h>
+#include <linux/init.h>
+#include <net/llc.h>
#include <net/llc_sap.h>
#include <net/llc_pdu.h>
#include <net/llc_conn.h>
-#include <net/llc_mac.h>
-#include <net/llc_main.h>
-#include <linux/rtnetlink.h>
-#include <linux/init.h>
+#include <net/llc_proc.h>
/* remember: uninitialized global data is zeroed because its in .bss */
static u16 llc_ui_sap_last_autoport = LLC_SAP_DYN_START;
@@ -182,10 +182,12 @@ static int llc_ui_release(struct socket *sock)
if (!llc_send_disc(sk))
llc_ui_wait_for_disc(sk, sk->sk_rcvtimeo);
if (!sk->sk_zapped)
- llc_sap_unassign_sock(llc->sap, sk);
+ llc_sap_remove_socket(llc->sap, sk);
release_sock(sk);
- if (llc->sap && hlist_empty(&llc->sap->sk_list.list))
+ if (llc->sap && hlist_empty(&llc->sap->sk_list.list)) {
+ llc_release_sockets(llc->sap);
llc_sap_close(llc->sap);
+ }
sock_put(sk);
llc_sk_free(sk);
out:
@@ -303,7 +305,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr)
memcpy(llc->daddr.mac, addr->sllc_dmac, IFHWADDRLEN);
memcpy(&llc->addr, addr, sizeof(llc->addr));
/* assign new connection to its SAP */
- llc_sap_assign_sock(sap, sk);
+ llc_sap_add_socket(sap, sk);
rc = sk->sk_zapped = 0;
out:
return rc;
@@ -1042,14 +1044,38 @@ static struct proto_ops llc_ui_ops = {
.sendpage = sock_no_sendpage,
};
-int __init llc_ui_init(void)
+extern void llc_sap_handler(struct llc_sap *sap, struct sk_buff *skb);
+extern void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb);
+
+static int __init llc2_init(void)
{
+ int rc;
+
+ llc_build_offset_table();
+ llc_station_init();
llc_ui_sap_last_autoport = LLC_SAP_DYN_START;
- sock_register(&llc_ui_family_ops);
- return 0;
+ rc = llc_proc_init();
+ if (!rc) {
+ sock_register(&llc_ui_family_ops);
+ llc_add_pack(LLC_DEST_SAP, llc_sap_handler);
+ llc_add_pack(LLC_DEST_CONN, llc_conn_handler);
+ }
+ return rc;
}
-void __exit llc_ui_exit(void)
+static void __exit llc2_exit(void)
{
+ llc_station_exit();
+ llc_remove_pack(LLC_DEST_SAP);
+ llc_remove_pack(LLC_DEST_CONN);
sock_unregister(PF_LLC);
+ llc_proc_exit();
}
+
+module_init(llc2_init);
+module_exit(llc2_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Procom 1997, Jay Schullist 2001, Arnaldo C. Melo 2001-2003");
+MODULE_DESCRIPTION("IEEE 802.2 PF_LLC support");
+MODULE_ALIAS_NETPROTO(PF_LLC);
diff --git a/net/llc/llc_actn.c b/net/llc/llc_actn.c
deleted file mode 100644
index b17943a5c222..000000000000
--- a/net/llc/llc_actn.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * llc_actn.c - Implementation of actions of station component of LLC
- *
- * Description :
- * Functions in this module are implementation of station component actions.
- * Details of actions can be found in IEEE-802.2 standard document.
- * All functions have one station and one event as input argument. All of
- * them return 0 On success and 1 otherwise.
- *
- * Copyright (c) 1997 by Procom Technology, Inc.
- * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *
- * This program can be redistributed or modified under the terms of the
- * GNU General Public License as published by the Free Software Foundation.
- * This program is distributed without any warranty or implied warranty
- * of merchantability or fitness for a particular purpose.
- *
- * See the GNU General Public License for more details.
- */
-#include <linux/netdevice.h>
-#include <net/llc_if.h>
-#include <net/llc_main.h>
-#include <net/llc_evnt.h>
-#include <net/llc_pdu.h>
-#include <net/llc_mac.h>
-
-int llc_station_ac_start_ack_timer(struct llc_station *station,
- struct sk_buff *skb)
-{
- mod_timer(&station->ack_timer, jiffies + LLC_ACK_TIME * HZ);
- return 0;
-}
-
-int llc_station_ac_set_retry_cnt_0(struct llc_station *station,
- struct sk_buff *skb)
-{
- station->retry_count = 0;
- return 0;
-}
-
-int llc_station_ac_inc_retry_cnt_by_1(struct llc_station *station,
- struct sk_buff *skb)
-{
- station->retry_count++;
- return 0;
-}
-
-int llc_station_ac_set_xid_r_cnt_0(struct llc_station *station,
- struct sk_buff *skb)
-{
- station->xid_r_count = 0;
- return 0;
-}
-
-int llc_station_ac_inc_xid_r_cnt_by_1(struct llc_station *station,
- struct sk_buff *skb)
-{
- station->xid_r_count++;
- return 0;
-}
-
-int llc_station_ac_send_null_dsap_xid_c(struct llc_station *station,
- struct sk_buff *skb)
-{
- int rc = 1;
- struct sk_buff *nskb = llc_alloc_frame();
-
- if (!nskb)
- goto out;
- rc = 0;
- llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, 0, LLC_PDU_CMD);
- llc_pdu_init_as_xid_cmd(nskb, LLC_XID_NULL_CLASS_2, 127);
- lan_hdrs_init(nskb, station->mac_sa, station->mac_sa);
- llc_station_send_pdu(station, nskb);
-out:
- return rc;
-}
-
-int llc_station_ac_send_xid_r(struct llc_station *station,
- struct sk_buff *skb)
-{
- u8 mac_da[ETH_ALEN], dsap;
- int rc = 1;
- struct sk_buff* nskb = llc_alloc_frame();
-
- if (!nskb)
- goto out;
- rc = 0;
- nskb->dev = skb->dev;
- llc_pdu_decode_sa(skb, mac_da);
- llc_pdu_decode_ssap(skb, &dsap);
- llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP);
- llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127);
- lan_hdrs_init(nskb, station->mac_sa, mac_da);
- llc_station_send_pdu(station, nskb);
-out:
- return rc;
-}
-
-int llc_station_ac_send_test_r(struct llc_station *station,
- struct sk_buff *skb)
-{
- u8 mac_da[ETH_ALEN], dsap;
- int rc = 1;
- struct sk_buff *nskb = llc_alloc_frame();
-
- if (!nskb)
- goto out;
- rc = 0;
- nskb->dev = skb->dev;
- llc_pdu_decode_sa(skb, mac_da);
- llc_pdu_decode_ssap(skb, &dsap);
- llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP);
- llc_pdu_init_as_test_rsp(nskb, skb);
- lan_hdrs_init(nskb, station->mac_sa, mac_da);
- llc_station_send_pdu(station, nskb);
-out:
- return rc;
-}
-
-int llc_station_ac_report_status(struct llc_station *station,
- struct sk_buff *skb)
-{
- return 0;
-}
-
-void llc_station_ack_tmr_cb(unsigned long timeout_data)
-{
- struct llc_station *station = (struct llc_station *)timeout_data;
- struct sk_buff *skb = alloc_skb(0, GFP_ATOMIC);
-
- if (skb) {
- struct llc_station_state_ev *ev = llc_station_ev(skb);
-
- ev->type = LLC_STATION_EV_TYPE_ACK_TMR;
- llc_station_state_process(station, skb);
- }
-}
diff --git a/net/llc/llc_c_ac.c b/net/llc/llc_c_ac.c
index d7f35bf275a7..f04f96fe5080 100644
--- a/net/llc/llc_c_ac.c
+++ b/net/llc/llc_c_ac.c
@@ -21,12 +21,13 @@
#include <net/llc_conn.h>
#include <net/llc_sap.h>
#include <net/sock.h>
-#include <net/llc_main.h>
#include <net/llc_c_ev.h>
#include <net/llc_c_ac.h>
#include <net/llc_c_st.h>
#include <net/llc_pdu.h>
-#include <net/llc_mac.h>
+#include <net/llc.h>
+
+#include "llc_output.h"
static int llc_conn_ac_inc_vs_by_1(struct sock *sk, struct sk_buff *skb);
static void llc_process_tmr_ev(struct sock *sk, struct sk_buff *skb);
@@ -52,7 +53,7 @@ int llc_conn_ac_clear_remote_busy(struct sock *sk, struct sk_buff *skb)
int llc_conn_ac_conn_ind(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOTCONN;
u8 dsap;
struct llc_sap *sap;
@@ -97,28 +98,24 @@ int llc_conn_ac_disc_ind(struct sock *sk, struct sk_buff *skb)
{
struct llc_conn_state_ev *ev = llc_conn_ev(skb);
u8 reason = 0;
- int rc = 1;
+ int rc = 0;
if (ev->type == LLC_CONN_EV_TYPE_PDU) {
struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
if (LLC_PDU_IS_RSP(pdu) &&
LLC_PDU_TYPE_IS_U(pdu) &&
- LLC_U_PDU_RSP(pdu) == LLC_2_PDU_RSP_DM) {
+ LLC_U_PDU_RSP(pdu) == LLC_2_PDU_RSP_DM)
reason = LLC_DISC_REASON_RX_DM_RSP_PDU;
- rc = 0;
- } else if (LLC_PDU_IS_CMD(pdu) &&
+ else if (LLC_PDU_IS_CMD(pdu) &&
LLC_PDU_TYPE_IS_U(pdu) &&
- LLC_U_PDU_CMD(pdu) == LLC_2_PDU_CMD_DISC) {
+ LLC_U_PDU_CMD(pdu) == LLC_2_PDU_CMD_DISC)
reason = LLC_DISC_REASON_RX_DISC_CMD_PDU;
- rc = 0;
- }
- } else if (ev->type == LLC_CONN_EV_TYPE_ACK_TMR) {
+ } else if (ev->type == LLC_CONN_EV_TYPE_ACK_TMR)
reason = LLC_DISC_REASON_ACK_TMR_EXP;
- rc = 0;
- } else {
+ else {
reason = 0;
- rc = 1;
+ rc = -EINVAL;
}
if (!rc) {
ev->reason = reason;
@@ -217,29 +214,33 @@ int llc_conn_ac_stop_rej_tmr_if_data_flag_eq_2(struct sock *sk,
int llc_conn_ac_send_disc_cmd_p_set_x(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
- u8 p_bit = 1;
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
nskb->dev = llc->dev;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_CMD);
- llc_pdu_init_as_disc_cmd(nskb, p_bit);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ llc_pdu_init_as_disc_cmd(nskb, 1);
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
+ llc_conn_ac_set_p_flag_1(sk, skb);
}
- llc_conn_ac_set_p_flag_1(sk, skb);
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_dm_rsp_f_set_p(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
@@ -252,16 +253,21 @@ int llc_conn_ac_send_dm_rsp_f_set_p(struct sock *sk, struct sk_buff *skb)
llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_dm_rsp(nskb, f_bit);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_dm_rsp_f_set_1(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
@@ -273,16 +279,21 @@ int llc_conn_ac_send_dm_rsp_f_set_1(struct sock *sk, struct sk_buff *skb)
llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_dm_rsp(nskb, f_bit);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_dm_rsp_f_set_f_flag(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
@@ -294,17 +305,22 @@ int llc_conn_ac_send_dm_rsp_f_set_f_flag(struct sock *sk, struct sk_buff *skb)
llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_dm_rsp(nskb, f_bit);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock *sk, struct sk_buff *skb)
{
u8 f_bit;
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb;
struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb);
struct llc_opt *llc = llc_sk(sk);
@@ -323,16 +339,21 @@ int llc_conn_ac_send_frmr_rsp_f_set_x(struct sock *sk, struct sk_buff *skb)
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_frmr_rsp(nskb, pdu, f_bit, llc->vS,
llc->vR, INCORRECT);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_resend_frmr_rsp_f_set_0(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
@@ -346,17 +367,22 @@ int llc_conn_ac_resend_frmr_rsp_f_set_0(struct sock *sk, struct sk_buff *skb)
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_frmr_rsp(nskb, pdu, f_bit, llc->vS,
llc->vR, INCORRECT);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_resend_frmr_rsp_f_set_p(struct sock *sk, struct sk_buff *skb)
{
u8 f_bit;
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb;
llc_pdu_decode_pf_bit(skb, &f_bit);
@@ -371,41 +397,50 @@ int llc_conn_ac_resend_frmr_rsp_f_set_p(struct sock *sk, struct sk_buff *skb)
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_frmr_rsp(nskb, pdu, f_bit, llc->vS,
llc->vR, INCORRECT);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_i_cmd_p_set_1(struct sock *sk, struct sk_buff *skb)
{
- u8 p_bit = 1;
+ int rc;
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
llc_pdu_header_init(skb, LLC_PDU_TYPE_I, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_CMD);
- llc_pdu_init_as_i_cmd(skb, p_bit, llc->vS, llc->vR);
- lan_hdrs_init(skb, llc->dev->dev_addr, llc->daddr.mac);
- llc_conn_send_pdu(sk, skb);
- llc_conn_ac_inc_vs_by_1(sk, skb);
- return 0;
+ llc_pdu_init_as_i_cmd(skb, 1, llc->vS, llc->vR);
+ rc = llc_mac_hdr_init(skb, llc->dev->dev_addr, llc->daddr.mac);
+ if (!rc) {
+ llc_conn_send_pdu(sk, skb);
+ llc_conn_ac_inc_vs_by_1(sk, skb);
+ }
+ return rc;
}
int llc_conn_ac_send_i_cmd_p_set_0(struct sock *sk, struct sk_buff *skb)
{
- u8 p_bit = 0;
+ int rc;
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
llc_pdu_header_init(skb, LLC_PDU_TYPE_I, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_CMD);
- llc_pdu_init_as_i_cmd(skb, p_bit, llc->vS, llc->vR);
- lan_hdrs_init(skb, llc->dev->dev_addr, llc->daddr.mac);
- llc_conn_send_pdu(sk, skb);
- llc_conn_ac_inc_vs_by_1(sk, skb);
- return 0;
+ llc_pdu_init_as_i_cmd(skb, 0, llc->vS, llc->vR);
+ rc = llc_mac_hdr_init(skb, llc->dev->dev_addr, llc->daddr.mac);
+ if (!rc) {
+ llc_conn_send_pdu(sk, skb);
+ llc_conn_ac_inc_vs_by_1(sk, skb);
+ }
+ return rc;
}
int llc_conn_ac_resend_i_cmd_p_set_1(struct sock *sk, struct sk_buff *skb)
@@ -431,16 +466,18 @@ int llc_conn_ac_resend_i_cmd_p_set_1_or_send_rr(struct sock *sk,
int llc_conn_ac_send_i_xxx_x_set_0(struct sock *sk, struct sk_buff *skb)
{
- u8 p_bit = 0;
+ int rc;
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
llc_pdu_header_init(skb, LLC_PDU_TYPE_I, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_CMD);
- llc_pdu_init_as_i_cmd(skb, p_bit, llc->vS, llc->vR);
- lan_hdrs_init(skb, llc->dev->dev_addr, llc->daddr.mac);
- llc_conn_send_pdu(sk, skb);
- llc_conn_ac_inc_vs_by_1(sk, skb);
+ llc_pdu_init_as_i_cmd(skb, 0, llc->vS, llc->vR);
+ rc = llc_mac_hdr_init(skb, llc->dev->dev_addr, llc->daddr.mac);
+ if (!rc) {
+ llc_conn_send_pdu(sk, skb);
+ llc_conn_ac_inc_vs_by_1(sk, skb);
+ }
return 0;
}
@@ -457,9 +494,8 @@ int llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr(struct sock *sk,
struct sk_buff *skb)
{
u8 nr;
- u8 f_bit = 0;
struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb);
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
@@ -469,15 +505,17 @@ int llc_conn_ac_resend_i_xxx_x_set_0_or_send_rr(struct sock *sk,
nskb->dev = llc->dev;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
- llc_pdu_init_as_rr_rsp(nskb, f_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
- llc_conn_send_pdu(sk, nskb);
+ llc_pdu_init_as_rr_rsp(nskb, 0, llc->vR);
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (!rc)
+ llc_conn_send_pdu(sk, nskb);
+ else
+ kfree_skb(skb);
}
if (rc) {
nr = LLC_I_GET_NR(pdu);
rc = 0;
- llc_conn_resend_i_pdu_as_cmd(sk, nr, f_bit);
+ llc_conn_resend_i_pdu_as_cmd(sk, nr, 0);
}
return rc;
}
@@ -493,28 +531,32 @@ int llc_conn_ac_resend_i_rsp_f_set_1(struct sock *sk, struct sk_buff *skb)
int llc_conn_ac_send_rej_cmd_p_set_1(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
- u8 p_bit = 1;
nskb->dev = llc->dev;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_CMD);
- llc_pdu_init_as_rej_cmd(nskb, p_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ llc_pdu_init_as_rej_cmd(nskb, 1, llc->vR);
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_rej_rsp_f_set_1(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
@@ -526,16 +568,21 @@ int llc_conn_ac_send_rej_rsp_f_set_1(struct sock *sk, struct sk_buff *skb)
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_rej_rsp(nskb, f_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_rej_xxx_x_set_0(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
@@ -547,37 +594,46 @@ int llc_conn_ac_send_rej_xxx_x_set_0(struct sock *sk, struct sk_buff *skb)
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_rej_rsp(nskb, f_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_rnr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
- u8 p_bit = 1;
nskb->dev = llc->dev;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_CMD);
- llc_pdu_init_as_rnr_cmd(nskb, p_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ llc_pdu_init_as_rnr_cmd(nskb, 1, llc->vR);
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_rnr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
@@ -589,16 +645,21 @@ int llc_conn_ac_send_rnr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb)
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_rnr_rsp(nskb, f_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
@@ -610,11 +671,16 @@ int llc_conn_ac_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb)
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_rnr_rsp(nskb, f_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_set_remote_busy(struct sock *sk, struct sk_buff *skb)
@@ -631,70 +697,82 @@ int llc_conn_ac_set_remote_busy(struct sock *sk, struct sk_buff *skb)
int llc_conn_ac_opt_send_rnr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
- u8 f_bit = 0;
nskb->dev = llc->dev;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
- llc_pdu_init_as_rnr_rsp(nskb, f_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ llc_pdu_init_as_rnr_rsp(nskb, 0, llc->vR);
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_rr_cmd_p_set_1(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
- u8 p_bit = 1;
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
nskb->dev = llc->dev;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_CMD);
- llc_pdu_init_as_rr_cmd(nskb, p_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ llc_pdu_init_as_rr_cmd(nskb, 1, llc->vR);
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_ack_cmd_p_set_1(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
- u8 p_bit = 1;
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
nskb->dev = llc->dev;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_CMD);
- llc_pdu_init_as_rr_cmd(nskb, p_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ llc_pdu_init_as_rr_cmd(nskb, 1, llc->vR);
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_rr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
@@ -706,16 +784,21 @@ int llc_conn_ac_send_rr_rsp_f_set_1(struct sock *sk, struct sk_buff *skb)
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_rr_rsp(nskb, f_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_ack_rsp_f_set_1(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
@@ -727,53 +810,66 @@ int llc_conn_ac_send_ack_rsp_f_set_1(struct sock *sk, struct sk_buff *skb)
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_rr_rsp(nskb, f_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_rr_xxx_x_set_0(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
- u8 f_bit = 0;
nskb->dev = llc->dev;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
- llc_pdu_init_as_rr_rsp(nskb, f_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ llc_pdu_init_as_rr_rsp(nskb, 0, llc->vR);
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_ack_xxx_x_set_0(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
- u8 f_bit = 0;
nskb->dev = llc->dev;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
- llc_pdu_init_as_rr_rsp(nskb, f_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ llc_pdu_init_as_rr_rsp(nskb, 0, llc->vR);
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
void llc_conn_set_p_flag(struct sock *sk, u8 value)
@@ -788,10 +884,9 @@ void llc_conn_set_p_flag(struct sock *sk, u8 value)
int llc_conn_ac_send_sabme_cmd_p_set_x(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
struct llc_opt *llc = llc_sk(sk);
- u8 p_bit = 1;
if (nskb) {
struct llc_sap *sap = llc->sap;
@@ -802,41 +897,49 @@ int llc_conn_ac_send_sabme_cmd_p_set_x(struct sock *sk, struct sk_buff *skb)
nskb->dev = llc->dev;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_CMD);
- llc_pdu_init_as_sabme_cmd(nskb, p_bit);
- lan_hdrs_init(nskb, llc->dev->dev_addr, dmac);
- rc = 0;
+ llc_pdu_init_as_sabme_cmd(nskb, 1);
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, dmac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
+ llc_conn_set_p_flag(sk, 1);
}
- llc_conn_set_p_flag(sk, p_bit);
-
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_ua_rsp_f_set_f_flag(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
- u8 f_bit = llc->f_flag;
nskb->dev = llc->dev;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
- llc_pdu_init_as_ua_rsp(nskb, f_bit);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ llc_pdu_init_as_ua_rsp(nskb, llc->f_flag);
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_send_ua_rsp_f_set_p(struct sock *sk, struct sk_buff *skb)
{
u8 f_bit;
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
llc_pdu_decode_pf_bit(skb, &f_bit);
@@ -848,11 +951,16 @@ int llc_conn_ac_send_ua_rsp_f_set_p(struct sock *sk, struct sk_buff *skb)
llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
llc_pdu_init_as_ua_rsp(nskb, f_bit);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
int llc_conn_ac_set_s_flag_0(struct sock *sk, struct sk_buff *skb)
@@ -935,17 +1043,19 @@ int llc_conn_ac_rst_sendack_flag(struct sock *sk, struct sk_buff *skb)
*/
int llc_conn_ac_send_i_rsp_f_set_ackpf(struct sock *sk, struct sk_buff *skb)
{
+ int rc;
struct llc_opt *llc = llc_sk(sk);
- u8 p_bit = llc->ack_pf;
struct llc_sap *sap = llc->sap;
llc_pdu_header_init(skb, LLC_PDU_TYPE_I, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
- llc_pdu_init_as_i_cmd(skb, p_bit, llc->vS, llc->vR);
- lan_hdrs_init(skb, llc->dev->dev_addr, llc->daddr.mac);
- llc_conn_send_pdu(sk, skb);
- llc_conn_ac_inc_vs_by_1(sk, skb);
- return 0;
+ llc_pdu_init_as_i_cmd(skb, llc->ack_pf, llc->vS, llc->vR);
+ rc = llc_mac_hdr_init(skb, llc->dev->dev_addr, llc->daddr.mac);
+ if (!rc) {
+ llc_conn_send_pdu(sk, skb);
+ llc_conn_ac_inc_vs_by_1(sk, skb);
+ }
+ return rc;
}
/**
@@ -983,23 +1093,27 @@ int llc_conn_ac_send_i_as_ack(struct sock *sk, struct sk_buff *skb)
*/
int llc_conn_ac_send_rr_rsp_f_set_ackpf(struct sock *sk, struct sk_buff *skb)
{
- int rc = 1;
+ int rc = -ENOBUFS;
struct sk_buff *nskb = llc_alloc_frame();
if (nskb) {
struct llc_opt *llc = llc_sk(sk);
struct llc_sap *sap = llc->sap;
- u8 f_bit = llc->ack_pf;
nskb->dev = llc->dev;
llc_pdu_header_init(nskb, LLC_PDU_TYPE_S, sap->laddr.lsap,
llc->daddr.lsap, LLC_PDU_RSP);
- llc_pdu_init_as_rr_rsp(nskb, f_bit, llc->vR);
- lan_hdrs_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
- rc = 0;
+ llc_pdu_init_as_rr_rsp(nskb, llc->ack_pf, llc->vR);
+ rc = llc_mac_hdr_init(nskb, llc->dev->dev_addr, llc->daddr.mac);
+ if (rc)
+ goto free;
llc_conn_send_pdu(sk, nskb);
}
+out:
return rc;
+free:
+ kfree_skb(nskb);
+ goto out;
}
/**
@@ -1193,7 +1307,6 @@ int llc_conn_ac_upd_nr_received(struct sock *sk, struct sk_buff *skb)
{
int acked;
u16 unacked = 0;
- u8 fbit;
struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb);
struct llc_opt *llc = llc_sk(sk);
@@ -1215,8 +1328,10 @@ int llc_conn_ac_upd_nr_received(struct sock *sk, struct sk_buff *skb)
mod_timer(&llc->ack_timer.timer,
jiffies + llc->ack_timer.expire * HZ);
} else if (llc->failed_data_req) {
- llc_pdu_decode_pf_bit(skb, &fbit);
- if (fbit == 1) {
+ u8 f_bit;
+
+ llc_pdu_decode_pf_bit(skb, &f_bit);
+ if (f_bit == 1) {
llc->failed_data_req = 0;
llc_conn_ac_data_confirm(sk, skb);
}
diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c
index 3fbb3fe45125..0b4dffbf2824 100644
--- a/net/llc/llc_conn.c
+++ b/net/llc/llc_conn.c
@@ -11,21 +11,22 @@
*
* See the GNU General Public License for more details.
*/
-#include <linux/netdevice.h>
-#include <linux/interrupt.h>
+
#include <linux/init.h>
-#include <net/llc_if.h>
#include <net/llc_sap.h>
#include <net/llc_conn.h>
#include <net/sock.h>
#include <linux/tcp.h>
-#include <net/llc_main.h>
#include <net/llc_c_ev.h>
#include <net/llc_c_ac.h>
#include <net/llc_c_st.h>
-#include <net/llc_mac.h>
#include <net/llc_pdu.h>
-#include <net/llc_s_ev.h>
+
+#if 0
+#define dprintk(args...) printk(KERN_DEBUG args)
+#else
+#define dprintk(args...)
+#endif
static int llc_find_offset(int state, int ev_type);
static void llc_conn_send_pdus(struct sock *sk);
@@ -39,22 +40,6 @@ static struct llc_conn_state_trans *llc_qualify_conn_ev(struct sock *sk,
/* Offset table on connection states transition diagram */
static int llc_offset_table[NBR_CONN_STATES][NBR_CONN_EV];
-void llc_save_primitive(struct sk_buff* skb, u8 prim)
-{
- struct sockaddr_llc *addr = llc_ui_skb_cb(skb);
-
- /* save primitive for use by the user. */
- addr->sllc_family = skb->sk->sk_family;
- addr->sllc_arphrd = skb->dev->type;
- addr->sllc_test = prim == LLC_TEST_PRIM;
- addr->sllc_xid = prim == LLC_XID_PRIM;
- addr->sllc_ua = prim == LLC_DATAUNIT_PRIM;
- llc_pdu_decode_sa(skb, addr->sllc_smac);
- llc_pdu_decode_da(skb, addr->sllc_dmac);
- llc_pdu_decode_dsap(skb, &addr->sllc_dsap);
- llc_pdu_decode_ssap(skb, &addr->sllc_ssap);
-}
-
/**
* llc_conn_state_process - sends event to connection state machine
* @sk: connection
@@ -541,35 +526,6 @@ found:
}
/**
- * llc_lookup_dgram - Finds dgram socket for the local sap/mac
- * @sap: SAP
- * @laddr: address of local LLC (MAC + SAP)
- *
- * Search socket list of the SAP and finds connection using the local
- * mac, and local sap. Returns pointer for socket found, %NULL otherwise.
- */
-struct sock *llc_lookup_dgram(struct llc_sap *sap, struct llc_addr *laddr)
-{
- struct sock *rc;
- struct hlist_node *node;
-
- read_lock_bh(&sap->sk_list.lock);
- sk_for_each(rc, node, &sap->sk_list.list) {
- struct llc_opt *llc = llc_sk(rc);
-
- if (rc->sk_type == SOCK_DGRAM &&
- llc->laddr.lsap == laddr->lsap &&
- llc_mac_match(llc->laddr.mac, laddr->mac)) {
- sock_hold(rc);
- goto found;
- }
- }
- rc = NULL;
-found:
- read_unlock_bh(&sap->sk_list.lock);
- return rc;
-}
-/**
* llc_data_accept_state - designates if in this state data can be sent.
* @state: state of connection.
*
@@ -651,3 +607,323 @@ static int llc_find_offset(int state, int ev_type)
}
return rc;
}
+
+/**
+ * llc_sap_add_socket - adds a socket to a SAP
+ * @sap: SAP
+ * @sk: socket
+ *
+ * This function adds a socket to sk_list of a SAP.
+ */
+void llc_sap_add_socket(struct llc_sap *sap, struct sock *sk)
+{
+ write_lock_bh(&sap->sk_list.lock);
+ llc_sk(sk)->sap = sap;
+ sk_add_node(sk, &sap->sk_list.list);
+ write_unlock_bh(&sap->sk_list.lock);
+}
+
+/**
+ * llc_sap_remove_socket - removes a socket from SAP
+ * @sap: SAP
+ * @sk: socket
+ *
+ * This function removes a connection from sk_list.list of a SAP if
+ * the connection was in this list.
+ */
+void llc_sap_remove_socket(struct llc_sap *sap, struct sock *sk)
+{
+ write_lock_bh(&sap->sk_list.lock);
+ sk_del_node_init(sk);
+ write_unlock_bh(&sap->sk_list.lock);
+}
+
+/**
+ * llc_conn_rcv - sends received pdus to the connection state machine
+ * @sk: current connection structure.
+ * @skb: received frame.
+ *
+ * Sends received pdus to the connection state machine.
+ */
+static int llc_conn_rcv(struct sock* sk, struct sk_buff *skb)
+{
+ struct llc_conn_state_ev *ev = llc_conn_ev(skb);
+ struct llc_opt *llc = llc_sk(sk);
+
+ if (!llc->dev)
+ llc->dev = skb->dev;
+ ev->type = LLC_CONN_EV_TYPE_PDU;
+ ev->reason = 0;
+ return llc_conn_state_process(sk, skb);
+}
+
+void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb)
+{
+ struct llc_addr saddr, daddr;
+ struct sock *sk;
+
+ llc_pdu_decode_sa(skb, saddr.mac);
+ llc_pdu_decode_ssap(skb, &saddr.lsap);
+ llc_pdu_decode_da(skb, daddr.mac);
+ llc_pdu_decode_dsap(skb, &daddr.lsap);
+
+ sk = llc_lookup_established(sap, &saddr, &daddr);
+ if (!sk) {
+ /*
+ * Didn't find an active connection; verify if there
+ * is a listening socket for this llc addr
+ */
+ struct llc_opt *llc;
+ struct sock *parent = llc_lookup_listener(sap, &daddr);
+
+ if (!parent) {
+ dprintk("llc_lookup_listener failed!\n");
+ goto drop;
+ }
+
+ sk = llc_sk_alloc(parent->sk_family, GFP_ATOMIC);
+ if (!sk) {
+ sock_put(parent);
+ goto drop;
+ }
+ llc = llc_sk(sk);
+ memcpy(&llc->laddr, &daddr, sizeof(llc->laddr));
+ memcpy(&llc->daddr, &saddr, sizeof(llc->daddr));
+ llc_sap_add_socket(sap, sk);
+ sock_hold(sk);
+ sock_put(parent);
+ skb->sk = parent;
+ } else
+ skb->sk = sk;
+ bh_lock_sock(sk);
+ if (!sock_owned_by_user(sk))
+ llc_conn_rcv(sk, skb);
+ else {
+ dprintk("%s: adding to backlog...\n", __FUNCTION__);
+ llc_set_backlog_type(skb, LLC_PACKET);
+ sk_add_backlog(sk, skb);
+ }
+ bh_unlock_sock(sk);
+ sock_put(sk);
+ return;
+drop:
+ kfree_skb(skb);
+}
+
+#undef LLC_REFCNT_DEBUG
+#ifdef LLC_REFCNT_DEBUG
+static atomic_t llc_sock_nr;
+#endif
+
+/**
+ * llc_release_sockets - releases all sockets in a sap
+ * @sap: sap to release its sockets
+ *
+ * Releases all connections of a sap. Returns 0 if all actions complete
+ * successfully, nonzero otherwise
+ */
+int llc_release_sockets(struct llc_sap *sap)
+{
+ int rc = 0;
+ struct sock *sk;
+ struct hlist_node *node;
+
+ write_lock_bh(&sap->sk_list.lock);
+
+ sk_for_each(sk, node, &sap->sk_list.list) {
+ llc_sk(sk)->state = LLC_CONN_STATE_TEMP;
+
+ if (llc_send_disc(sk))
+ rc = 1;
+ }
+
+ write_unlock_bh(&sap->sk_list.lock);
+ return rc;
+}
+
+/**
+ * llc_backlog_rcv - Processes rx frames and expired timers.
+ * @sk: LLC sock (p8022 connection)
+ * @skb: queued rx frame or event
+ *
+ * This function processes frames that has received and timers that has
+ * expired during sending an I pdu (refer to data_req_handler). frames
+ * queue by llc_rcv function (llc_mac.c) and timers queue by timer
+ * callback functions(llc_c_ac.c).
+ */
+static int llc_backlog_rcv(struct sock *sk, struct sk_buff *skb)
+{
+ int rc = 0;
+ struct llc_opt *llc = llc_sk(sk);
+
+ if (llc_backlog_type(skb) == LLC_PACKET) {
+ if (llc->state > 1) /* not closed */
+ rc = llc_conn_rcv(sk, skb);
+ else
+ goto out_kfree_skb;
+ } else if (llc_backlog_type(skb) == LLC_EVENT) {
+ /* timer expiration event */
+ if (llc->state > 1) /* not closed */
+ rc = llc_conn_state_process(sk, skb);
+ else
+ goto out_kfree_skb;
+ } else {
+ printk(KERN_ERR "%s: invalid skb in backlog\n", __FUNCTION__);
+ goto out_kfree_skb;
+ }
+out:
+ return rc;
+out_kfree_skb:
+ kfree_skb(skb);
+ goto out;
+}
+
+/**
+ * llc_sk_init - Initializes a socket with default llc values.
+ * @sk: socket to initialize.
+ *
+ * Initializes a socket with default llc values.
+ */
+int llc_sk_init(struct sock* sk)
+{
+ struct llc_opt *llc = kmalloc(sizeof(*llc), GFP_ATOMIC);
+ int rc = -ENOMEM;
+
+ if (!llc)
+ goto out;
+ memset(llc, 0, sizeof(*llc));
+ rc = 0;
+
+ llc->sk = sk;
+ llc->state = LLC_CONN_STATE_ADM;
+ llc->inc_cntr = llc->dec_cntr = 2;
+ llc->dec_step = llc->connect_step = 1;
+
+ init_timer(&llc->ack_timer.timer);
+ llc->ack_timer.expire = LLC_ACK_TIME;
+ llc->ack_timer.timer.data = (unsigned long)sk;
+ llc->ack_timer.timer.function = llc_conn_ack_tmr_cb;
+
+ init_timer(&llc->pf_cycle_timer.timer);
+ llc->pf_cycle_timer.expire = LLC_P_TIME;
+ llc->pf_cycle_timer.timer.data = (unsigned long)sk;
+ llc->pf_cycle_timer.timer.function = llc_conn_pf_cycle_tmr_cb;
+
+ init_timer(&llc->rej_sent_timer.timer);
+ llc->rej_sent_timer.expire = LLC_REJ_TIME;
+ llc->rej_sent_timer.timer.data = (unsigned long)sk;
+ llc->rej_sent_timer.timer.function = llc_conn_rej_tmr_cb;
+
+ init_timer(&llc->busy_state_timer.timer);
+ llc->busy_state_timer.expire = LLC_BUSY_TIME;
+ llc->busy_state_timer.timer.data = (unsigned long)sk;
+ llc->busy_state_timer.timer.function = llc_conn_busy_tmr_cb;
+
+ llc->n2 = 2; /* max retransmit */
+ llc->k = 2; /* tx win size, will adjust dynam */
+ llc->rw = 128; /* rx win size (opt and equal to
+ * tx_win of remote LLC) */
+ skb_queue_head_init(&llc->pdu_unack_q);
+ sk->sk_backlog_rcv = llc_backlog_rcv;
+ llc_sk(sk) = llc;
+out:
+ return rc;
+}
+
+/**
+ * llc_sk_alloc - Allocates LLC sock
+ * @family: upper layer protocol family
+ * @priority: for allocation (%GFP_KERNEL, %GFP_ATOMIC, etc)
+ *
+ * Allocates a LLC sock and initializes it. Returns the new LLC sock
+ * or %NULL if there's no memory available for one
+ */
+struct sock *llc_sk_alloc(int family, int priority)
+{
+ struct sock *sk = sk_alloc(family, priority, 1, NULL);
+
+ if (!sk)
+ goto out;
+ if (llc_sk_init(sk))
+ goto outsk;
+ sock_init_data(NULL, sk);
+ sk_set_owner(sk, THIS_MODULE);
+#ifdef LLC_REFCNT_DEBUG
+ atomic_inc(&llc_sock_nr);
+ printk(KERN_DEBUG "LLC socket %p created in %s, now we have %d alive\n", sk,
+ __FUNCTION__, atomic_read(&llc_sock_nr));
+#endif
+out:
+ return sk;
+outsk:
+ sk_free(sk);
+ sk = NULL;
+ goto out;
+}
+
+/**
+ * llc_sk_free - Frees a LLC socket
+ * @sk - socket to free
+ *
+ * Frees a LLC socket
+ */
+void llc_sk_free(struct sock *sk)
+{
+ struct llc_opt *llc = llc_sk(sk);
+
+ llc->state = LLC_CONN_OUT_OF_SVC;
+ /* Stop all (possibly) running timers */
+ llc_conn_ac_stop_all_timers(sk, NULL);
+#ifdef DEBUG_LLC_CONN_ALLOC
+ printk(KERN_INFO "%s: unackq=%d, txq=%d\n", __FUNCTION__,
+ skb_queue_len(&llc->pdu_unack_q),
+ skb_queue_len(&sk->sk_write_queue));
+#endif
+ skb_queue_purge(&sk->sk_receive_queue);
+ skb_queue_purge(&sk->sk_write_queue);
+ skb_queue_purge(&llc->pdu_unack_q);
+#ifdef LLC_REFCNT_DEBUG
+ if (atomic_read(&sk->sk_refcnt) != 1) {
+ printk(KERN_DEBUG "Destruction of LLC sock %p delayed in %s, cnt=%d\n",
+ sk, __FUNCTION__, atomic_read(&sk->sk_refcnt));
+ printk(KERN_DEBUG "%d LLC sockets are still alive\n",
+ atomic_read(&llc_sock_nr));
+ } else {
+ atomic_dec(&llc_sock_nr);
+ printk(KERN_DEBUG "LLC socket %p released in %s, %d are still alive\n", sk,
+ __FUNCTION__, atomic_read(&llc_sock_nr));
+ }
+#endif
+ sock_put(sk);
+}
+
+/**
+ * llc_sk_reset - resets a connection
+ * @sk: LLC socket to reset
+ *
+ * Resets a connection to the out of service state. Stops its timers
+ * and frees any frames in the queues of the connection.
+ */
+void llc_sk_reset(struct sock *sk)
+{
+ struct llc_opt *llc = llc_sk(sk);
+
+ llc_conn_ac_stop_all_timers(sk, NULL);
+ skb_queue_purge(&sk->sk_write_queue);
+ skb_queue_purge(&llc->pdu_unack_q);
+ llc->remote_busy_flag = 0;
+ llc->cause_flag = 0;
+ llc->retry_count = 0;
+ llc_conn_set_p_flag(sk, 0);
+ llc->f_flag = 0;
+ llc->s_flag = 0;
+ llc->ack_pf = 0;
+ llc->first_pdu_Ns = 0;
+ llc->ack_must_be_send = 0;
+ llc->dec_step = 1;
+ llc->inc_cntr = 2;
+ llc->dec_cntr = 2;
+ llc->X = 0;
+ llc->failed_data_req = 0 ;
+ llc->last_nr = 0;
+}
diff --git a/net/llc/llc_core.c b/net/llc/llc_core.c
new file mode 100644
index 000000000000..d0f9262505b0
--- /dev/null
+++ b/net/llc/llc_core.c
@@ -0,0 +1,181 @@
+/*
+ * llc_core.c - Minimum needed routines for sap handling and module init/exit
+ *
+ * Copyright (c) 1997 by Procom Technology, Inc.
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ *
+ * This program can be redistributed or modified under the terms of the
+ * GNU General Public License as published by the Free Software Foundation.
+ * This program is distributed without any warranty or implied warranty
+ * of merchantability or fitness for a particular purpose.
+ *
+ * See the GNU General Public License for more details.
+ */
+
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/if_ether.h>
+#include <linux/netdevice.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+#include <linux/init.h>
+#include <net/llc.h>
+
+LIST_HEAD(llc_sap_list);
+rwlock_t llc_sap_list_lock = RW_LOCK_UNLOCKED;
+
+unsigned char llc_station_mac_sa[ETH_ALEN];
+
+/**
+ * llc_sap_alloc - allocates and initializes sap.
+ *
+ * Allocates and initializes sap.
+ */
+struct llc_sap *llc_sap_alloc(void)
+{
+ struct llc_sap *sap = kmalloc(sizeof(*sap), GFP_ATOMIC);
+
+ if (sap) {
+ memset(sap, 0, sizeof(*sap));
+ sap->state = LLC_SAP_STATE_ACTIVE;
+ memcpy(sap->laddr.mac, llc_station_mac_sa, ETH_ALEN);
+ rwlock_init(&sap->sk_list.lock);
+ }
+ return sap;
+}
+
+/**
+ * llc_add_sap - add sap to station list
+ * @sap: Address of the sap
+ *
+ * Adds a sap to the LLC's station sap list.
+ */
+void llc_add_sap(struct llc_sap *sap)
+{
+ write_lock_bh(&llc_sap_list_lock);
+ list_add_tail(&sap->node, &llc_sap_list);
+ write_unlock_bh(&llc_sap_list_lock);
+}
+
+/**
+ * llc_del_sap - del sap from station list
+ * @sap: Address of the sap
+ *
+ * Removes a sap to the LLC's station sap list.
+ */
+void llc_del_sap(struct llc_sap *sap)
+{
+ write_lock_bh(&llc_sap_list_lock);
+ list_del(&sap->node);
+ write_unlock_bh(&llc_sap_list_lock);
+}
+
+/**
+ * llc_sap_find - searchs a SAP in station
+ * @sap_value: sap to be found
+ *
+ * Searchs for a sap in the sap list of the LLC's station upon the sap ID.
+ * Returns the sap or %NULL if not found.
+ */
+struct llc_sap *llc_sap_find(unsigned char sap_value)
+{
+ struct llc_sap* sap;
+
+ read_lock_bh(&llc_sap_list_lock);
+ list_for_each_entry(sap, &llc_sap_list, node)
+ if (sap->laddr.lsap == sap_value)
+ goto out;
+ sap = NULL;
+out:
+ read_unlock_bh(&llc_sap_list_lock);
+ return sap;
+}
+
+/**
+ * llc_sap_open - open interface to the upper layers.
+ * @lsap: SAP number.
+ * @func: rcv func for datalink protos
+ *
+ * Interface function to upper layer. Each one who wants to get a SAP
+ * (for example NetBEUI) should call this function. Returns the opened
+ * SAP for success, NULL for failure.
+ */
+struct llc_sap *llc_sap_open(unsigned char lsap,
+ int (*func)(struct sk_buff *skb,
+ struct net_device *dev,
+ struct packet_type *pt))
+{
+ struct llc_sap *sap = llc_sap_find(lsap);
+
+ if (sap) { /* SAP already exists */
+ sap = NULL;
+ goto out;
+ }
+ sap = llc_sap_alloc();
+ if (!sap)
+ goto out;
+ sap->laddr.lsap = lsap;
+ sap->rcv_func = func;
+ llc_add_sap(sap);
+out:
+ return sap;
+}
+
+/**
+ * llc_sap_close - close interface for upper layers.
+ * @sap: SAP to be closed.
+ *
+ * Close interface function to upper layer. Each one who wants to
+ * close an open SAP (for example NetBEUI) should call this function.
+ * Removes this sap from the list of saps in the station and then
+ * frees the memory for this sap.
+ */
+void llc_sap_close(struct llc_sap *sap)
+{
+ WARN_ON(!hlist_empty(&sap->sk_list.list));
+ llc_del_sap(sap);
+ kfree(sap);
+}
+
+static struct packet_type llc_packet_type = {
+ .type = __constant_htons(ETH_P_802_2),
+ .func = llc_rcv,
+ .data = (void *)1,
+};
+
+static struct packet_type llc_tr_packet_type = {
+ .type = __constant_htons(ETH_P_TR_802_2),
+ .func = llc_rcv,
+ .data = (void *)1,
+};
+
+static int __init llc_init(void)
+{
+ if (dev_base->next)
+ memcpy(llc_station_mac_sa, dev_base->next->dev_addr, ETH_ALEN);
+ else
+ memset(llc_station_mac_sa, 0, ETH_ALEN);
+ dev_add_pack(&llc_packet_type);
+ dev_add_pack(&llc_tr_packet_type);
+ return 0;
+}
+
+static void __exit llc_exit(void)
+{
+ dev_remove_pack(&llc_packet_type);
+ dev_remove_pack(&llc_tr_packet_type);
+}
+
+module_init(llc_init);
+module_exit(llc_exit);
+
+EXPORT_SYMBOL(llc_station_mac_sa);
+EXPORT_SYMBOL(llc_sap_list);
+EXPORT_SYMBOL(llc_sap_list_lock);
+EXPORT_SYMBOL(llc_sap_find);
+EXPORT_SYMBOL(llc_sap_open);
+EXPORT_SYMBOL(llc_sap_close);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Procom 1997, Jay Schullist 2001, Arnaldo C. Melo 2001-2003");
+MODULE_DESCRIPTION("LLC IEEE 802.2 core support");
diff --git a/net/llc/llc_evnt.c b/net/llc/llc_evnt.c
deleted file mode 100644
index 3ff47997522d..000000000000
--- a/net/llc/llc_evnt.c
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * llc_evnt.c - LLC station component event match functions
- * Description :
- * Functions in this module are implementation of station component events.
- * Details of events can be found in IEEE-802.2 standard document.
- * All functions have one station and one event as input argument. All of
- * them return 0 On success and 1 otherwise.
- *
- * Copyright (c) 1997 by Procom Technology, Inc.
- * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *
- * This program can be redistributed or modified under the terms of the
- * GNU General Public License as published by the Free Software Foundation.
- * This program is distributed without any warranty or implied warranty
- * of merchantability or fitness for a particular purpose.
- *
- * See the GNU General Public License for more details.
- */
-#include <linux/socket.h>
-#include <net/sock.h>
-#include <net/llc_if.h>
-#include <net/llc_main.h>
-#include <net/llc_evnt.h>
-#include <net/llc_pdu.h>
-
-int llc_stat_ev_enable_with_dup_addr_check(struct llc_station *station,
- struct sk_buff *skb)
-{
- struct llc_station_state_ev *ev = llc_station_ev(skb);
-
- return ev->type == LLC_STATION_EV_TYPE_SIMPLE &&
- ev->prim_type ==
- LLC_STATION_EV_ENABLE_WITH_DUP_ADDR_CHECK ? 0 : 1;
-}
-
-int llc_stat_ev_enable_without_dup_addr_check(struct llc_station *station,
- struct sk_buff *skb)
-{
- struct llc_station_state_ev *ev = llc_station_ev(skb);
-
- return ev->type == LLC_STATION_EV_TYPE_SIMPLE &&
- ev->prim_type ==
- LLC_STATION_EV_ENABLE_WITHOUT_DUP_ADDR_CHECK ? 0 : 1;
-}
-
-int llc_stat_ev_ack_tmr_exp_lt_retry_cnt_max_retry(struct llc_station *station,
- struct sk_buff *skb)
-{
- struct llc_station_state_ev *ev = llc_station_ev(skb);
-
- return ev->type == LLC_STATION_EV_TYPE_ACK_TMR &&
- station->retry_count < station->maximum_retry ? 0 : 1;
-}
-
-int llc_stat_ev_ack_tmr_exp_eq_retry_cnt_max_retry(struct llc_station *station,
- struct sk_buff *skb)
-{
- struct llc_station_state_ev *ev = llc_station_ev(skb);
-
- return ev->type == LLC_STATION_EV_TYPE_ACK_TMR &&
- station->retry_count == station->maximum_retry ? 0 : 1;
-}
-
-int llc_stat_ev_rx_null_dsap_xid_c(struct llc_station *station,
- struct sk_buff *skb)
-{
- struct llc_station_state_ev *ev = llc_station_ev(skb);
- struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
-
- return ev->type == LLC_STATION_EV_TYPE_PDU &&
- LLC_PDU_IS_CMD(pdu) && /* command PDU */
- LLC_PDU_TYPE_IS_U(pdu) && /* U type PDU */
- LLC_U_PDU_CMD(pdu) == LLC_1_PDU_CMD_XID &&
- !pdu->dsap ? 0 : 1; /* NULL DSAP value */
-}
-
-int llc_stat_ev_rx_null_dsap_0_xid_r_xid_r_cnt_eq(struct llc_station *station,
- struct sk_buff *skb)
-{
- struct llc_station_state_ev *ev = llc_station_ev(skb);
- struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
-
- return ev->type == LLC_STATION_EV_TYPE_PDU &&
- LLC_PDU_IS_RSP(pdu) && /* response PDU */
- LLC_PDU_TYPE_IS_U(pdu) && /* U type PDU */
- LLC_U_PDU_RSP(pdu) == LLC_1_PDU_CMD_XID &&
- !pdu->dsap && /* NULL DSAP value */
- !station->xid_r_count ? 0 : 1;
-}
-
-int llc_stat_ev_rx_null_dsap_1_xid_r_xid_r_cnt_eq(struct llc_station *station,
- struct sk_buff *skb)
-{
- struct llc_station_state_ev *ev = llc_station_ev(skb);
- struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
-
- return ev->type == LLC_STATION_EV_TYPE_PDU &&
- LLC_PDU_IS_RSP(pdu) && /* response PDU */
- LLC_PDU_TYPE_IS_U(pdu) && /* U type PDU */
- LLC_U_PDU_RSP(pdu) == LLC_1_PDU_CMD_XID &&
- !pdu->dsap && /* NULL DSAP value */
- station->xid_r_count == 1 ? 0 : 1;
-}
-
-int llc_stat_ev_rx_null_dsap_test_c(struct llc_station *station,
- struct sk_buff *skb)
-{
- struct llc_station_state_ev *ev = llc_station_ev(skb);
- struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
-
- return ev->type == LLC_STATION_EV_TYPE_PDU &&
- LLC_PDU_IS_CMD(pdu) && /* command PDU */
- LLC_PDU_TYPE_IS_U(pdu) && /* U type PDU */
- LLC_U_PDU_CMD(pdu) == LLC_1_PDU_CMD_TEST &&
- !pdu->dsap ? 0 : 1; /* NULL DSAP */
-}
-
-int llc_stat_ev_disable_req(struct llc_station *station, struct sk_buff *skb)
-{
- struct llc_station_state_ev *ev = llc_station_ev(skb);
-
- return ev->type == LLC_STATION_EV_TYPE_PRIM &&
- ev->prim == LLC_DISABLE_PRIM &&
- ev->prim_type == LLC_PRIM_TYPE_REQ ? 0 : 1;
-}
diff --git a/net/llc/llc_if.c b/net/llc/llc_if.c
index 217765b6fb44..31253d2a3bc9 100644
--- a/net/llc/llc_if.c
+++ b/net/llc/llc_if.c
@@ -25,136 +25,8 @@
#include <net/llc_c_ev.h>
#include <net/llc_c_ac.h>
#include <net/llc_c_st.h>
-#include <net/llc_main.h>
-/**
- * llc_sap_open - open interface to the upper layers.
- * @lsap: SAP number.
- * @func: rcv func for datalink protos
- *
- * Interface function to upper layer. Each one who wants to get a SAP
- * (for example NetBEUI) should call this function. Returns the opened
- * SAP for success, NULL for failure.
- */
-struct llc_sap *llc_sap_open(u8 lsap, int (*func)(struct sk_buff *skb,
- struct net_device *dev,
- struct packet_type *pt))
-{
- /* verify this SAP is not already open; if so, return error */
- struct llc_sap *sap;
-
- sap = llc_sap_find(lsap);
- if (sap) { /* SAP already exists */
- sap = NULL;
- goto out;
- }
- /* sap requested does not yet exist */
- sap = llc_sap_alloc();
- if (!sap)
- goto out;
- /* allocated a SAP; initialize it and clear out its memory pool */
- sap->laddr.lsap = lsap;
- sap->rcv_func = func;
- sap->station = &llc_main_station;
- /* initialized SAP; add it to list of SAPs this station manages */
- llc_sap_save(sap);
-out:
- return sap;
-}
-
-/**
- * llc_sap_close - close interface for upper layers.
- * @sap: SAP to be closed.
- *
- * Close interface function to upper layer. Each one who wants to
- * close an open SAP (for example NetBEUI) should call this function.
- */
-void llc_sap_close(struct llc_sap *sap)
-{
- llc_free_sap(sap);
-}
-
-/**
- * llc_build_and_send_ui_pkt - unitdata request interface for upper layers
- * @sap: sap to use
- * @skb: packet to send
- * @dmac: destination mac address
- * @dsap: destination sap
- *
- * Upper layers calls this function when upper layer wants to send data
- * using connection-less mode communication (UI pdu).
- *
- * Accept data frame from network layer to be sent using connection-
- * less mode communication; timeout/retries handled by network layer;
- * package primitive as an event and send to SAP event handler
- */
-void llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb,
- u8 *dmac, u8 dsap)
-{
- struct llc_sap_state_ev *ev = llc_sap_ev(skb);
-
- ev->saddr.lsap = sap->laddr.lsap;
- ev->daddr.lsap = dsap;
- memcpy(ev->saddr.mac, skb->dev->dev_addr, IFHWADDRLEN);
- memcpy(ev->daddr.mac, dmac, IFHWADDRLEN);
-
- ev->type = LLC_SAP_EV_TYPE_PRIM;
- ev->prim = LLC_DATAUNIT_PRIM;
- ev->prim_type = LLC_PRIM_TYPE_REQ;
- llc_sap_state_process(sap, skb);
-}
-
-/**
- * llc_build_and_send_test_pkt - TEST interface for upper layers.
- * @sap: sap to use
- * @skb: packet to send
- * @dmac: destination mac address
- * @dsap: destination sap
- *
- * This function is called when upper layer wants to send a TEST pdu.
- * Returns 0 for success, 1 otherwise.
- */
-void llc_build_and_send_test_pkt(struct llc_sap *sap,
- struct sk_buff *skb, u8 *dmac, u8 dsap)
-{
- struct llc_sap_state_ev *ev = llc_sap_ev(skb);
-
- ev->saddr.lsap = sap->laddr.lsap;
- ev->daddr.lsap = dsap;
- memcpy(ev->saddr.mac, skb->dev->dev_addr, IFHWADDRLEN);
- memcpy(ev->daddr.mac, dmac, IFHWADDRLEN);
-
- ev->type = LLC_SAP_EV_TYPE_PRIM;
- ev->prim = LLC_TEST_PRIM;
- ev->prim_type = LLC_PRIM_TYPE_REQ;
- llc_sap_state_process(sap, skb);
-}
-
-/**
- * llc_build_and_send_xid_pkt - XID interface for upper layers
- * @sap: sap to use
- * @skb: packet to send
- * @dmac: destination mac address
- * @dsap: destination sap
- *
- * This function is called when upper layer wants to send a XID pdu.
- * Returns 0 for success, 1 otherwise.
- */
-void llc_build_and_send_xid_pkt(struct llc_sap *sap, struct sk_buff *skb,
- u8 *dmac, u8 dsap)
-{
- struct llc_sap_state_ev *ev = llc_sap_ev(skb);
-
- ev->saddr.lsap = sap->laddr.lsap;
- ev->daddr.lsap = dsap;
- memcpy(ev->saddr.mac, skb->dev->dev_addr, IFHWADDRLEN);
- memcpy(ev->daddr.mac, dmac, IFHWADDRLEN);
-
- ev->type = LLC_SAP_EV_TYPE_PRIM;
- ev->prim = LLC_XID_PRIM;
- ev->prim_type = LLC_PRIM_TYPE_REQ;
- llc_sap_state_process(sap, skb);
-}
+u8 llc_mac_null_var[IFHWADDRLEN];
/**
* llc_build_and_send_pkt - Connection data sending for upper layers.
@@ -307,7 +179,3 @@ int llc_build_and_send_reset_pkt(struct sock *sk)
}
return rc;
}
-
-EXPORT_SYMBOL(llc_sap_open);
-EXPORT_SYMBOL(llc_sap_close);
-EXPORT_SYMBOL(llc_build_and_send_ui_pkt);
diff --git a/net/llc/llc_input.c b/net/llc/llc_input.c
new file mode 100644
index 000000000000..8a789cd2659a
--- /dev/null
+++ b/net/llc/llc_input.c
@@ -0,0 +1,189 @@
+/*
+ * llc_input.c - Minimal input path for LLC
+ *
+ * Copyright (c) 1997 by Procom Technology, Inc.
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ *
+ * This program can be redistributed or modified under the terms of the
+ * GNU General Public License as published by the Free Software Foundation.
+ * This program is distributed without any warranty or implied warranty
+ * of merchantability or fitness for a particular purpose.
+ *
+ * See the GNU General Public License for more details.
+ */
+#include <linux/netdevice.h>
+#include <net/llc.h>
+#include <net/llc_pdu.h>
+#include <net/llc_sap.h>
+
+#if 0
+#define dprintk(args...) printk(KERN_DEBUG args)
+#else
+#define dprintk(args...)
+#endif
+
+/*
+ * Packet handler for the station, registerable because in the minimal
+ * LLC core that is taking shape only the very minimal subset of LLC that
+ * is needed for things like IPX, Appletalk, etc will stay, with all the
+ * rest in the llc1 and llc2 modules.
+ */
+static void (*llc_station_handler)(struct sk_buff *skb);
+
+/*
+ * Packet handlers for LLC_DEST_SAP and LLC_DEST_CONN.
+ */
+static void (*llc_type_handlers[2])(struct llc_sap *sap,
+ struct sk_buff *skb);
+
+void llc_add_pack(int type, void (*handler)(struct llc_sap *sap,
+ struct sk_buff *skb))
+{
+ if (type == LLC_DEST_SAP || type == LLC_DEST_CONN)
+ llc_type_handlers[type] = handler;
+}
+
+void llc_remove_pack(int type)
+{
+ if (type == LLC_DEST_SAP || type == LLC_DEST_CONN)
+ llc_type_handlers[type] = NULL;
+}
+
+void llc_set_station_handler(void (*handler)(struct sk_buff *skb))
+{
+ llc_station_handler = handler;
+}
+
+/**
+ * llc_pdu_type - returns which LLC component must handle for PDU
+ * @skb: input skb
+ *
+ * This function returns which LLC component must handle this PDU.
+ */
+static __inline__ int llc_pdu_type(struct sk_buff *skb)
+{
+ int type = LLC_DEST_CONN; /* I-PDU or S-PDU type */
+ struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb);
+
+ if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) != LLC_PDU_TYPE_U)
+ goto out;
+ switch (LLC_U_PDU_CMD(pdu)) {
+ case LLC_1_PDU_CMD_XID:
+ case LLC_1_PDU_CMD_UI:
+ case LLC_1_PDU_CMD_TEST:
+ type = LLC_DEST_SAP;
+ break;
+ case LLC_2_PDU_CMD_SABME:
+ case LLC_2_PDU_CMD_DISC:
+ case LLC_2_PDU_RSP_UA:
+ case LLC_2_PDU_RSP_DM:
+ case LLC_2_PDU_RSP_FRMR:
+ break;
+ default:
+ type = LLC_DEST_INVALID;
+ break;
+ }
+out:
+ return type;
+}
+
+/**
+ * llc_fixup_skb - initializes skb pointers
+ * @skb: This argument points to incoming skb
+ *
+ * Initializes internal skb pointer to start of network layer by deriving
+ * length of LLC header; finds length of LLC control field in LLC header
+ * by looking at the two lowest-order bits of the first control field
+ * byte; field is either 3 or 4 bytes long.
+ */
+static inline int llc_fixup_skb(struct sk_buff *skb)
+{
+ u8 llc_len = 2;
+ struct llc_pdu_sn *pdu;
+
+ if (!pskb_may_pull(skb, sizeof(*pdu)))
+ return 0;
+
+ pdu = (struct llc_pdu_sn *)skb->data;
+ if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) == LLC_PDU_TYPE_U)
+ llc_len = 1;
+ llc_len += 2;
+ skb->h.raw += llc_len;
+ skb_pull(skb, llc_len);
+ if (skb->protocol == htons(ETH_P_802_2)) {
+ u16 pdulen = ((struct ethhdr *)skb->mac.raw)->h_proto,
+ data_size = ntohs(pdulen) - llc_len;
+
+ skb_trim(skb, data_size);
+ }
+ return 1;
+}
+
+/**
+ * llc_rcv - 802.2 entry point from net lower layers
+ * @skb: received pdu
+ * @dev: device that receive pdu
+ * @pt: packet type
+ *
+ * When the system receives a 802.2 frame this function is called. It
+ * checks SAP and connection of received pdu and passes frame to
+ * llc_{station,sap,conn}_rcv for sending to proper state machine. If
+ * the frame is related to a busy connection (a connection is sending
+ * data now), it queues this frame in the connection's backlog.
+ */
+int llc_rcv(struct sk_buff *skb, struct net_device *dev,
+ struct packet_type *pt)
+{
+ struct llc_sap *sap;
+ struct llc_pdu_sn *pdu;
+ int dest;
+
+ /*
+ * When the interface is in promisc. mode, drop all the crap that it
+ * receives, do not try to analyse it.
+ */
+ if (unlikely(skb->pkt_type == PACKET_OTHERHOST)) {
+ dprintk("%s: PACKET_OTHERHOST\n", __FUNCTION__);
+ goto drop;
+ }
+ skb = skb_share_check(skb, GFP_ATOMIC);
+ if (unlikely(!skb))
+ goto out;
+ if (unlikely(!llc_fixup_skb(skb)))
+ goto drop;
+ pdu = llc_pdu_sn_hdr(skb);
+ if (unlikely(!pdu->dsap)) /* NULL DSAP, refer to station */
+ goto handle_station;
+ sap = llc_sap_find(pdu->dsap);
+ if (unlikely(!sap)) {/* unknown SAP */
+ dprintk("%s: llc_sap_find(%02X) failed!\n", __FUNCTION__,
+ pdu->dsap);
+ goto drop;
+ }
+ /*
+ * First the upper layer protocols that don't need the full
+ * LLC functionality
+ */
+ if (sap->rcv_func) {
+ sap->rcv_func(skb, dev, pt);
+ goto out;
+ }
+ dest = llc_pdu_type(skb);
+ if (unlikely(!dest || !llc_type_handlers[dest - 1]))
+ goto drop;
+ llc_type_handlers[dest - 1](sap, skb);
+out:
+ return 0;
+drop:
+ kfree_skb(skb);
+ goto out;
+handle_station:
+ if (!llc_station_handler)
+ goto drop;
+ llc_station_handler(skb);
+ goto out;
+}
+
+EXPORT_SYMBOL(llc_add_pack);
+EXPORT_SYMBOL(llc_remove_pack);
+EXPORT_SYMBOL(llc_set_station_handler);
diff --git a/net/llc/llc_mac.c b/net/llc/llc_mac.c
deleted file mode 100644
index 1fa9bb706975..000000000000
--- a/net/llc/llc_mac.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * llc_mac.c - Manages interface between LLC and MAC
- *
- * Copyright (c) 1997 by Procom Technology, Inc.
- * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *
- * This program can be redistributed or modified under the terms of the
- * GNU General Public License as published by the Free Software Foundation.
- * This program is distributed without any warranty or implied warranty
- * of merchantability or fitness for a particular purpose.
- *
- * See the GNU General Public License for more details.
- */
-#include <linux/netdevice.h>
-#include <linux/if_arp.h>
-#include <linux/if_tr.h>
-#include <linux/rtnetlink.h>
-#include <net/llc_if.h>
-#include <net/llc_mac.h>
-#include <net/llc_pdu.h>
-#include <net/llc_sap.h>
-#include <net/llc_conn.h>
-#include <net/sock.h>
-#include <net/llc_main.h>
-#include <net/llc_evnt.h>
-#include <net/llc_c_ev.h>
-#include <net/llc_s_ev.h>
-#include <linux/trdevice.h>
-
-#if 0
-#define dprintk(args...) printk(KERN_DEBUG args)
-#else
-#define dprintk(args...)
-#endif
-
-u8 llc_mac_null_var[IFHWADDRLEN];
-
-static int fix_up_incoming_skb(struct sk_buff *skb);
-static void llc_station_rcv(struct sk_buff *skb);
-static void llc_sap_rcv(struct llc_sap *sap, struct sk_buff *skb);
-
-/**
- * llc_rcv - 802.2 entry point from net lower layers
- * @skb: received pdu
- * @dev: device that receive pdu
- * @pt: packet type
- *
- * When the system receives a 802.2 frame this function is called. It
- * checks SAP and connection of received pdu and passes frame to
- * llc_{station,sap,conn}_rcv for sending to proper state machine. If
- * the frame is related to a busy connection (a connection is sending
- * data now), it queues this frame in the connection's backlog.
- */
-int llc_rcv(struct sk_buff *skb, struct net_device *dev,
- struct packet_type *pt)
-{
- struct llc_sap *sap;
- struct llc_pdu_sn *pdu;
- u8 dest;
-
- /*
- * When the interface is in promisc. mode, drop all the crap that it
- * receives, do not try to analyse it.
- */
- if (skb->pkt_type == PACKET_OTHERHOST) {
- dprintk("%s: PACKET_OTHERHOST\n", __FUNCTION__);
- goto drop;
- }
- skb = skb_share_check(skb, GFP_ATOMIC);
- if (!skb)
- goto out;
- if (!fix_up_incoming_skb(skb))
- goto drop;
- pdu = llc_pdu_sn_hdr(skb);
- if (!pdu->dsap) { /* NULL DSAP, refer to station */
- dprintk("%s: calling llc_station_rcv!\n", __FUNCTION__);
- llc_station_rcv(skb);
- goto out;
- }
- sap = llc_sap_find(pdu->dsap);
- if (!sap) {/* unknown SAP */
- dprintk("%s: llc_sap_find(%02X) failed!\n", __FUNCTION__,
- pdu->dsap);
- goto drop;
- }
- llc_decode_pdu_type(skb, &dest);
- if (dest == LLC_DEST_SAP) { /* type 1 services */
- if (sap->rcv_func)
- sap->rcv_func(skb, dev, pt);
- else {
- struct llc_addr laddr;
- struct sock *sk;
-
- llc_pdu_decode_da(skb, laddr.mac);
- llc_pdu_decode_dsap(skb, &laddr.lsap);
-
- sk = llc_lookup_dgram(sap, &laddr);
- if (!sk)
- goto drop;
- skb->sk = sk;
- llc_sap_rcv(sap, skb);
- sock_put(sk);
- }
- } else if (dest == LLC_DEST_CONN) {
- struct llc_addr saddr, daddr;
- struct sock *sk;
- int rc;
-
- llc_pdu_decode_sa(skb, saddr.mac);
- llc_pdu_decode_ssap(skb, &saddr.lsap);
- llc_pdu_decode_da(skb, daddr.mac);
- llc_pdu_decode_dsap(skb, &daddr.lsap);
-
- sk = llc_lookup_established(sap, &saddr, &daddr);
- if (!sk) {
- /*
- * Didn't find an active connection; verify if there
- * is a listening socket for this llc addr
- */
- struct llc_opt *llc;
- struct sock *parent;
-
- parent = llc_lookup_listener(sap, &daddr);
-
- if (!parent) {
- dprintk("llc_lookup_listener failed!\n");
- goto drop;
- }
-
- sk = llc_sk_alloc(parent->sk_family, GFP_ATOMIC);
- if (!sk) {
- sock_put(parent);
- goto drop;
- }
- llc = llc_sk(sk);
- memcpy(&llc->laddr, &daddr, sizeof(llc->laddr));
- memcpy(&llc->daddr, &saddr, sizeof(llc->daddr));
- llc_sap_assign_sock(sap, sk);
- sock_hold(sk);
- sock_put(parent);
- skb->sk = parent;
- } else
- skb->sk = sk;
- bh_lock_sock(sk);
- if (!sock_owned_by_user(sk)) {
- /* rc = */ llc_conn_rcv(sk, skb);
- rc = 0;
- } else {
- dprintk("%s: adding to backlog...\n", __FUNCTION__);
- llc_set_backlog_type(skb, LLC_PACKET);
- sk_add_backlog(sk, skb);
- rc = 0;
- }
- bh_unlock_sock(sk);
- sock_put(sk);
- if (rc)
- goto drop;
- } else /* unknown or not supported pdu */
- goto drop;
-out:
- return 0;
-drop:
- kfree_skb(skb);
- goto out;
-}
-
-/**
- * fix_up_incoming_skb - initializes skb pointers
- * @skb: This argument points to incoming skb
- *
- * Initializes internal skb pointer to start of network layer by deriving
- * length of LLC header; finds length of LLC control field in LLC header
- * by looking at the two lowest-order bits of the first control field
- * byte; field is either 3 or 4 bytes long.
- */
-static int fix_up_incoming_skb(struct sk_buff *skb)
-{
- u8 llc_len = 2;
- struct llc_pdu_sn *pdu;
-
- if (!pskb_may_pull(skb, sizeof(*pdu)))
- return 0;
-
- pdu = (struct llc_pdu_sn *)skb->data;
- if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) == LLC_PDU_TYPE_U)
- llc_len = 1;
- llc_len += 2;
- skb->h.raw += llc_len;
- skb_pull(skb, llc_len);
- if (skb->protocol == htons(ETH_P_802_2)) {
- u16 pdulen = ((struct ethhdr *)skb->mac.raw)->h_proto,
- data_size = ntohs(pdulen) - llc_len;
-
- skb_trim(skb, data_size);
- }
- return 1;
-}
-
-/*
- * llc_station_rcv - send received pdu to the station state machine
- * @skb: received frame.
- *
- * Sends data unit to station state machine.
- */
-static void llc_station_rcv(struct sk_buff *skb)
-{
- struct llc_station_state_ev *ev = llc_station_ev(skb);
-
- ev->type = LLC_STATION_EV_TYPE_PDU;
- ev->reason = 0;
- llc_station_state_process(&llc_main_station, skb);
-}
-
-
-/**
- * llc_conn_rcv - sends received pdus to the connection state machine
- * @sk: current connection structure.
- * @skb: received frame.
- *
- * Sends received pdus to the connection state machine.
- */
-int llc_conn_rcv(struct sock* sk, struct sk_buff *skb)
-{
- struct llc_conn_state_ev *ev = llc_conn_ev(skb);
- struct llc_opt *llc = llc_sk(sk);
-
- if (!llc->dev)
- llc->dev = skb->dev;
- ev->type = LLC_CONN_EV_TYPE_PDU;
- ev->reason = 0;
- return llc_conn_state_process(sk, skb);
-}
-
-/**
- * llc_sap_rcv - sends received pdus to the sap state machine
- * @sap: current sap component structure.
- * @skb: received frame.
- *
- * Sends received pdus to the sap state machine.
- */
-static void llc_sap_rcv(struct llc_sap *sap, struct sk_buff *skb)
-{
- struct llc_sap_state_ev *ev = llc_sap_ev(skb);
-
- ev->type = LLC_SAP_EV_TYPE_PDU;
- ev->reason = 0;
- llc_sap_state_process(sap, skb);
-}
-
-/**
- * lan_hdrs_init - fills MAC header fields
- * @skb: Address of the frame to initialize its MAC header
- * @sa: The MAC source address
- * @da: The MAC destination address
- *
- * Fills MAC header fields, depending on MAC type. Returns 0, If MAC type
- * is a valid type and initialization completes correctly 1, otherwise.
- */
-u16 lan_hdrs_init(struct sk_buff *skb, u8 *sa, u8 *da)
-{
- u16 rc = 0;
-
- switch (skb->dev->type) {
-#ifdef CONFIG_TR
- case ARPHRD_IEEE802_TR: {
- struct trh_hdr *trh;
- struct net_device *dev = skb->dev;
-
- trh = (struct trh_hdr *)skb_push(skb, sizeof(*trh));
- trh->ac = AC;
- trh->fc = LLC_FRAME;
- if (sa)
- memcpy(trh->saddr, sa, dev->addr_len);
- else
- memset(trh->saddr, 0, dev->addr_len);
- if (da) {
- memcpy(trh->daddr, da, dev->addr_len);
- tr_source_route(skb, trh, dev);
- }
- skb->mac.raw = skb->data;
- break;
- }
-#endif
- case ARPHRD_ETHER:
- case ARPHRD_LOOPBACK: {
- unsigned short len = skb->len;
- struct ethhdr *eth;
-
- skb->mac.raw = skb_push(skb, sizeof(*eth));
- eth = (struct ethhdr *)skb->mac.raw;
- eth->h_proto = htons(len);
- memcpy(eth->h_dest, da, ETH_ALEN);
- memcpy(eth->h_source, sa, ETH_ALEN);
- break;
- }
- default:
- printk(KERN_WARNING "Unknown DEVICE type : %d\n",
- skb->dev->type);
- rc = 1;
- }
- return rc;
-}
diff --git a/net/llc/llc_main.c b/net/llc/llc_main.c
deleted file mode 100644
index 8f2fc4d7ec71..000000000000
--- a/net/llc/llc_main.c
+++ /dev/null
@@ -1,607 +0,0 @@
-/*
- * llc_main.c - This module contains main functions to manage station, saps
- * and connections of the LLC.
- *
- * Copyright (c) 1997 by Procom Technology, Inc.
- * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *
- * This program can be redistributed or modified under the terms of the
- * GNU General Public License as published by the Free Software Foundation.
- * This program is distributed without any warranty or implied warranty
- * of merchantability or fitness for a particular purpose.
- *
- * See the GNU General Public License for more details.
- */
-#include <linux/config.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <net/llc_sap.h>
-#include <net/llc_conn.h>
-#include <net/llc_main.h>
-#include <net/llc_evnt.h>
-#include <net/llc_actn.h>
-#include <net/llc_stat.h>
-#include <net/llc_c_ac.h>
-#include <net/llc_s_ac.h>
-#include <net/llc_c_ev.h>
-#include <net/llc_c_st.h>
-#include <net/llc_s_ev.h>
-#include <net/llc_s_st.h>
-#include <net/llc_mac.h>
-#include <net/llc_proc.h>
-
-/* static function prototypes */
-static void llc_station_service_events(struct llc_station *station);
-static void llc_station_free_ev(struct llc_station *station,
- struct sk_buff *skb);
-static void llc_station_send_pdus(struct llc_station *station);
-static u16 llc_station_next_state(struct llc_station *station,
- struct sk_buff *skb);
-static u16 llc_exec_station_trans_actions(struct llc_station *station,
- struct llc_station_state_trans *trans,
- struct sk_buff *skb);
-static struct llc_station_state_trans *
- llc_find_station_trans(struct llc_station *station,
- struct sk_buff *skb);
-static int llc_rtn_all_conns(struct llc_sap *sap);
-
-struct llc_station llc_main_station; /* only one of its kind */
-
-#undef LLC_REFCNT_DEBUG
-#ifdef LLC_REFCNT_DEBUG
-static atomic_t llc_sock_nr;
-#endif
-
-/**
- * llc_sap_alloc - allocates and initializes sap.
- *
- * Allocates and initializes sap.
- */
-struct llc_sap *llc_sap_alloc(void)
-{
- struct llc_sap *sap = kmalloc(sizeof(*sap), GFP_ATOMIC);
-
- if (sap) {
- memset(sap, 0, sizeof(*sap));
- sap->state = LLC_SAP_STATE_ACTIVE;
- memcpy(sap->laddr.mac, llc_main_station.mac_sa, ETH_ALEN);
- rwlock_init(&sap->sk_list.lock);
- }
- return sap;
-}
-
-/**
- * llc_free_sap - frees a sap
- * @sap: Address of the sap
- *
- * Frees all associated connections (if any), removes this sap from
- * the list of saps in te station and them frees the memory for this sap.
- */
-void llc_free_sap(struct llc_sap *sap)
-{
- llc_rtn_all_conns(sap);
- write_lock_bh(&sap->station->sap_list.lock);
- list_del(&sap->node);
- write_unlock_bh(&sap->station->sap_list.lock);
- kfree(sap);
-}
-
-/**
- * llc_sap_save - add sap to station list
- * @sap: Address of the sap
- *
- * Adds a sap to the LLC's station sap list.
- */
-void llc_sap_save(struct llc_sap *sap)
-{
- write_lock_bh(&llc_main_station.sap_list.lock);
- list_add_tail(&sap->node, &llc_main_station.sap_list.list);
- write_unlock_bh(&llc_main_station.sap_list.lock);
-}
-
-/**
- * llc_sap_find - searchs a SAP in station
- * @sap_value: sap to be found
- *
- * Searchs for a sap in the sap list of the LLC's station upon the sap ID.
- * Returns the sap or %NULL if not found.
- */
-struct llc_sap *llc_sap_find(u8 sap_value)
-{
- struct llc_sap* sap = NULL;
- struct list_head *entry;
-
- read_lock_bh(&llc_main_station.sap_list.lock);
- list_for_each(entry, &llc_main_station.sap_list.list) {
- sap = list_entry(entry, struct llc_sap, node);
- if (sap->laddr.lsap == sap_value)
- break;
- }
- if (entry == &llc_main_station.sap_list.list) /* not found */
- sap = NULL;
- read_unlock_bh(&llc_main_station.sap_list.lock);
- return sap;
-}
-
-/**
- * llc_backlog_rcv - Processes rx frames and expired timers.
- * @sk: LLC sock (p8022 connection)
- * @skb: queued rx frame or event
- *
- * This function processes frames that has received and timers that has
- * expired during sending an I pdu (refer to data_req_handler). frames
- * queue by llc_rcv function (llc_mac.c) and timers queue by timer
- * callback functions(llc_c_ac.c).
- */
-static int llc_backlog_rcv(struct sock *sk, struct sk_buff *skb)
-{
- int rc = 0;
- struct llc_opt *llc = llc_sk(sk);
-
- if (llc_backlog_type(skb) == LLC_PACKET) {
- if (llc->state > 1) /* not closed */
- rc = llc_conn_rcv(sk, skb);
- else
- goto out_kfree_skb;
- } else if (llc_backlog_type(skb) == LLC_EVENT) {
- /* timer expiration event */
- if (llc->state > 1) /* not closed */
- rc = llc_conn_state_process(sk, skb);
- else
- goto out_kfree_skb;
- } else {
- printk(KERN_ERR "%s: invalid skb in backlog\n", __FUNCTION__);
- goto out_kfree_skb;
- }
-out:
- return rc;
-out_kfree_skb:
- kfree_skb(skb);
- goto out;
-}
-
-/**
- * llc_sk_init - Initializes a socket with default llc values.
- * @sk: socket to initialize.
- *
- * Initializes a socket with default llc values.
- */
-int llc_sk_init(struct sock* sk)
-{
- struct llc_opt *llc = kmalloc(sizeof(*llc), GFP_ATOMIC);
- int rc = -ENOMEM;
-
- if (!llc)
- goto out;
- memset(llc, 0, sizeof(*llc));
- rc = 0;
-
- llc->sk = sk;
- llc->state = LLC_CONN_STATE_ADM;
- llc->inc_cntr = llc->dec_cntr = 2;
- llc->dec_step = llc->connect_step = 1;
-
- init_timer(&llc->ack_timer.timer);
- llc->ack_timer.expire = LLC_ACK_TIME;
- llc->ack_timer.timer.data = (unsigned long)sk;
- llc->ack_timer.timer.function = llc_conn_ack_tmr_cb;
-
- init_timer(&llc->pf_cycle_timer.timer);
- llc->pf_cycle_timer.expire = LLC_P_TIME;
- llc->pf_cycle_timer.timer.data = (unsigned long)sk;
- llc->pf_cycle_timer.timer.function = llc_conn_pf_cycle_tmr_cb;
-
- init_timer(&llc->rej_sent_timer.timer);
- llc->rej_sent_timer.expire = LLC_REJ_TIME;
- llc->rej_sent_timer.timer.data = (unsigned long)sk;
- llc->rej_sent_timer.timer.function = llc_conn_rej_tmr_cb;
-
- init_timer(&llc->busy_state_timer.timer);
- llc->busy_state_timer.expire = LLC_BUSY_TIME;
- llc->busy_state_timer.timer.data = (unsigned long)sk;
- llc->busy_state_timer.timer.function = llc_conn_busy_tmr_cb;
-
- llc->n2 = 2; /* max retransmit */
- llc->k = 2; /* tx win size, will adjust dynam */
- llc->rw = 128; /* rx win size (opt and equal to
- * tx_win of remote LLC) */
- skb_queue_head_init(&llc->pdu_unack_q);
- sk->sk_backlog_rcv = llc_backlog_rcv;
- llc_sk(sk) = llc;
-out:
- return rc;
-}
-
-/**
- * llc_sk_alloc - Allocates LLC sock
- * @family: upper layer protocol family
- * @priority: for allocation (%GFP_KERNEL, %GFP_ATOMIC, etc)
- *
- * Allocates a LLC sock and initializes it. Returns the new LLC sock
- * or %NULL if there's no memory available for one
- */
-struct sock *llc_sk_alloc(int family, int priority)
-{
- struct sock *sk = sk_alloc(family, priority, 1, NULL);
-
- if (!sk)
- goto out;
- if (llc_sk_init(sk))
- goto outsk;
- sock_init_data(NULL, sk);
- sk_set_owner(sk, THIS_MODULE);
-#ifdef LLC_REFCNT_DEBUG
- atomic_inc(&llc_sock_nr);
- printk(KERN_DEBUG "LLC socket %p created in %s, now we have %d alive\n", sk,
- __FUNCTION__, atomic_read(&llc_sock_nr));
-#endif
-out:
- return sk;
-outsk:
- sk_free(sk);
- sk = NULL;
- goto out;
-}
-
-/**
- * llc_sk_free - Frees a LLC socket
- * @sk - socket to free
- *
- * Frees a LLC socket
- */
-void llc_sk_free(struct sock *sk)
-{
- struct llc_opt *llc = llc_sk(sk);
-
- llc->state = LLC_CONN_OUT_OF_SVC;
- /* Stop all (possibly) running timers */
- llc_conn_ac_stop_all_timers(sk, NULL);
-#ifdef DEBUG_LLC_CONN_ALLOC
- printk(KERN_INFO "%s: unackq=%d, txq=%d\n", __FUNCTION__,
- skb_queue_len(&llc->pdu_unack_q),
- skb_queue_len(&sk->sk_write_queue));
-#endif
- skb_queue_purge(&sk->sk_receive_queue);
- skb_queue_purge(&sk->sk_write_queue);
- skb_queue_purge(&llc->pdu_unack_q);
-#ifdef LLC_REFCNT_DEBUG
- if (atomic_read(&sk->sk_refcnt) != 1) {
- printk(KERN_DEBUG "Destruction of LLC sock %p delayed in %s, cnt=%d\n",
- sk, __FUNCTION__, atomic_read(&sk->sk_refcnt));
- printk(KERN_DEBUG "%d LLC sockets are still alive\n",
- atomic_read(&llc_sock_nr));
- } else {
- atomic_dec(&llc_sock_nr);
- printk(KERN_DEBUG "LLC socket %p released in %s, %d are still alive\n", sk,
- __FUNCTION__, atomic_read(&llc_sock_nr));
- }
-#endif
- sock_put(sk);
-}
-
-/**
- * llc_sk_reset - resets a connection
- * @sk: LLC socket to reset
- *
- * Resets a connection to the out of service state. Stops its timers
- * and frees any frames in the queues of the connection.
- */
-void llc_sk_reset(struct sock *sk)
-{
- struct llc_opt *llc = llc_sk(sk);
-
- llc_conn_ac_stop_all_timers(sk, NULL);
- skb_queue_purge(&sk->sk_write_queue);
- skb_queue_purge(&llc->pdu_unack_q);
- llc->remote_busy_flag = 0;
- llc->cause_flag = 0;
- llc->retry_count = 0;
- llc_conn_set_p_flag(sk, 0);
- llc->f_flag = 0;
- llc->s_flag = 0;
- llc->ack_pf = 0;
- llc->first_pdu_Ns = 0;
- llc->ack_must_be_send = 0;
- llc->dec_step = 1;
- llc->inc_cntr = 2;
- llc->dec_cntr = 2;
- llc->X = 0;
- llc->failed_data_req = 0 ;
- llc->last_nr = 0;
-}
-
-/**
- * llc_rtn_all_conns - Closes all connections of a sap
- * @sap: sap to close its connections
- *
- * Closes all connections of a sap. Returns 0 if all actions complete
- * successfully, nonzero otherwise
- */
-static int llc_rtn_all_conns(struct llc_sap *sap)
-{
- int rc = 0;
- struct sock *sk;
- struct hlist_node *node;
-
- write_lock_bh(&sap->sk_list.lock);
-
- sk_for_each(sk, node, &sap->sk_list.list) {
- llc_sk(sk)->state = LLC_CONN_STATE_TEMP;
-
- if (llc_send_disc(sk))
- rc = 1;
- }
-
- write_unlock_bh(&sap->sk_list.lock);
- return rc;
-}
-
-/**
- * llc_station_state_process: queue event and try to process queue.
- * @station: Address of the station
- * @skb: Address of the event
- *
- * Queues an event (on the station event queue) for handling by the
- * station state machine and attempts to process any queued-up events.
- */
-void llc_station_state_process(struct llc_station *station, struct sk_buff *skb)
-{
- spin_lock_bh(&station->ev_q.lock);
- skb_queue_tail(&station->ev_q.list, skb);
- llc_station_service_events(station);
- spin_unlock_bh(&station->ev_q.lock);
-}
-
-/**
- * llc_station_send_pdu - queues PDU to send
- * @station: Address of the station
- * @skb: Address of the PDU
- *
- * Queues a PDU to send to the MAC layer.
- */
-void llc_station_send_pdu(struct llc_station *station, struct sk_buff *skb)
-{
- skb_queue_tail(&station->mac_pdu_q, skb);
- llc_station_send_pdus(station);
-}
-
-/**
- * llc_station_send_pdus - tries to send queued PDUs
- * @station: Address of the station
- *
- * Tries to send any PDUs queued in the station mac_pdu_q to the MAC
- * layer.
- */
-static void llc_station_send_pdus(struct llc_station *station)
-{
- struct sk_buff *skb;
-
- while ((skb = skb_dequeue(&station->mac_pdu_q)) != NULL)
- if (dev_queue_xmit(skb))
- break;
-}
-
-/**
- * llc_station_free_ev - frees an event
- * @station: Address of the station
- * @skb: Address of the event
- *
- * Frees an event.
- */
-static void llc_station_free_ev(struct llc_station *station,
- struct sk_buff *skb)
-{
- struct llc_station_state_ev *ev = llc_station_ev(skb);
-
- if (ev->type == LLC_STATION_EV_TYPE_PDU)
- kfree_skb(skb);
-}
-
-/**
- * llc_station_service_events - service events in the queue
- * @station: Address of the station
- *
- * Get an event from the station event queue (if any); attempt to service
- * the event; if event serviced, get the next event (if any) on the event
- * queue; if event not service, re-queue the event on the event queue and
- * attempt to service the next event; when serviced all events in queue,
- * finished; if don't transition to different state, just service all
- * events once; if transition to new state, service all events again.
- * Caller must hold station->ev_q.lock.
- */
-static void llc_station_service_events(struct llc_station *station)
-{
- struct sk_buff *skb;
-
- while ((skb = skb_dequeue(&station->ev_q.list)) != NULL)
- llc_station_next_state(station, skb);
-}
-
-/**
- * llc_station_next_state - processes event and goes to the next state
- * @station: Address of the station
- * @skb: Address of the event
- *
- * Processes an event, executes any transitions related to that event and
- * updates the state of the station.
- */
-static u16 llc_station_next_state(struct llc_station *station,
- struct sk_buff *skb)
-{
- u16 rc = 1;
- struct llc_station_state_trans *trans;
-
- if (station->state > LLC_NBR_STATION_STATES)
- goto out;
- trans = llc_find_station_trans(station, skb);
- if (trans) {
- /* got the state to which we next transition; perform the
- * actions associated with this transition before actually
- * transitioning to the next state
- */
- rc = llc_exec_station_trans_actions(station, trans, skb);
- if (!rc)
- /* transition station to next state if all actions
- * execute successfully; done; wait for next event
- */
- station->state = trans->next_state;
- } else
- /* event not recognized in current state; re-queue it for
- * processing again at a later time; return failure
- */
- rc = 0;
-out:
- llc_station_free_ev(station, skb);
- return rc;
-}
-
-/**
- * llc_find_station_trans - finds transition for this event
- * @station: Address of the station
- * @skb: Address of the event
- *
- * Search thru events of the current state of the station until list
- * exhausted or it's obvious that the event is not valid for the current
- * state. Returns the address of the transition if cound, %NULL otherwise.
- */
-static struct llc_station_state_trans *
- llc_find_station_trans(struct llc_station *station,
- struct sk_buff *skb)
-{
- int i = 0;
- struct llc_station_state_trans *rc = NULL;
- struct llc_station_state_trans **next_trans;
- struct llc_station_state *curr_state =
- &llc_station_state_table[station->state - 1];
-
- for (next_trans = curr_state->transitions; next_trans[i]->ev; i++)
- if (!next_trans[i]->ev(station, skb)) {
- rc = next_trans[i];
- break;
- }
- return rc;
-}
-
-/**
- * llc_exec_station_trans_actions - executes actions for transition
- * @station: Address of the station
- * @trans: Address of the transition
- * @skb: Address of the event that caused the transition
- *
- * Executes actions of a transition of the station state machine. Returns
- * 0 if all actions complete successfully, nonzero otherwise.
- */
-static u16 llc_exec_station_trans_actions(struct llc_station *station,
- struct llc_station_state_trans *trans,
- struct sk_buff *skb)
-{
- u16 rc = 0;
- llc_station_action_t *next_action = trans->ev_actions;
-
- for (; next_action && *next_action; next_action++)
- if ((*next_action)(station, skb))
- rc = 1;
- return rc;
-}
-
-/**
- * llc_alloc_frame - allocates sk_buff for frame
- *
- * Allocates an sk_buff for frame and initializes sk_buff fields.
- * Returns allocated skb or %NULL when out of memory.
- */
-struct sk_buff *llc_alloc_frame(void)
-{
- struct sk_buff *skb = alloc_skb(128, GFP_ATOMIC);
-
- if (skb) {
- skb_reserve(skb, 50);
- skb->nh.raw = skb->h.raw = skb->data;
- skb->protocol = htons(ETH_P_802_2);
- skb->dev = dev_base->next;
- skb->mac.raw = skb->head;
- }
- return skb;
-}
-
-static struct packet_type llc_packet_type = {
- .type = __constant_htons(ETH_P_802_2),
- .func = llc_rcv,
- .data = (void *)1,
-};
-
-static struct packet_type llc_tr_packet_type = {
- .type = __constant_htons(ETH_P_TR_802_2),
- .func = llc_rcv,
- .data = (void *)1,
-};
-
-static char llc_banner[] __initdata =
- KERN_INFO "LLC 2.0 by Procom, 1997, Arnaldo C. Melo, 2001, 2002\n"
- KERN_INFO "NET 4.0 IEEE 802.2 extended support\n";
-static char llc_error_msg[] __initdata =
- KERN_ERR "LLC install NOT successful.\n";
-
-static int __init llc_init(void)
-{
- u16 rc = 0;
- struct sk_buff *skb;
- struct llc_station_state_ev *ev;
-
- printk(llc_banner);
- INIT_LIST_HEAD(&llc_main_station.sap_list.list);
- rwlock_init(&llc_main_station.sap_list.lock);
- skb_queue_head_init(&llc_main_station.mac_pdu_q);
- skb_queue_head_init(&llc_main_station.ev_q.list);
- spin_lock_init(&llc_main_station.ev_q.lock);
- init_timer(&llc_main_station.ack_timer);
- llc_main_station.ack_timer.data = (unsigned long)&llc_main_station;
- llc_main_station.ack_timer.function = llc_station_ack_tmr_cb;
-
- if (llc_proc_init())
- goto err;
- skb = alloc_skb(0, GFP_ATOMIC);
- if (!skb)
- goto err_skb;
- llc_build_offset_table();
- ev = llc_station_ev(skb);
- memset(ev, 0, sizeof(*ev));
- if (dev_base->next)
- memcpy(llc_main_station.mac_sa,
- dev_base->next->dev_addr, ETH_ALEN);
- else
- memset(llc_main_station.mac_sa, 0, ETH_ALEN);
- llc_main_station.ack_timer.expires = jiffies + 3 * HZ;
- llc_main_station.maximum_retry = 1;
- llc_main_station.state = LLC_STATION_STATE_DOWN;
- ev->type = LLC_STATION_EV_TYPE_SIMPLE;
- ev->prim_type = LLC_STATION_EV_ENABLE_WITHOUT_DUP_ADDR_CHECK;
- rc = llc_station_next_state(&llc_main_station, skb);
- llc_ui_init();
- dev_add_pack(&llc_packet_type);
- dev_add_pack(&llc_tr_packet_type);
-out:
- return rc;
-err_skb:
- llc_proc_exit();
-err:
- printk(llc_error_msg);
- rc = 1;
- goto out;
-}
-
-static void __exit llc_exit(void)
-{
- llc_ui_exit();
- llc_proc_exit();
- dev_remove_pack(&llc_packet_type);
- dev_remove_pack(&llc_tr_packet_type);
-}
-
-module_init(llc_init);
-module_exit(llc_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Procom, 1997, Arnaldo C. Melo, Jay Schullist, 2001-2003");
-MODULE_DESCRIPTION("LLC 2.0, IEEE 802.2 extended support");
-MODULE_ALIAS_NETPROTO(PF_LLC);
diff --git a/net/llc/llc_output.c b/net/llc/llc_output.c
new file mode 100644
index 000000000000..3a8d92190b1c
--- /dev/null
+++ b/net/llc/llc_output.c
@@ -0,0 +1,105 @@
+/*
+ * llc_output.c - LLC minimal output path
+ *
+ * Copyright (c) 1997 by Procom Technology, Inc.
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ *
+ * This program can be redistributed or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation.
+ * This program is distributed without any warranty or implied warranty
+ * of merchantability or fitness for a particular purpose.
+ *
+ * See the GNU General Public License version 2 for more details.
+ */
+
+#include <linux/if_arp.h>
+#include <linux/if_tr.h>
+#include <linux/netdevice.h>
+#include <linux/skbuff.h>
+#include <net/llc.h>
+#include <net/llc_pdu.h>
+
+/**
+ * llc_mac_hdr_init - fills MAC header fields
+ * @skb: Address of the frame to initialize its MAC header
+ * @sa: The MAC source address
+ * @da: The MAC destination address
+ *
+ * Fills MAC header fields, depending on MAC type. Returns 0, If MAC type
+ * is a valid type and initialization completes correctly 1, otherwise.
+ */
+int llc_mac_hdr_init(struct sk_buff *skb, unsigned char *sa, unsigned char *da)
+{
+ int rc = 0;
+
+ switch (skb->dev->type) {
+#ifdef CONFIG_TR
+ case ARPHRD_IEEE802_TR: {
+ struct net_device *dev = skb->dev;
+ struct trh_hdr *trh;
+
+ trh = (struct trh_hdr *)skb_push(skb, sizeof(*trh));
+ trh->ac = AC;
+ trh->fc = LLC_FRAME;
+ if (sa)
+ memcpy(trh->saddr, sa, dev->addr_len);
+ else
+ memset(trh->saddr, 0, dev->addr_len);
+ if (da) {
+ memcpy(trh->daddr, da, dev->addr_len);
+ tr_source_route(skb, trh, dev);
+ }
+ skb->mac.raw = skb->data;
+ break;
+ }
+#endif
+ case ARPHRD_ETHER:
+ case ARPHRD_LOOPBACK: {
+ unsigned short len = skb->len;
+ struct ethhdr *eth;
+
+ skb->mac.raw = skb_push(skb, sizeof(*eth));
+ eth = (struct ethhdr *)skb->mac.raw;
+ eth->h_proto = htons(len);
+ memcpy(eth->h_dest, da, ETH_ALEN);
+ memcpy(eth->h_source, sa, ETH_ALEN);
+ break;
+ }
+ default:
+ printk(KERN_WARNING "device type not supported: %d\n",
+ skb->dev->type);
+ rc = -EINVAL;
+ }
+ return rc;
+}
+
+/**
+ * llc_build_and_send_ui_pkt - unitdata request interface for upper layers
+ * @sap: sap to use
+ * @skb: packet to send
+ * @dmac: destination mac address
+ * @dsap: destination sap
+ *
+ * Upper layers calls this function when upper layer wants to send data
+ * using connection-less mode communication (UI pdu).
+ *
+ * Accept data frame from network layer to be sent using connection-
+ * less mode communication; timeout/retries handled by network layer;
+ * package primitive as an event and send to SAP event handler
+ */
+int llc_build_and_send_ui_pkt(struct llc_sap *sap, struct sk_buff *skb,
+ unsigned char *dmac, unsigned char dsap)
+{
+ int rc;
+ llc_pdu_header_init(skb, LLC_PDU_TYPE_U, sap->laddr.lsap,
+ dsap, LLC_PDU_CMD);
+ llc_pdu_init_as_ui_cmd(skb);
+ rc = llc_mac_hdr_init(skb, skb->dev->dev_addr, dmac);
+ if (!rc)
+ rc = dev_queue_xmit(skb);
+ return rc;
+}
+
+EXPORT_SYMBOL(llc_mac_hdr_init);
+EXPORT_SYMBOL(llc_build_and_send_ui_pkt);
diff --git a/net/llc/llc_output.h b/net/llc/llc_output.h
new file mode 100644
index 000000000000..179edf753f00
--- /dev/null
+++ b/net/llc/llc_output.h
@@ -0,0 +1,20 @@
+#ifndef LLC_OUTPUT_H
+#define LLC_OUTPUT_H
+/*
+ * Copyright (c) 1997 by Procom Technology, Inc.
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ *
+ * This program can be redistributed or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation.
+ * This program is distributed without any warranty or implied warranty
+ * of merchantability or fitness for a particular purpose.
+ *
+ * See the GNU General Public License version 2 for more details.
+ */
+
+struct sk_buff;
+
+int llc_mac_hdr_init(struct sk_buff *skb, unsigned char *sa, unsigned char *da);
+
+#endif /* LLC_OUTPUT_H */
diff --git a/net/llc/llc_pdu.c b/net/llc/llc_pdu.c
index c99273a5d21b..66344fabd84d 100644
--- a/net/llc/llc_pdu.c
+++ b/net/llc/llc_pdu.c
@@ -11,35 +11,13 @@
*
* See the GNU General Public License for more details.
*/
+
#include <linux/netdevice.h>
-#include <linux/if_tr.h>
#include <net/llc_pdu.h>
-#include <net/llc_if.h>
-#include <net/llc_main.h>
static void llc_pdu_decode_pdu_type(struct sk_buff *skb, u8 *type);
-static __inline__ int llc_get_hdr_len(u8 pdu_type);
static u8 llc_pdu_get_pf_bit(struct llc_pdu_sn *pdu);
-/**
- * llc_pdu_header_init - initializes pdu header
- * @skb: input skb that header must be set into it.
- * @type: type of PDU (U, I or S).
- * @ssap: source sap.
- * @dsap: destination sap.
- * @cr: command/response bit (0 or 1).
- *
- * This function sets DSAP, SSAP and command/Response bit in LLC header.
- */
-void llc_pdu_header_init(struct sk_buff *skb, u8 type, u8 ssap, u8 dsap, u8 cr)
-{
- struct llc_pdu_un *pdu =
- llc_set_pdu_hdr(skb, skb_push(skb, llc_get_hdr_len(type)));
- pdu->dsap = dsap;
- pdu->ssap = ssap;
- pdu->ssap |= cr;
-}
-
void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 pdu_type)
{
llc_pdu_un_hdr(skb)->ssap |= pdu_type;
@@ -115,114 +93,6 @@ void llc_pdu_decode_cr_bit(struct sk_buff *skb, u8 *cr_bit)
}
/**
- * llc_pdu_decode_sa - extracs source address (MAC) of input frame
- * @skb: input skb that source address must be extracted from it.
- * @sa: pointer to source address (6 byte array).
- *
- * This function extracts source address(MAC) of input frame.
- */
-void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa)
-{
- if (skb->protocol == ntohs(ETH_P_802_2))
- memcpy(sa, ((struct ethhdr *)skb->mac.raw)->h_source, ETH_ALEN);
- else if (skb->protocol == ntohs(ETH_P_TR_802_2))
- memcpy(sa, ((struct trh_hdr *)skb->mac.raw)->saddr, ETH_ALEN);
-}
-
-/**
- * llc_pdu_decode_da - extracts dest address of input frame
- * @skb: input skb that destination address must be extracted from it
- * @sa: pointer to destination address (6 byte array).
- *
- * This function extracts destination address(MAC) of input frame.
- */
-void llc_pdu_decode_da(struct sk_buff *skb, u8 *da)
-{
- if (skb->protocol == ntohs(ETH_P_802_2))
- memcpy(da, ((struct ethhdr *)skb->mac.raw)->h_dest, ETH_ALEN);
- else if (skb->protocol == ntohs(ETH_P_TR_802_2))
- memcpy(da, ((struct trh_hdr *)skb->mac.raw)->daddr, ETH_ALEN);
-}
-
-/**
- * llc_pdu_decode_dsap - extracts dest SAP of input frame
- * @skb: input skb that destination SAP must be extracted from it.
- * @dsap: destination SAP (output argument).
- *
- * This function extracts destination SAP of input frame. right bit of
- * DSAP designates individual/group SAP.
- */
-void llc_pdu_decode_dsap(struct sk_buff *skb, u8 *dsap)
-{
- *dsap = llc_pdu_un_hdr(skb)->dsap & 0xFE;
-}
-
-/**
- * llc_pdu_decode_ssap - extracts source SAP of input frame
- * @skb: input skb that source SAP must be extracted from it.
- * @ssap: source SAP (output argument).
- *
- * This function extracts source SAP of input frame. Right bit of SSAP is
- * command/response bit.
- */
-void llc_pdu_decode_ssap(struct sk_buff *skb, u8 *ssap)
-{
- *ssap = llc_pdu_un_hdr(skb)->ssap & 0xFE;
-}
-
-/**
- * llc_pdu_init_as_ui_cmd - sets LLC header as UI PDU
- * @skb: input skb that header must be set into it.
- *
- * This function sets third byte of LLC header as a UI PDU.
- */
-void llc_pdu_init_as_ui_cmd(struct sk_buff *skb)
-{
- struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
-
- pdu->ctrl_1 = LLC_PDU_TYPE_U;
- pdu->ctrl_1 |= LLC_1_PDU_CMD_UI;
-}
-
-/**
- * llc_pdu_init_as_xid_cmd - sets bytes 3, 4 & 5 of LLC header as XID
- * @skb: input skb that header must be set into it.
- *
- * This function sets third,fourth,fifth and sixth bytes of LLC header as
- * a XID PDU.
- */
-void llc_pdu_init_as_xid_cmd(struct sk_buff *skb, u8 svcs_supported,
- u8 rx_window)
-{
- struct llc_xid_info *xid_info;
- struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
-
- pdu->ctrl_1 = LLC_PDU_TYPE_U;
- pdu->ctrl_1 |= LLC_1_PDU_CMD_XID;
- pdu->ctrl_1 |= LLC_U_PF_BIT_MASK;
- xid_info = (struct llc_xid_info *)(((u8 *)&pdu->ctrl_1) + 1);
- xid_info->fmt_id = LLC_XID_FMT_ID; /* 0x81 */
- xid_info->type = svcs_supported;
- xid_info->rw = rx_window << 1; /* size of receive window */
- skb_put(skb, 3);
-}
-
-/**
- * llc_pdu_init_as_test_cmd - sets PDU as TEST
- * @skb - Address of the skb to build
- *
- * Sets a PDU as TEST
- */
-void llc_pdu_init_as_test_cmd(struct sk_buff *skb)
-{
- struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
-
- pdu->ctrl_1 = LLC_PDU_TYPE_U;
- pdu->ctrl_1 |= LLC_1_PDU_CMD_TEST;
- pdu->ctrl_1 |= LLC_U_PF_BIT_MASK;
-}
-
-/**
* llc_pdu_init_as_disc_cmd - Builds DISC PDU
* @skb: Address of the skb to build
* @p_bit: The P bit to set in the PDU
@@ -350,55 +220,6 @@ void llc_pdu_init_as_dm_rsp(struct sk_buff *skb, u8 f_bit)
}
/**
- * llc_pdu_init_as_xid_rsp - builds XID response PDU
- * @skb: Address of the skb to build
- * @svcs_supported: The class of the LLC (I or II)
- * @rx_window: The size of the receive window of the LLC
- *
- * Builds a pdu frame as an XID response.
- */
-void llc_pdu_init_as_xid_rsp(struct sk_buff *skb, u8 svcs_supported,
- u8 rx_window)
-{
- struct llc_xid_info *xid_info;
- struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
-
- pdu->ctrl_1 = LLC_PDU_TYPE_U;
- pdu->ctrl_1 |= LLC_1_PDU_CMD_XID;
- pdu->ctrl_1 |= LLC_U_PF_BIT_MASK;
-
- xid_info = (struct llc_xid_info *)(((u8 *)&pdu->ctrl_1) + 1);
- xid_info->fmt_id = LLC_XID_FMT_ID;
- xid_info->type = svcs_supported;
- xid_info->rw = rx_window << 1;
- skb_put(skb, 3);
-}
-
-/**
- * llc_pdu_init_as_test_rsp - build TEST response PDU
- * @skb: Address of the skb to build
- * @ev_skb: The received TEST command PDU frame
- *
- * Builds a pdu frame as a TEST response.
- */
-void llc_pdu_init_as_test_rsp(struct sk_buff *skb, struct sk_buff *ev_skb)
-{
- int dsize;
- struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
-
- pdu->ctrl_1 = LLC_PDU_TYPE_U;
- pdu->ctrl_1 |= LLC_1_PDU_CMD_TEST;
- pdu->ctrl_1 |= LLC_U_PF_BIT_MASK;
- if (ev_skb->protocol == ntohs(ETH_P_802_2)) {
- struct llc_pdu_un *ev_pdu = llc_pdu_un_hdr(ev_skb);
-
- dsize = ntohs(((struct ethhdr *)ev_skb->mac.raw)->h_proto) - 3;
- memcpy(((u8 *)pdu) + 3, ((u8 *)ev_pdu) + 3, dsize);
- skb_put(skb, dsize);
- }
-}
-
-/**
* llc_pdu_init_as_frmr_rsp - builds FRMR response PDU
* @skb: Address of the frame to build
* @prev_pdu: The rejected PDU frame
@@ -533,58 +354,6 @@ static void llc_pdu_decode_pdu_type(struct sk_buff *skb, u8 *type)
}
/**
- * llc_decode_pdu_type - designates component LLC must handle for PDU
- * @skb: input skb
- * @dest: destination component
- *
- * This function designates which component of LLC must handle this PDU.
- */
-void llc_decode_pdu_type(struct sk_buff *skb, u8 *dest)
-{
- u8 type = LLC_DEST_CONN; /* I-PDU or S-PDU type */
- struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb);
-
- if ((pdu->ctrl_1 & LLC_PDU_TYPE_MASK) != LLC_PDU_TYPE_U)
- goto out;
- switch (LLC_U_PDU_CMD(pdu)) {
- case LLC_1_PDU_CMD_XID:
- case LLC_1_PDU_CMD_UI:
- case LLC_1_PDU_CMD_TEST:
- type = LLC_DEST_SAP;
- break;
- case LLC_2_PDU_CMD_SABME:
- case LLC_2_PDU_CMD_DISC:
- case LLC_2_PDU_RSP_UA:
- case LLC_2_PDU_RSP_DM:
- case LLC_2_PDU_RSP_FRMR:
- break;
- default:
- type = LLC_DEST_INVALID;
- break;
- }
-out:
- *dest = type;
-}
-
-/**
- * llc_get_hdr_len - designates LLC header length
- * @type: type of PDU.
- *
- * This function designates LLC header length of PDU. header length for I
- * and S PDU is 4 and for U is 3 bytes. Returns the length of header.
- */
-static __inline__ int llc_get_hdr_len(u8 type)
-{
- static int hdr_len[] = {
- [LLC_PDU_TYPE_U] = 3,
- [LLC_PDU_TYPE_I] = 4,
- [LLC_PDU_TYPE_S] = 4,
- };
-
- return hdr_len[type];
-}
-
-/**
* llc_pdu_get_pf_bit - extracts p/f bit of input PDU
* @pdu: pointer to LLC header.
*
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
index 3addf7c081e4..5efc6090e196 100644
--- a/net/llc/llc_proc.c
+++ b/net/llc/llc_proc.c
@@ -20,13 +20,11 @@
#include <linux/errno.h>
#include <linux/seq_file.h>
#include <net/sock.h>
+#include <net/llc.h>
#include <net/llc_c_ac.h>
#include <net/llc_c_ev.h>
#include <net/llc_c_st.h>
#include <net/llc_conn.h>
-#include <net/llc_mac.h>
-#include <net/llc_main.h>
-#include <net/llc_sap.h>
static void llc_ui_format_mac(struct seq_file *seq, unsigned char *mac)
{
@@ -41,7 +39,7 @@ static struct sock *llc_get_sk_idx(loff_t pos)
struct hlist_node *node;
struct sock *sk = NULL;
- list_for_each(sap_entry, &llc_main_station.sap_list.list) {
+ list_for_each(sap_entry, &llc_sap_list) {
sap = list_entry(sap_entry, struct llc_sap, node);
read_lock_bh(&sap->sk_list.lock);
@@ -66,7 +64,7 @@ static void *llc_seq_start(struct seq_file *seq, loff_t *pos)
{
loff_t l = *pos;
- read_lock_bh(&llc_main_station.sap_list.lock);
+ read_lock_bh(&llc_sap_list_lock);
return l ? llc_get_sk_idx(--l) : SEQ_START_TOKEN;
}
@@ -92,7 +90,7 @@ static void *llc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
read_unlock_bh(&sap->sk_list.lock);
sk = NULL;
for (;;) {
- if (sap->node.next == &llc_main_station.sap_list.list)
+ if (sap->node.next == &llc_sap_list)
break;
sap = list_entry(sap->node.next, struct llc_sap, node);
read_lock_bh(&sap->sk_list.lock);
@@ -115,7 +113,7 @@ static void llc_seq_stop(struct seq_file *seq, void *v)
read_unlock_bh(&sap->sk_list.lock);
}
- read_unlock_bh(&llc_main_station.sap_list.lock);
+ read_unlock_bh(&llc_sap_list_lock);
}
static int llc_seq_socket_show(struct seq_file *seq, void *v)
diff --git a/net/llc/llc_s_ac.c b/net/llc/llc_s_ac.c
index 1a67f2ef1a56..ed8ba7de6122 100644
--- a/net/llc/llc_s_ac.c
+++ b/net/llc/llc_s_ac.c
@@ -17,13 +17,14 @@
*
* See the GNU General Public License for more details.
*/
+
#include <linux/netdevice.h>
-#include <net/llc_if.h>
-#include <net/llc_sap.h>
-#include <net/llc_main.h>
-#include <net/llc_s_ev.h>
+#include <net/llc.h>
#include <net/llc_pdu.h>
-#include <net/llc_mac.h>
+#include <net/llc_s_ac.h>
+#include <net/llc_s_ev.h>
+#include <net/llc_sap.h>
+#include "llc_output.h"
/**
* llc_sap_action_unit_data_ind - forward UI PDU to network layer
@@ -56,7 +57,7 @@ int llc_sap_action_send_ui(struct llc_sap *sap, struct sk_buff *skb)
llc_pdu_header_init(skb, LLC_PDU_TYPE_U, ev->saddr.lsap,
ev->daddr.lsap, LLC_PDU_CMD);
llc_pdu_init_as_ui_cmd(skb);
- rc = lan_hdrs_init(skb, ev->saddr.mac, ev->daddr.mac);
+ rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac);
if (!rc)
rc = dev_queue_xmit(skb);
return rc;
@@ -79,7 +80,7 @@ int llc_sap_action_send_xid_c(struct llc_sap *sap, struct sk_buff *skb)
llc_pdu_header_init(skb, LLC_PDU_TYPE_U, ev->saddr.lsap,
ev->daddr.lsap, LLC_PDU_CMD);
llc_pdu_init_as_xid_cmd(skb, LLC_XID_NULL_CLASS_2, 0);
- rc = lan_hdrs_init(skb, ev->saddr.mac, ev->daddr.mac);
+ rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac);
if (!rc)
rc = dev_queue_xmit(skb);
return rc;
@@ -109,7 +110,7 @@ int llc_sap_action_send_xid_r(struct llc_sap *sap, struct sk_buff *skb)
llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap,
LLC_PDU_RSP);
llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 0);
- rc = lan_hdrs_init(nskb, mac_sa, mac_da);
+ rc = llc_mac_hdr_init(nskb, mac_sa, mac_da);
if (!rc)
rc = dev_queue_xmit(nskb);
out:
@@ -133,7 +134,7 @@ int llc_sap_action_send_test_c(struct llc_sap *sap, struct sk_buff *skb)
llc_pdu_header_init(skb, LLC_PDU_TYPE_U, ev->saddr.lsap,
ev->daddr.lsap, LLC_PDU_CMD);
llc_pdu_init_as_test_cmd(skb);
- rc = lan_hdrs_init(skb, ev->saddr.mac, ev->daddr.mac);
+ rc = llc_mac_hdr_init(skb, ev->saddr.mac, ev->daddr.mac);
if (!rc)
rc = dev_queue_xmit(skb);
return rc;
@@ -155,7 +156,7 @@ int llc_sap_action_send_test_r(struct llc_sap *sap, struct sk_buff *skb)
llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, sap->laddr.lsap, dsap,
LLC_PDU_RSP);
llc_pdu_init_as_test_rsp(nskb, skb);
- rc = lan_hdrs_init(nskb, mac_sa, mac_da);
+ rc = llc_mac_hdr_init(nskb, mac_sa, mac_da);
if (!rc)
rc = dev_queue_xmit(nskb);
out:
diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c
index e15f2ef6e6de..0b6f0e9ab406 100644
--- a/net/llc/llc_sap.c
+++ b/net/llc/llc_sap.c
@@ -11,46 +11,53 @@
*
* See the GNU General Public License for more details.
*/
-#include <linux/skbuff.h>
+
+#include <net/llc.h>
+#include <net/llc_if.h>
#include <net/llc_conn.h>
+#include <net/llc_pdu.h>
#include <net/llc_sap.h>
-#include <net/llc_s_ev.h>
#include <net/llc_s_ac.h>
+#include <net/llc_s_ev.h>
#include <net/llc_s_st.h>
#include <net/sock.h>
#include <linux/tcp.h>
-#include <net/llc_main.h>
-#include <net/llc_pdu.h>
-#include <linux/if_tr.h>
+#include <linux/llc.h>
/**
- * llc_sap_assign_sock - adds a connection to a SAP
- * @sap: pointer to SAP.
- * @conn: pointer to connection.
+ * llc_alloc_frame - allocates sk_buff for frame
*
- * This function adds a connection to connection_list of a SAP.
+ * Allocates an sk_buff for frame and initializes sk_buff fields.
+ * Returns allocated skb or %NULL when out of memory.
*/
-void llc_sap_assign_sock(struct llc_sap *sap, struct sock *sk)
+struct sk_buff *llc_alloc_frame(void)
{
- write_lock_bh(&sap->sk_list.lock);
- llc_sk(sk)->sap = sap;
- sk_add_node(sk, &sap->sk_list.list);
- write_unlock_bh(&sap->sk_list.lock);
+ struct sk_buff *skb = alloc_skb(128, GFP_ATOMIC);
+
+ if (skb) {
+ skb_reserve(skb, 50);
+ skb->nh.raw = skb->h.raw = skb->data;
+ skb->protocol = htons(ETH_P_802_2);
+ skb->dev = dev_base->next;
+ skb->mac.raw = skb->head;
+ }
+ return skb;
}
-/**
- * llc_sap_unassign_sock - removes a connection from SAP
- * @sap: SAP
- * @sk: pointer to connection
- *
- * This function removes a connection from sk_list.list of a SAP if
- * the connection was in this list.
- */
-void llc_sap_unassign_sock(struct llc_sap *sap, struct sock *sk)
+void llc_save_primitive(struct sk_buff* skb, u8 prim)
{
- write_lock_bh(&sap->sk_list.lock);
- sk_del_node_init(sk);
- write_unlock_bh(&sap->sk_list.lock);
+ struct sockaddr_llc *addr = llc_ui_skb_cb(skb);
+
+ /* save primitive for use by the user. */
+ addr->sllc_family = skb->sk->sk_family;
+ addr->sllc_arphrd = skb->dev->type;
+ addr->sllc_test = prim == LLC_TEST_PRIM;
+ addr->sllc_xid = prim == LLC_XID_PRIM;
+ addr->sllc_ua = prim == LLC_DATAUNIT_PRIM;
+ llc_pdu_decode_sa(skb, addr->sllc_smac);
+ llc_pdu_decode_da(skb, addr->sllc_dmac);
+ llc_pdu_decode_dsap(skb, &addr->sllc_dsap);
+ llc_pdu_decode_ssap(skb, &addr->sllc_ssap);
}
/**
@@ -193,3 +200,118 @@ void llc_sap_state_process(struct llc_sap *sap, struct sk_buff *skb)
}
kfree_skb(skb);
}
+
+/**
+ * llc_build_and_send_test_pkt - TEST interface for upper layers.
+ * @sap: sap to use
+ * @skb: packet to send
+ * @dmac: destination mac address
+ * @dsap: destination sap
+ *
+ * This function is called when upper layer wants to send a TEST pdu.
+ * Returns 0 for success, 1 otherwise.
+ */
+void llc_build_and_send_test_pkt(struct llc_sap *sap,
+ struct sk_buff *skb, u8 *dmac, u8 dsap)
+{
+ struct llc_sap_state_ev *ev = llc_sap_ev(skb);
+
+ ev->saddr.lsap = sap->laddr.lsap;
+ ev->daddr.lsap = dsap;
+ memcpy(ev->saddr.mac, skb->dev->dev_addr, IFHWADDRLEN);
+ memcpy(ev->daddr.mac, dmac, IFHWADDRLEN);
+
+ ev->type = LLC_SAP_EV_TYPE_PRIM;
+ ev->prim = LLC_TEST_PRIM;
+ ev->prim_type = LLC_PRIM_TYPE_REQ;
+ llc_sap_state_process(sap, skb);
+}
+
+/**
+ * llc_build_and_send_xid_pkt - XID interface for upper layers
+ * @sap: sap to use
+ * @skb: packet to send
+ * @dmac: destination mac address
+ * @dsap: destination sap
+ *
+ * This function is called when upper layer wants to send a XID pdu.
+ * Returns 0 for success, 1 otherwise.
+ */
+void llc_build_and_send_xid_pkt(struct llc_sap *sap, struct sk_buff *skb,
+ u8 *dmac, u8 dsap)
+{
+ struct llc_sap_state_ev *ev = llc_sap_ev(skb);
+
+ ev->saddr.lsap = sap->laddr.lsap;
+ ev->daddr.lsap = dsap;
+ memcpy(ev->saddr.mac, skb->dev->dev_addr, IFHWADDRLEN);
+ memcpy(ev->daddr.mac, dmac, IFHWADDRLEN);
+
+ ev->type = LLC_SAP_EV_TYPE_PRIM;
+ ev->prim = LLC_XID_PRIM;
+ ev->prim_type = LLC_PRIM_TYPE_REQ;
+ llc_sap_state_process(sap, skb);
+}
+
+/**
+ * llc_sap_rcv - sends received pdus to the sap state machine
+ * @sap: current sap component structure.
+ * @skb: received frame.
+ *
+ * Sends received pdus to the sap state machine.
+ */
+static void llc_sap_rcv(struct llc_sap *sap, struct sk_buff *skb)
+{
+ struct llc_sap_state_ev *ev = llc_sap_ev(skb);
+
+ ev->type = LLC_SAP_EV_TYPE_PDU;
+ ev->reason = 0;
+ llc_sap_state_process(sap, skb);
+}
+
+/**
+ * llc_lookup_dgram - Finds dgram socket for the local sap/mac
+ * @sap: SAP
+ * @laddr: address of local LLC (MAC + SAP)
+ *
+ * Search socket list of the SAP and finds connection using the local
+ * mac, and local sap. Returns pointer for socket found, %NULL otherwise.
+ */
+struct sock *llc_lookup_dgram(struct llc_sap *sap, struct llc_addr *laddr)
+{
+ struct sock *rc;
+ struct hlist_node *node;
+
+ read_lock_bh(&sap->sk_list.lock);
+ sk_for_each(rc, node, &sap->sk_list.list) {
+ struct llc_opt *llc = llc_sk(rc);
+
+ if (rc->sk_type == SOCK_DGRAM &&
+ llc->laddr.lsap == laddr->lsap &&
+ llc_mac_match(llc->laddr.mac, laddr->mac)) {
+ sock_hold(rc);
+ goto found;
+ }
+ }
+ rc = NULL;
+found:
+ read_unlock_bh(&sap->sk_list.lock);
+ return rc;
+}
+
+void llc_sap_handler(struct llc_sap *sap, struct sk_buff *skb)
+{
+ struct llc_addr laddr;
+ struct sock *sk;
+
+ llc_pdu_decode_da(skb, laddr.mac);
+ llc_pdu_decode_dsap(skb, &laddr.lsap);
+
+ sk = llc_lookup_dgram(sap, &laddr);
+ if (sk) {
+ skb->sk = sk;
+ llc_sap_rcv(sap, skb);
+ sock_put(sk);
+ } else
+ kfree_skb(skb);
+}
diff --git a/net/llc/llc_stat.c b/net/llc/llc_stat.c
deleted file mode 100644
index 06f071dc95a7..000000000000
--- a/net/llc/llc_stat.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * llc_stat.c - Implementation of LLC station component state machine
- * transitions
- * Copyright (c) 1997 by Procom Technology, Inc.
- * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
- *
- * This program can be redistributed or modified under the terms of the
- * GNU General Public License as published by the Free Software Foundation.
- * This program is distributed without any warranty or implied warranty
- * of merchantability or fitness for a particular purpose.
- *
- * See the GNU General Public License for more details.
- */
-#include <linux/types.h>
-#include <net/llc_if.h>
-#include <net/llc_sap.h>
-#include <net/llc_evnt.h>
-#include <net/llc_actn.h>
-#include <net/llc_stat.h>
-
-/* COMMON STATION STATE transitions */
-
-/* dummy last-transition indicator; common to all state transition groups
- * last entry for this state
- * all members are zeros, .bss zeroes it
- */
-static struct llc_station_state_trans llc_stat_state_trans_end;
-
-/* DOWN STATE transitions */
-
-/* state transition for LLC_STATION_EV_ENABLE_WITH_DUP_ADDR_CHECK event */
-static llc_station_action_t llc_stat_down_state_actions_1[] = {
- [0] = llc_station_ac_start_ack_timer,
- [1] = llc_station_ac_set_retry_cnt_0,
- [2] = llc_station_ac_set_xid_r_cnt_0,
- [3] = llc_station_ac_send_null_dsap_xid_c,
- [4] = NULL,
-};
-
-static struct llc_station_state_trans llc_stat_down_state_trans_1 = {
- .ev = llc_stat_ev_enable_with_dup_addr_check,
- .next_state = LLC_STATION_STATE_DUP_ADDR_CHK,
- .ev_actions = llc_stat_down_state_actions_1,
-};
-
-/* state transition for LLC_STATION_EV_ENABLE_WITHOUT_DUP_ADDR_CHECK event */
-static llc_station_action_t llc_stat_down_state_actions_2[] = {
- [0] = llc_station_ac_report_status, /* STATION UP */
- [1] = NULL,
-};
-
-static struct llc_station_state_trans llc_stat_down_state_trans_2 = {
- .ev = llc_stat_ev_enable_without_dup_addr_check,
- .next_state = LLC_STATION_STATE_UP,
- .ev_actions = llc_stat_down_state_actions_2,
-};
-
-/* array of pointers; one to each transition */
-static struct llc_station_state_trans *llc_stat_dwn_state_trans[] = {
- [0] = &llc_stat_down_state_trans_1,
- [1] = &llc_stat_down_state_trans_2,
- [2] = &llc_stat_state_trans_end,
-};
-
-/* UP STATE transitions */
-/* state transition for LLC_STATION_EV_DISABLE_REQ event */
-static llc_station_action_t llc_stat_up_state_actions_1[] = {
- [0] = llc_station_ac_report_status, /* STATION DOWN */
- [1] = NULL,
-};
-
-static struct llc_station_state_trans llc_stat_up_state_trans_1 = {
- .ev = llc_stat_ev_disable_req,
- .next_state = LLC_STATION_STATE_DOWN,
- .ev_actions = llc_stat_up_state_actions_1,
-};
-
-/* state transition for LLC_STATION_EV_RX_NULL_DSAP_XID_C event */
-static llc_station_action_t llc_stat_up_state_actions_2[] = {
- [0] = llc_station_ac_send_xid_r,
- [1] = NULL,
-};
-
-static struct llc_station_state_trans llc_stat_up_state_trans_2 = {
- .ev = llc_stat_ev_rx_null_dsap_xid_c,
- .next_state = LLC_STATION_STATE_UP,
- .ev_actions = llc_stat_up_state_actions_2,
-};
-
-/* state transition for LLC_STATION_EV_RX_NULL_DSAP_TEST_C event */
-static llc_station_action_t llc_stat_up_state_actions_3[] = {
- [0] = llc_station_ac_send_test_r,
- [1] = NULL,
-};
-
-static struct llc_station_state_trans llc_stat_up_state_trans_3 = {
- .ev = llc_stat_ev_rx_null_dsap_test_c,
- .next_state = LLC_STATION_STATE_UP,
- .ev_actions = llc_stat_up_state_actions_3,
-};
-
-/* array of pointers; one to each transition */
-static struct llc_station_state_trans *llc_stat_up_state_trans [] = {
- [0] = &llc_stat_up_state_trans_1,
- [1] = &llc_stat_up_state_trans_2,
- [2] = &llc_stat_up_state_trans_3,
- [3] = &llc_stat_state_trans_end,
-};
-
-/* DUP ADDR CHK STATE transitions */
-/* state transition for LLC_STATION_EV_RX_NULL_DSAP_0_XID_R_XID_R_CNT_EQ
- * event
- */
-static llc_station_action_t llc_stat_dupaddr_state_actions_1[] = {
- [0] = llc_station_ac_inc_xid_r_cnt_by_1,
- [1] = NULL,
-};
-
-static struct llc_station_state_trans llc_stat_dupaddr_state_trans_1 = {
- .ev = llc_stat_ev_rx_null_dsap_0_xid_r_xid_r_cnt_eq,
- .next_state = LLC_STATION_STATE_DUP_ADDR_CHK,
- .ev_actions = llc_stat_dupaddr_state_actions_1,
-};
-
-/* state transition for LLC_STATION_EV_RX_NULL_DSAP_1_XID_R_XID_R_CNT_EQ
- * event
- */
-static llc_station_action_t llc_stat_dupaddr_state_actions_2[] = {
- [0] = llc_station_ac_report_status, /* DUPLICATE ADDRESS FOUND */
- [1] = NULL,
-};
-
-static struct llc_station_state_trans llc_stat_dupaddr_state_trans_2 = {
- .ev = llc_stat_ev_rx_null_dsap_1_xid_r_xid_r_cnt_eq,
- .next_state = LLC_STATION_STATE_DOWN,
- .ev_actions = llc_stat_dupaddr_state_actions_2,
-};
-
-/* state transition for LLC_STATION_EV_RX_NULL_DSAP_XID_C event */
-static llc_station_action_t llc_stat_dupaddr_state_actions_3[] = {
- [0] = llc_station_ac_send_xid_r,
- [1] = NULL,
-};
-
-static struct llc_station_state_trans llc_stat_dupaddr_state_trans_3 = {
- .ev = llc_stat_ev_rx_null_dsap_xid_c,
- .next_state = LLC_STATION_STATE_DUP_ADDR_CHK,
- .ev_actions = llc_stat_dupaddr_state_actions_3,
-};
-
-/* state transition for LLC_STATION_EV_ACK_TMR_EXP_LT_RETRY_CNT_MAX_RETRY
- * event
- */
-static llc_station_action_t llc_stat_dupaddr_state_actions_4[] = {
- [0] = llc_station_ac_start_ack_timer,
- [1] = llc_station_ac_inc_retry_cnt_by_1,
- [2] = llc_station_ac_set_xid_r_cnt_0,
- [3] = llc_station_ac_send_null_dsap_xid_c,
- [4] = NULL,
-};
-
-static struct llc_station_state_trans llc_stat_dupaddr_state_trans_4 = {
- .ev = llc_stat_ev_ack_tmr_exp_lt_retry_cnt_max_retry,
- .next_state = LLC_STATION_STATE_DUP_ADDR_CHK,
- .ev_actions = llc_stat_dupaddr_state_actions_4,
-};
-
-/* state transition for LLC_STATION_EV_ACK_TMR_EXP_EQ_RETRY_CNT_MAX_RETRY
- * event
- */
-static llc_station_action_t llc_stat_dupaddr_state_actions_5[] = {
- [0] = llc_station_ac_report_status, /* STATION UP */
- [1] = NULL,
-};
-
-static struct llc_station_state_trans llc_stat_dupaddr_state_trans_5 = {
- .ev = llc_stat_ev_ack_tmr_exp_eq_retry_cnt_max_retry,
- .next_state = LLC_STATION_STATE_UP,
- .ev_actions = llc_stat_dupaddr_state_actions_5,
-};
-
-/* state transition for LLC_STATION_EV_DISABLE_REQ event */
-static llc_station_action_t llc_stat_dupaddr_state_actions_6[] = {
- [0] = llc_station_ac_report_status, /* STATION DOWN */
- [1] = NULL,
-};
-
-static struct llc_station_state_trans llc_stat_dupaddr_state_trans_6 = {
- .ev = llc_stat_ev_disable_req,
- .next_state = LLC_STATION_STATE_DOWN,
- .ev_actions = llc_stat_dupaddr_state_actions_6,
-};
-
-/* array of pointers; one to each transition */
-static struct llc_station_state_trans *llc_stat_dupaddr_state_trans[] = {
- [0] = &llc_stat_dupaddr_state_trans_6, /* Request */
- [1] = &llc_stat_dupaddr_state_trans_4, /* Timer */
- [2] = &llc_stat_dupaddr_state_trans_5,
- [3] = &llc_stat_dupaddr_state_trans_1, /* Receive frame */
- [4] = &llc_stat_dupaddr_state_trans_2,
- [5] = &llc_stat_dupaddr_state_trans_3,
- [6] = &llc_stat_state_trans_end,
-};
-
-struct llc_station_state llc_station_state_table[LLC_NBR_STATION_STATES] = {
- [LLC_STATION_STATE_DOWN - 1] = {
- .curr_state = LLC_STATION_STATE_DOWN,
- .transitions = llc_stat_dwn_state_trans,
- },
- [LLC_STATION_STATE_DUP_ADDR_CHK - 1] = {
- .curr_state = LLC_STATION_STATE_DUP_ADDR_CHK,
- .transitions = llc_stat_dupaddr_state_trans,
- },
- [LLC_STATION_STATE_UP - 1] = {
- .curr_state = LLC_STATION_STATE_UP,
- .transitions = llc_stat_up_state_trans,
- },
-};
diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c
new file mode 100644
index 000000000000..76177cdcf591
--- /dev/null
+++ b/net/llc/llc_station.c
@@ -0,0 +1,713 @@
+/*
+ * llc_station.c - station component of LLC
+ *
+ * Copyright (c) 1997 by Procom Technology, Inc.
+ * 2001-2003 by Arnaldo Carvalho de Melo <acme@conectiva.com.br>
+ *
+ * This program can be redistributed or modified under the terms of the
+ * GNU General Public License as published by the Free Software Foundation.
+ * This program is distributed without any warranty or implied warranty
+ * of merchantability or fitness for a particular purpose.
+ *
+ * See the GNU General Public License for more details.
+ */
+#include <linux/config.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <net/llc.h>
+#include <net/llc_sap.h>
+#include <net/llc_conn.h>
+#include <net/llc_c_ac.h>
+#include <net/llc_s_ac.h>
+#include <net/llc_c_ev.h>
+#include <net/llc_c_st.h>
+#include <net/llc_s_ev.h>
+#include <net/llc_s_st.h>
+#include <net/llc_pdu.h>
+
+/**
+ * struct llc_station - LLC station component
+ *
+ * SAP and connection resource manager, one per adapter.
+ *
+ * @state - state of station
+ * @xid_r_count - XID response PDU counter
+ * @mac_sa - MAC source address
+ * @sap_list - list of related SAPs
+ * @ev_q - events entering state mach.
+ * @mac_pdu_q - PDUs ready to send to MAC
+ */
+struct llc_station {
+ u8 state;
+ u8 xid_r_count;
+ struct timer_list ack_timer;
+ u8 retry_count;
+ u8 maximum_retry;
+ struct {
+ struct sk_buff_head list;
+ spinlock_t lock;
+ } ev_q;
+ struct sk_buff_head mac_pdu_q;
+};
+
+/* Types of events (possible values in 'ev->type') */
+#define LLC_STATION_EV_TYPE_SIMPLE 1
+#define LLC_STATION_EV_TYPE_CONDITION 2
+#define LLC_STATION_EV_TYPE_PRIM 3
+#define LLC_STATION_EV_TYPE_PDU 4 /* command/response PDU */
+#define LLC_STATION_EV_TYPE_ACK_TMR 5
+#define LLC_STATION_EV_TYPE_RPT_STATUS 6
+
+/* Events */
+#define LLC_STATION_EV_ENABLE_WITH_DUP_ADDR_CHECK 1
+#define LLC_STATION_EV_ENABLE_WITHOUT_DUP_ADDR_CHECK 2
+#define LLC_STATION_EV_ACK_TMR_EXP_LT_RETRY_CNT_MAX_RETRY 3
+#define LLC_STATION_EV_ACK_TMR_EXP_EQ_RETRY_CNT_MAX_RETRY 4
+#define LLC_STATION_EV_RX_NULL_DSAP_XID_C 5
+#define LLC_STATION_EV_RX_NULL_DSAP_0_XID_R_XID_R_CNT_EQ 6
+#define LLC_STATION_EV_RX_NULL_DSAP_1_XID_R_XID_R_CNT_EQ 7
+#define LLC_STATION_EV_RX_NULL_DSAP_TEST_C 8
+#define LLC_STATION_EV_DISABLE_REQ 9
+
+struct llc_station_state_ev {
+ u8 type;
+ u8 prim;
+ u8 prim_type;
+ u8 reason;
+ struct list_head node; /* node in station->ev_q.list */
+};
+
+static __inline__ struct llc_station_state_ev *
+ llc_station_ev(struct sk_buff *skb)
+{
+ return (struct llc_station_state_ev *)skb->cb;
+}
+
+typedef int (*llc_station_ev_t)(struct sk_buff *skb);
+
+#define LLC_STATION_STATE_DOWN 1 /* initial state */
+#define LLC_STATION_STATE_DUP_ADDR_CHK 2
+#define LLC_STATION_STATE_UP 3
+
+#define LLC_NBR_STATION_STATES 3 /* size of state table */
+
+typedef int (*llc_station_action_t)(struct sk_buff *skb);
+
+/* Station component state table structure */
+struct llc_station_state_trans {
+ llc_station_ev_t ev;
+ u8 next_state;
+ llc_station_action_t *ev_actions;
+};
+
+struct llc_station_state {
+ u8 curr_state;
+ struct llc_station_state_trans **transitions;
+};
+
+static struct llc_station llc_main_station;
+
+static int llc_stat_ev_enable_with_dup_addr_check(struct sk_buff *skb)
+{
+ struct llc_station_state_ev *ev = llc_station_ev(skb);
+
+ return ev->type == LLC_STATION_EV_TYPE_SIMPLE &&
+ ev->prim_type ==
+ LLC_STATION_EV_ENABLE_WITH_DUP_ADDR_CHECK ? 0 : 1;
+}
+
+static int llc_stat_ev_enable_without_dup_addr_check(struct sk_buff *skb)
+{
+ struct llc_station_state_ev *ev = llc_station_ev(skb);
+
+ return ev->type == LLC_STATION_EV_TYPE_SIMPLE &&
+ ev->prim_type ==
+ LLC_STATION_EV_ENABLE_WITHOUT_DUP_ADDR_CHECK ? 0 : 1;
+}
+
+static int llc_stat_ev_ack_tmr_exp_lt_retry_cnt_max_retry(struct sk_buff *skb)
+{
+ struct llc_station_state_ev *ev = llc_station_ev(skb);
+
+ return ev->type == LLC_STATION_EV_TYPE_ACK_TMR &&
+ llc_main_station.retry_count <
+ llc_main_station.maximum_retry ? 0 : 1;
+}
+
+static int llc_stat_ev_ack_tmr_exp_eq_retry_cnt_max_retry(struct sk_buff *skb)
+{
+ struct llc_station_state_ev *ev = llc_station_ev(skb);
+
+ return ev->type == LLC_STATION_EV_TYPE_ACK_TMR &&
+ llc_main_station.retry_count ==
+ llc_main_station.maximum_retry ? 0 : 1;
+}
+
+static int llc_stat_ev_rx_null_dsap_xid_c(struct sk_buff *skb)
+{
+ struct llc_station_state_ev *ev = llc_station_ev(skb);
+ struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
+
+ return ev->type == LLC_STATION_EV_TYPE_PDU &&
+ LLC_PDU_IS_CMD(pdu) && /* command PDU */
+ LLC_PDU_TYPE_IS_U(pdu) && /* U type PDU */
+ LLC_U_PDU_CMD(pdu) == LLC_1_PDU_CMD_XID &&
+ !pdu->dsap ? 0 : 1; /* NULL DSAP value */
+}
+
+static int llc_stat_ev_rx_null_dsap_0_xid_r_xid_r_cnt_eq(struct sk_buff *skb)
+{
+ struct llc_station_state_ev *ev = llc_station_ev(skb);
+ struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
+
+ return ev->type == LLC_STATION_EV_TYPE_PDU &&
+ LLC_PDU_IS_RSP(pdu) && /* response PDU */
+ LLC_PDU_TYPE_IS_U(pdu) && /* U type PDU */
+ LLC_U_PDU_RSP(pdu) == LLC_1_PDU_CMD_XID &&
+ !pdu->dsap && /* NULL DSAP value */
+ !llc_main_station.xid_r_count ? 0 : 1;
+}
+
+static int llc_stat_ev_rx_null_dsap_1_xid_r_xid_r_cnt_eq(struct sk_buff *skb)
+{
+ struct llc_station_state_ev *ev = llc_station_ev(skb);
+ struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
+
+ return ev->type == LLC_STATION_EV_TYPE_PDU &&
+ LLC_PDU_IS_RSP(pdu) && /* response PDU */
+ LLC_PDU_TYPE_IS_U(pdu) && /* U type PDU */
+ LLC_U_PDU_RSP(pdu) == LLC_1_PDU_CMD_XID &&
+ !pdu->dsap && /* NULL DSAP value */
+ llc_main_station.xid_r_count == 1 ? 0 : 1;
+}
+
+static int llc_stat_ev_rx_null_dsap_test_c(struct sk_buff *skb)
+{
+ struct llc_station_state_ev *ev = llc_station_ev(skb);
+ struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb);
+
+ return ev->type == LLC_STATION_EV_TYPE_PDU &&
+ LLC_PDU_IS_CMD(pdu) && /* command PDU */
+ LLC_PDU_TYPE_IS_U(pdu) && /* U type PDU */
+ LLC_U_PDU_CMD(pdu) == LLC_1_PDU_CMD_TEST &&
+ !pdu->dsap ? 0 : 1; /* NULL DSAP */
+}
+
+static int llc_stat_ev_disable_req(struct sk_buff *skb)
+{
+ struct llc_station_state_ev *ev = llc_station_ev(skb);
+
+ return ev->type == LLC_STATION_EV_TYPE_PRIM &&
+ ev->prim == LLC_DISABLE_PRIM &&
+ ev->prim_type == LLC_PRIM_TYPE_REQ ? 0 : 1;
+}
+
+/**
+ * llc_station_send_pdu - queues PDU to send
+ * @skb: Address of the PDU
+ *
+ * Queues a PDU to send to the MAC layer.
+ */
+static void llc_station_send_pdu(struct sk_buff *skb)
+{
+ skb_queue_tail(&llc_main_station.mac_pdu_q, skb);
+ while ((skb = skb_dequeue(&llc_main_station.mac_pdu_q)) != NULL)
+ if (dev_queue_xmit(skb))
+ break;
+}
+
+static int llc_station_ac_start_ack_timer(struct sk_buff *skb)
+{
+ mod_timer(&llc_main_station.ack_timer, jiffies + LLC_ACK_TIME * HZ);
+ return 0;
+}
+
+static int llc_station_ac_set_retry_cnt_0(struct sk_buff *skb)
+{
+ llc_main_station.retry_count = 0;
+ return 0;
+}
+
+static int llc_station_ac_inc_retry_cnt_by_1(struct sk_buff *skb)
+{
+ llc_main_station.retry_count++;
+ return 0;
+}
+
+static int llc_station_ac_set_xid_r_cnt_0(struct sk_buff *skb)
+{
+ llc_main_station.xid_r_count = 0;
+ return 0;
+}
+
+static int llc_station_ac_inc_xid_r_cnt_by_1(struct sk_buff *skb)
+{
+ llc_main_station.xid_r_count++;
+ return 0;
+}
+
+static int llc_station_ac_send_null_dsap_xid_c(struct sk_buff *skb)
+{
+ int rc = 1;
+ struct sk_buff *nskb = llc_alloc_frame();
+
+ if (!nskb)
+ goto out;
+ llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, 0, LLC_PDU_CMD);
+ llc_pdu_init_as_xid_cmd(nskb, LLC_XID_NULL_CLASS_2, 127);
+ rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, llc_station_mac_sa);
+ if (rc)
+ goto free;
+ llc_station_send_pdu(nskb);
+out:
+ return rc;
+free:
+ kfree_skb(skb);
+ goto out;
+}
+
+static int llc_station_ac_send_xid_r(struct sk_buff *skb)
+{
+ u8 mac_da[ETH_ALEN], dsap;
+ int rc = 1;
+ struct sk_buff* nskb = llc_alloc_frame();
+
+ if (!nskb)
+ goto out;
+ rc = 0;
+ nskb->dev = skb->dev;
+ llc_pdu_decode_sa(skb, mac_da);
+ llc_pdu_decode_ssap(skb, &dsap);
+ llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP);
+ llc_pdu_init_as_xid_rsp(nskb, LLC_XID_NULL_CLASS_2, 127);
+ rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da);
+ if (rc)
+ goto free;
+ llc_station_send_pdu(nskb);
+out:
+ return rc;
+free:
+ kfree_skb(skb);
+ goto out;
+}
+
+static int llc_station_ac_send_test_r(struct sk_buff *skb)
+{
+ u8 mac_da[ETH_ALEN], dsap;
+ int rc = 1;
+ struct sk_buff *nskb = llc_alloc_frame();
+
+ if (!nskb)
+ goto out;
+ rc = 0;
+ nskb->dev = skb->dev;
+ llc_pdu_decode_sa(skb, mac_da);
+ llc_pdu_decode_ssap(skb, &dsap);
+ llc_pdu_header_init(nskb, LLC_PDU_TYPE_U, 0, dsap, LLC_PDU_RSP);
+ llc_pdu_init_as_test_rsp(nskb, skb);
+ rc = llc_mac_hdr_init(nskb, llc_station_mac_sa, mac_da);
+ if (rc)
+ goto free;
+ llc_station_send_pdu(nskb);
+out:
+ return rc;
+free:
+ kfree_skb(skb);
+ goto out;
+}
+
+static int llc_station_ac_report_status(struct sk_buff *skb)
+{
+ return 0;
+}
+
+/* COMMON STATION STATE transitions */
+
+/* dummy last-transition indicator; common to all state transition groups
+ * last entry for this state
+ * all members are zeros, .bss zeroes it
+ */
+static struct llc_station_state_trans llc_stat_state_trans_end;
+
+/* DOWN STATE transitions */
+
+/* state transition for LLC_STATION_EV_ENABLE_WITH_DUP_ADDR_CHECK event */
+static llc_station_action_t llc_stat_down_state_actions_1[] = {
+ [0] = llc_station_ac_start_ack_timer,
+ [1] = llc_station_ac_set_retry_cnt_0,
+ [2] = llc_station_ac_set_xid_r_cnt_0,
+ [3] = llc_station_ac_send_null_dsap_xid_c,
+ [4] = NULL,
+};
+
+static struct llc_station_state_trans llc_stat_down_state_trans_1 = {
+ .ev = llc_stat_ev_enable_with_dup_addr_check,
+ .next_state = LLC_STATION_STATE_DUP_ADDR_CHK,
+ .ev_actions = llc_stat_down_state_actions_1,
+};
+
+/* state transition for LLC_STATION_EV_ENABLE_WITHOUT_DUP_ADDR_CHECK event */
+static llc_station_action_t llc_stat_down_state_actions_2[] = {
+ [0] = llc_station_ac_report_status, /* STATION UP */
+ [1] = NULL,
+};
+
+static struct llc_station_state_trans llc_stat_down_state_trans_2 = {
+ .ev = llc_stat_ev_enable_without_dup_addr_check,
+ .next_state = LLC_STATION_STATE_UP,
+ .ev_actions = llc_stat_down_state_actions_2,
+};
+
+/* array of pointers; one to each transition */
+static struct llc_station_state_trans *llc_stat_dwn_state_trans[] = {
+ [0] = &llc_stat_down_state_trans_1,
+ [1] = &llc_stat_down_state_trans_2,
+ [2] = &llc_stat_state_trans_end,
+};
+
+/* UP STATE transitions */
+/* state transition for LLC_STATION_EV_DISABLE_REQ event */
+static llc_station_action_t llc_stat_up_state_actions_1[] = {
+ [0] = llc_station_ac_report_status, /* STATION DOWN */
+ [1] = NULL,
+};
+
+static struct llc_station_state_trans llc_stat_up_state_trans_1 = {
+ .ev = llc_stat_ev_disable_req,
+ .next_state = LLC_STATION_STATE_DOWN,
+ .ev_actions = llc_stat_up_state_actions_1,
+};
+
+/* state transition for LLC_STATION_EV_RX_NULL_DSAP_XID_C event */
+static llc_station_action_t llc_stat_up_state_actions_2[] = {
+ [0] = llc_station_ac_send_xid_r,
+ [1] = NULL,
+};
+
+static struct llc_station_state_trans llc_stat_up_state_trans_2 = {
+ .ev = llc_stat_ev_rx_null_dsap_xid_c,
+ .next_state = LLC_STATION_STATE_UP,
+ .ev_actions = llc_stat_up_state_actions_2,
+};
+
+/* state transition for LLC_STATION_EV_RX_NULL_DSAP_TEST_C event */
+static llc_station_action_t llc_stat_up_state_actions_3[] = {
+ [0] = llc_station_ac_send_test_r,
+ [1] = NULL,
+};
+
+static struct llc_station_state_trans llc_stat_up_state_trans_3 = {
+ .ev = llc_stat_ev_rx_null_dsap_test_c,
+ .next_state = LLC_STATION_STATE_UP,
+ .ev_actions = llc_stat_up_state_actions_3,
+};
+
+/* array of pointers; one to each transition */
+static struct llc_station_state_trans *llc_stat_up_state_trans [] = {
+ [0] = &llc_stat_up_state_trans_1,
+ [1] = &llc_stat_up_state_trans_2,
+ [2] = &llc_stat_up_state_trans_3,
+ [3] = &llc_stat_state_trans_end,
+};
+
+/* DUP ADDR CHK STATE transitions */
+/* state transition for LLC_STATION_EV_RX_NULL_DSAP_0_XID_R_XID_R_CNT_EQ
+ * event
+ */
+static llc_station_action_t llc_stat_dupaddr_state_actions_1[] = {
+ [0] = llc_station_ac_inc_xid_r_cnt_by_1,
+ [1] = NULL,
+};
+
+static struct llc_station_state_trans llc_stat_dupaddr_state_trans_1 = {
+ .ev = llc_stat_ev_rx_null_dsap_0_xid_r_xid_r_cnt_eq,
+ .next_state = LLC_STATION_STATE_DUP_ADDR_CHK,
+ .ev_actions = llc_stat_dupaddr_state_actions_1,
+};
+
+/* state transition for LLC_STATION_EV_RX_NULL_DSAP_1_XID_R_XID_R_CNT_EQ
+ * event
+ */
+static llc_station_action_t llc_stat_dupaddr_state_actions_2[] = {
+ [0] = llc_station_ac_report_status, /* DUPLICATE ADDRESS FOUND */
+ [1] = NULL,
+};
+
+static struct llc_station_state_trans llc_stat_dupaddr_state_trans_2 = {
+ .ev = llc_stat_ev_rx_null_dsap_1_xid_r_xid_r_cnt_eq,
+ .next_state = LLC_STATION_STATE_DOWN,
+ .ev_actions = llc_stat_dupaddr_state_actions_2,
+};
+
+/* state transition for LLC_STATION_EV_RX_NULL_DSAP_XID_C event */
+static llc_station_action_t llc_stat_dupaddr_state_actions_3[] = {
+ [0] = llc_station_ac_send_xid_r,
+ [1] = NULL,
+};
+
+static struct llc_station_state_trans llc_stat_dupaddr_state_trans_3 = {
+ .ev = llc_stat_ev_rx_null_dsap_xid_c,
+ .next_state = LLC_STATION_STATE_DUP_ADDR_CHK,
+ .ev_actions = llc_stat_dupaddr_state_actions_3,
+};
+
+/* state transition for LLC_STATION_EV_ACK_TMR_EXP_LT_RETRY_CNT_MAX_RETRY
+ * event
+ */
+static llc_station_action_t llc_stat_dupaddr_state_actions_4[] = {
+ [0] = llc_station_ac_start_ack_timer,
+ [1] = llc_station_ac_inc_retry_cnt_by_1,
+ [2] = llc_station_ac_set_xid_r_cnt_0,
+ [3] = llc_station_ac_send_null_dsap_xid_c,
+ [4] = NULL,
+};
+
+static struct llc_station_state_trans llc_stat_dupaddr_state_trans_4 = {
+ .ev = llc_stat_ev_ack_tmr_exp_lt_retry_cnt_max_retry,
+ .next_state = LLC_STATION_STATE_DUP_ADDR_CHK,
+ .ev_actions = llc_stat_dupaddr_state_actions_4,
+};
+
+/* state transition for LLC_STATION_EV_ACK_TMR_EXP_EQ_RETRY_CNT_MAX_RETRY
+ * event
+ */
+static llc_station_action_t llc_stat_dupaddr_state_actions_5[] = {
+ [0] = llc_station_ac_report_status, /* STATION UP */
+ [1] = NULL,
+};
+
+static struct llc_station_state_trans llc_stat_dupaddr_state_trans_5 = {
+ .ev = llc_stat_ev_ack_tmr_exp_eq_retry_cnt_max_retry,
+ .next_state = LLC_STATION_STATE_UP,
+ .ev_actions = llc_stat_dupaddr_state_actions_5,
+};
+
+/* state transition for LLC_STATION_EV_DISABLE_REQ event */
+static llc_station_action_t llc_stat_dupaddr_state_actions_6[] = {
+ [0] = llc_station_ac_report_status, /* STATION DOWN */
+ [1] = NULL,
+};
+
+static struct llc_station_state_trans llc_stat_dupaddr_state_trans_6 = {
+ .ev = llc_stat_ev_disable_req,
+ .next_state = LLC_STATION_STATE_DOWN,
+ .ev_actions = llc_stat_dupaddr_state_actions_6,
+};
+
+/* array of pointers; one to each transition */
+static struct llc_station_state_trans *llc_stat_dupaddr_state_trans[] = {
+ [0] = &llc_stat_dupaddr_state_trans_6, /* Request */
+ [1] = &llc_stat_dupaddr_state_trans_4, /* Timer */
+ [2] = &llc_stat_dupaddr_state_trans_5,
+ [3] = &llc_stat_dupaddr_state_trans_1, /* Receive frame */
+ [4] = &llc_stat_dupaddr_state_trans_2,
+ [5] = &llc_stat_dupaddr_state_trans_3,
+ [6] = &llc_stat_state_trans_end,
+};
+
+static struct llc_station_state
+ llc_station_state_table[LLC_NBR_STATION_STATES] = {
+ [LLC_STATION_STATE_DOWN - 1] = {
+ .curr_state = LLC_STATION_STATE_DOWN,
+ .transitions = llc_stat_dwn_state_trans,
+ },
+ [LLC_STATION_STATE_DUP_ADDR_CHK - 1] = {
+ .curr_state = LLC_STATION_STATE_DUP_ADDR_CHK,
+ .transitions = llc_stat_dupaddr_state_trans,
+ },
+ [LLC_STATION_STATE_UP - 1] = {
+ .curr_state = LLC_STATION_STATE_UP,
+ .transitions = llc_stat_up_state_trans,
+ },
+};
+
+/**
+ * llc_exec_station_trans_actions - executes actions for transition
+ * @trans: Address of the transition
+ * @skb: Address of the event that caused the transition
+ *
+ * Executes actions of a transition of the station state machine. Returns
+ * 0 if all actions complete successfully, nonzero otherwise.
+ */
+static u16 llc_exec_station_trans_actions(struct llc_station_state_trans *trans,
+ struct sk_buff *skb)
+{
+ u16 rc = 0;
+ llc_station_action_t *next_action = trans->ev_actions;
+
+ for (; next_action && *next_action; next_action++)
+ if ((*next_action)(skb))
+ rc = 1;
+ return rc;
+}
+
+/**
+ * llc_find_station_trans - finds transition for this event
+ * @skb: Address of the event
+ *
+ * Search thru events of the current state of the station until list
+ * exhausted or it's obvious that the event is not valid for the current
+ * state. Returns the address of the transition if cound, %NULL otherwise.
+ */
+static struct llc_station_state_trans *
+ llc_find_station_trans(struct sk_buff *skb)
+{
+ int i = 0;
+ struct llc_station_state_trans *rc = NULL;
+ struct llc_station_state_trans **next_trans;
+ struct llc_station_state *curr_state =
+ &llc_station_state_table[llc_main_station.state - 1];
+
+ for (next_trans = curr_state->transitions; next_trans[i]->ev; i++)
+ if (!next_trans[i]->ev(skb)) {
+ rc = next_trans[i];
+ break;
+ }
+ return rc;
+}
+
+/**
+ * llc_station_free_ev - frees an event
+ * @skb: Address of the event
+ *
+ * Frees an event.
+ */
+static void llc_station_free_ev(struct sk_buff *skb)
+{
+ struct llc_station_state_ev *ev = llc_station_ev(skb);
+
+ if (ev->type == LLC_STATION_EV_TYPE_PDU)
+ kfree_skb(skb);
+}
+
+/**
+ * llc_station_next_state - processes event and goes to the next state
+ * @skb: Address of the event
+ *
+ * Processes an event, executes any transitions related to that event and
+ * updates the state of the station.
+ */
+static u16 llc_station_next_state(struct sk_buff *skb)
+{
+ u16 rc = 1;
+ struct llc_station_state_trans *trans;
+
+ if (llc_main_station.state > LLC_NBR_STATION_STATES)
+ goto out;
+ trans = llc_find_station_trans(skb);
+ if (trans) {
+ /* got the state to which we next transition; perform the
+ * actions associated with this transition before actually
+ * transitioning to the next state
+ */
+ rc = llc_exec_station_trans_actions(trans, skb);
+ if (!rc)
+ /* transition station to next state if all actions
+ * execute successfully; done; wait for next event
+ */
+ llc_main_station.state = trans->next_state;
+ } else
+ /* event not recognized in current state; re-queue it for
+ * processing again at a later time; return failure
+ */
+ rc = 0;
+out:
+ llc_station_free_ev(skb);
+ return rc;
+}
+
+/**
+ * llc_station_service_events - service events in the queue
+ *
+ * Get an event from the station event queue (if any); attempt to service
+ * the event; if event serviced, get the next event (if any) on the event
+ * queue; if event not service, re-queue the event on the event queue and
+ * attempt to service the next event; when serviced all events in queue,
+ * finished; if don't transition to different state, just service all
+ * events once; if transition to new state, service all events again.
+ * Caller must hold llc_main_station.ev_q.lock.
+ */
+static void llc_station_service_events(void)
+{
+ struct sk_buff *skb;
+
+ while ((skb = skb_dequeue(&llc_main_station.ev_q.list)) != NULL)
+ llc_station_next_state(skb);
+}
+
+/**
+ * llc_station_state_process: queue event and try to process queue.
+ * @skb: Address of the event
+ *
+ * Queues an event (on the station event queue) for handling by the
+ * station state machine and attempts to process any queued-up events.
+ */
+void llc_station_state_process(struct sk_buff *skb)
+{
+ spin_lock_bh(&llc_main_station.ev_q.lock);
+ skb_queue_tail(&llc_main_station.ev_q.list, skb);
+ llc_station_service_events();
+ spin_unlock_bh(&llc_main_station.ev_q.lock);
+}
+
+static void llc_station_ack_tmr_cb(unsigned long timeout_data)
+{
+ struct sk_buff *skb = alloc_skb(0, GFP_ATOMIC);
+
+ if (skb) {
+ struct llc_station_state_ev *ev = llc_station_ev(skb);
+
+ ev->type = LLC_STATION_EV_TYPE_ACK_TMR;
+ llc_station_state_process(skb);
+ }
+}
+
+/*
+ * llc_station_rcv - send received pdu to the station state machine
+ * @skb: received frame.
+ *
+ * Sends data unit to station state machine.
+ */
+static void llc_station_rcv(struct sk_buff *skb)
+{
+ struct llc_station_state_ev *ev = llc_station_ev(skb);
+
+ ev->type = LLC_STATION_EV_TYPE_PDU;
+ ev->reason = 0;
+ llc_station_state_process(skb);
+}
+
+int __init llc_station_init(void)
+{
+ u16 rc = -ENOBUFS;
+ struct sk_buff *skb;
+ struct llc_station_state_ev *ev;
+
+ skb_queue_head_init(&llc_main_station.mac_pdu_q);
+ skb_queue_head_init(&llc_main_station.ev_q.list);
+ spin_lock_init(&llc_main_station.ev_q.lock);
+ init_timer(&llc_main_station.ack_timer);
+ llc_main_station.ack_timer.data = (unsigned long)&llc_main_station;
+ llc_main_station.ack_timer.function = llc_station_ack_tmr_cb;
+
+ skb = alloc_skb(0, GFP_ATOMIC);
+ if (!skb)
+ goto out;
+ rc = 0;
+ llc_set_station_handler(llc_station_rcv);
+ ev = llc_station_ev(skb);
+ memset(ev, 0, sizeof(*ev));
+ llc_main_station.ack_timer.expires = jiffies + 3 * HZ;
+ llc_main_station.maximum_retry = 1;
+ llc_main_station.state = LLC_STATION_STATE_DOWN;
+ ev->type = LLC_STATION_EV_TYPE_SIMPLE;
+ ev->prim_type = LLC_STATION_EV_ENABLE_WITHOUT_DUP_ADDR_CHECK;
+ rc = llc_station_next_state(skb);
+out:
+ return rc;
+}
+
+void __exit llc_station_exit(void)
+{
+ llc_set_station_handler(NULL);
+}
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 3347859a1665..2aace02b65ff 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -988,7 +988,7 @@ static struct sock *netlink_seq_socket_idx(struct seq_file *seq, loff_t pos)
static void *netlink_seq_start(struct seq_file *seq, loff_t *pos)
{
read_lock(&nl_table_lock);
- return *pos ? netlink_seq_socket_idx(seq, *pos - 1) : (void *) 1;
+ return *pos ? netlink_seq_socket_idx(seq, *pos - 1) : SEQ_START_TOKEN;
}
static void *netlink_seq_next(struct seq_file *seq, void *v, loff_t *pos)
@@ -997,7 +997,7 @@ static void *netlink_seq_next(struct seq_file *seq, void *v, loff_t *pos)
++*pos;
- if (v == (void *) 1)
+ if (v == SEQ_START_TOKEN)
return netlink_seq_socket_idx(seq, 0);
s = sk_next(v);
@@ -1023,7 +1023,7 @@ static void netlink_seq_stop(struct seq_file *seq, void *v)
static int netlink_seq_show(struct seq_file *seq, void *v)
{
- if (v == (void *)1)
+ if (v == SEQ_START_TOKEN)
seq_puts(seq,
"sk Eth Pid Groups "
"Rmem Wmem Dump Locks\n");
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 872289e73770..38a6f9ab7980 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -62,6 +62,7 @@ static HLIST_HEAD(nr_list);
static spinlock_t nr_list_lock = SPIN_LOCK_UNLOCKED;
static struct proto_ops nr_proto_ops;
+void nr_init_timers(struct sock *sk);
static struct sock *nr_alloc_sock(void)
{
@@ -279,17 +280,12 @@ void nr_destroy_socket(struct sock *sk)
kfree_skb(skb);
}
- while ((skb = skb_dequeue(&sk->sk_write_queue)) != NULL) {
- kfree_skb(skb);
- }
if (atomic_read(&sk->sk_wmem_alloc) ||
atomic_read(&sk->sk_rmem_alloc)) {
/* Defer: outstanding buffers */
- init_timer(&sk->sk_timer);
- sk->sk_timer.expires = jiffies + 2 * HZ;
sk->sk_timer.function = nr_destroy_timer;
- sk->sk_timer.data = (unsigned long)sk;
+ sk->sk_timer.expires = jiffies + 2 * HZ;
add_timer(&sk->sk_timer);
} else
sock_put(sk);
@@ -442,10 +438,7 @@ static int nr_create(struct socket *sock, int protocol)
skb_queue_head_init(&nr->reseq_queue);
skb_queue_head_init(&nr->frag_queue);
- init_timer(&nr->t1timer);
- init_timer(&nr->t2timer);
- init_timer(&nr->t4timer);
- init_timer(&nr->idletimer);
+ nr_init_timers(sk);
nr->t1 = sysctl_netrom_transport_timeout;
nr->t2 = sysctl_netrom_transport_acknowledge_delay;
@@ -491,10 +484,7 @@ static struct sock *nr_make_new(struct sock *osk)
skb_queue_head_init(&nr->reseq_queue);
skb_queue_head_init(&nr->frag_queue);
- init_timer(&nr->t1timer);
- init_timer(&nr->t2timer);
- init_timer(&nr->t4timer);
- init_timer(&nr->idletimer);
+ nr_init_timers(sk);
onr = nr_sk(osk);
diff --git a/net/netrom/nr_loopback.c b/net/netrom/nr_loopback.c
index 4debbeb6b43c..165b2abce110 100644
--- a/net/netrom/nr_loopback.c
+++ b/net/netrom/nr_loopback.c
@@ -14,19 +14,17 @@
#include <net/netrom.h>
#include <linux/init.h>
-static struct sk_buff_head loopback_queue;
-static struct timer_list loopback_timer;
+static void nr_loopback_timer(unsigned long);
-static void nr_set_loopback_timer(void);
+static struct sk_buff_head loopback_queue;
+static struct timer_list loopback_timer = TIMER_INITIALIZER(nr_loopback_timer, 0, 0);
-void nr_loopback_init(void)
+void __init nr_loopback_init(void)
{
skb_queue_head_init(&loopback_queue);
-
- init_timer(&loopback_timer);
}
-static int nr_loopback_running(void)
+static inline int nr_loopback_running(void)
{
return timer_pending(&loopback_timer);
}
@@ -42,26 +40,13 @@ int nr_loopback_queue(struct sk_buff *skb)
skb_queue_tail(&loopback_queue, skbn);
if (!nr_loopback_running())
- nr_set_loopback_timer();
+ mod_timer(&loopback_timer, jiffies + 10);
}
kfree_skb(skb);
return 1;
}
-static void nr_loopback_timer(unsigned long);
-
-static void nr_set_loopback_timer(void)
-{
- del_timer(&loopback_timer);
-
- loopback_timer.data = 0;
- loopback_timer.function = &nr_loopback_timer;
- loopback_timer.expires = jiffies + 10;
-
- add_timer(&loopback_timer);
-}
-
static void nr_loopback_timer(unsigned long param)
{
struct sk_buff *skb;
@@ -80,12 +65,12 @@ static void nr_loopback_timer(unsigned long param)
dev_put(dev);
if (!skb_queue_empty(&loopback_queue) && !nr_loopback_running())
- nr_set_loopback_timer();
+ mod_timer(&loopback_timer, jiffies + 10);
}
}
void __exit nr_loopback_clear(void)
{
- del_timer(&loopback_timer);
+ del_timer_sync(&loopback_timer);
skb_queue_purge(&loopback_queue);
}
diff --git a/net/netrom/nr_timer.c b/net/netrom/nr_timer.c
index 47570b2024d2..213d0b400709 100644
--- a/net/netrom/nr_timer.c
+++ b/net/netrom/nr_timer.c
@@ -36,69 +36,63 @@ static void nr_t2timer_expiry(unsigned long);
static void nr_t4timer_expiry(unsigned long);
static void nr_idletimer_expiry(unsigned long);
-void nr_start_t1timer(struct sock *sk)
+void nr_init_timers(struct sock *sk)
{
nr_cb *nr = nr_sk(sk);
- del_timer(&nr->t1timer);
-
+ init_timer(&nr->t1timer);
nr->t1timer.data = (unsigned long)sk;
nr->t1timer.function = &nr_t1timer_expiry;
- nr->t1timer.expires = jiffies + nr->t1;
+
+ init_timer(&nr->t2timer);
+ nr->t2timer.data = (unsigned long)sk;
+ nr->t2timer.function = &nr_t2timer_expiry;
+
+ init_timer(&nr->t4timer);
+ nr->t4timer.data = (unsigned long)sk;
+ nr->t4timer.function = &nr_t4timer_expiry;
+
+ init_timer(&nr->idletimer);
+ nr->idletimer.data = (unsigned long)sk;
+ nr->idletimer.function = &nr_idletimer_expiry;
- add_timer(&nr->t1timer);
+ /* initialized by sock_init_data */
+ sk->sk_timer.data = (unsigned long)sk;
+ sk->sk_timer.function = &nr_heartbeat_expiry;
}
-void nr_start_t2timer(struct sock *sk)
+void nr_start_t1timer(struct sock *sk)
{
nr_cb *nr = nr_sk(sk);
- del_timer(&nr->t2timer);
+ mod_timer(&nr->t1timer, jiffies + nr->t1);
+}
- nr->t2timer.data = (unsigned long)sk;
- nr->t2timer.function = &nr_t2timer_expiry;
- nr->t2timer.expires = jiffies + nr->t2;
+void nr_start_t2timer(struct sock *sk)
+{
+ nr_cb *nr = nr_sk(sk);
- add_timer(&nr->t2timer);
+ mod_timer(&nr->t2timer, jiffies + nr->t2);
}
void nr_start_t4timer(struct sock *sk)
{
nr_cb *nr = nr_sk(sk);
- del_timer(&nr->t4timer);
-
- nr->t4timer.data = (unsigned long)sk;
- nr->t4timer.function = &nr_t4timer_expiry;
- nr->t4timer.expires = jiffies + nr->t4;
-
- add_timer(&nr->t4timer);
+ mod_timer(&nr->t4timer, jiffies + nr->t4);
}
void nr_start_idletimer(struct sock *sk)
{
nr_cb *nr = nr_sk(sk);
- del_timer(&nr->idletimer);
-
- if (nr->idle > 0) {
- nr->idletimer.data = (unsigned long)sk;
- nr->idletimer.function = &nr_idletimer_expiry;
- nr->idletimer.expires = jiffies + nr->idle;
-
- add_timer(&nr->idletimer);
- }
+ if (nr->idle > 0)
+ mod_timer(&nr->idletimer, jiffies + nr->idle);
}
void nr_start_heartbeat(struct sock *sk)
{
- del_timer(&sk->sk_timer);
-
- sk->sk_timer.data = (unsigned long)sk;
- sk->sk_timer.function = &nr_heartbeat_expiry;
- sk->sk_timer.expires = jiffies + 5 * HZ;
-
- add_timer(&sk->sk_timer);
+ mod_timer(&sk->sk_timer, jiffies + 5 * HZ);
}
void nr_stop_t1timer(struct sock *sk)
diff --git a/net/netsyms.c b/net/netsyms.c
index c6320c8f5e65..beb9ce450eb0 100644
--- a/net/netsyms.c
+++ b/net/netsyms.c
@@ -511,7 +511,7 @@ EXPORT_SYMBOL(netif_receive_skb);
EXPORT_SYMBOL(dev_add_pack);
EXPORT_SYMBOL(dev_remove_pack);
EXPORT_SYMBOL(__dev_remove_pack);
-EXPORT_SYMBOL(dev_get);
+EXPORT_SYMBOL(__dev_get);
EXPORT_SYMBOL(dev_alloc);
EXPORT_SYMBOL(dev_alloc_name);
EXPORT_SYMBOL(__netdev_watchdog_up);
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 3b593a6e17d7..455040cf3767 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -381,6 +381,23 @@ out_unlock:
}
#endif
+static inline unsigned run_filter(struct sk_buff *skb, struct sock *sk, unsigned res)
+{
+ struct sk_filter *filter;
+
+ bh_lock_sock(sk);
+ filter = sk->sk_filter;
+ /*
+ * Our caller already checked that filter != NULL but we need to
+ * verify that under bh_lock_sock() to be safe
+ */
+ if (likely(filter != NULL))
+ res = sk_run_filter(skb, filter->insns, filter->len);
+ bh_unlock_sock(sk);
+
+ return res;
+}
+
/*
This function makes lazy skb cloning in hope that most of packets
are discarded by BPF.
@@ -429,15 +446,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
snaplen = skb->len;
if (sk->sk_filter) {
- unsigned res = snaplen;
- struct sk_filter *filter;
-
- bh_lock_sock(sk);
- if ((filter = sk->sk_filter) != NULL)
- res = sk_run_filter(skb, sk->sk_filter->insns,
- sk->sk_filter->len);
- bh_unlock_sock(sk);
-
+ unsigned res = run_filter(skb, sk, snaplen);
if (res == 0)
goto drop_n_restore;
if (snaplen > res)
@@ -533,15 +542,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
snaplen = skb->len;
if (sk->sk_filter) {
- unsigned res = snaplen;
- struct sk_filter *filter;
-
- bh_lock_sock(sk);
- if ((filter = sk->sk_filter) != NULL)
- res = sk_run_filter(skb, sk->sk_filter->insns,
- sk->sk_filter->len);
- bh_unlock_sock(sk);
-
+ unsigned res = run_filter(skb, sk, snaplen);
if (res == 0)
goto drop_n_restore;
if (snaplen > res)
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 4e6818222613..71cc4f3414af 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -7,7 +7,7 @@
* 2 of the License, or (at your option) any later version.
*
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
- * Jamal Hadi Salim, <hadi@nortelnetworks.com> 990601
+ * Jamal Hadi Salim, <hadi@cyberus.ca> 990601
* - Ingress support
*/
@@ -278,6 +278,8 @@ pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc* qdisc)
if (list->qlen <= qdisc->dev->tx_queue_len) {
__skb_queue_tail(list, skb);
qdisc->q.qlen++;
+ qdisc->stats.bytes += skb->len;
+ qdisc->stats.packets++;
return 0;
}
qdisc->stats.drops++;
@@ -326,6 +328,21 @@ pfifo_fast_reset(struct Qdisc* qdisc)
qdisc->q.qlen = 0;
}
+static int pfifo_fast_dump(struct Qdisc *qdisc, struct sk_buff *skb)
+{
+ unsigned char *b = skb->tail;
+ struct tc_prio_qopt opt;
+
+ opt.bands = 3;
+ memcpy(&opt.priomap, prio2band, TC_PRIO_MAX+1);
+ RTA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt);
+ return skb->len;
+
+rtattr_failure:
+ skb_trim(skb, b - skb->data);
+ return -1;
+}
+
static int pfifo_fast_init(struct Qdisc *qdisc, struct rtattr *opt)
{
int i;
@@ -349,6 +366,7 @@ static struct Qdisc_ops pfifo_fast_ops = {
.requeue = pfifo_fast_requeue,
.init = pfifo_fast_init,
.reset = pfifo_fast_reset,
+ .dump = pfifo_fast_dump,
.owner = THIS_MODULE,
};
@@ -438,6 +456,12 @@ void dev_activate(struct net_device *dev)
printk(KERN_INFO "%s: activation failed\n", dev->name);
return;
}
+
+ write_lock(&qdisc_tree_lock);
+ qdisc->next = dev->qdisc_list;
+ dev->qdisc_list = qdisc;
+ write_unlock(&qdisc_tree_lock);
+
} else {
qdisc = &noqueue_qdisc;
}
diff --git a/net/wanrouter/af_wanpipe.c b/net/wanrouter/af_wanpipe.c
index 02bc8d43fe52..a8e3f4b07ecc 100644
--- a/net/wanrouter/af_wanpipe.c
+++ b/net/wanrouter/af_wanpipe.c
@@ -32,7 +32,6 @@
*
******************************************************************************/
-#include <linux/version.h>
#include <linux/config.h>
#include <linux/types.h>
#include <linux/sched.h>
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 2d8659709f36..6e73ca077110 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -42,7 +42,6 @@
* Jun 02, 1999 Gideon Hack Updates for Linux 2.0.X and 2.2.X kernels.
*****************************************************************************/
-#include <linux/version.h>
#include <linux/config.h>
#include <linux/stddef.h> /* offsetof(), etc. */
#include <linux/errno.h> /* return codes */
diff --git a/scripts/mkconfigs b/scripts/mkconfigs
index fc9c3dd978bc..a3166274ebc3 100755
--- a/scripts/mkconfigs
+++ b/scripts/mkconfigs
@@ -25,12 +25,6 @@
# - Retain lines that begin with "# CONFIG_"
# - lines that use double-quotes must \\-escape-quote them
-
-kernel_version()
-{
- KERNVER="`grep VERSION $1 | head -1 | cut -f3 -d' '`.`grep PATCHLEVEL $1 | head -1 | cut -f3 -d' '`.`grep SUBLEVEL $1 | head -1 | cut -f3 -d' '``grep EXTRAVERSION $1 | head -1 | cut -f3 -d' '`"
-}
-
if [ $# -lt 2 ]
then
echo "Usage: `basename $0` <configuration_file> <Makefile>"
@@ -66,12 +60,6 @@ echo \
*
*/"
-echo "#ifdef CONFIG_IKCONFIG_PROC"
-echo "static char const ikconfig_build_info[] ="
-echo " \"`uname -s` `uname -r` `uname -v` `uname -m`\";"
-echo "#endif"
-echo
-kernel_version $makefile
echo "static char const ikconfig_config[] __attribute__((unused)) = "
echo "\"CONFIG_BEGIN=n\\n\\"
echo "`cat $config | sed 's/\"/\\\\\"/g' | grep "^#\? \?CONFIG_" | awk '{ print $0 "\\\\n\\\\" }' `"
diff --git a/scripts/modpost.c b/scripts/modpost.c
index 05369df84c02..5f8629d3425d 100644
--- a/scripts/modpost.c
+++ b/scripts/modpost.c
@@ -193,7 +193,7 @@ grab_file(const char *filename, unsigned long *size)
*size = st.st_size;
map = mmap(NULL, *size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
- if (mmap == MAP_FAILED) {
+ if (map == MAP_FAILED) {
perror(filename);
abort();
}
diff --git a/sound/oss/Kconfig b/sound/oss/Kconfig
index c051f9eece50..6f540f48c795 100644
--- a/sound/oss/Kconfig
+++ b/sound/oss/Kconfig
@@ -237,13 +237,6 @@ config SOUND_HARMONY
tristate "PA Harmony audio driver"
depends on GSC_LASI && SOUND
-config SOUND_RME96XX
- tristate "RME Hammerfall (RME96XX) support (EXPERIMENTAL)"
- depends on SOUND_PRIME!=n && SOUND && PCI && EXPERIMENTAL
- help
- Say Y or M if you have a Hammerfall, Hammerfall light or Hammerfall
- DSP card from RME.
-
config SOUND_SONICVIBES
tristate "S3 SonicVibes"
depends on SOUND_PRIME!=n && SOUND && SOUND_GAMEPORT
diff --git a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c
index 1006ad599d35..40af7a1c4633 100644
--- a/sound/oss/i810_audio.c
+++ b/sound/oss/i810_audio.c
@@ -2728,7 +2728,7 @@ static int i810_ac97_probe_and_powerup(struct i810_card *card,struct ac97_codec
i810_ac97_get(codec, AC97_POWER_CONTROL) & ~0x7f00);
/* wait for analog ready */
- for (i=10; i && ((i810_ac97_get(codec, AC97_POWER_CONTROL) & 0xf) != 0xf); i--)
+ for (i=100; i && ((i810_ac97_get(codec, AC97_POWER_CONTROL) & 0xf) != 0xf); i--)
{
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ/20);
@@ -3091,10 +3091,17 @@ static int __init i810_probe(struct pci_dev *pci_dev, const struct pci_device_id
return -EIO;
if (pci_set_dma_mask(pci_dev, I810_DMA_MASK)) {
- printk(KERN_ERR "intel810: architecture does not support"
+ printk(KERN_ERR "i810_audio: architecture does not support"
" 32bit PCI busmaster DMA\n");
return -ENODEV;
}
+
+ if( pci_resource_start(pci_dev, 1) == 0)
+ {
+ /* MMIO only ICH5 .. here be dragons .. */
+ printk(KERN_ERR "i810_audio: Pure MMIO interfaces not yet supported.\n");
+ return -ENODEV;
+ }
if ((card = kmalloc(sizeof(struct i810_card), GFP_KERNEL)) == NULL) {
printk(KERN_ERR "i810_audio: out of memory\n");
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index 2a779b11de52..1220a2d11d86 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -47,6 +47,13 @@
#define CHIP1370
#endif
+#ifdef CHIP1370
+#define DRIVER_NAME "ENS1370"
+#else
+#define DRIVER_NAME "ENS1371"
+#endif
+
+
MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Thomas Sailer <sailer@ife.ee.ethz.ch>");
MODULE_LICENSE("GPL");
MODULE_CLASSES("{sound}");
@@ -2324,12 +2331,8 @@ static int __devinit snd_audiopci_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
-#ifdef CHIP1370
- strcpy(card->driver, "ENS1370");
-#endif
-#ifdef CHIP1371
- strcpy(card->driver, "ENS1371");
-#endif
+ strcpy(card->driver, DRIVER_NAME);
+
strcpy(card->shortname, "Ensoniq AudioPCI");
sprintf(card->longname, "%s %s at 0x%lx, irq %i",
card->shortname,
@@ -2354,7 +2357,7 @@ static void __devexit snd_audiopci_remove(struct pci_dev *pci)
}
static struct pci_driver driver = {
- .name = "Ensoniq AudioPCI",
+ .name = DRIVER_NAME,
.id_table = snd_audiopci_ids,
.probe = snd_audiopci_probe,
.remove = __devexit_p(snd_audiopci_remove),